[css-grid] Logical margin incorrectly applied during the tracks sizing algorithm...
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Jun 2017 11:35:27 +0000 (11:35 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Jun 2017 11:35:27 +0000 (11:35 +0000)
commit6ad693ab83015cd687ffff399744aa6b9343cee1
treeb730459359521de2315f8b94a1e28120d8261839
parent30bf697b4cb3bb965ae651d72a1c9bde7825a08c
[css-grid] Logical margin incorrectly applied during the tracks sizing algorithm of auto tracks
https://bugs.webkit.org/show_bug.cgi?id=172836

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

When computing min-content and max-content of the content-sized tracks
we are using the marginIntrinsicLogicalWidthForChild function, which
uses the grid's writing-mode to determine wether to use the child's
margin width or height. This is not correct when the grid item is
orthogonal.

This patch changes how we compute the tracks width so we use always
the item's marginLogicalWidth, which depends only on its own writing
mode.

Test: fast/css-grid-layout/grid-track-sizing-with-margins-and-orthogonal-flows.html

* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild):
(WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild):

LayoutTests:

Test to verify different cases of auto-sized tracks and orthogonal items with margins.

* fast/css-grid-layout/grid-track-sizing-with-margins-and-orthogonal-flows-expected.txt: Added.
* fast/css-grid-layout/grid-track-sizing-with-margins-and-orthogonal-flows.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/fast/css-grid-layout/grid-track-sizing-with-margins-and-orthogonal-flows-expected.txt [new file with mode: 0644]
LayoutTests/fast/css-grid-layout/grid-track-sizing-with-margins-and-orthogonal-flows.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid-1/alignment/grid-self-alignment-stretch-014-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-grid-1/alignment/grid-self-alignment-stretch-vertical-lr-014-expected.txt
LayoutTests/imported/w3c/web-platform-tests/css/css-grid-1/alignment/grid-self-alignment-stretch-vertical-rl-014-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp