more refactoring of RenderFlexibleBox in preparation for multiline
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Feb 2012 00:42:46 +0000 (00:42 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Feb 2012 00:42:46 +0000 (00:42 +0000)
commit96ffa05363236fadbc4244c20b80089db7ec3d6f
tree8255ea16f5f4067c2d95630c136982f063752e1e
parent6ce58622bb28f2c523ee1eafc785b8e2f3d9c0e9
more refactoring of RenderFlexibleBox in preparation for multiline
https://bugs.webkit.org/show_bug.cgi?id=78281

Reviewed by Ojan Vafai.

Previously, we were creating Vector of each flex item's preferred size in document order,
but for multiline, we need to break the lines in the flex order.  I just removed this code
since it was the wrong order.

Instead, have 2 funtions, computeMainAxisPreferredSizes which only does the necessary
layouts and margin computations to compute preferred sizes and computeFlexOrder which
does the work of computing the flex order, preferred sizes, positive/negative flex.

For multiline, we will have computeFlexOrder drive a while loop and it will return the
flex items, preferred size, and positive/negative flex values for each line.

No new tests, just refactoring.

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutFlexItems):
(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Only layout auto sized children and set margins.
(WebCore::RenderFlexibleBox::computeFlexOrder): Compute flex order, preferred size, positive/negative flex.
(WebCore::RenderFlexibleBox::runFreeSpaceAllocationAlgorithm): Use the precomputed flex order.
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren): Use the precomputed flex order.
(WebCore::RenderFlexibleBox::layoutColumnReverse): Use the precomputed flex order.
(WebCore::RenderFlexibleBox::alignChildren): Use the precomputed flex order.
* rendering/RenderFlexibleBox.h:
(RenderFlexibleBox):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107310 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderFlexibleBox.h