[css-grid] Preserve auto repeat() in getComputedStyle() for non-grids
authorobrufau@igalia.com <obrufau@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Oct 2019 10:06:20 +0000 (10:06 +0000)
committerobrufau@igalia.com <obrufau@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Oct 2019 10:06:20 +0000 (10:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202258

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Import WPT tests.
There are some test failures because integer repeat() is still expanded
at computed-value time (https://webkit.org/b/202259).

* resources/import-expectations.json:
* web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-expected.txt: Added.
* web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid-expected.txt: Added.
* web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html: Added.
* web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html: Added.
* web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-expected.txt: Added.
* web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid-expected.txt: Added.
* web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html: Added.
* web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html: Added.
* web-platform-tests/css/css-grid/parsing/w3c-import.log:

Source/WebCore:

Tests: imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html
       imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html
       imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html
       imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html

Usually, the resolved value of grid-template-rows/columns is the used
value, expanding the repeat() notation. But for elements with a non-grid
display, the resolved value is just the computed value, with repeat(),
since the used value doesn't exist.
Before this patch, the repeat() was dropped, and line names after it
appeared at the wrong position or were also dropped. There was also an
assert failure in debug. This patch fixes the serialization for auto
repeat(). Integer repeat() is still expanded at computed-value time, so
it's not preserved in getComputedStyle().

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::OrderedNamedLinesCollector::OrderedNamedLinesCollector):
(WebCore::OrderedNamedLinesCollectorInsideRepeat::OrderedNamedLinesCollectorInsideRepeat):
(WebCore::OrderedNamedLinesCollectorInGridLayout::OrderedNamedLinesCollectorInGridLayout):
(WebCore::OrderedNamedLinesCollector::collectLineNamesForIndex const):
(WebCore::OrderedNamedLinesCollectorInsideRepeat::collectLineNamesForIndex const):
(WebCore::OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex const):
(WebCore::populateGridTrackList):
(WebCore::valueForGridTrackList):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250715 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/resources/import-expectations.json
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/w3c-import.log
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp

index e779bcd..e3e0da3 100644 (file)
@@ -1,3 +1,25 @@
+2019-10-04  Oriol Brufau  <obrufau@igalia.com>
+
+        [css-grid] Preserve auto repeat() in getComputedStyle() for non-grids
+        https://bugs.webkit.org/show_bug.cgi?id=202258
+
+        Reviewed by Javier Fernandez.
+
+        Import WPT tests.
+        There are some test failures because integer repeat() is still expanded
+        at computed-value time (https://webkit.org/b/202259).
+
+        * resources/import-expectations.json:
+        * web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-expected.txt: Added.
+        * web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid-expected.txt: Added.
+        * web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html: Added.
+        * web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html: Added.
+        * web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-expected.txt: Added.
+        * web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid-expected.txt: Added.
+        * web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html: Added.
+        * web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html: Added.
+        * web-platform-tests/css/css-grid/parsing/w3c-import.log:
+
 2019-10-04  Chris Lord  <clord@igalia.com>
 
         Import 2dcontext Web Platform Tests
index 2ebb5a5..bed3395 100644 (file)
@@ -70,6 +70,7 @@
     "web-platform-tests/css/css-grid/abspos": "import", 
     "web-platform-tests/css/css-grid/grid-definition/": "import", 
     "web-platform-tests/css/css-grid/layout-algorithm/": "import", 
+    "web-platform-tests/css/css-grid/parsing/": "import", 
     "web-platform-tests/css/css-lists/": "import", 
     "web-platform-tests/css/css-logical": "import", 
     "web-platform-tests/css/css-multicol": "import", 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-expected.txt
new file mode 100644 (file)
index 0000000..38c1595
--- /dev/null
@@ -0,0 +1,23 @@
+
+PASS Property grid-template-columns value 'none' computes to 'none' 
+PASS Property grid-template-columns value '1px' computes to '1px' 
+PASS Property grid-template-columns value '1px [a]' computes to '1px [a]' 
+PASS Property grid-template-columns value '1px [a] 2px' computes to '1px [a] 2px' 
+PASS Property grid-template-columns value '[a] 1px' computes to '[a] 1px' 
+PASS Property grid-template-columns value '[a] 1px [b]' computes to '[a] 1px [b]' 
+PASS Property grid-template-columns value '1px repeat(1, 2px) 3px' computes to '1px 2px 3px' 
+PASS Property grid-template-columns value '1px repeat(auto-fill, 2px) 3px' computes to '1px 2px 3px' 
+PASS Property grid-template-columns value '1px repeat(auto-fit, 2px) 3px' computes to '1px 0px 3px' 
+PASS Property grid-template-columns value '1px [a] repeat(1, [b] 2px [c]) [d] 3px' computes to '1px [a b] 2px [c d] 3px' 
+PASS Property grid-template-columns value '1px [a] repeat(auto-fill, [b] 2px [c]) [d] 3px' computes to '1px [a b] 2px [c d] 3px' 
+PASS Property grid-template-columns value '1px [a] repeat(auto-fit, [b] 2px [c]) [d] 3px' computes to '1px [a b] 0px [c d] 3px' 
+PASS Property grid-template-columns value '[a] 1px repeat(1, 2px [b] 3px) 4px [d]' computes to '[a] 1px 2px [b] 3px 4px [d]' 
+PASS Property grid-template-columns value '[a] 1px repeat(auto-fill, 2px [b] 3px) 4px [d]' computes to '[a] 1px 2px [b] 3px 4px [d]' 
+PASS Property grid-template-columns value '[a] 1px repeat(auto-fit, 2px [b] 3px) 4px [d]' computes to '[a] 1px 0px [b] 0px 4px [d]' 
+PASS Property grid-template-columns value '100% [a] repeat(1, [b] 200% [c]) [d] 300%' computes to '1px [a b] 2px [c d] 3px' 
+PASS Property grid-template-columns value '100% [a] repeat(auto-fill, [b] 200% [c]) [d] 300%' computes to '1px [a b] 2px [c d] 3px' 
+PASS Property grid-template-columns value '100% [a] repeat(auto-fit, [b] 200% [c]) [d] 300%' computes to '1px [a b] 0px [c d] 3px' 
+PASS Property grid-template-columns value '[a] 1em repeat(1, 2em [b] 3em) 4em [d]' computes to '[a] 1px 2px [b] 3px 4px [d]' 
+PASS Property grid-template-columns value '[a] 1em repeat(auto-fill, 2em [b] 3em) 4em [d]' computes to '[a] 1px 2px [b] 3px 4px [d]' 
+PASS Property grid-template-columns value '[a] 1em repeat(auto-fit, 2em [b] 3em) 4em [d]' computes to '[a] 1px 0px [b] 0px 4px [d]' 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid-expected.txt
new file mode 100644 (file)
index 0000000..20fe6dc
--- /dev/null
@@ -0,0 +1,23 @@
+
+PASS Property grid-template-columns value 'none' computes to 'none' 
+PASS Property grid-template-columns value '1px' computes to '1px' 
+PASS Property grid-template-columns value '1px [a]' computes to '1px [a]' 
+PASS Property grid-template-columns value '1px [a] 2px' computes to '1px [a] 2px' 
+PASS Property grid-template-columns value '[a] 1px' computes to '[a] 1px' 
+PASS Property grid-template-columns value '[a] 1px [b]' computes to '[a] 1px [b]' 
+FAIL Property grid-template-columns value '1px repeat(1, 2px) 3px' computes to '1px repeat(1, 2px) 3px' assert_equals: expected "1px repeat(1, 2px) 3px" but got "1px 2px 3px"
+PASS Property grid-template-columns value '1px repeat(auto-fill, 2px) 3px' computes to '1px repeat(auto-fill, 2px) 3px' 
+PASS Property grid-template-columns value '1px repeat(auto-fit, 2px) 3px' computes to '1px repeat(auto-fit, 2px) 3px' 
+FAIL Property grid-template-columns value '1px [a] repeat(1, [b] 2px [c]) [d] 3px' computes to '1px [a] repeat(1, [b] 2px [c]) [d] 3px' assert_equals: expected "1px [a] repeat(1, [b] 2px [c]) [d] 3px" but got "1px [a b] 2px [c d] 3px"
+PASS Property grid-template-columns value '1px [a] repeat(auto-fill, [b] 2px [c]) [d] 3px' computes to '1px [a] repeat(auto-fill, [b] 2px [c]) [d] 3px' 
+PASS Property grid-template-columns value '1px [a] repeat(auto-fit, [b] 2px [c]) [d] 3px' computes to '1px [a] repeat(auto-fit, [b] 2px [c]) [d] 3px' 
+FAIL Property grid-template-columns value '[a] 1px repeat(1, 2px [b] 3px) 4px [d]' computes to '[a] 1px repeat(1, 2px [b] 3px) 4px [d]' assert_equals: expected "[a] 1px repeat(1, 2px [b] 3px) 4px [d]" but got "[a] 1px 2px [b] 3px 4px [d]"
+PASS Property grid-template-columns value '[a] 1px repeat(auto-fill, 2px [b] 3px) 4px [d]' computes to '[a] 1px repeat(auto-fill, 2px [b] 3px) 4px [d]' 
+PASS Property grid-template-columns value '[a] 1px repeat(auto-fit, 2px [b] 3px) 4px [d]' computes to '[a] 1px repeat(auto-fit, 2px [b] 3px) 4px [d]' 
+FAIL Property grid-template-rows value '100% [a] repeat(1, [b] 200% [c]) [d] 300%' computes to '100% [a] repeat(1, [b] 200% [c]) [d] 300%' assert_equals: expected "100% [a] repeat(1, [b] 200% [c]) [d] 300%" but got "100% [a b] 200% [c d] 300%"
+PASS Property grid-template-rows value '100% [a] repeat(auto-fill, [b] 200% [c]) [d] 300%' computes to '100% [a] repeat(auto-fill, [b] 200% [c]) [d] 300%' 
+PASS Property grid-template-rows value '100% [a] repeat(auto-fit, [b] 200% [c]) [d] 300%' computes to '100% [a] repeat(auto-fit, [b] 200% [c]) [d] 300%' 
+FAIL Property grid-template-columns value '[a] 1em repeat(1, 2em [b] 3em) 4em [d]' computes to '[a] 1px repeat(1, 2px [b] 3px) 4px [d]' assert_equals: expected "[a] 1px repeat(1, 2px [b] 3px) 4px [d]" but got "[a] 1px 2px [b] 3px 4px [d]"
+PASS Property grid-template-columns value '[a] 1em repeat(auto-fill, 2em [b] 3em) 4em [d]' computes to '[a] 1px repeat(auto-fill, 2px [b] 3px) 4px [d]' 
+PASS Property grid-template-columns value '[a] 1em repeat(auto-fit, 2em [b] 3em) 4em [d]' computes to '[a] 1px repeat(auto-fit, 2px [b] 3px) 4px [d]' 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html
new file mode 100644 (file)
index 0000000..b95914f
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Grid Layout Test: getComputedStyle().gridTemplateColumns</title>
+<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/css-grid/#resolved-track-list" title="7.2.6. Resolved Value of a Track Listing">
+<meta name="assert" content="Checks the resolved value of grid-template-columns on an element which is not a grid container.">
+<style>
+#target {
+  display: block;
+  height: 1px;
+  font-size: 1px;
+}
+</style>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/computed-testcommon.js"></script>
+<div id="target"></div>
+<script>
+test_computed_value("grid-template-columns", "none");
+test_computed_value("grid-template-columns", "1px");
+test_computed_value("grid-template-columns", "1px [a]");
+test_computed_value("grid-template-columns", "1px [a] 2px");
+test_computed_value("grid-template-columns", "[a] 1px");
+test_computed_value("grid-template-columns", "[a] 1px [b]");
+test_computed_value("grid-template-columns", "1px repeat(1, 2px) 3px");
+test_computed_value("grid-template-columns", "1px repeat(auto-fill, 2px) 3px");
+test_computed_value("grid-template-columns", "1px repeat(auto-fit, 2px) 3px");
+test_computed_value("grid-template-columns", "1px [a] repeat(1, [b] 2px [c]) [d] 3px");
+test_computed_value("grid-template-columns", "1px [a] repeat(auto-fill, [b] 2px [c]) [d] 3px");
+test_computed_value("grid-template-columns", "1px [a] repeat(auto-fit, [b] 2px [c]) [d] 3px");
+test_computed_value("grid-template-columns", "[a] 1px repeat(1, 2px [b] 3px) 4px [d]");
+test_computed_value("grid-template-columns", "[a] 1px repeat(auto-fill, 2px [b] 3px) 4px [d]");
+test_computed_value("grid-template-columns", "[a] 1px repeat(auto-fit, 2px [b] 3px) 4px [d]");
+test_computed_value("grid-template-rows", "100% [a] repeat(1, [b] 200% [c]) [d] 300%");
+test_computed_value("grid-template-rows", "100% [a] repeat(auto-fill, [b] 200% [c]) [d] 300%");
+test_computed_value("grid-template-rows", "100% [a] repeat(auto-fit, [b] 200% [c]) [d] 300%");
+test_computed_value("grid-template-columns", "[a] 1em repeat(1, 2em [b] 3em) 4em [d]", "[a] 1px repeat(1, 2px [b] 3px) 4px [d]");
+test_computed_value("grid-template-columns", "[a] 1em repeat(auto-fill, 2em [b] 3em) 4em [d]", "[a] 1px repeat(auto-fill, 2px [b] 3px) 4px [d]");
+test_computed_value("grid-template-columns", "[a] 1em repeat(auto-fit, 2em [b] 3em) 4em [d]", "[a] 1px repeat(auto-fit, 2px [b] 3px) 4px [d]");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html
new file mode 100644 (file)
index 0000000..f6d0d97
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Grid Layout Test: getComputedStyle().gridTemplateColumns</title>
+<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/css-grid/#resolved-track-list" title="7.2.6. Resolved Value of a Track Listing">
+<meta name="assert" content="Checks the resolved value of grid-template-columns on a grid container.">
+<style>
+#target {
+  display: grid;
+  width: 1px;
+  font-size: 1px;
+}
+</style>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/computed-testcommon.js"></script>
+<div id="target"></div>
+<script>
+test_computed_value("grid-template-columns", "none");
+test_computed_value("grid-template-columns", "1px");
+test_computed_value("grid-template-columns", "1px [a]");
+test_computed_value("grid-template-columns", "1px [a] 2px");
+test_computed_value("grid-template-columns", "[a] 1px");
+test_computed_value("grid-template-columns", "[a] 1px [b]");
+test_computed_value("grid-template-columns", "1px repeat(1, 2px) 3px", "1px 2px 3px");
+test_computed_value("grid-template-columns", "1px repeat(auto-fill, 2px) 3px", "1px 2px 3px");
+test_computed_value("grid-template-columns", "1px repeat(auto-fit, 2px) 3px", "1px 0px 3px");
+test_computed_value("grid-template-columns", "1px [a] repeat(1, [b] 2px [c]) [d] 3px", "1px [a b] 2px [c d] 3px");
+test_computed_value("grid-template-columns", "1px [a] repeat(auto-fill, [b] 2px [c]) [d] 3px", "1px [a b] 2px [c d] 3px");
+test_computed_value("grid-template-columns", "1px [a] repeat(auto-fit, [b] 2px [c]) [d] 3px", "1px [a b] 0px [c d] 3px");
+test_computed_value("grid-template-columns", "[a] 1px repeat(1, 2px [b] 3px) 4px [d]", "[a] 1px 2px [b] 3px 4px [d]");
+test_computed_value("grid-template-columns", "[a] 1px repeat(auto-fill, 2px [b] 3px) 4px [d]", "[a] 1px 2px [b] 3px 4px [d]");
+test_computed_value("grid-template-columns", "[a] 1px repeat(auto-fit, 2px [b] 3px) 4px [d]", "[a] 1px 0px [b] 0px 4px [d]");
+test_computed_value("grid-template-columns", "100% [a] repeat(1, [b] 200% [c]) [d] 300%", "1px [a b] 2px [c d] 3px");
+test_computed_value("grid-template-columns", "100% [a] repeat(auto-fill, [b] 200% [c]) [d] 300%", "1px [a b] 2px [c d] 3px");
+test_computed_value("grid-template-columns", "100% [a] repeat(auto-fit, [b] 200% [c]) [d] 300%", "1px [a b] 0px [c d] 3px");
+test_computed_value("grid-template-columns", "[a] 1em repeat(1, 2em [b] 3em) 4em [d]", "[a] 1px 2px [b] 3px 4px [d]");
+test_computed_value("grid-template-columns", "[a] 1em repeat(auto-fill, 2em [b] 3em) 4em [d]", "[a] 1px 2px [b] 3px 4px [d]");
+test_computed_value("grid-template-columns", "[a] 1em repeat(auto-fit, 2em [b] 3em) 4em [d]", "[a] 1px 0px [b] 0px 4px [d]");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-expected.txt
new file mode 100644 (file)
index 0000000..c36241a
--- /dev/null
@@ -0,0 +1,23 @@
+
+PASS Property grid-template-rows value 'none' computes to 'none' 
+PASS Property grid-template-rows value '1px' computes to '1px' 
+PASS Property grid-template-rows value '1px [a]' computes to '1px [a]' 
+PASS Property grid-template-rows value '1px [a] 2px' computes to '1px [a] 2px' 
+PASS Property grid-template-rows value '[a] 1px' computes to '[a] 1px' 
+PASS Property grid-template-rows value '[a] 1px [b]' computes to '[a] 1px [b]' 
+PASS Property grid-template-rows value '1px repeat(1, 2px) 3px' computes to '1px 2px 3px' 
+PASS Property grid-template-rows value '1px repeat(auto-fill, 2px) 3px' computes to '1px 2px 3px' 
+PASS Property grid-template-rows value '1px repeat(auto-fit, 2px) 3px' computes to '1px 0px 3px' 
+PASS Property grid-template-rows value '1px [a] repeat(1, [b] 2px [c]) [d] 3px' computes to '1px [a b] 2px [c d] 3px' 
+PASS Property grid-template-rows value '1px [a] repeat(auto-fill, [b] 2px [c]) [d] 3px' computes to '1px [a b] 2px [c d] 3px' 
+PASS Property grid-template-rows value '1px [a] repeat(auto-fit, [b] 2px [c]) [d] 3px' computes to '1px [a b] 0px [c d] 3px' 
+PASS Property grid-template-rows value '[a] 1px repeat(1, 2px [b] 3px) 4px [d]' computes to '[a] 1px 2px [b] 3px 4px [d]' 
+PASS Property grid-template-rows value '[a] 1px repeat(auto-fill, 2px [b] 3px) 4px [d]' computes to '[a] 1px 2px [b] 3px 4px [d]' 
+PASS Property grid-template-rows value '[a] 1px repeat(auto-fit, 2px [b] 3px) 4px [d]' computes to '[a] 1px 0px [b] 0px 4px [d]' 
+PASS Property grid-template-rows value '100% [a] repeat(1, [b] 200% [c]) [d] 300%' computes to '1px [a b] 2px [c d] 3px' 
+PASS Property grid-template-rows value '100% [a] repeat(auto-fill, [b] 200% [c]) [d] 300%' computes to '1px [a b] 2px [c d] 3px' 
+PASS Property grid-template-rows value '100% [a] repeat(auto-fit, [b] 200% [c]) [d] 300%' computes to '1px [a b] 0px [c d] 3px' 
+PASS Property grid-template-rows value '[a] 1em repeat(1, 2em [b] 3em) 4em [d]' computes to '[a] 1px 2px [b] 3px 4px [d]' 
+PASS Property grid-template-rows value '[a] 1em repeat(auto-fill, 2em [b] 3em) 4em [d]' computes to '[a] 1px 2px [b] 3px 4px [d]' 
+PASS Property grid-template-rows value '[a] 1em repeat(auto-fit, 2em [b] 3em) 4em [d]' computes to '[a] 1px 0px [b] 0px 4px [d]' 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid-expected.txt
new file mode 100644 (file)
index 0000000..75e03bf
--- /dev/null
@@ -0,0 +1,23 @@
+
+PASS Property grid-template-rows value 'none' computes to 'none' 
+PASS Property grid-template-rows value '1px' computes to '1px' 
+PASS Property grid-template-rows value '1px [a]' computes to '1px [a]' 
+PASS Property grid-template-rows value '1px [a] 2px' computes to '1px [a] 2px' 
+PASS Property grid-template-rows value '[a] 1px' computes to '[a] 1px' 
+PASS Property grid-template-rows value '[a] 1px [b]' computes to '[a] 1px [b]' 
+FAIL Property grid-template-rows value '1px repeat(1, 2px) 3px' computes to '1px repeat(1, 2px) 3px' assert_equals: expected "1px repeat(1, 2px) 3px" but got "1px 2px 3px"
+PASS Property grid-template-rows value '1px repeat(auto-fill, 2px) 3px' computes to '1px repeat(auto-fill, 2px) 3px' 
+PASS Property grid-template-rows value '1px repeat(auto-fit, 2px) 3px' computes to '1px repeat(auto-fit, 2px) 3px' 
+FAIL Property grid-template-rows value '1px [a] repeat(1, [b] 2px [c]) [d] 3px' computes to '1px [a] repeat(1, [b] 2px [c]) [d] 3px' assert_equals: expected "1px [a] repeat(1, [b] 2px [c]) [d] 3px" but got "1px [a b] 2px [c d] 3px"
+PASS Property grid-template-rows value '1px [a] repeat(auto-fill, [b] 2px [c]) [d] 3px' computes to '1px [a] repeat(auto-fill, [b] 2px [c]) [d] 3px' 
+PASS Property grid-template-rows value '1px [a] repeat(auto-fit, [b] 2px [c]) [d] 3px' computes to '1px [a] repeat(auto-fit, [b] 2px [c]) [d] 3px' 
+FAIL Property grid-template-rows value '[a] 1px repeat(1, 2px [b] 3px) 4px [d]' computes to '[a] 1px repeat(1, 2px [b] 3px) 4px [d]' assert_equals: expected "[a] 1px repeat(1, 2px [b] 3px) 4px [d]" but got "[a] 1px 2px [b] 3px 4px [d]"
+PASS Property grid-template-rows value '[a] 1px repeat(auto-fill, 2px [b] 3px) 4px [d]' computes to '[a] 1px repeat(auto-fill, 2px [b] 3px) 4px [d]' 
+PASS Property grid-template-rows value '[a] 1px repeat(auto-fit, 2px [b] 3px) 4px [d]' computes to '[a] 1px repeat(auto-fit, 2px [b] 3px) 4px [d]' 
+FAIL Property grid-template-rows value '100% [a] repeat(1, [b] 200% [c]) [d] 300%' computes to '100% [a] repeat(1, [b] 200% [c]) [d] 300%' assert_equals: expected "100% [a] repeat(1, [b] 200% [c]) [d] 300%" but got "100% [a b] 200% [c d] 300%"
+PASS Property grid-template-rows value '100% [a] repeat(auto-fill, [b] 200% [c]) [d] 300%' computes to '100% [a] repeat(auto-fill, [b] 200% [c]) [d] 300%' 
+PASS Property grid-template-rows value '100% [a] repeat(auto-fit, [b] 200% [c]) [d] 300%' computes to '100% [a] repeat(auto-fit, [b] 200% [c]) [d] 300%' 
+FAIL Property grid-template-rows value '[a] 1em repeat(1, 2em [b] 3em) 4em [d]' computes to '[a] 1px repeat(1, 2px [b] 3px) 4px [d]' assert_equals: expected "[a] 1px repeat(1, 2px [b] 3px) 4px [d]" but got "[a] 1px 2px [b] 3px 4px [d]"
+PASS Property grid-template-rows value '[a] 1em repeat(auto-fill, 2em [b] 3em) 4em [d]' computes to '[a] 1px repeat(auto-fill, 2px [b] 3px) 4px [d]' 
+PASS Property grid-template-rows value '[a] 1em repeat(auto-fit, 2em [b] 3em) 4em [d]' computes to '[a] 1px repeat(auto-fit, 2px [b] 3px) 4px [d]' 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html
new file mode 100644 (file)
index 0000000..03e601a
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Grid Layout Test: getComputedStyle().gridTemplateRows</title>
+<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/css-grid/#resolved-track-list" title="7.2.6. Resolved Value of a Track Listing">
+<meta name="assert" content="Checks the resolved value of grid-template-rows on an element which is not a grid container.">
+<style>
+#target {
+  display: block;
+  height: 1px;
+  font-size: 1px;
+}
+</style>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/computed-testcommon.js"></script>
+<div id="target"></div>
+<script>
+test_computed_value("grid-template-rows", "none");
+test_computed_value("grid-template-rows", "1px");
+test_computed_value("grid-template-rows", "1px [a]");
+test_computed_value("grid-template-rows", "1px [a] 2px");
+test_computed_value("grid-template-rows", "[a] 1px");
+test_computed_value("grid-template-rows", "[a] 1px [b]");
+test_computed_value("grid-template-rows", "1px repeat(1, 2px) 3px");
+test_computed_value("grid-template-rows", "1px repeat(auto-fill, 2px) 3px");
+test_computed_value("grid-template-rows", "1px repeat(auto-fit, 2px) 3px");
+test_computed_value("grid-template-rows", "1px [a] repeat(1, [b] 2px [c]) [d] 3px");
+test_computed_value("grid-template-rows", "1px [a] repeat(auto-fill, [b] 2px [c]) [d] 3px");
+test_computed_value("grid-template-rows", "1px [a] repeat(auto-fit, [b] 2px [c]) [d] 3px");
+test_computed_value("grid-template-rows", "[a] 1px repeat(1, 2px [b] 3px) 4px [d]");
+test_computed_value("grid-template-rows", "[a] 1px repeat(auto-fill, 2px [b] 3px) 4px [d]");
+test_computed_value("grid-template-rows", "[a] 1px repeat(auto-fit, 2px [b] 3px) 4px [d]");
+test_computed_value("grid-template-rows", "100% [a] repeat(1, [b] 200% [c]) [d] 300%");
+test_computed_value("grid-template-rows", "100% [a] repeat(auto-fill, [b] 200% [c]) [d] 300%");
+test_computed_value("grid-template-rows", "100% [a] repeat(auto-fit, [b] 200% [c]) [d] 300%");
+test_computed_value("grid-template-rows", "[a] 1em repeat(1, 2em [b] 3em) 4em [d]", "[a] 1px repeat(1, 2px [b] 3px) 4px [d]");
+test_computed_value("grid-template-rows", "[a] 1em repeat(auto-fill, 2em [b] 3em) 4em [d]", "[a] 1px repeat(auto-fill, 2px [b] 3px) 4px [d]");
+test_computed_value("grid-template-rows", "[a] 1em repeat(auto-fit, 2em [b] 3em) 4em [d]", "[a] 1px repeat(auto-fit, 2px [b] 3px) 4px [d]");
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html b/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html
new file mode 100644 (file)
index 0000000..4072262
--- /dev/null
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Grid Layout Test: getComputedStyle().gridTemplateRows</title>
+<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
+<link rel="help" href="https://drafts.csswg.org/css-grid/#resolved-track-list" title="7.2.6. Resolved Value of a Track Listing">
+<meta name="assert" content="Checks the resolved value of grid-template-rows on a grid container.">
+<style>
+#target {
+  display: grid;
+  height: 1px;
+  font-size: 1px;
+}
+</style>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/computed-testcommon.js"></script>
+<div id="target"></div>
+<script>
+test_computed_value("grid-template-rows", "none");
+test_computed_value("grid-template-rows", "1px");
+test_computed_value("grid-template-rows", "1px [a]");
+test_computed_value("grid-template-rows", "1px [a] 2px");
+test_computed_value("grid-template-rows", "[a] 1px");
+test_computed_value("grid-template-rows", "[a] 1px [b]");
+test_computed_value("grid-template-rows", "1px repeat(1, 2px) 3px", "1px 2px 3px");
+test_computed_value("grid-template-rows", "1px repeat(auto-fill, 2px) 3px", "1px 2px 3px");
+test_computed_value("grid-template-rows", "1px repeat(auto-fit, 2px) 3px", "1px 0px 3px");
+test_computed_value("grid-template-rows", "1px [a] repeat(1, [b] 2px [c]) [d] 3px", "1px [a b] 2px [c d] 3px");
+test_computed_value("grid-template-rows", "1px [a] repeat(auto-fill, [b] 2px [c]) [d] 3px", "1px [a b] 2px [c d] 3px");
+test_computed_value("grid-template-rows", "1px [a] repeat(auto-fit, [b] 2px [c]) [d] 3px", "1px [a b] 0px [c d] 3px");
+test_computed_value("grid-template-rows", "[a] 1px repeat(1, 2px [b] 3px) 4px [d]", "[a] 1px 2px [b] 3px 4px [d]");
+test_computed_value("grid-template-rows", "[a] 1px repeat(auto-fill, 2px [b] 3px) 4px [d]", "[a] 1px 2px [b] 3px 4px [d]");
+test_computed_value("grid-template-rows", "[a] 1px repeat(auto-fit, 2px [b] 3px) 4px [d]", "[a] 1px 0px [b] 0px 4px [d]");
+test_computed_value("grid-template-rows", "100% [a] repeat(1, [b] 200% [c]) [d] 300%", "1px [a b] 2px [c d] 3px");
+test_computed_value("grid-template-rows", "100% [a] repeat(auto-fill, [b] 200% [c]) [d] 300%", "1px [a b] 2px [c d] 3px");
+test_computed_value("grid-template-rows", "100% [a] repeat(auto-fit, [b] 200% [c]) [d] 300%", "1px [a b] 0px [c d] 3px");
+test_computed_value("grid-template-rows", "[a] 1em repeat(1, 2em [b] 3em) 4em [d]", "[a] 1px 2px [b] 3px 4px [d]");
+test_computed_value("grid-template-rows", "[a] 1em repeat(auto-fill, 2em [b] 3em) 4em [d]", "[a] 1px 2px [b] 3px 4px [d]");
+test_computed_value("grid-template-rows", "[a] 1em repeat(auto-fit, 2em [b] 3em) 4em [d]", "[a] 1px 0px [b] 0px 4px [d]");
+</script>
index 844cd7f..ebe7782 100644 (file)
@@ -24,3 +24,7 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-auto-rows-valid.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-areas-invalid.html
 /LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-areas-valid.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html
+/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html
index 4458eda..624f9c0 100644 (file)
@@ -1,3 +1,35 @@
+2019-10-04  Oriol Brufau  <obrufau@igalia.com>
+
+        [css-grid] Preserve auto repeat() in getComputedStyle() for non-grids
+        https://bugs.webkit.org/show_bug.cgi?id=202258
+
+        Reviewed by Javier Fernandez.
+
+        Tests: imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html
+               imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html
+               imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html
+               imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html
+
+        Usually, the resolved value of grid-template-rows/columns is the used
+        value, expanding the repeat() notation. But for elements with a non-grid
+        display, the resolved value is just the computed value, with repeat(),
+        since the used value doesn't exist.
+        Before this patch, the repeat() was dropped, and line names after it
+        appeared at the wrong position or were also dropped. There was also an
+        assert failure in debug. This patch fixes the serialization for auto
+        repeat(). Integer repeat() is still expanded at computed-value time, so
+        it's not preserved in getComputedStyle().
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::OrderedNamedLinesCollector::OrderedNamedLinesCollector):
+        (WebCore::OrderedNamedLinesCollectorInsideRepeat::OrderedNamedLinesCollectorInsideRepeat):
+        (WebCore::OrderedNamedLinesCollectorInGridLayout::OrderedNamedLinesCollectorInGridLayout):
+        (WebCore::OrderedNamedLinesCollector::collectLineNamesForIndex const):
+        (WebCore::OrderedNamedLinesCollectorInsideRepeat::collectLineNamesForIndex const):
+        (WebCore::OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex const):
+        (WebCore::populateGridTrackList):
+        (WebCore::valueForGridTrackList):
+
 2019-10-04  Antti Koivisto  <antti@apple.com>
 
         [CSS Shadow Parts] Support 'exportparts' attribute
index 02e8985..5806fac 100644 (file)
@@ -36,6 +36,7 @@
 #include "CSSFontValue.h"
 #include "CSSFontVariationValue.h"
 #include "CSSFunctionValue.h"
+#include "CSSGridAutoRepeatValue.h"
 #include "CSSLineBoxContainValue.h"
 #include "CSSPrimitiveValue.h"
 #include "CSSPrimitiveValueMappings.h"
@@ -1124,25 +1125,48 @@ static Ref<CSSValue> specifiedValueForGridTrackSize(const GridTrackSize& trackSi
 class OrderedNamedLinesCollector {
     WTF_MAKE_NONCOPYABLE(OrderedNamedLinesCollector);
 public:
-    OrderedNamedLinesCollector(const RenderStyle& style, bool isRowAxis, unsigned autoRepeatTracksCount)
+    OrderedNamedLinesCollector(const RenderStyle& style, bool isRowAxis)
         : m_orderedNamedGridLines(isRowAxis ? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines())
         , m_orderedNamedAutoRepeatGridLines(isRowAxis ? style.autoRepeatOrderedNamedGridColumnLines() : style.autoRepeatOrderedNamedGridRowLines())
-        , m_insertionPoint(isRowAxis ? style.gridAutoRepeatColumnsInsertionPoint() : style.gridAutoRepeatRowsInsertionPoint())
-        , m_autoRepeatTotalTracks(autoRepeatTracksCount)
-        , m_autoRepeatTrackListLength(isRowAxis ? style.gridAutoRepeatColumns().size() : style.gridAutoRepeatRows().size())
     {
     }
+    virtual ~OrderedNamedLinesCollector() = default;
 
     bool isEmpty() const { return m_orderedNamedGridLines.isEmpty() && m_orderedNamedAutoRepeatGridLines.isEmpty(); }
-    void collectLineNamesForIndex(CSSGridLineNamesValue&, unsigned index) const;
+    virtual void collectLineNamesForIndex(CSSGridLineNamesValue&, unsigned index) const;
 
-private:
+protected:
 
     enum NamedLinesType { NamedLines, AutoRepeatNamedLines };
     void appendLines(CSSGridLineNamesValue&, unsigned index, NamedLinesType) const;
 
     const OrderedNamedGridLinesMap& m_orderedNamedGridLines;
     const OrderedNamedGridLinesMap& m_orderedNamedAutoRepeatGridLines;
+};
+
+class OrderedNamedLinesCollectorInsideRepeat : public OrderedNamedLinesCollector {
+public:
+    OrderedNamedLinesCollectorInsideRepeat(const RenderStyle& style, bool isRowAxis)
+        : OrderedNamedLinesCollector(style, isRowAxis)
+    {
+    }
+
+    void collectLineNamesForIndex(CSSGridLineNamesValue&, unsigned index) const override;
+};
+
+class OrderedNamedLinesCollectorInGridLayout : public OrderedNamedLinesCollector {
+public:
+    OrderedNamedLinesCollectorInGridLayout(const RenderStyle& style, bool isRowAxis, unsigned autoRepeatTracksCount)
+        : OrderedNamedLinesCollector(style, isRowAxis)
+        , m_insertionPoint(isRowAxis ? style.gridAutoRepeatColumnsInsertionPoint() : style.gridAutoRepeatRowsInsertionPoint())
+        , m_autoRepeatTotalTracks(autoRepeatTracksCount)
+        , m_autoRepeatTrackListLength(isRowAxis ? style.gridAutoRepeatColumns().size() : style.gridAutoRepeatRows().size())
+    {
+    }
+
+    void collectLineNamesForIndex(CSSGridLineNamesValue&, unsigned index) const override;
+
+private:
     unsigned m_insertionPoint;
     unsigned m_autoRepeatTotalTracks;
     unsigned m_autoRepeatTrackListLength;
@@ -1163,6 +1187,18 @@ void OrderedNamedLinesCollector::appendLines(CSSGridLineNamesValue& lineNamesVal
 void OrderedNamedLinesCollector::collectLineNamesForIndex(CSSGridLineNamesValue& lineNamesValue, unsigned i) const
 {
     ASSERT(!isEmpty());
+    appendLines(lineNamesValue, i, NamedLines);
+}
+
+void OrderedNamedLinesCollectorInsideRepeat::collectLineNamesForIndex(CSSGridLineNamesValue& lineNamesValue, unsigned i) const
+{
+    ASSERT(!isEmpty());
+    appendLines(lineNamesValue, i, AutoRepeatNamedLines);
+}
+
+void OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex(CSSGridLineNamesValue& lineNamesValue, unsigned i) const
+{
+    ASSERT(!isEmpty());
     if (m_orderedNamedAutoRepeatGridLines.isEmpty() || i < m_insertionPoint) {
         appendLines(lineNamesValue, i, NamedLines);
         return;
@@ -1214,6 +1250,23 @@ static Ref<CSSValueList> valueForGridTrackSizeList(GridTrackSizingDirection dire
     return list;
 }
 
+template <typename T, typename F>
+void populateGridTrackList(CSSValueList& list, OrderedNamedLinesCollector& collector, const Vector<T>& tracks, F getTrackSize, unsigned start, unsigned end, unsigned offset = 0)
+{
+    ASSERT(end <= tracks.size());
+    for (unsigned i = start; i < end; ++i) {
+        addValuesForNamedGridLinesAtIndex(collector, i + offset, list);
+        list.append(getTrackSize(tracks[i]));
+    }
+    addValuesForNamedGridLinesAtIndex(collector, end + offset, list);
+}
+
+template <typename T, typename F>
+void populateGridTrackList(CSSValueList& list, OrderedNamedLinesCollector& collector, const Vector<T>& tracks, F getTrackSize)
+{
+    populateGridTrackList<T>(list, collector, tracks, getTrackSize, 0, tracks.size());
+}
+
 static Ref<CSSValue> valueForGridTrackList(GridTrackSizingDirection direction, RenderObject* renderer, const RenderStyle& style)
 {
     bool isRowAxis = direction == ForColumns;
@@ -1234,30 +1287,44 @@ static Ref<CSSValue> valueForGridTrackList(GridTrackSizingDirection direction, R
     if (trackListIsEmpty)
         return CSSValuePool::singleton().createIdentifierValue(CSSValueNone);
 
-    unsigned autoRepeatTotalTracks = isRenderGrid ? downcast<RenderGrid>(renderer)->autoRepeatCountForDirection(direction) : 0;
-    OrderedNamedLinesCollector collector(style, isRowAxis, autoRepeatTotalTracks);
     auto list = CSSValueList::createSpaceSeparated();
-    unsigned insertionIndex;
+
+    // If the element is a grid container, the resolved value is the used value,
+    // specifying track sizes in pixels and expanding the repeat() notation.
     if (isRenderGrid) {
-        auto computedTrackSizes = downcast<RenderGrid>(*renderer).trackSizesForComputedStyle(direction);
-        unsigned numTracks = computedTrackSizes.size();
+        auto* grid = downcast<RenderGrid>(renderer);
+        OrderedNamedLinesCollectorInGridLayout collector(style, isRowAxis, grid->autoRepeatCountForDirection(direction));
+        populateGridTrackList(list.get(), collector, grid->trackSizesForComputedStyle(direction), [&](const LayoutUnit& v) {
+            return zoomAdjustedPixelValue(v, style);
+        });
+        return list;
+    }
 
-        for (unsigned i = 0; i < numTracks; ++i) {
-            addValuesForNamedGridLinesAtIndex(collector, i, list.get());
-            list->append(zoomAdjustedPixelValue(computedTrackSizes[i], style));
-        }
-        addValuesForNamedGridLinesAtIndex(collector, numTracks + 1, list.get());
-        insertionIndex = numTracks;
-    } else {
-        for (unsigned i = 0; i < trackSizes.size(); ++i) {
-            addValuesForNamedGridLinesAtIndex(collector, i, list.get());
-            list->append(specifiedValueForGridTrackSize(trackSizes[i], style));
-        }
-        insertionIndex = trackSizes.size();
+    // Otherwise, the resolved value is the computed value, preserving repeat().
+    OrderedNamedLinesCollector collector(style, isRowAxis);
+    auto getTrackSize = [&](const GridTrackSize& v) {
+        return specifiedValueForGridTrackSize(v, style);
+    };
+
+    if (autoRepeatTrackSizes.isEmpty()) {
+        // If there's no auto repeat(), just add all the line names and track sizes.
+        populateGridTrackList(list.get(), collector, trackSizes, getTrackSize);
+        return list;
     }
 
-    // Those are the trailing <ident>* allowed in the syntax.
-    addValuesForNamedGridLinesAtIndex(collector, insertionIndex, list.get());
+    // Add the line names and track sizes that precede the auto repeat().
+    unsigned autoRepeatInsertionPoint = isRowAxis ? style.gridAutoRepeatColumnsInsertionPoint() : style.gridAutoRepeatRowsInsertionPoint();
+    populateGridTrackList(list.get(), collector, trackSizes, getTrackSize, 0, autoRepeatInsertionPoint);
+
+    // Add a CSSGridAutoRepeatValue with the contents of the auto repeat().
+    AutoRepeatType autoRepeatType = isRowAxis ? style.gridAutoRepeatColumnsType() : style.gridAutoRepeatRowsType();
+    auto repeatedValues = CSSGridAutoRepeatValue::create(autoRepeatType == AutoRepeatType::Fill ? CSSValueAutoFill : CSSValueAutoFit);
+    OrderedNamedLinesCollectorInsideRepeat repeatCollector(style, isRowAxis);
+    populateGridTrackList(repeatedValues.get(), repeatCollector, autoRepeatTrackSizes, getTrackSize);
+    list->append(repeatedValues.get());
+
+    // Add the line names and track sizes that follow the auto repeat().
+    populateGridTrackList(list.get(), collector, trackSizes, getTrackSize, autoRepeatInsertionPoint, trackSizes.size(), 1);
     return list;
 }