Changeset 123696 in webkit
- Timestamp:
- Jul 25, 2012 7:24:47 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r123692 r123696 1 2012-07-25 Tony Chang <tony@chromium.org> 2 3 flexitems can overflow the flexbox due to rounding 4 https://bugs.webkit.org/show_bug.cgi?id=92163 5 6 Reviewed by Levi Weintraub. 7 8 Tests for dividing space in non-integral amounts. 9 10 * css3/flexbox/flex-rounding-expected.txt: Added. 11 * css3/flexbox/flex-rounding.html: Added. 12 1 13 2012-07-25 Yoshifumi Inoue <yosin@chromium.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r123694 r123696 1 2012-07-25 Tony Chang <tony@chromium.org> 2 3 flexitems can overflow the flexbox due to rounding 4 https://bugs.webkit.org/show_bug.cgi?id=92163 5 6 Reviewed by Levi Weintraub. 7 8 Don't round flex item sizes and use LayoutPoint for the location of flex items. 9 10 Test: css3/flexbox/flex-rounding.html 11 12 * rendering/RenderFlexibleBox.cpp: 13 (WebCore::RenderFlexibleBox::resolveFlexibleLengths): 14 (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): 15 (WebCore::RenderFlexibleBox::layoutColumnReverse): 16 1 17 2012-07-25 Jonathan Dong <jonathan.dong@torchmobile.com.cn> 2 18 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r122508 r123696 879 879 LayoutUnit childSize = preferredChildSize; 880 880 if (availableFreeSpace > 0 && totalFlexGrow > 0 && flexSign == PositiveFlexibility && isfinite(totalFlexGrow)) 881 childSize += static_cast<int>(lroundf(availableFreeSpace * child->style()->flexGrow() / totalFlexGrow));881 childSize += availableFreeSpace * child->style()->flexGrow() / totalFlexGrow; 882 882 else if (availableFreeSpace < 0 && totalWeightedFlexShrink > 0 && flexSign == NegativeFlexibility && isfinite(totalWeightedFlexShrink)) 883 childSize += static_cast<int>(lroundf(availableFreeSpace * child->style()->flexShrink() * preferredChildSize / totalWeightedFlexShrink));883 childSize += availableFreeSpace * child->style()->flexShrink() * preferredChildSize / totalWeightedFlexShrink; 884 884 885 885 LayoutUnit adjustedChildSize = adjustChildSizeForMinAndMax(child, childSize, flexboxAvailableContentExtent); … … 1019 1019 1020 1020 LayoutUnit childMainExtent = mainAxisExtentForChild(child); 1021 IntPoint childLocation(shouldFlipMainAxis ? totalMainExtent - mainAxisOffset - childMainExtent : mainAxisOffset,1021 LayoutPoint childLocation(shouldFlipMainAxis ? totalMainExtent - mainAxisOffset - childMainExtent : mainAxisOffset, 1022 1022 crossAxisOffset + flowAwareMarginBeforeForChild(child)); 1023 1023 … … 1062 1062 1063 1063 LayoutRect oldRect = child->frameRect(); 1064 setFlowAwareLocationForChild(child, IntPoint(mainAxisOffset, crossAxisOffset + flowAwareMarginBeforeForChild(child)));1064 setFlowAwareLocationForChild(child, LayoutPoint(mainAxisOffset, crossAxisOffset + flowAwareMarginBeforeForChild(child))); 1065 1065 if (!selfNeedsLayout() && child->checkForRepaintDuringLayout()) 1066 1066 child->repaintDuringLayoutIfMoved(oldRect);
Note: See TracChangeset
for help on using the changeset viewer.