refactor flexbox in preparation for flex-line-pack
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2012 17:16:30 +0000 (17:16 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2012 17:16:30 +0000 (17:16 +0000)
commitcb8b25c9e2a6feeb52a850b352b992ee0e3e62c8
tree500b13757df389b3cb256162d09ba138aeb03ade
parent15f1073d4e3e3626fb66de1de2ff462aa0187164
refactor flexbox in preparation for flex-line-pack
https://bugs.webkit.org/show_bug.cgi?id=81843

Reviewed by Ojan Vafai.

Replace WrapReverseContext with a vector of LineContexts that contain
the same information, plus values needed for flex-align.

alignChildren has been moved to after all the lines have been
positioned. We want to align children after flex-line-pack has changed
the size of each line to avoid unnecessary layouts.

Take 2: Remove the assert. If there are no children, then there are no
flex lines. Instead, assert that child is not null.

No new tests, just refactoring.

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::LineContext::LineContext): New struct,
holds information needed for wrap-reverse and aligning children.
(RenderFlexibleBox::LineContext):
(WebCore::RenderFlexibleBox::layoutFlexItems): alignChildren after layout out all the lines rather than after each line.
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren): don't alignChildren
(WebCore::RenderFlexibleBox::alignChildren): align all flex items, not just a line at a time.
(WebCore::RenderFlexibleBox::flipForWrapReverse): Update to use LineContext
* rendering/RenderFlexibleBox.h:

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