inline-flex baseline is sometimes wrong
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Oct 2012 16:47:50 +0000 (16:47 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Oct 2012 16:47:50 +0000 (16:47 +0000)
commitc0951072e1ab6fd0b351096af78e8d068f965ebf
tree9cad8422a65943f1fe9316aa7d9a7cc95c5b88e3
parent57fe63676c0fa26f860f1effa6da6fcc72d156ee
inline-flex baseline is sometimes wrong
https://bugs.webkit.org/show_bug.cgi?id=96188

Reviewed by Ojan Vafai.

Source/WebCore:

Implement the necessary methods to get the proper baseline alignment of flexbox.
We were falling back to the inline-block behavior.

Test: css3/flexbox/flexbox-baseline.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::RenderFlexibleBox):
(WebCore::RenderFlexibleBox::baselinePosition): Used to get the baseline of the box.
Mostly just the first line box baseline.
(WebCore):
(WebCore::RenderFlexibleBox::lastLineBoxBaseline): This is used for getting the baseline when in an inline-block.
We actually don't want the last line, but the flexbox's baseline.
(WebCore::RenderFlexibleBox::firstLineBoxBaseline): Compute the baseline according to the rules in the spec.
(WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems): Keep track of the number of children on the
first line so we don't have to re-compute this when getting the baseline.
(WebCore::RenderFlexibleBox::crossAxisExtentForChild): Make const.
(WebCore::RenderFlexibleBox::mainAxisExtentForChild): Make const.
(WebCore::RenderFlexibleBox::hasAutoMarginsInCrossAxis): Make const.
* rendering/RenderFlexibleBox.h: Add a size_t to keep track of how many children are in the first line.

LayoutTests:

Add a new pixel test and mark the test as failing so we can get pixel results from the bots.

* css3/flexbox/flexbox-baseline.html: Added.
* platform/chromium-linux/css3/flexbox/flexbox-baseline-expected.png: Added.
* platform/chromium-linux/css3/flexbox/flexbox-baseline-expected.txt: Added.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/flexbox/flexbox-baseline.html [new file with mode: 0644]
LayoutTests/platform/chromium-linux/css3/flexbox/flexbox-baseline-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-linux/css3/flexbox/flexbox-baseline-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderFlexibleBox.h