[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: http://svn.webkit.org/repository/webkit/trunk@203771 268f45cc-cd09-0410-ab3c-d52691b4dbfc
10 files changed