implement new negative flexing algorithm
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 May 2012 02:07:18 +0000 (02:07 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 May 2012 02:07:18 +0000 (02:07 +0000)
commitb86791d89cb33b51c670d0fb47eda937551d8aa6
tree52c149e65e8e85c9c7e132488a59db62514f3156
parent9934c1db599ea6372c1804c7a1d4c213488adb6b
implement new negative flexing algorithm
https://bugs.webkit.org/show_bug.cgi?id=86528

Reviewed by Ojan Vafai.

Source/WebCore:

Rather than just scale by the negative flexibility, we also take the
flex-basis (preferred size) into consideration.  That means items with
a larger preferred size will shrink faster.

Test: css3/flexbox/flex-algorithm.html (new test cases added)

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild): Handle overflow.
(WebCore::RenderFlexibleBox::layoutFlexItems):
(WebCore::RenderFlexibleBox::computeNextFlexLine): Sum weighted negative flex.
(WebCore::RenderFlexibleBox::freezeViolations):
(WebCore::RenderFlexibleBox::resolveFlexibleLengths): Shrink by weighted amount.
Also handle large values by making sure the flex values are finite.
* rendering/RenderFlexibleBox.h:

LayoutTests:

* css3/flexbox/flex-algorithm-expected.txt:
* css3/flexbox/flex-algorithm.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118600 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/flex-algorithm-expected.txt
LayoutTests/css3/flexbox/flex-algorithm.html
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderFlexibleBox.h