[css-grid] Implementing baseline positioning for grid containers
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jan 2017 23:15:26 +0000 (23:15 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jan 2017 23:15:26 +0000 (23:15 +0000)
commitd51581bd2217a0d3c2220425b99fec090df109d1
tree094cc73ecae144ae9b88fe59b776c732b838fa36
parent34a701ae68c4e5385999483c24d3ee77fb94ee39
[css-grid] Implementing baseline positioning for grid containers
https://bugs.webkit.org/show_bug.cgi?id=165063

Reviewed by Darin Adler and Sergio Villar Senin.

Source/WebCore:

Implementation of the 'first-line' baseline for Grid containers,
according to the CSS Grid Layout spec.
https://drafts.csswg.org/css-grid/#grid-baselines

The self-baseline and content-baseline alignment logic is still
not implemented, hence some cases will be implemented in
future patches.

Tests: fast/css-grid-layout/grid-baseline-margins.html
       fast/css-grid-layout/grid-baseline-must-respect-grid-order.html
       fast/css-grid-layout/grid-baseline.html

* rendering/RenderGrid.cpp:
(WebCore::synthesizedBaselineFromBorderBox):
(WebCore::RenderGrid::isInlineBaselineAlignedChild):
(WebCore::RenderGrid::baselinePosition):
(WebCore::RenderGrid::firstLineBaseline):
(WebCore::RenderGrid::inlineBlockBaseline):
* rendering/RenderGrid.h:

LayoutTests:

Tests to verify the baseline positioning of grid and inline-grid blocks.
Note that two of these new tests are expected to fail because of a Flexbox
bug, since we use Flexbox as reference test.

* TestExpectations:
* fast/css-grid-layout/grid-baseline-expected.html: Added.
* fast/css-grid-layout/grid-baseline-margins-expected.html: Added.
* fast/css-grid-layout/grid-baseline-margins.html: Added.
* fast/css-grid-layout/grid-baseline-must-respect-grid-order-expected.txt: Added.
* fast/css-grid-layout/grid-baseline-must-respect-grid-order.html: Added.
* fast/css-grid-layout/grid-baseline.html: Added.
* fast/css-grid-layout/resources/grid-alignment.css:
(.alignSelfBaseline):
(.selfBaseline):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/fast/css-grid-layout/grid-baseline-expected.html [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-baseline-margins-expected.html [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-baseline-margins.html [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-baseline-must-respect-grid-order-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-baseline-must-respect-grid-order.html [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-baseline.html [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/resources/grid-alignment.css
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/RenderGrid.h