Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (251964 => 251965)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2019-11-02 16:54:41 UTC (rev 251964)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2019-11-02 18:48:15 UTC (rev 251965)
@@ -1,3 +1,28 @@
+2019-11-02 Oriol Brufau <obru...@igalia.com>
+
+ [css-grid] Fix line name positions after auto repeat with no line names
+ https://bugs.webkit.org/show_bug.cgi?id=203670
+
+ Reviewed by Manuel Rego Casasnovas.
+
+ Import WPT tests.
+ There are some test failures because integer repeat() is still expanded
+ at computed-value time (https://webkit.org/b/202259).
+
+ * web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-expected.txt:
+ * web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid-expected.txt:
+ * web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html:
+ * web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-withcontent-expected.txt: Added.
+ * web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-withcontent.html: Added.
+ * web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html:
+ * web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-expected.txt:
+ * web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid-expected.txt:
+ * web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html:
+ * web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-withcontent-expected.txt: Added.
+ * web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-withcontent.html: Added.
+ * web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html:
+ * web-platform-tests/css/css-grid/parsing/w3c-import.log:
+
2019-10-31 Said Abou-Hallawa <sabouhall...@apple.com>
SVGGeometryElement.getPointAtLength should clamp its argument to [0, length]
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-expected.txt (251964 => 251965)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-expected.txt 2019-11-02 16:54:41 UTC (rev 251964)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-expected.txt 2019-11-02 18:48:15 UTC (rev 251965)
@@ -8,6 +8,9 @@
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, 2px 3px) [b] 4px' computes to '1px [a] 2px 3px [b] 4px'
+PASS Property grid-template-columns value '1px [a] repeat(auto-fill, 2px 3px) [b] 4px' computes to '1px [a] 2px 3px [b] 4px'
+PASS Property grid-template-columns value '1px [a] repeat(auto-fit, 2px 3px) [b] 4px' computes to '1px [a] 0px 0px [b] 4px'
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'
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid-expected.txt (251964 => 251965)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid-expected.txt 2019-11-02 16:54:41 UTC (rev 251964)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid-expected.txt 2019-11-02 18:48:15 UTC (rev 251965)
@@ -8,6 +8,9 @@
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, 2px 3px) [b] 4px' computes to '1px [a] repeat(1, 2px 3px) [b] 4px' assert_equals: expected "1px [a] repeat(1, 2px 3px) [b] 4px" but got "1px [a] 2px 3px [b] 4px"
+PASS Property grid-template-columns value '1px [a] repeat(auto-fill, 2px 3px) [b] 4px' computes to '1px [a] repeat(auto-fill, 2px 3px) [b] 4px'
+PASS Property grid-template-columns value '1px [a] repeat(auto-fit, 2px 3px) [b] 4px' computes to '1px [a] repeat(auto-fit, 2px 3px) [b] 4px'
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'
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html (251964 => 251965)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html 2019-11-02 16:54:41 UTC (rev 251964)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html 2019-11-02 18:48:15 UTC (rev 251965)
@@ -25,6 +25,9 @@
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, 2px 3px) [b] 4px");
+test_computed_value("grid-template-columns", "1px [a] repeat(auto-fill, 2px 3px) [b] 4px");
+test_computed_value("grid-template-columns", "1px [a] repeat(auto-fit, 2px 3px) [b] 4px");
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");
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-withcontent-expected.txt (0 => 251965)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-withcontent-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-withcontent-expected.txt 2019-11-02 18:48:15 UTC (rev 251965)
@@ -0,0 +1,29 @@
+
+PASS Property grid-template-columns value 'none' computes to '300px'
+PASS Property grid-template-columns value '20%' computes to '60px'
+PASS Property grid-template-columns value 'calc(-0.5em + 10px)' computes to '0px'
+PASS Property grid-template-columns value 'calc(0.5em + 10px)' computes to '30px'
+PASS Property grid-template-columns value 'calc(30% + 40px)' computes to '130px'
+PASS Property grid-template-columns value '5fr' computes to '300px'
+PASS Property grid-template-columns value 'min-content' computes to '30px'
+PASS Property grid-template-columns value 'max-content' computes to '30px'
+PASS Property grid-template-columns value 'auto' computes to '300px'
+PASS Property grid-template-columns value 'minmax(10px, auto)' computes to '300px'
+PASS Property grid-template-columns value 'minmax(20%, max-content)' computes to '60px'
+PASS Property grid-template-columns value 'minmax(min-content, calc(-0.5em + 10px))' computes to '30px'
+PASS Property grid-template-columns value 'minmax(auto, 0)' computes to '30px'
+PASS Property grid-template-columns value 'fit-content(70px)' computes to '30px'
+PASS Property grid-template-columns value 'fit-content(20%)' computes to '30px'
+PASS Property grid-template-columns value 'fit-content(calc(-0.5em + 10px))' computes to '30px'
+PASS Property grid-template-columns value 'repeat(1, 10px)' computes to '10px'
+PASS Property grid-template-columns value 'repeat(1, [one two] 20%)' computes to '[one two] 60px'
+PASS Property grid-template-columns value 'repeat(2, minmax(10px, auto))' computes to '160px 140px'
+PASS Property grid-template-columns value 'repeat(2, fit-content(20%) [three four] 30px 40px [five six])' computes to '30px [three four] 30px 40px [five six] 0px [three four] 30px 40px [five six]'
+PASS Property grid-template-columns value 'min-content repeat(5, minmax(10px, auto))' computes to '30px 54px 54px 54px 54px 54px'
+PASS Property grid-template-columns value '[] 150px [] 1fr []' computes to '150px 150px'
+PASS Property grid-template-columns value 'repeat(auto-fill, 200px)' computes to '200px'
+PASS Property grid-template-columns value 'repeat(auto-fit, [one] 20%)' computes to '[one] 60px [one] 0px [one] 0px [one] 0px [one] 0px'
+PASS Property grid-template-columns value 'repeat(auto-fill, minmax(100px, 5fr) [two])' computes to '100px [two] 100px [two] 100px [two]'
+PASS Property grid-template-columns value 'repeat(auto-fit, [three] minmax(max-content, 6em) [four])' computes to '[three] 240px [four]'
+PASS Property grid-template-columns value '[one] repeat(2, minmax(50px, auto)) [two] 30px [three] repeat(auto-fill, 10px) 40px [four five] repeat(2, minmax(200px, auto)) [six]' computes to '[one] 50px 50px [two] 30px [three] 10px 40px [four five] 200px 200px [six]'
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-withcontent.html (0 => 251965)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-withcontent.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-withcontent.html 2019-11-02 18:48:15 UTC (rev 251965)
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Grid Layout Test: getComputedStyle().gridTemplateColumns</title>
+<link rel="help" href=""
+<meta name="assert" content="grid-template-columns computed value is the keyword none or a computed track list.">
+<script src=""
+<script src=""
+<script src=""
+<style>
+ #target {
+ display: grid;
+ font-size: 40px;
+ min-width: 200px;
+ width: 300px;
+ max-width: 400px;
+ min-height: 500px;
+ height: 600px;
+ max-height: 700px;
+ }
+ #child {
+ min-width: 20px;
+ width: 30px;
+ max-width: 40px;
+ min-height: 50px;
+ height: 60px;
+ max-height: 70px;
+ }
+</style>
+</head>
+<body>
+<div id="container">
+ <div id="target">
+ <div id="child"></div>
+ </div>
+</div>
+<script>
+test_computed_value("grid-template-columns", 'none', '300px'); // "none" without #child
+
+// track-size <fixed-breadth> = <length-percentage> | <flex> | min-content | max-content | auto
+test_computed_value("grid-template-columns", '20%', '60px'); // 20% * width
+test_computed_value("grid-template-columns", 'calc(-0.5em + 10px)', '0px');
+test_computed_value("grid-template-columns", 'calc(0.5em + 10px)', '30px');
+test_computed_value("grid-template-columns", 'calc(30% + 40px)', '130px'); // 30% * width + 40px
+test_computed_value("grid-template-columns", '5fr', '300px'); // width
+test_computed_value("grid-template-columns", 'min-content', '30px');
+test_computed_value("grid-template-columns", 'max-content', '30px');
+test_computed_value("grid-template-columns", 'auto', '300px'); // width
+
+// track-size minmax( <inflexible-breadth> , <track-breadth> )
+test_computed_value("grid-template-columns", 'minmax(10px, auto)', '300px'); // width
+test_computed_value("grid-template-columns", 'minmax(20%, max-content)', '60px'); // 20% * width
+test_computed_value("grid-template-columns", 'minmax(min-content, calc(-0.5em + 10px))', '30px');
+test_computed_value("grid-template-columns", 'minmax(auto, 0)', '30px');
+
+// track-size fit-content( <length-percentage> )
+test_computed_value("grid-template-columns", 'fit-content(70px)', '30px');
+test_computed_value("grid-template-columns", 'fit-content(20%)', '30px');
+test_computed_value("grid-template-columns", 'fit-content(calc(-0.5em + 10px))', '30px');
+
+// <track-repeat> = repeat( [ <positive-integer> ] , [ <line-names>? <track-size> ]+ <line-names>? )
+test_computed_value("grid-template-columns", 'repeat(1, 10px)', '10px');
+test_computed_value("grid-template-columns", 'repeat(1, [one two] 20%)', '[one two] 60px');
+test_computed_value("grid-template-columns", 'repeat(2, minmax(10px, auto))', '160px 140px');
+
+test_computed_value("grid-template-columns", 'repeat(2, fit-content(20%) [three four] 30px 40px [five six])',
+ '30px [three four] 30px 40px [five six] 0px [three four] 30px 40px [five six]');
+
+// <track-list> = [ <line-names>? [ <track-size> | <track-repeat> ] ]+ <line-names>?
+test_computed_value("grid-template-columns", 'min-content repeat(5, minmax(10px, auto))',
+ '30px 54px 54px 54px 54px 54px');
+test_computed_value("grid-template-columns", '[] 150px [] 1fr []', '150px 150px');
+
+// <auto-repeat> = repeat( [ auto-fill | auto-fit ] , [ <line-names>? <fixed-size> ]+ <line-names>? )
+test_computed_value("grid-template-columns", 'repeat(auto-fill, 200px)', '200px');
+test_computed_value("grid-template-columns", 'repeat(auto-fit, [one] 20%)',
+ '[one] 60px [one] 0px [one] 0px [one] 0px [one] 0px');
+test_computed_value("grid-template-columns", 'repeat(auto-fill, minmax(100px, 5fr) [two])',
+ '100px [two] 100px [two] 100px [two]');
+test_computed_value("grid-template-columns", 'repeat(auto-fit, [three] minmax(max-content, 6em) [four])',
+ '[three] 240px [four]');
+
+// <auto-track-list> =
+// [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>?
+// <auto-repeat>
+// [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>?
+
+test_computed_value("grid-template-columns", '[one] repeat(2, minmax(50px, auto)) [two] 30px [three] repeat(auto-fill, 10px) 40px [four five] repeat(2, minmax(200px, auto)) [six]',
+ '[one] 50px 50px [two] 30px [three] 10px 40px [four five] 200px 200px [six]');
+</script>
+</body>
+</html>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html (251964 => 251965)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html 2019-11-02 16:54:41 UTC (rev 251964)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html 2019-11-02 18:48:15 UTC (rev 251965)
@@ -25,6 +25,9 @@
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, 2px 3px) [b] 4px", "1px [a] 2px 3px [b] 4px");
+test_computed_value("grid-template-columns", "1px [a] repeat(auto-fill, 2px 3px) [b] 4px", "1px [a] 2px 3px [b] 4px");
+test_computed_value("grid-template-columns", "1px [a] repeat(auto-fit, 2px 3px) [b] 4px", "1px [a] 0px 0px [b] 4px");
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");
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-expected.txt (251964 => 251965)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-expected.txt 2019-11-02 16:54:41 UTC (rev 251964)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-expected.txt 2019-11-02 18:48:15 UTC (rev 251965)
@@ -8,6 +8,9 @@
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, 2px 3px) [b] 4px' computes to '1px [a] 2px 3px [b] 4px'
+PASS Property grid-template-rows value '1px [a] repeat(auto-fill, 2px 3px) [b] 4px' computes to '1px [a] 2px 3px [b] 4px'
+PASS Property grid-template-rows value '1px [a] repeat(auto-fit, 2px 3px) [b] 4px' computes to '1px [a] 0px 0px [b] 4px'
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'
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid-expected.txt (251964 => 251965)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid-expected.txt 2019-11-02 16:54:41 UTC (rev 251964)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid-expected.txt 2019-11-02 18:48:15 UTC (rev 251965)
@@ -8,6 +8,9 @@
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, 2px 3px) [b] 4px' computes to '1px [a] repeat(1, 2px 3px) [b] 4px' assert_equals: expected "1px [a] repeat(1, 2px 3px) [b] 4px" but got "1px [a] 2px 3px [b] 4px"
+PASS Property grid-template-rows value '1px [a] repeat(auto-fill, 2px 3px) [b] 4px' computes to '1px [a] repeat(auto-fill, 2px 3px) [b] 4px'
+PASS Property grid-template-rows value '1px [a] repeat(auto-fit, 2px 3px) [b] 4px' computes to '1px [a] repeat(auto-fit, 2px 3px) [b] 4px'
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'
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html (251964 => 251965)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html 2019-11-02 16:54:41 UTC (rev 251964)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html 2019-11-02 18:48:15 UTC (rev 251965)
@@ -25,6 +25,9 @@
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, 2px 3px) [b] 4px");
+test_computed_value("grid-template-rows", "1px [a] repeat(auto-fill, 2px 3px) [b] 4px");
+test_computed_value("grid-template-rows", "1px [a] repeat(auto-fit, 2px 3px) [b] 4px");
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");
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-withcontent-expected.txt (0 => 251965)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-withcontent-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-withcontent-expected.txt 2019-11-02 18:48:15 UTC (rev 251965)
@@ -0,0 +1,29 @@
+
+PASS Property grid-template-rows value 'none' computes to '600px'
+PASS Property grid-template-rows value '20%' computes to '120px'
+PASS Property grid-template-rows value 'calc(-0.5em + 10px)' computes to '0px'
+PASS Property grid-template-rows value 'calc(0.5em + 10px)' computes to '30px'
+PASS Property grid-template-rows value 'calc(30% + 40px)' computes to '220px'
+PASS Property grid-template-rows value '5fr' computes to '600px'
+PASS Property grid-template-rows value 'min-content' computes to '60px'
+PASS Property grid-template-rows value 'max-content' computes to '60px'
+PASS Property grid-template-rows value 'auto' computes to '600px'
+PASS Property grid-template-rows value 'minmax(10px, auto)' computes to '600px'
+PASS Property grid-template-rows value 'minmax(20%, max-content)' computes to '120px'
+PASS Property grid-template-rows value 'minmax(min-content, calc(-0.5em + 10px))' computes to '60px'
+PASS Property grid-template-rows value 'minmax(auto, 0)' computes to '60px'
+PASS Property grid-template-rows value 'fit-content(70px)' computes to '60px'
+PASS Property grid-template-rows value 'fit-content(20%)' computes to '60px'
+PASS Property grid-template-rows value 'fit-content(calc(-0.5em + 10px))' computes to '60px'
+PASS Property grid-template-rows value 'repeat(1, 10px)' computes to '10px'
+PASS Property grid-template-rows value 'repeat(1, [one two] 20%)' computes to '[one two] 120px'
+PASS Property grid-template-rows value 'repeat(2, minmax(10px, auto))' computes to '325px 275px'
+PASS Property grid-template-rows value 'repeat(2, fit-content(20%) [three four] 30px 40px [five six])' computes to '60px [three four] 30px 40px [five six] 0px [three four] 30px 40px [five six]'
+PASS Property grid-template-rows value 'min-content repeat(5, minmax(10px, auto))' computes to '60px 108px 108px 108px 108px 108px'
+PASS Property grid-template-rows value '[] 150px [] 1fr []' computes to '150px 450px'
+PASS Property grid-template-rows value 'repeat(auto-fill, 200px)' computes to '200px 200px 200px'
+PASS Property grid-template-rows value 'repeat(auto-fit, [one] 20%)' computes to '[one] 120px [one] 0px [one] 0px [one] 0px [one] 0px'
+PASS Property grid-template-rows value 'repeat(auto-fill, minmax(100px, 5fr) [two])' computes to '100px [two] 100px [two] 100px [two] 100px [two] 100px [two] 100px [two]'
+PASS Property grid-template-rows value 'repeat(auto-fit, [three] minmax(max-content, 6em) [four])' computes to '[three] 240px [four three] 0px [four]'
+PASS Property grid-template-rows value '[one] repeat(2, minmax(50px, auto)) [two] 30px [three] repeat(auto-fill, 10px) 40px [four five] repeat(2, minmax(200px, auto)) [six]' computes to '[one] 50px 50px [two] 30px [three] 10px 10px 10px 40px [four five] 200px 200px [six]'
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-withcontent.html (0 => 251965)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-withcontent.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-withcontent.html 2019-11-02 18:48:15 UTC (rev 251965)
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Grid Layout Test: getComputedStyle().gridTemplateRows</title>
+<link rel="help" href=""
+<meta name="assert" content="grid-template-rows computed value is the keyword none or a computed track list.">
+<script src=""
+<script src=""
+<script src=""
+<style>
+ #target {
+ display: grid;
+ font-size: 40px;
+ min-width: 200px;
+ width: 300px;
+ max-width: 400px;
+ min-height: 500px;
+ height: 600px;
+ max-height: 700px;
+ }
+ #child {
+ min-width: 20px;
+ width: 30px;
+ max-width: 40px;
+ min-height: 50px;
+ height: 60px;
+ max-height: 70px;
+ }
+</style>
+</head>
+<body>
+<div id="container">
+ <div id="target">
+ <div id="child"></div>
+ </div>
+</div>
+<script>
+test_computed_value("grid-template-rows", 'none', '600px'); // "none" without #child
+
+// track-size <fixed-breadth> = <length-percentage> | <flex> | min-content | max-content | auto
+test_computed_value("grid-template-rows", '20%', '120px'); // 20% * height
+test_computed_value("grid-template-rows", 'calc(-0.5em + 10px)', '0px');
+test_computed_value("grid-template-rows", 'calc(0.5em + 10px)', '30px');
+test_computed_value("grid-template-rows", 'calc(30% + 40px)', '220px'); // 30% * height + 40px
+test_computed_value("grid-template-rows", '5fr', '600px'); // height
+test_computed_value("grid-template-rows", 'min-content', '60px');
+test_computed_value("grid-template-rows", 'max-content', '60px');
+test_computed_value("grid-template-rows", 'auto', '600px'); // height
+
+// track-size minmax( <inflexible-breadth> , <track-breadth> )
+test_computed_value("grid-template-rows", 'minmax(10px, auto)', '600px'); // height
+test_computed_value("grid-template-rows", 'minmax(20%, max-content)', '120px'); // 20% * height
+test_computed_value("grid-template-rows", 'minmax(min-content, calc(-0.5em + 10px))', '60px');
+test_computed_value("grid-template-rows", 'minmax(auto, 0)', '60px');
+
+// track-size fit-content( <length-percentage> )
+test_computed_value("grid-template-rows", 'fit-content(70px)', '60px');
+test_computed_value("grid-template-rows", 'fit-content(20%)', '60px');
+test_computed_value("grid-template-rows", 'fit-content(calc(-0.5em + 10px))', '60px');
+
+// <track-repeat> = repeat( [ <positive-integer> ] , [ <line-names>? <track-size> ]+ <line-names>? )
+test_computed_value("grid-template-rows", 'repeat(1, 10px)', '10px');
+test_computed_value("grid-template-rows", 'repeat(1, [one two] 20%)', '[one two] 120px');
+test_computed_value("grid-template-rows", 'repeat(2, minmax(10px, auto))', '325px 275px');
+
+test_computed_value("grid-template-rows", 'repeat(2, fit-content(20%) [three four] 30px 40px [five six])',
+ '60px [three four] 30px 40px [five six] 0px [three four] 30px 40px [five six]');
+
+// <track-list> = [ <line-names>? [ <track-size> | <track-repeat> ] ]+ <line-names>?
+test_computed_value("grid-template-rows", 'min-content repeat(5, minmax(10px, auto))',
+ '60px 108px 108px 108px 108px 108px');
+test_computed_value("grid-template-rows", '[] 150px [] 1fr []', '150px 450px');
+
+// <auto-repeat> = repeat( [ auto-fill | auto-fit ] , [ <line-names>? <fixed-size> ]+ <line-names>? )
+test_computed_value("grid-template-rows", 'repeat(auto-fill, 200px)', '200px 200px 200px');
+test_computed_value("grid-template-rows", 'repeat(auto-fit, [one] 20%)',
+ '[one] 120px [one] 0px [one] 0px [one] 0px [one] 0px');
+test_computed_value("grid-template-rows", 'repeat(auto-fill, minmax(100px, 5fr) [two])',
+ '100px [two] 100px [two] 100px [two] 100px [two] 100px [two] 100px [two]');
+test_computed_value("grid-template-rows", 'repeat(auto-fit, [three] minmax(max-content, 6em) [four])',
+ '[three] 240px [four three] 0px [four]');
+
+// <auto-track-list> =
+// [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>?
+// <auto-repeat>
+// [ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>?
+
+test_computed_value("grid-template-rows", '[one] repeat(2, minmax(50px, auto)) [two] 30px [three] repeat(auto-fill, 10px) 40px [four five] repeat(2, minmax(200px, auto)) [six]',
+ '[one] 50px 50px [two] 30px [three] 10px 10px 10px 40px [four five] 200px 200px [six]');
+</script>
+</body>
+</html>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html (251964 => 251965)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html 2019-11-02 16:54:41 UTC (rev 251964)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html 2019-11-02 18:48:15 UTC (rev 251965)
@@ -25,6 +25,9 @@
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, 2px 3px) [b] 4px", "1px [a] 2px 3px [b] 4px");
+test_computed_value("grid-template-rows", "1px [a] repeat(auto-fill, 2px 3px) [b] 4px", "1px [a] 2px 3px [b] 4px");
+test_computed_value("grid-template-rows", "1px [a] repeat(auto-fit, 2px 3px) [b] 4px", "1px [a] 0px 0px [b] 4px");
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");
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/w3c-import.log (251964 => 251965)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/w3c-import.log 2019-11-02 16:54:41 UTC (rev 251964)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/w3c-import.log 2019-11-02 18:48:15 UTC (rev 251965)
@@ -25,6 +25,8 @@
/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-withcontent.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-withcontent.html
/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html
Modified: trunk/Source/WebCore/ChangeLog (251964 => 251965)
--- trunk/Source/WebCore/ChangeLog 2019-11-02 16:54:41 UTC (rev 251964)
+++ trunk/Source/WebCore/ChangeLog 2019-11-02 18:48:15 UTC (rev 251965)
@@ -1,3 +1,35 @@
+2019-11-02 Oriol Brufau <obru...@igalia.com>
+
+ [css-grid] Fix line name positions after auto repeat with no line names
+ https://bugs.webkit.org/show_bug.cgi?id=203670
+
+ Reviewed by Manuel Rego Casasnovas.
+
+ When serializing grid-template-rows/columns of a grid container, we need
+ to handle auto repeat() specially in order to insert the line names at
+ the correct places.
+
+ Before this patch, this was skipped for indices before the insertion
+ point of the auto repeat, and in case the auto repeat had no line name.
+ The latter logic was wrong, if there is an auto repeat we still need the
+ special code after the insertion point, even if it has no line names.
+ The proper condition to check is whether there is no auto repeat.
+
+ The patch also avoids a 2nd call to gridAutoRepeatRows/Columns since we
+ already have the value in a variable.
+
+ Tests: 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-columns-computed-nogrid.html
+ imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-withcontent.html
+ imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-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-withcontent.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::OrderedNamedLinesCollectorInGridLayout::OrderedNamedLinesCollectorInGridLayout):
+ (WebCore::OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex const):
+ (WebCore::valueForGridTrackList):
+
2019-11-02 Devin Rousso <drou...@apple.com>
Web Inspector: Add diagnostic logging for frontend feature usage
Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (251964 => 251965)
--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2019-11-02 16:54:41 UTC (rev 251964)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2019-11-02 18:48:15 UTC (rev 251965)
@@ -773,11 +773,11 @@
class OrderedNamedLinesCollectorInGridLayout : public OrderedNamedLinesCollector {
public:
- OrderedNamedLinesCollectorInGridLayout(const RenderStyle& style, bool isRowAxis, unsigned autoRepeatTracksCount)
+ OrderedNamedLinesCollectorInGridLayout(const RenderStyle& style, bool isRowAxis, unsigned autoRepeatTracksCount, unsigned autoRepeatTrackListLength)
: OrderedNamedLinesCollector(style, isRowAxis)
, m_insertionPoint(isRowAxis ? style.gridAutoRepeatColumnsInsertionPoint() : style.gridAutoRepeatRowsInsertionPoint())
, m_autoRepeatTotalTracks(autoRepeatTracksCount)
- , m_autoRepeatTrackListLength(isRowAxis ? style.gridAutoRepeatColumns().size() : style.gridAutoRepeatRows().size())
+ , m_autoRepeatTrackListLength(autoRepeatTrackListLength)
{
}
@@ -816,7 +816,7 @@
void OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex(CSSGridLineNamesValue& lineNamesValue, unsigned i) const
{
ASSERT(!isEmpty());
- if (m_orderedNamedAutoRepeatGridLines.isEmpty() || i < m_insertionPoint) {
+ if (!m_autoRepeatTrackListLength || i < m_insertionPoint) {
appendLines(lineNamesValue, i, NamedLines);
return;
}
@@ -910,7 +910,7 @@
// specifying track sizes in pixels and expanding the repeat() notation.
if (isRenderGrid) {
auto* grid = downcast<RenderGrid>(renderer);
- OrderedNamedLinesCollectorInGridLayout collector(style, isRowAxis, grid->autoRepeatCountForDirection(direction));
+ OrderedNamedLinesCollectorInGridLayout collector(style, isRowAxis, grid->autoRepeatCountForDirection(direction), autoRepeatTrackSizes.size());
populateGridTrackList(list.get(), collector, grid->trackSizesForComputedStyle(direction), [&](const LayoutUnit& v) {
return zoomAdjustedPixelValue(v, style);
});