[css-grid] Handle alignment with orthogonal flows
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Jul 2016 10:07:19 +0000 (10:07 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Jul 2016 10:07:19 +0000 (10:07 +0000)
commitc364c6a2eb08a442f49b3dd7ace85ce6d5877115
treeb9b52e54669c1bf7c92ca194f5ec52a184dca0e3
parent50ac7de1aad95bd65ae4b8a321eeb5443cb3fdf5
[css-grid] Handle alignment with orthogonal flows
https://bugs.webkit.org/show_bug.cgi?id=159295

Reviewed by Darin Adler.

Now that grid sizing and positioning issues wrt orthogonal flows have
been clarified in the last spec draft, we can adapt now our alignment
logic to work with orthogonal flows.

Source/WebCore:

Even though basic alignment would work with orthogonal flows with
this patch, we still doesn't allow stretching in that case. I'll provide a
patch for that feature since it's a complex logic and better have an
isolated change.

Tests: fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-vertical-lr.html
       fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-vertical-rl.html
       fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows.html

* rendering/RenderGrid.cpp:
(WebCore::computeOverflowAlignmentOffset): Using 'size' instead of 'breadth' as concept.
(WebCore::RenderGrid::columnAxisPositionForChild): Dealing with orthogonal flow cases.
(WebCore::RenderGrid::rowAxisPositionForChild): Dealing with orthogonal flow cases.
(WebCore::RenderGrid::columnAxisOffsetForChild): Using 'size' instead of 'breadth' as concept.
(WebCore::RenderGrid::rowAxisOffsetForChild): Using 'size' instead of 'breadth' as concept.
(WebCore::RenderGrid::findChildLogicalPosition): Dealing with orthogonal flow cases.

LayoutTests:

These tests ensure that alignment works as expected in the cases where
grid and its children are orthogonal.

* fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-expected.txt: Added.
* fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-vertical-lr-expected.txt: Added.
* fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-vertical-lr.html: Added.
* fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-vertical-rl-expected.txt: Added.
* fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-vertical-rl.html: Added.
* fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows.html: Added.
* fast/css-grid-layout/resources/grid-alignment.css:
(.alignContentSpaceBetween):
(.alignContentSpaceAround):
(.alignContentSpaceEvenly):
(.alignContentStretch):
(.selfStart):
(.selfEnd):
(.selfCenter):
(.selfRight):
(.selfLeft):
(.selfSelfStart):
(.selfSelfEnd):
(.itemsSelfEnd): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203771 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-vertical-lr-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-vertical-lr.html [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-vertical-rl-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-vertical-rl.html [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows.html [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/resources/grid-alignment.css
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp