flexbox assert fails with auto-sized item with padding
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Sep 2012 17:14:43 +0000 (17:14 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Sep 2012 17:14:43 +0000 (17:14 +0000)
commit10a4ebb4c1a94cd3579a5db79d60881159a616ab
treee2636fb2cc495c602c82a43236bf708ce2b31f83
parent751bebf9ac72b11d1f56bb29b3158b893fda464c
flexbox assert fails with auto-sized item with padding
https://bugs.webkit.org/show_bug.cgi?id=97606

Reviewed by Ojan Vafai.

Source/WebCore:

Depending on the denominator of FractionalLayoutUnit, we can lose precision when
converting to a float.  This would cause a rounding error in flex-shrink to trigger an ASSERT.
To avoid this problem in the future, switch to using doubles for flex-shrink and flex-grow
at layout time.  The CSS values themselves are still floats.

Test: css3/flexbox/negative-flex-rounding-assert.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutFlexItems): Use doubles for local variables.
(WebCore::RenderFlexibleBox::computeNextFlexLine): Pass in doubles.
(WebCore::RenderFlexibleBox::freezeViolations): Pass in doubles.
(WebCore::RenderFlexibleBox::resolveFlexibleLengths): Pass in doubles.
* rendering/RenderFlexibleBox.h:

LayoutTests:

Add a test that hits an ASSERT when FractionalLayoutUnit denominator is 60.

* css3/flexbox/negative-flex-rounding-assert-expected.txt: Added.
* css3/flexbox/negative-flex-rounding-assert.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/negative-flex-rounding-assert-expected.txt [new file with mode: 0644]
LayoutTests/css3/flexbox/negative-flex-rounding-assert.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderFlexibleBox.h