Implement flex-wrap: wrap
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Mar 2012 21:59:10 +0000 (21:59 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Mar 2012 21:59:10 +0000 (21:59 +0000)
commitf4ca565680b4d67da53695a265e11503be0bcb65
treed2267be3f813b19eb671cfbf2f6f5853ee5a70b1
parent7af6eadd3e0244b518d5aa69b7dc519a78813e55
Implement flex-wrap: wrap
https://bugs.webkit.org/show_bug.cgi?id=79930

Reviewed by David Hyatt.

Source/WebCore:

Tests: css3/flexbox/multiline-align.html
       css3/flexbox/multiline.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::sizesToIntrinsicLogicalWidth): Don't apply column+stretch optimization to multiline.
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::FlexOrderIterator::FlexOrderIterator):
(WebCore::RenderFlexibleBox::FlexOrderIterator::currentChild): Expose the current child so we can pause
in the middle of iteration and resume later.
(RenderFlexibleBox::FlexOrderIterator):
(WebCore::RenderFlexibleBox::isMultiline):
(WebCore):
(WebCore::RenderFlexibleBox::layoutFlexItems): Loop per line.
(WebCore::RenderFlexibleBox::availableAlignmentSpaceForChild): Use the line space, not the whole container space.
(WebCore::RenderFlexibleBox::computeFlexOrder): Return true for each line.
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren): Use the line offset. Also compute the line height as we go.
(WebCore::RenderFlexibleBox::layoutColumnReverse): Use the line offset.
(WebCore::RenderFlexibleBox::alignChildren): Align based on the line height. For multiline + column, we have to relayout
since the width may change (same as the row case above). We'll have to do something smarter when we implement flex-line-pack.
* rendering/RenderFlexibleBox.h:
(RenderFlexibleBox):

LayoutTests:

* css3/flexbox/multiline-align-expected.txt: Added.
* css3/flexbox/multiline-align.html: Added.
* css3/flexbox/multiline-expected.txt: Added.
* css3/flexbox/multiline.html: Added.

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