Changeset 101897 in webkit
- Timestamp:
- Dec 2, 2011 7:50:24 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r101895 r101897 1 2011-12-02 Tony Chang <tony@chromium.org> 2 3 Need to implement flex-flow: column-reverse 4 https://bugs.webkit.org/show_bug.cgi?id=73504 5 6 Reviewed by David Hyatt. 7 8 Enable testing of column-reverse. 9 10 * css3/flexbox/flex-flow-expected.txt: 11 * css3/flexbox/flex-flow.html: Added test cases to make sure start and end still apply to the text flow direction. 12 * css3/flexbox/flex-flow-border-expected.txt: 13 * css3/flexbox/flex-flow-border.html: Single flexitem, so reverse does nothing. 14 * css3/flexbox/flex-flow-margins-auto-size-expected.txt: 15 * css3/flexbox/flex-flow-margins-auto-size.html: Ditto. The vertical tests cases (orthogonal directions) have always failed. 16 * css3/flexbox/flex-flow-margins-expected.txt: 17 * css3/flexbox/flex-flow-margins.html: Ditto. 18 * css3/flexbox/flex-flow-orientations-expected.txt: 19 * css3/flexbox/flex-flow-orientations.html: This test has 2 flexitems, the positions of which are now flipped. 20 * css3/flexbox/flex-flow-overflow-expected.txt: 21 * css3/flexbox/flex-flow-overflow.html: The overflow should go in the opposite direction vertically, but the same direction horizontally. 22 * css3/flexbox/flex-flow-padding-expected.txt: 23 * css3/flexbox/flex-flow-padding.html: Single flexitem, no change. 24 1 25 2011-12-02 Stephen Chenney <schenney@chromium.org> 2 26 -
trunk/LayoutTests/css3/flexbox/flex-flow-border-expected.txt
r101703 r101897 22 22 PASS 23 23 horizontal-tb ltr row-reverse logical 24 PASS 25 horizontal-tb rtl column-reverse physical 26 PASS 27 horizontal-tb rtl column-reverse logical 28 PASS 29 horizontal-tb ltr column-reverse physical 30 PASS 31 horizontal-tb ltr column-reverse logical 24 32 PASS 25 33 horizontal-bt rtl row physical … … 47 55 horizontal-bt ltr row-reverse logical 48 56 PASS 57 horizontal-bt rtl column-reverse physical 58 PASS 59 horizontal-bt rtl column-reverse logical 60 PASS 61 horizontal-bt ltr column-reverse physical 62 PASS 63 horizontal-bt ltr column-reverse logical 64 PASS 49 65 vertical-lr rtl row physical 50 66 PASS … … 70 86 PASS 71 87 vertical-lr ltr row-reverse logical 88 PASS 89 vertical-lr rtl column-reverse physical 90 PASS 91 vertical-lr rtl column-reverse logical 92 PASS 93 vertical-lr ltr column-reverse physical 94 PASS 95 vertical-lr ltr column-reverse logical 72 96 PASS 73 97 vertical-rl rtl row physical … … 95 119 vertical-rl ltr row-reverse logical 96 120 PASS 121 vertical-rl rtl column-reverse physical 122 PASS 123 vertical-rl rtl column-reverse logical 124 PASS 125 vertical-rl ltr column-reverse physical 126 PASS 127 vertical-rl ltr column-reverse logical 128 PASS 97 129 -
trunk/LayoutTests/css3/flexbox/flex-flow-border.html
r101703 r101897 225 225 226 226 var writingModes = ['horizontal-tb', 'horizontal-bt', 'vertical-lr', 'vertical-rl']; 227 // FIXME: Test column-reverse. 228 var flexFlows = ['row', 'column', 'row-reverse']; 227 var flexFlows = ['row', 'column', 'row-reverse', 'column-reverse']; 229 228 var directions = ['rtl', 'ltr']; 230 229 var marginTypes = ['physical', 'logical']; -
trunk/LayoutTests/css3/flexbox/flex-flow-expected.txt
r101703 r101897 7 7 PASS 8 8 PASS 9 PASS 10 PASS 11 PASS 12 PASS -
trunk/LayoutTests/css3/flexbox/flex-flow-margins-auto-size-expected.txt
r101703 r101897 11 11 horizontal-tb ltr row-reverse 12 12 PASS 13 horizontal-tb rtl column-reverse 14 PASS 15 horizontal-tb ltr column-reverse 16 PASS 13 17 horizontal-bt rtl row 14 18 PASS … … 22 26 PASS 23 27 horizontal-bt ltr row-reverse 28 PASS 29 horizontal-bt rtl column-reverse 30 PASS 31 horizontal-bt ltr column-reverse 24 32 PASS 25 33 vertical-lr rtl row … … 63 71 64 72 <div class="container" data-expected-width="90" data-expected-height="90"><div class="flexbox vertical-lr ltr row-reverse" data-offset-x="40" data-offset-y="10"> 73 <div style="width: -webkit-flex(1 20px); height: -webkit-flex(1 20px);" data-expected-width="20" data-expected-height="20" data-offset-x="48" data-offset-y="23"></div> 74 </div></div> 75 vertical-lr rtl column-reverse 76 FAIL: 77 Expected 90 for width, but got 60. 78 79 <div class="container" data-expected-width="90" data-expected-height="90"><div class="flexbox vertical-lr rtl column-reverse" data-offset-x="40" data-offset-y="10"> 80 <div style="width: -webkit-flex(1 20px); height: -webkit-flex(1 20px);" data-expected-width="20" data-expected-height="20" data-offset-x="48" data-offset-y="23"></div> 81 </div></div> 82 vertical-lr ltr column-reverse 83 FAIL: 84 Expected 90 for width, but got 60. 85 86 <div class="container" data-expected-width="90" data-expected-height="90"><div class="flexbox vertical-lr ltr column-reverse" data-offset-x="40" data-offset-y="10"> 65 87 <div style="width: -webkit-flex(1 20px); height: -webkit-flex(1 20px);" data-expected-width="20" data-expected-height="20" data-offset-x="48" data-offset-y="23"></div> 66 88 </div></div> … … 107 129 <div style="width: -webkit-flex(1 20px); height: -webkit-flex(1 20px);" data-expected-width="20" data-expected-height="20" data-offset-x="48" data-offset-y="23"></div> 108 130 </div></div> 131 vertical-rl rtl column-reverse 132 FAIL: 133 Expected 90 for width, but got 60. 109 134 135 <div class="container" data-expected-width="90" data-expected-height="90"><div class="flexbox vertical-rl rtl column-reverse" data-offset-x="40" data-offset-y="10"> 136 <div style="width: -webkit-flex(1 20px); height: -webkit-flex(1 20px);" data-expected-width="20" data-expected-height="20" data-offset-x="48" data-offset-y="23"></div> 137 </div></div> 138 vertical-rl ltr column-reverse 139 FAIL: 140 Expected 90 for width, but got 60. 141 142 <div class="container" data-expected-width="90" data-expected-height="90"><div class="flexbox vertical-rl ltr column-reverse" data-offset-x="40" data-offset-y="10"> 143 <div style="width: -webkit-flex(1 20px); height: -webkit-flex(1 20px);" data-expected-width="20" data-expected-height="20" data-offset-x="48" data-offset-y="23"></div> 144 </div></div> 145 -
trunk/LayoutTests/css3/flexbox/flex-flow-margins-auto-size.html
r101703 r101897 63 63 // https://bugs.webkit.org/show_bug.cgi?id=70769 64 64 var writingModes = ['horizontal-tb', 'horizontal-bt', 'vertical-lr', 'vertical-rl']; 65 // FIXME: Test column-reverse. 66 var flexFlows = ['row', 'column', 'row-reverse']; 65 var flexFlows = ['row', 'column', 'row-reverse', 'column-reverse']; 67 66 var directions = ['rtl', 'ltr']; 68 67 -
trunk/LayoutTests/css3/flexbox/flex-flow-margins-expected.txt
r101703 r101897 14 14 PASS 15 15 horizontal-tb ltr column logical 16 PASS 17 horizontal-tb rtl row-reverse physical 18 PASS 19 horizontal-tb rtl row-reverse logical 20 PASS 21 horizontal-tb ltr row-reverse physical 22 PASS 23 horizontal-tb ltr row-reverse logical 16 24 PASS 17 25 horizontal-tb rtl row-reverse physical … … 47 55 horizontal-bt ltr row-reverse logical 48 56 PASS 57 horizontal-bt rtl row-reverse physical 58 PASS 59 horizontal-bt rtl row-reverse logical 60 PASS 61 horizontal-bt ltr row-reverse physical 62 PASS 63 horizontal-bt ltr row-reverse logical 64 PASS 49 65 vertical-lr rtl row physical 50 66 PASS … … 62 78 PASS 63 79 vertical-lr ltr column logical 80 PASS 81 vertical-lr rtl row-reverse physical 82 PASS 83 vertical-lr rtl row-reverse logical 84 PASS 85 vertical-lr ltr row-reverse physical 86 PASS 87 vertical-lr ltr row-reverse logical 64 88 PASS 65 89 vertical-lr rtl row-reverse physical … … 95 119 vertical-rl ltr row-reverse logical 96 120 PASS 121 vertical-rl rtl row-reverse physical 122 PASS 123 vertical-rl rtl row-reverse logical 124 PASS 125 vertical-rl ltr row-reverse physical 126 PASS 127 vertical-rl ltr row-reverse logical 128 PASS 97 129 -
trunk/LayoutTests/css3/flexbox/flex-flow-margins.html
r101703 r101897 215 215 216 216 var writingModes = ['horizontal-tb', 'horizontal-bt', 'vertical-lr', 'vertical-rl']; 217 // FIXME: Test column-reverse. 218 var flexFlows = ['row', 'column', 'row-reverse']; 217 var flexFlows = ['row', 'column', 'row-reverse', 'row-reverse']; 219 218 var directions = ['rtl', 'ltr']; 220 219 var marginTypes = ['physical', 'logical']; -
trunk/LayoutTests/css3/flexbox/flex-flow-orientations-expected.txt
r101703 r101897 10 10 PASS 11 11 horizontal-tb ltr row-reverse 12 PASS 13 horizontal-tb rtl column-reverse 14 PASS 15 horizontal-tb ltr column-reverse 12 16 PASS 13 17 horizontal-bt rtl row … … 23 27 horizontal-bt ltr row-reverse 24 28 PASS 29 horizontal-bt rtl column-reverse 30 PASS 31 horizontal-bt ltr column-reverse 32 PASS 25 33 vertical-lr rtl row 26 34 PASS … … 34 42 PASS 35 43 vertical-lr ltr row-reverse 44 PASS 45 vertical-lr rtl column-reverse 46 PASS 47 vertical-lr ltr column-reverse 36 48 PASS 37 49 vertical-rl rtl row … … 47 59 vertical-rl ltr row-reverse 48 60 PASS 61 vertical-rl rtl column-reverse 62 PASS 63 vertical-rl ltr column-reverse 64 PASS 49 65 -
trunk/LayoutTests/css3/flexbox/flex-flow-orientations.html
r101703 r101897 76 76 ltr: [[0, 0], [0, 20]] 77 77 }, 78 'column-reverse': { 79 rtl: [[80, 80], [80, 60]], 80 ltr: [[0, 80], [0, 60]] 81 }, 78 82 row: { 79 83 rtl: [[80, 0], [60, 0]], … … 89 93 rtl: [[80, 80], [80, 60]], 90 94 ltr: [[0, 80], [0, 60]] 95 }, 96 'column-reverse': { 97 rtl: [[80, 0], [80, 20]], 98 ltr: [[0, 0], [0, 20]] 91 99 }, 92 100 row: { … … 104 112 ltr: [[0, 0], [20, 0]] 105 113 }, 114 'column-reverse': { 115 rtl: [[80, 80], [60, 80]], 116 ltr: [[80, 0], [60, 0]] 117 }, 106 118 row: { 107 119 rtl: [[0, 80], [0, 60]], … … 118 130 ltr: [[80, 0], [60, 0]] 119 131 }, 132 'column-reverse': { 133 rtl: [[0, 80], [20, 80]], 134 ltr: [[0, 0], [20, 0]] 135 }, 120 136 row: { 121 137 rtl: [[80, 80], [80, 60]], … … 130 146 131 147 var writingModes = ['horizontal-tb', 'horizontal-bt', 'vertical-lr', 'vertical-rl']; 132 // FIXME: Test column-reverse. 133 var flexFlows = ['row', 'column', 'row-reverse']; 148 var flexFlows = ['row', 'column', 'row-reverse', 'column-reverse']; 134 149 var directions = ['rtl', 'ltr']; 135 150 -
trunk/LayoutTests/css3/flexbox/flex-flow-overflow-expected.txt
r101703 r101897 10 10 PASS 11 11 horizontal-tb ltr row-reverse 12 PASS 13 horizontal-tb rtl column-reverse 14 PASS 15 horizontal-tb ltr column-reverse 12 16 PASS 13 17 horizontal-bt rtl row … … 23 27 horizontal-bt ltr row-reverse 24 28 PASS 29 horizontal-bt rtl column-reverse 30 PASS 31 horizontal-bt ltr column-reverse 32 PASS 25 33 vertical-lr rtl row 26 34 PASS … … 34 42 PASS 35 43 vertical-lr ltr row-reverse 44 PASS 45 vertical-lr rtl column-reverse 46 PASS 47 vertical-lr ltr column-reverse 36 48 PASS 37 49 vertical-rl rtl row … … 47 59 vertical-rl ltr row-reverse 48 60 PASS 61 vertical-rl rtl column-reverse 62 PASS 63 vertical-rl ltr column-reverse 64 PASS 49 65 -
trunk/LayoutTests/css3/flexbox/flex-flow-overflow.html
r101703 r101897 74 74 'horizontal-tb': { 75 75 rtl: [-5, 0], 76 ltr: [0, 0] 76 ltr: [0, 0], 77 'rtl-column-reverse': [-5, -5], 78 'ltr-column-reverse': [0, -5], 77 79 }, 78 80 'horizontal-bt': { 79 81 rtl: [-5, -5], 80 ltr: [0, -5] 82 ltr: [0, -5], 83 'rtl-column-reverse': [-5, 0], 84 'ltr-column-reverse': [0, 0], 81 85 }, 82 86 'vertical-lr': { 83 87 rtl: [0, -5], 84 ltr: [0, 0] 88 ltr: [0, 0], 89 'rtl-column-reverse': [-5, -5], 90 'ltr-column-reverse': [-5, 0], 85 91 }, 86 92 'vertical-rl': { 87 93 rtl: [-5, -5], 88 ltr: [-5, 0] 94 ltr: [-5, 0], 95 'rtl-column-reverse': [0, -5], 96 'ltr-column-reverse': [0, 0], 89 97 } 90 98 } 91 99 92 100 var writingModes = ['horizontal-tb', 'horizontal-bt', 'vertical-lr', 'vertical-rl']; 93 // FIXME: Test column-reverse. 94 var flexFlows = ['row', 'column', 'row-reverse']; 101 var flexFlows = ['row', 'column', 'row-reverse', 'column-reverse']; 95 102 var directions = ['rtl', 'ltr']; 96 103 … … 110 117 111 118 var flowDirection = direction; 112 if (flexFlow.indexOf("-reverse") != -1) 119 // row-reverse is the same as flipping the writing direction. 120 if (flexFlow == "row-reverse") 113 121 flowDirection = direction == "rtl" ? "ltr" : "rtl"; 122 else if (flexFlow == "column-reverse") 123 flowDirection = direction + "-column-reverse"; 114 124 115 125 container.innerHTML = '\n<div class="flexbox ' + flexboxClassName + '" ' + sizeAsString(containerSize) + '>\n' + -
trunk/LayoutTests/css3/flexbox/flex-flow-padding-expected.txt
r101703 r101897 22 22 PASS 23 23 horizontal-tb ltr row-reverse logical 24 PASS 25 horizontal-tb rtl column-reverse physical 26 PASS 27 horizontal-tb rtl column-reverse logical 28 PASS 29 horizontal-tb ltr column-reverse physical 30 PASS 31 horizontal-tb ltr column-reverse logical 24 32 PASS 25 33 horizontal-bt rtl row physical … … 47 55 horizontal-bt ltr row-reverse logical 48 56 PASS 57 horizontal-bt rtl column-reverse physical 58 PASS 59 horizontal-bt rtl column-reverse logical 60 PASS 61 horizontal-bt ltr column-reverse physical 62 PASS 63 horizontal-bt ltr column-reverse logical 64 PASS 49 65 vertical-lr rtl row physical 50 66 PASS … … 70 86 PASS 71 87 vertical-lr ltr row-reverse logical 88 PASS 89 vertical-lr rtl column-reverse physical 90 PASS 91 vertical-lr rtl column-reverse logical 92 PASS 93 vertical-lr ltr column-reverse physical 94 PASS 95 vertical-lr ltr column-reverse logical 72 96 PASS 73 97 vertical-rl rtl row physical … … 95 119 vertical-rl ltr row-reverse logical 96 120 PASS 121 vertical-rl rtl column-reverse physical 122 PASS 123 vertical-rl rtl column-reverse logical 124 PASS 125 vertical-rl ltr column-reverse physical 126 PASS 127 vertical-rl ltr column-reverse logical 128 PASS 97 129 -
trunk/LayoutTests/css3/flexbox/flex-flow-padding.html
r101703 r101897 228 228 229 229 var writingModes = ['horizontal-tb', 'horizontal-bt', 'vertical-lr', 'vertical-rl']; 230 // FIXME: Test column-reverse. 231 var flexFlows = ['row', 'column', 'row-reverse']; 230 var flexFlows = ['row', 'column', 'row-reverse', 'column-reverse']; 232 231 var directions = ['rtl', 'ltr']; 233 232 var marginTypes = ['physical', 'logical']; -
trunk/LayoutTests/css3/flexbox/flex-flow.html
r101703 r101897 103 103 104 104 <div style="position: relative;"> 105 <div class="flexbox column-reverse"> 106 <div data-expected-height="150" data-offset-y="450" style="height: -webkit-flex(1 0 0); margin: auto 200px auto 150px;"></div> 107 <div data-expected-height="300" data-offset-y="150" style="height: -webkit-flex(2 0 0); -webkit-padding-start: 200px"><div data-offset-y="150" data-offset-x="200"></div></div> 108 <div data-expected-height="150" data-offset-y="0" style="height: -webkit-flex(1 0 0); -webkit-margin-end: 100px;"></div> 109 </div> 110 </div> 111 112 <div style="position: relative;"> 105 113 <div class="flexbox column rtl"> 106 114 <div data-expected-height="150" data-offset-y="0" data-offset-x="480" style="height: -webkit-flex(1 0 0); margin: auto 100px auto 50px;"></div> 107 115 <div data-expected-height="300" data-offset-y="150" style="height: -webkit-flex(2 0 0); -webkit-padding-start: 200px"><div data-offset-y="150" data-offset-x="380"></div></div> 108 116 <div data-expected-height="150" data-offset-y="450" data-offset-x="580" style="height: -webkit-flex(1 0 0); -webkit-margin-end: 100px;"></div> 117 </div> 118 </div> 119 120 <div style="position: relative;"> 121 <div class="flexbox column-reverse rtl"> 122 <div data-expected-height="150" data-offset-y="450" data-offset-x="480" style="height: -webkit-flex(1 0 0); margin: auto 100px auto 50px;"></div> 123 <div data-expected-height="300" data-offset-y="150" style="height: -webkit-flex(2 0 0); -webkit-padding-start: 200px"><div data-offset-y="150" data-offset-x="380"></div></div> 124 <div data-expected-height="150" data-offset-y="0" data-offset-x="580" style="height: -webkit-flex(1 0 0); -webkit-margin-end: 100px;"></div> 109 125 </div> 110 126 </div> … … 118 134 119 135 <div style="position: relative;"> 136 <div data-expected-height="600" class="flexbox vertical-lr column-reverse"> 137 <div data-offset-x="100" data-expected-width="500" style="width: -webkit-flex(1 0 0); min-width: 300px"></div> 138 <div data-offset-x="0" data-offset-y="100" data-expected-width="100" style="width: -webkit-flex(1 0 200px); max-width: 100px; margin: 100px 0 50px 0;"></div> 139 </div> 140 </div> 141 142 <div style="position: relative;"> 120 143 <div data-expected-height="600" class="flexbox vertical-rl column"> 121 144 <div data-offset-x="100" data-expected-width="500" style="width: -webkit-flex(1 0 0); min-width: 300px; margin-bottom: 100px"></div> … … 124 147 </div> 125 148 149 <div style="position: relative;"> 150 <div data-expected-height="600" class="flexbox vertical-rl column-reverse"> 151 <div data-offset-x="0" data-expected-width="500" style="width: -webkit-flex(1 0 0); min-width: 300px; margin-bottom: 100px"></div> 152 <div data-offset-x="500" data-offset-y="100" data-expected-width="100" style="width: -webkit-flex(1 0 200px); max-width: 100px; margin: 100px 0 50px 0;"></div> 153 </div> 154 </div> 155 126 156 </body> 127 157 </html> -
trunk/Source/WebCore/ChangeLog
r101895 r101897 1 2011-12-02 Tony Chang <tony@chromium.org> 2 3 Need to implement flex-flow: column-reverse 4 https://bugs.webkit.org/show_bug.cgi?id=73504 5 6 Reviewed by David Hyatt. 7 8 We can't just change the direction of the FlexOrderIterator because we want the overflow to be 9 on the top. We can't just position them in the reverse location since we don't know where the 10 bottom edge is until we've layed out the flex items. So we do an extra pass, but it should be 11 fast since we're not laying out, just moving. 12 13 * rendering/RenderFlexibleBox.cpp: 14 (WebCore::RenderFlexibleBox::flowAwareBorderEnd): 15 (WebCore::RenderFlexibleBox::flowAwarePaddingEnd): 16 (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): 17 (WebCore::RenderFlexibleBox::layoutColumnReverse): Do an extra pass to reposition flexitems in the reverse order. 18 * rendering/RenderFlexibleBox.h: 19 1 20 2011-12-02 Stephen Chenney <schenney@chromium.org> 2 21 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r101703 r101897 299 299 } 300 300 301 LayoutUnit RenderFlexibleBox::flowAwareBorderEnd() const 302 { 303 if (isHorizontalFlow()) 304 return isLeftToRightFlow() ? borderRight() : borderLeft(); 305 return isLeftToRightFlow() ? borderBottom() : borderTop(); 306 } 307 301 308 LayoutUnit RenderFlexibleBox::flowAwareBorderBefore() const 302 309 { … … 325 332 return isLeftToRightFlow() ? paddingLeft() : paddingRight(); 326 333 return isLeftToRightFlow() ? paddingTop() : paddingBottom(); 334 } 335 336 LayoutUnit RenderFlexibleBox::flowAwarePaddingEnd() const 337 { 338 if (isHorizontalFlow()) 339 return isLeftToRightFlow() ? paddingRight() : paddingLeft(); 340 return isLeftToRightFlow() ? paddingBottom() : paddingTop(); 327 341 } 328 342 … … 556 570 } 557 571 572 static LayoutUnit initialPackingOffset(LayoutUnit availableFreeSpace, float totalPositiveFlexibility, EFlexPack flexPack) 573 { 574 if (hasPackingSpace(availableFreeSpace, totalPositiveFlexibility)) { 575 if (flexPack == PackEnd) 576 return availableFreeSpace; 577 if (flexPack == PackCenter) 578 return availableFreeSpace / 2; 579 } 580 return 0; 581 } 582 583 static LayoutUnit packingSpaceBetweenChildren(LayoutUnit availableFreeSpace, float totalPositiveFlexibility, EFlexPack flexPack, size_t numberOfChildren) 584 { 585 if (hasPackingSpace(availableFreeSpace, totalPositiveFlexibility) && flexPack == PackJustify && numberOfChildren > 1) 586 return availableFreeSpace / (numberOfChildren - 1); 587 return 0; 588 } 589 558 590 void RenderFlexibleBox::setLogicalOverrideSize(RenderBox* child, LayoutUnit childPreferredSize) 559 591 { … … 568 600 { 569 601 LayoutUnit startEdge = flowAwareBorderStart() + flowAwarePaddingStart(); 570 571 if (hasPackingSpace(availableFreeSpace, totalPositiveFlexibility)) { 572 if (style()->flexPack() == PackEnd) 573 startEdge += availableFreeSpace; 574 else if (style()->flexPack() == PackCenter) 575 startEdge += availableFreeSpace / 2; 576 } 602 startEdge += initialPackingOffset(availableFreeSpace, totalPositiveFlexibility, style()->flexPack()); 577 603 578 604 LayoutUnit logicalTop = flowAwareBorderBefore() + flowAwarePaddingBefore(); … … 609 635 startEdge += childMainExtent + flowAwareMarginEndForChild(child); 610 636 611 if (hasPackingSpace(availableFreeSpace, totalPositiveFlexibility) && style()->flexPack() == PackJustify && childSizes.size() > 1) 612 startEdge += availableFreeSpace / (childSizes.size() - 1); 637 startEdge += packingSpaceBetweenChildren(availableFreeSpace, totalPositiveFlexibility, style()->flexPack(), childSizes.size()); 613 638 614 639 if (isColumnFlow()) 615 640 setLogicalHeight(startEdge); 616 641 } 642 643 if (style()->flexFlow() == FlowColumnReverse) { 644 // We have to do an extra pass for column-reverse to reposition the flex items since the start depends 645 // on the height of the flexbox, which we only know after we've positioned all the flex items. 646 computeLogicalHeight(); 647 layoutColumnReverse(iterator, childSizes, availableFreeSpace, totalPositiveFlexibility); 648 } 649 617 650 alignChildren(iterator, maxAscent); 651 } 652 653 void RenderFlexibleBox::layoutColumnReverse(FlexOrderIterator& iterator, const WTF::Vector<LayoutUnit>& childSizes, LayoutUnit availableFreeSpace, float totalPositiveFlexibility) 654 { 655 // This is similar to the logic in layoutAndPlaceChildren, except we place the children 656 // starting from the end of the flexbox. We also don't need to layout anything since we're 657 // just moving the children to a new position. 658 LayoutUnit mainAxisOffset = logicalHeight() - flowAwareBorderEnd() - flowAwarePaddingEnd(); 659 mainAxisOffset -= initialPackingOffset(availableFreeSpace, totalPositiveFlexibility, style()->flexPack()); 660 661 LayoutUnit crossAxisOffset = flowAwareBorderBefore() + flowAwarePaddingBefore(); 662 size_t i = 0; 663 for (RenderBox* child = iterator.first(); child; child = iterator.next(), ++i) { 664 mainAxisOffset -= mainAxisExtentForChild(child) + flowAwareMarginEndForChild(child); 665 666 LayoutRect oldRect = child->frameRect(); 667 setFlowAwareLocationForChild(child, IntPoint(mainAxisOffset, crossAxisOffset + flowAwareMarginBeforeForChild(child))); 668 if (!selfNeedsLayout() && child->checkForRepaintDuringLayout()) 669 child->repaintDuringLayoutIfMoved(oldRect); 670 671 mainAxisOffset -= flowAwareMarginStartForChild(child); 672 mainAxisOffset -= packingSpaceBetweenChildren(availableFreeSpace, totalPositiveFlexibility, style()->flexPack(), childSizes.size()); 673 } 618 674 } 619 675 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r101703 r101897 69 69 LayoutUnit flowAwareBorderStart() const; 70 70 LayoutUnit flowAwareBorderBefore() const; 71 LayoutUnit flowAwareBorderEnd() const; 71 72 LayoutUnit crossAxisBorderAndPaddingExtent() const; 72 73 LayoutUnit flowAwarePaddingStart() const; 73 74 LayoutUnit flowAwarePaddingBefore() const; 75 LayoutUnit flowAwarePaddingEnd() const; 74 76 LayoutUnit flowAwareMarginStartForChild(RenderBox* child) const; 75 77 LayoutUnit flowAwareMarginEndForChild(RenderBox* child) const; … … 97 99 void setLogicalOverrideSize(RenderBox* child, LayoutUnit childPreferredSize); 98 100 void layoutAndPlaceChildren(FlexOrderIterator&, const WTF::Vector<LayoutUnit>& childSizes, LayoutUnit availableFreeSpace, float totalPositiveFlexibility); 101 void layoutColumnReverse(FlexOrderIterator&, const WTF::Vector<LayoutUnit>& childSizes, LayoutUnit availableFreeSpace, float totalPositiveFlexibility); 99 102 void alignChildren(FlexOrderIterator&, LayoutUnit maxAscent); 100 103 };
Note: See TracChangeset
for help on using the changeset viewer.