Changeset 96159 in webkit
- Timestamp:
- Sep 27, 2011 2:45:54 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r96158 r96159 1 2011-09-27 Ojan Vafai <ojan@chromium.org> 2 3 take padding/border on flexbox into account with direction:rtl 4 https://bugs.webkit.org/show_bug.cgi?id=68846 5 6 Reviewed by David Hyatt. 7 8 * css3/flexbox/writing-modes-expected.txt: 9 * css3/flexbox/writing-modes.html: 10 1 11 2011-09-27 Mihai Parparita <mihaip@chromium.org> 2 12 -
trunk/LayoutTests/css3/flexbox/writing-modes-expected.txt
r96152 r96159 1 PASS 2 PASS 1 3 PASS 2 4 PASS -
trunk/LayoutTests/css3/flexbox/writing-modes.html
r96152 r96159 8 8 width: 600px; 9 9 display: -webkit-flexbox; 10 background-color: grey; 10 11 } 11 12 .flexbox div { … … 175 176 </div> 176 177 178 <div style="position: relative;"> 179 <div data-expected-width="600" style="direction: rtl; display: -webkit-flexbox; margin-left: 10px; margin-right:20px;" class="flexbox"> 180 <div data-expected-width="50" data-offset-x="510" style="width: -webkit-flex(1 0 0); margin: 0 auto;"></div> 181 <div data-expected-width="300" data-offset-x="160" style="width: -webkit-flex(2 0 0); padding: 0 100px;"></div> 182 <div data-expected-width="50" data-offset-x="10" style="width: -webkit-flex(1 0 0);margin-right: 100px;"></div> 183 </div> 184 </div> 185 186 <div style="position: relative;"> 187 <div data-expected-width="700" style="direction: rtl; display: -webkit-flexbox; padding-left: 10px; padding-right: 20px; border-style: solid; border-left: 30px solid; border-right: 40px solid;" class="flexbox "> 188 <div data-expected-width="50" data-offset-x="540" style="width: -webkit-flex(1 0 0); margin: 0 auto;"></div> 189 <div data-expected-width="300" data-offset-x="190" style="width: -webkit-flex(2 0 0); padding: 0 100px;"></div> 190 <div data-expected-width="50" data-offset-x="40" style="width: -webkit-flex(1 0 0);margin-right: 100px;"></div> 191 </div> 192 </div> 193 177 194 </body> 178 195 </html> -
trunk/Source/WebCore/ChangeLog
r96157 r96159 1 2011-09-27 Ojan Vafai <ojan@chromium.org> 2 3 take padding/border on flexbox into account with direction:rtl 4 https://bugs.webkit.org/show_bug.cgi?id=68846 5 6 Reviewed by David Hyatt. 7 8 Use the logicalWidth of the flexbox instead of it's availableLogicalWidth 9 so that we include the flexbox's border and padding. 10 11 Also, change all uses of availableLogicalWidth to contentLogicalWidth. 12 The former takes multi-column into account. Multi-column flexboxes don't 13 make any sense, so there's no point in calling availableLogicalWidth. 14 15 * rendering/RenderFlexibleBox.cpp: 16 (WebCore::RenderFlexibleBox::flowAwareLogicalWidth): 17 (WebCore::RenderFlexibleBox::flowAwareContentLogicalWidth): 18 (WebCore::RenderFlexibleBox::computePreferredLogicalWidth): 19 (WebCore::RenderFlexibleBox::runFreeSpaceAllocationAlgorithmInlineDirection): 20 (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): 21 * rendering/RenderFlexibleBox.h: 22 1 23 2011-09-27 Sheriff Bot <webkit.review.bot@gmail.com> 2 24 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r95901 r96159 230 230 } 231 231 232 LayoutUnit RenderFlexibleBox::flowAwareLogicalWidth() const 233 { 234 return logicalWidth(); 235 } 236 232 237 LayoutUnit RenderFlexibleBox::flowAwareContentLogicalWidth() const 233 238 { 234 239 return contentLogicalWidth(); 235 }236 237 LayoutUnit RenderFlexibleBox::flowAwareAvailableLogicalWidth() const238 {239 return availableLogicalWidth();240 240 } 241 241 … … 375 375 totalPositiveFlexibility = totalNegativeFlexibility = 0; 376 376 377 LayoutUnit flexboxAvailableLogicalWidth = flowAware AvailableLogicalWidth();377 LayoutUnit flexboxAvailableLogicalWidth = flowAwareContentLogicalWidth(); 378 378 for (RenderBox* child = iterator.first(); child; child = iterator.next()) { 379 379 // We always have to lay out flexible objects again, since the flex distribution … … 411 411 childSizes.clear(); 412 412 413 LayoutUnit flexboxAvailableLogicalWidth = flowAware AvailableLogicalWidth();413 LayoutUnit flexboxAvailableLogicalWidth = flowAwareContentLogicalWidth(); 414 414 for (RenderBox* child = iterator.first(); child; child = iterator.next()) { 415 415 LayoutUnit childPreferredSize; … … 475 475 476 476 LayoutUnit logicalTop = flowAwareBorderBefore() + flowAwarePaddingBefore(); 477 LayoutUnit total AvailableLogicalWidth = flowAwareAvailableLogicalWidth();477 LayoutUnit totalLogicalWidth = flowAwareLogicalWidth(); 478 478 setFlowAwareLogicalHeight(0); 479 479 size_t i = 0; … … 495 495 496 496 LayoutUnit childLogicalWidth = flowAwareLogicalWidthForChild(child); 497 LayoutUnit logicalLeft = isLeftToRightFlow() ? startEdge : total AvailableLogicalWidth - startEdge - childLogicalWidth;497 LayoutUnit logicalLeft = isLeftToRightFlow() ? startEdge : totalLogicalWidth - startEdge - childLogicalWidth; 498 498 // FIXME: Do repaintDuringLayoutIfMoved. 499 499 // FIXME: Supporting layout deltas. -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r95901 r96159 61 61 LayoutUnit flowAwareLogicalWidthForChild(RenderBox* child); 62 62 LayoutUnit flowAwareLogicalHeight() const; 63 LayoutUnit flowAwareLogicalWidth() const; 63 64 LayoutUnit flowAwareContentLogicalWidth() const; 64 LayoutUnit flowAwareAvailableLogicalWidth() const;65 65 LayoutUnit flowAwareBorderStart() const; 66 66 LayoutUnit flowAwareBorderBefore() const;
Note: See TracChangeset
for help on using the changeset viewer.