Changeset 124987 in webkit
- Timestamp:
- Aug 7, 2012 10:25:34 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r124986 r124987 1 2012-08-07 Ojan Vafai <ojan@chromium.org> 2 3 percentage margins + flex incorrectly overflows the flexbox 4 https://bugs.webkit.org/show_bug.cgi?id=93411 5 6 Reviewed by Tony Chang. 7 8 * css3/flexbox/percent-margins-expected.txt: Added. 9 * css3/flexbox/percent-margins.html: Added. 10 1 11 2012-08-07 Eric Carlson <eric.carlson@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r124985 r124987 1 2012-08-07 Ojan Vafai <ojan@chromium.org> 2 3 percentage margins + flex incorrectly overflows the flexbox 4 https://bugs.webkit.org/show_bug.cgi?id=93411 5 6 Reviewed by Tony Chang. 7 8 Percent margins should always be computed with respect to the containing 9 block's width, not it's height. We were getting this wrong in column flows. 10 11 Test: css3/flexbox/percent-margins.html 12 13 * rendering/RenderFlexibleBox.cpp: 14 (WebCore::RenderFlexibleBox::computeMarginValue): 15 (WebCore): 16 (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): 17 (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): 18 * rendering/RenderFlexibleBox.h: 19 1 20 2012-08-07 Kentaro Hara <haraken@chromium.org> 2 21 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r124793 r124987 759 759 } 760 760 761 LayoutUnit RenderFlexibleBox::computeMarginValue(Length margin, LayoutUnit availableSize, RenderView* view) 762 { 763 // CSS always computes percent margins with respect to the containing block's width, even for margin-top/margin-bottom. 764 if (margin.isPercent()) 765 availableSize = logicalWidth(); 766 return minimumValueForLength(margin, availableSize, view); 767 } 768 761 769 void RenderFlexibleBox::computeMainAxisPreferredSizes(bool relayoutChildren, OrderHashSet& orderValues) 762 770 { … … 781 789 // Also, if we're not auto sizing, we don't do a layout that computes the start/end margins. 782 790 if (isHorizontalFlow()) { 783 child->setMarginLeft( minimumValueForLength(child->style()->marginLeft(), flexboxAvailableContentExtent, renderView));784 child->setMarginRight( minimumValueForLength(child->style()->marginRight(), flexboxAvailableContentExtent, renderView));791 child->setMarginLeft(computeMarginValue(child->style()->marginLeft(), flexboxAvailableContentExtent, renderView)); 792 child->setMarginRight(computeMarginValue(child->style()->marginRight(), flexboxAvailableContentExtent, renderView)); 785 793 } else { 786 child->setMarginTop( minimumValueForLength(child->style()->marginTop(), flexboxAvailableContentExtent, renderView));787 child->setMarginBottom( minimumValueForLength(child->style()->marginBottom(), flexboxAvailableContentExtent, renderView));794 child->setMarginTop(computeMarginValue(child->style()->marginTop(), flexboxAvailableContentExtent, renderView)); 795 child->setMarginBottom(computeMarginValue(child->style()->marginBottom(), flexboxAvailableContentExtent, renderView)); 788 796 } 789 797 } -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r124793 r124987 120 120 LayoutUnit marginBoxAscentForChild(RenderBox*); 121 121 122 LayoutUnit computeMarginValue(Length margin, LayoutUnit availableSize, RenderView*); 122 123 void computeMainAxisPreferredSizes(bool relayoutChildren, OrderHashSet&); 123 124 LayoutUnit lineBreakLength();
Note: See TracChangeset
for help on using the changeset viewer.