Changeset 129914 in webkit
- Timestamp:
- Sep 28, 2012 10:14:43 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r129908 r129914 1 2012-09-27 Tony Chang <tony@chromium.org> 2 3 flexbox assert fails with auto-sized item with padding 4 https://bugs.webkit.org/show_bug.cgi?id=97606 5 6 Reviewed by Ojan Vafai. 7 8 Add a test that hits an ASSERT when FractionalLayoutUnit denominator is 60. 9 10 * css3/flexbox/negative-flex-rounding-assert-expected.txt: Added. 11 * css3/flexbox/negative-flex-rounding-assert.html: Added. 12 1 13 2012-09-28 Harald Tveit Alvestrand <harald@alvestrand.no> 2 14 -
trunk/Source/WebCore/ChangeLog
r129913 r129914 1 2012-09-27 Tony Chang <tony@chromium.org> 2 3 flexbox assert fails with auto-sized item with padding 4 https://bugs.webkit.org/show_bug.cgi?id=97606 5 6 Reviewed by Ojan Vafai. 7 8 Depending on the denominator of FractionalLayoutUnit, we can lose precision when 9 converting to a float. This would cause a rounding error in flex-shrink to trigger an ASSERT. 10 To avoid this problem in the future, switch to using doubles for flex-shrink and flex-grow 11 at layout time. The CSS values themselves are still floats. 12 13 Test: css3/flexbox/negative-flex-rounding-assert.html 14 15 * rendering/RenderFlexibleBox.cpp: 16 (WebCore::RenderFlexibleBox::layoutFlexItems): Use doubles for local variables. 17 (WebCore::RenderFlexibleBox::computeNextFlexLine): Pass in doubles. 18 (WebCore::RenderFlexibleBox::freezeViolations): Pass in doubles. 19 (WebCore::RenderFlexibleBox::resolveFlexibleLengths): Pass in doubles. 20 * rendering/RenderFlexibleBox.h: 21 1 22 2012-09-28 Sheriff Bot <webkit.review.bot@gmail.com> 2 23 -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r129154 r129914 616 616 OrderedFlexItemList orderedChildren; 617 617 LayoutUnit preferredMainAxisExtent; 618 floattotalFlexGrow;619 floattotalWeightedFlexShrink;618 double totalFlexGrow; 619 double totalWeightedFlexShrink; 620 620 LayoutUnit minMaxAppliedMainAxisExtent; 621 621 … … 798 798 } 799 799 800 bool RenderFlexibleBox::computeNextFlexLine(OrderIterator& iterator, OrderedFlexItemList& orderedChildren, LayoutUnit& preferredMainAxisExtent, float& totalFlexGrow, float& totalWeightedFlexShrink, LayoutUnit& minMaxAppliedMainAxisExtent)800 bool RenderFlexibleBox::computeNextFlexLine(OrderIterator& iterator, OrderedFlexItemList& orderedChildren, LayoutUnit& preferredMainAxisExtent, double& totalFlexGrow, double& totalWeightedFlexShrink, LayoutUnit& minMaxAppliedMainAxisExtent) 801 801 { 802 802 orderedChildren.clear(); … … 833 833 } 834 834 835 void RenderFlexibleBox::freezeViolations(const WTF::Vector<Violation>& violations, LayoutUnit& availableFreeSpace, float& totalFlexGrow, float& totalWeightedFlexShrink, InflexibleFlexItemSize& inflexibleItems)835 void RenderFlexibleBox::freezeViolations(const WTF::Vector<Violation>& violations, LayoutUnit& availableFreeSpace, double& totalFlexGrow, double& totalWeightedFlexShrink, InflexibleFlexItemSize& inflexibleItems) 836 836 { 837 837 for (size_t i = 0; i < violations.size(); ++i) { … … 847 847 848 848 // Returns true if we successfully ran the algorithm and sized the flex items. 849 bool RenderFlexibleBox::resolveFlexibleLengths(FlexSign flexSign, const OrderedFlexItemList& children, LayoutUnit& availableFreeSpace, float& totalFlexGrow, float& totalWeightedFlexShrink, InflexibleFlexItemSize& inflexibleItems, WTF::Vector<LayoutUnit>& childSizes)849 bool RenderFlexibleBox::resolveFlexibleLengths(FlexSign flexSign, const OrderedFlexItemList& children, LayoutUnit& availableFreeSpace, double& totalFlexGrow, double& totalWeightedFlexShrink, InflexibleFlexItemSize& inflexibleItems, WTF::Vector<LayoutUnit>& childSizes) 850 850 { 851 851 childSizes.clear(); -
trunk/Source/WebCore/rendering/RenderFlexibleBox.h
r129154 r129914 124 124 void computeMainAxisPreferredSizes(bool relayoutChildren, OrderHashSet&); 125 125 LayoutUnit adjustChildSizeForMinAndMax(RenderBox*, LayoutUnit childSize); 126 bool computeNextFlexLine(OrderIterator&, OrderedFlexItemList& orderedChildren, LayoutUnit& preferredMainAxisExtent, float& totalFlexGrow, float& totalWeightedFlexShrink, LayoutUnit& minMaxAppliedMainAxisExtent);126 bool computeNextFlexLine(OrderIterator&, OrderedFlexItemList& orderedChildren, LayoutUnit& preferredMainAxisExtent, double& totalFlexGrow, double& totalWeightedFlexShrink, LayoutUnit& minMaxAppliedMainAxisExtent); 127 127 128 bool resolveFlexibleLengths(FlexSign, const OrderedFlexItemList&, LayoutUnit& availableFreeSpace, float& totalFlexGrow, float& totalWeightedFlexShrink, InflexibleFlexItemSize&, WTF::Vector<LayoutUnit>& childSizes);129 void freezeViolations(const WTF::Vector<Violation>&, LayoutUnit& availableFreeSpace, float& totalFlexGrow, float& totalWeightedFlexShrink, InflexibleFlexItemSize&);128 bool resolveFlexibleLengths(FlexSign, const OrderedFlexItemList&, LayoutUnit& availableFreeSpace, double& totalFlexGrow, double& totalWeightedFlexShrink, InflexibleFlexItemSize&, WTF::Vector<LayoutUnit>& childSizes); 129 void freezeViolations(const WTF::Vector<Violation>&, LayoutUnit& availableFreeSpace, double& totalFlexGrow, double& totalWeightedFlexShrink, InflexibleFlexItemSize&); 130 130 131 131 void setLogicalOverrideSize(RenderBox* child, LayoutUnit childPreferredSize);
Note: See TracChangeset
for help on using the changeset viewer.