[css-grid] Properly handle static positions of abspos inside grid items
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jan 2019 12:44:49 +0000 (12:44 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jan 2019 12:44:49 +0000 (12:44 +0000)
commitb03ccb86f69769e127259656732ccf8318b28641
treee011c66cdf5177717c69052e7da9a11b48310c8b
parentbddd4dfd595b1faf66806e7731b97115d05d976c
[css-grid] Properly handle static positions of abspos inside grid items
https://bugs.webkit.org/show_bug.cgi?id=193657

Patch by Oriol Brufau <obrufau@igalia.com> on 2019-01-23
Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Import test changes from WPT.
Various orthogonal tests still fail because of https://bugs.webkit.org/show_bug.cgi?id=189513
Some other tests also fail because of https://bugs.webkit.org/show_bug.cgi?id=193656

* resources/import-expectations.json:
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015.html: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016-expected.txt: Added.
* web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html: Added.
* web-platform-tests/css/css-grid/abspos/support/positioned-grid-descendants.css: Added.
(.grid):
(.abspos):
(.orthogonal):
(.grid > :nth-child(1) > .abspos):
(.grid > :nth-child(2) > .abspos):
* web-platform-tests/css/css-grid/abspos/support/positioned-grid-descendants.js: Added.
(export.runTests):
* web-platform-tests/css/css-grid/abspos/support/w3c-import.log:
* web-platform-tests/css/css-grid/abspos/w3c-import.log:

Source/WebCore:

Rename findChildLogicalPosition to setLogicalPositionForChild and let it set the position.
Add setLogicalOffsetForChild like setLogicalPositionForChild but just for one offset,
and only if it's needed (not for abspos descentants in their static position).
Add logicalOffsetForChild that finds the value to be set by the functions above.
Rename existing logicalOffsetForChild to logicalOffsetForOutOfFlowChild.

Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015.html
       imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutGridItems):
(WebCore::RenderGrid::layoutPositionedObject):
(WebCore::RenderGrid::logicalOffsetForOutOfFlowChild const):
(WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):
(WebCore::RenderGrid::setLogicalPositionForChild const):
(WebCore::RenderGrid::setLogicalOffsetForChild const):
(WebCore::RenderGrid::logicalOffsetForChild const):
* rendering/RenderGrid.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
73 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/resources/import-expectations.json
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/support/positioned-grid-descendants.css [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/support/positioned-grid-descendants.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/support/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/w3c-import.log
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/RenderGrid.h