auto margins on flexbox should allocate space in the cross direction
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 May 2012 00:19:40 +0000 (00:19 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 May 2012 00:19:40 +0000 (00:19 +0000)
commit2ec889926082eb60b017388a66823eb09baa1088
treee50f1ea0285ab88331b75b0ffc14f6901d212a9c
parenta41c3bc2e404eb14cb0397db706b4b524a339589
auto margins on flexbox should allocate space in the cross direction
https://bugs.webkit.org/show_bug.cgi?id=86913

Reviewed by Ojan Vafai.

Source/WebCore:

Test: css3/flexbox/auto-margins.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::hasAutoMarginsInCrossAxis):
(WebCore):
(WebCore::RenderFlexibleBox::updateAutoMarginsInCrossAxis):
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren): If we have flex-align: baseline and auto margins, we ignore flex-align: baseline.
(WebCore::RenderFlexibleBox::alignChildren): auto margins apply before flex-align.
* rendering/RenderFlexibleBox.h:

LayoutTests:

* css3/flexbox/auto-margins-expected.html: Added.
* css3/flexbox/auto-margins.html: Added. These are the test cases in the spec.
* css3/flexbox/flex-align-vertical-writing-mode.html: Fix tests with auto margins and add more tests.
Also reduce the height so it's easier to see the test cases (these vertical tests don't check the height).
* css3/flexbox/flex-align.html: Fix tests with auto margins and add more tests.
* css3/flexbox/flex-flow-auto-margins.html: Fix results now that we handle auto in the cross direction.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/auto-margins-expected.html [new file with mode: 0644]
LayoutTests/css3/flexbox/auto-margins.html [new file with mode: 0644]
LayoutTests/css3/flexbox/flex-align-vertical-writing-mode.html
LayoutTests/css3/flexbox/flex-align.html
LayoutTests/css3/flexbox/flex-flow-auto-margins.html
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderFlexibleBox.h