implement flexbox wrap-reverse
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Mar 2012 22:55:53 +0000 (22:55 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Mar 2012 22:55:53 +0000 (22:55 +0000)
commit7d851afbb3c2553208e6cf57c79713c6e521226c
tree1901cb45a2dd27c9b6da97c3c0ba8920edf403b1
parenta1fd0a582244ac453805542f2b9c41d0af6e6645
implement flexbox wrap-reverse
https://bugs.webkit.org/show_bug.cgi?id=80552

Reviewed by Ojan Vafai.

Source/WebCore:

No new tests, but additional coverage in:
    css3/flexbox/multiline-align.html
    css3/flexbox/multiline-pack.html
    css3/flexbox/multiline.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::WrapReverseContext::WrapReverseContext): Helper struct to hold information needed for reversing
the order of lines.
(RenderFlexibleBox::WrapReverseContext):
(WebCore::RenderFlexibleBox::WrapReverseContext::addCrossAxisOffset):
(WebCore::RenderFlexibleBox::WrapReverseContext::addNumberOfChildrenOnLine):
(WebCore::RenderFlexibleBox::WrapReverseContext::lineCrossAxisDelta): Computes the number of pixels to move a line.
(WebCore):
(WebCore::RenderFlexibleBox::layoutFlexItems): Call flipForWrapReverse if needed. This happens
before flipForRightToLeftColumn because otherwise the crossAxisOffsets will be wrong.
(WebCore::flexAlignForChild):
(WebCore::RenderFlexibleBox::alignChildren): Flip alignment in wrap-reverse because the cross directions are flipped.
(WebCore::RenderFlexibleBox::flipForWrapReverse): Flip each line.
* rendering/RenderFlexibleBox.h:
(RenderFlexibleBox):

LayoutTests:

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

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