- Revision
- 252901
- Author
- r...@igalia.com
- Date
- 2019-11-27 04:44:20 -0800 (Wed, 27 Nov 2019)
Log Message
[css-grid] Serialization of grid-area, grid-row and grid-column should include "/" separator
https://bugs.webkit.org/show_bug.cgi?id=204508
Reviewed by Javier Fernandez.
LayoutTests/imported/w3c:
After this patch several test cases are passing.
There are still failures as the serialization is still not the right one in all the cases,
but this makes WebKit behave like Chromium for these shorthands.
* web-platform-tests/css/css-grid/grid-layout-properties-expected.txt:
* web-platform-tests/css/css-grid/parsing/grid-area-valid-expected.txt:
* web-platform-tests/css/css-grid/parsing/grid-shorthand-valid-expected.txt:
* web-platform-tests/css/css-grid/parsing/grid-template-shorthand-valid-expected.txt:
Source/WebCore:
Just use "/" separator instead of a white space when serializing the grid shorthands.
There are still failures because serialization of grid shorthands still needs some extra work
(see webkit.org/b/204611), however this change puts WebKit in the same status than Chromium
regarding this topic.
Several WPT test cases are passing thanks to this change.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
(WebCore::StyleProperties::getGridShorthandValue const):
(WebCore::StyleProperties::getShorthandValue const):
* css/StyleProperties.h:
Modified Paths
Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (252900 => 252901)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2019-11-27 12:24:54 UTC (rev 252900)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2019-11-27 12:44:20 UTC (rev 252901)
@@ -1,3 +1,19 @@
+2019-11-27 Manuel Rego Casasnovas <r...@igalia.com>
+
+ [css-grid] Serialization of grid-area, grid-row and grid-column should include "/" separator
+ https://bugs.webkit.org/show_bug.cgi?id=204508
+
+ Reviewed by Javier Fernandez.
+
+ After this patch several test cases are passing.
+ There are still failures as the serialization is still not the right one in all the cases,
+ but this makes WebKit behave like Chromium for these shorthands.
+
+ * web-platform-tests/css/css-grid/grid-layout-properties-expected.txt:
+ * web-platform-tests/css/css-grid/parsing/grid-area-valid-expected.txt:
+ * web-platform-tests/css/css-grid/parsing/grid-shorthand-valid-expected.txt:
+ * web-platform-tests/css/css-grid/parsing/grid-template-shorthand-valid-expected.txt:
+
2019-11-26 Manuel Rego Casasnovas <r...@igalia.com>
[css-grid] Avoid serializing [] in grid-template* specified values
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-layout-properties-expected.txt (252900 => 252901)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-layout-properties-expected.txt 2019-11-27 12:24:54 UTC (rev 252900)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-layout-properties-expected.txt 2019-11-27 12:44:20 UTC (rev 252901)
@@ -33,10 +33,10 @@
PASS grid-template
FAIL grid-template.initial assert_equals: initial value of grid-template should be 150px / 50px 50px 50px expected "150px / 50px 50px 50px" but got "50px 50px 50px / 150px / none"
FAIL grid-template.none assert_equals: none expected "150px / 50px 50px 50px" but got "50px 50px 50px / 150px / none"
-FAIL grid-template.<grid-template-rows> / <grid-template-columns> assert_equals: <grid-template-rows> / <grid-template-columns> expected "100px 100px / 200px 200px" but got "100px 100px 200px 200px none"
-FAIL grid-template.<line-names> assert_equals: <line-names> expected "[a] auto [b] auto [c] / [d] auto [e] auto [f]" but got "[a] auto [b] auto [c] [d] auto [e] auto [f] none"
-FAIL grid-template.<string>+ assert_equals: <string>+ expected "\"a b\" \"a b\"" but got "auto auto none \"a b\" \"a b\""
-FAIL grid-template.<string><track-size>+ assert_equals: <string><track-size>+ expected "100px / \"a b\" 50px" but got "auto auto none \"a b\" \"a b\""
+FAIL grid-template.<grid-template-rows> / <grid-template-columns> assert_equals: <grid-template-rows> / <grid-template-columns> expected "100px 100px / 200px 200px" but got "100px 100px / 200px 200px / none"
+FAIL grid-template.<line-names> assert_equals: <line-names> expected "[a] auto [b] auto [c] / [d] auto [e] auto [f]" but got "[a] auto [b] auto [c] / [d] auto [e] auto [f] / none"
+FAIL grid-template.<string>+ assert_equals: <string>+ expected "\"a b\" \"a b\"" but got "auto auto / none / \"a b\" \"a b\""
+FAIL grid-template.<string><track-size>+ assert_equals: <string><track-size>+ expected "100px / \"a b\" 50px" but got "auto auto / none / \"a b\" \"a b\""
FAIL grid-template.reset assert_equals: reset expected "150px / 50px 50px 50px" but got "50px 50px 50px / 150px / none"
PASS grid-auto-columns
PASS grid-auto-columns.initial
@@ -108,37 +108,37 @@
PASS grid-column-end.reset
PASS grid-column
FAIL grid-column.initial assert_equals: initial value of grid-column should be auto expected "auto" but got "auto / auto"
-FAIL grid-column.auto assert_equals: auto expected "auto" but got "auto auto"
-FAIL grid-column.<custom-ident> assert_equals: <custom-ident> expected "a / b" but got "a b"
-FAIL grid-column.<integer> start assert_equals: <integer> start expected "1" but got "1 auto"
-FAIL grid-column.<integer> assert_equals: <integer> expected "1 / 3" but got "1 3"
-FAIL grid-column.<integer> <ident> assert_equals: <integer> <ident> expected "1 a / 2 b" but got "1 a 2 b"
-FAIL grid-column.span <integer> assert_equals: span <integer> expected "span 1 / span 2" but got "span 1 span 2"
-FAIL grid-column.span <custom-ident> assert_equals: span <custom-ident> expected "span a / span b" but got "span a span b"
-FAIL grid-column.span <integer> <custom-ident> assert_equals: span <integer> <custom-ident> expected "span 2 a / span 3 b" but got "span 2 a span 3 b"
-FAIL grid-column.reset assert_equals: reset expected "auto" but got "auto auto"
+FAIL grid-column.auto assert_equals: auto expected "auto" but got "auto / auto"
+PASS grid-column.<custom-ident>
+FAIL grid-column.<integer> start assert_equals: <integer> start expected "1" but got "1 / auto"
+PASS grid-column.<integer>
+PASS grid-column.<integer> <ident>
+PASS grid-column.span <integer>
+PASS grid-column.span <custom-ident>
+PASS grid-column.span <integer> <custom-ident>
+FAIL grid-column.reset assert_equals: reset expected "auto" but got "auto / auto"
PASS grid-row
FAIL grid-row.initial assert_equals: initial value of grid-row should be auto expected "auto" but got "auto / auto"
-FAIL grid-row.auto assert_equals: auto expected "auto" but got "auto auto"
-FAIL grid-row.<custom-ident> assert_equals: <custom-ident> expected "a / b" but got "a b"
-FAIL grid-row.<integer> start assert_equals: <integer> start expected "1" but got "1 auto"
-FAIL grid-row.<integer> assert_equals: <integer> expected "1 / 3" but got "1 3"
-FAIL grid-row.<integer> <ident> assert_equals: <integer> <ident> expected "1 a / 2 b" but got "1 a 2 b"
-FAIL grid-row.span <integer> assert_equals: span <integer> expected "span 1 / span 2" but got "span 1 span 2"
-FAIL grid-row.span <custom-ident> assert_equals: span <custom-ident> expected "span a / span b" but got "span a span b"
-FAIL grid-row.span <integer> <custom-ident> assert_equals: span <integer> <custom-ident> expected "span 2 a / span 3 b" but got "span 2 a span 3 b"
-FAIL grid-row.reset assert_equals: reset expected "auto" but got "auto auto"
+FAIL grid-row.auto assert_equals: auto expected "auto" but got "auto / auto"
+PASS grid-row.<custom-ident>
+FAIL grid-row.<integer> start assert_equals: <integer> start expected "1" but got "1 / auto"
+PASS grid-row.<integer>
+PASS grid-row.<integer> <ident>
+PASS grid-row.span <integer>
+PASS grid-row.span <custom-ident>
+PASS grid-row.span <integer> <custom-ident>
+FAIL grid-row.reset assert_equals: reset expected "auto" but got "auto / auto"
PASS grid-area
FAIL grid-area.initial assert_equals: initial value of grid-area should be auto expected "auto" but got "auto / auto / auto / auto"
-FAIL grid-area.auto assert_equals: auto expected "auto" but got "auto auto auto auto"
-FAIL grid-area.<custom-ident> assert_equals: <custom-ident> expected "a / b / c / d" but got "a b c d"
-FAIL grid-area.<integer> start assert_equals: <integer> start expected "1 / 2" but got "1 2 auto auto"
-FAIL grid-area.<integer> assert_equals: <integer> expected "1 / 2 / 3 / 4" but got "1 2 3 4"
-FAIL grid-area.<integer> <ident> assert_equals: <integer> <ident> expected "1 a / 2 b / 3 c / 4 d" but got "1 a 2 b 3 c 4 d"
-FAIL grid-area.span <integer> assert_equals: span <integer> expected "span 1 / span 2 / span 3 / span 4" but got "span 1 span 2 span 3 span 4"
-FAIL grid-area.span <custom-ident> assert_equals: span <custom-ident> expected "span a / span b / span c / span d" but got "span a span b span c span d"
-FAIL grid-area.span <integer> <custom-ident> assert_equals: span <integer> <custom-ident> expected "span 2 a / span 3 b / span 4 c / span 5 d" but got "span 2 a span 3 b span 4 c span 5 d"
-FAIL grid-area.reset assert_equals: reset expected "auto" but got "auto auto auto auto"
+FAIL grid-area.auto assert_equals: auto expected "auto" but got "auto / auto / auto / auto"
+PASS grid-area.<custom-ident>
+FAIL grid-area.<integer> start assert_equals: <integer> start expected "1 / 2" but got "1 / 2 / auto / auto"
+PASS grid-area.<integer>
+PASS grid-area.<integer> <ident>
+PASS grid-area.span <integer>
+PASS grid-area.span <custom-ident>
+PASS grid-area.span <integer> <custom-ident>
+FAIL grid-area.reset assert_equals: reset expected "auto" but got "auto / auto / auto / auto"
I T
IT
I
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-area-valid-expected.txt (252900 => 252901)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-area-valid-expected.txt 2019-11-27 12:24:54 UTC (rev 252900)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-area-valid-expected.txt 2019-11-27 12:44:20 UTC (rev 252901)
@@ -1,25 +1,25 @@
-FAIL e.style['grid-area'] = "auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto auto auto auto"
-FAIL e.style['grid-area'] = "auto / auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto auto auto auto"
-FAIL e.style['grid-area'] = "auto / auto / auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto auto auto auto"
-FAIL e.style['grid-area'] = "auto / auto / auto / auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto auto auto auto"
-FAIL e.style['grid-area'] = "AuTo" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto auto auto auto"
-FAIL e.style['grid-row'] = "auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto auto"
-FAIL e.style['grid-row'] = "auto/auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto auto"
+FAIL e.style['grid-area'] = "auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto / auto / auto / auto"
+FAIL e.style['grid-area'] = "auto / auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto / auto / auto / auto"
+FAIL e.style['grid-area'] = "auto / auto / auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto / auto / auto / auto"
+FAIL e.style['grid-area'] = "auto / auto / auto / auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto / auto / auto / auto"
+FAIL e.style['grid-area'] = "AuTo" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto / auto / auto / auto"
+FAIL e.style['grid-row'] = "auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto / auto"
+FAIL e.style['grid-row'] = "auto/auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto / auto"
PASS e.style['grid-column-end'] = "AuTo" should set the property value
-FAIL e.style['grid-area'] = "--a" should set the property value assert_equals: serialization should be canonical expected "--a" but got "\"--a\" \"--a\" \"--a\" \"--a\""
-FAIL e.style['grid-row'] = "-zπ" should set the property value assert_equals: serialization should be canonical expected "-zπ" but got "-zπ -zπ"
-FAIL e.style['grid-row'] = "-zπ/-zπ" should set the property value assert_equals: serialization should be canonical expected "-zπ" but got "-zπ -zπ"
-FAIL e.style['grid-row'] = "i / i" should set the property value assert_equals: serialization should be canonical expected "i" but got "i i"
+FAIL e.style['grid-area'] = "--a" should set the property value assert_equals: serialization should be canonical expected "--a" but got "\"--a\" / \"--a\" / \"--a\" / \"--a\""
+FAIL e.style['grid-row'] = "-zπ" should set the property value assert_equals: serialization should be canonical expected "-zπ" but got "-zπ / -zπ"
+FAIL e.style['grid-row'] = "-zπ/-zπ" should set the property value assert_equals: serialization should be canonical expected "-zπ" but got "-zπ / -zπ"
+FAIL e.style['grid-row'] = "i / i" should set the property value assert_equals: serialization should be canonical expected "i" but got "i / i"
PASS e.style['grid-row-start'] = "AZ" should set the property value
PASS e.style['grid-column-start'] = "-_π" should set the property value
PASS e.style['grid-row-end'] = "_9" should set the property value
-FAIL e.style['grid-area'] = "1" should set the property value assert_equals: serialization should be canonical expected "1" but got "1 auto auto auto"
-FAIL e.style['grid-area'] = "+90 -a-" should set the property value assert_equals: serialization should be canonical expected "90 -a-" but got "90 -a- auto auto auto"
-FAIL e.style['grid-row'] = "az 2" should set the property value assert_equals: serialization should be canonical expected "2 az" but got "2 az auto"
-FAIL e.style['grid-column'] = "9" should set the property value assert_equals: serialization should be canonical expected "9" but got "9 auto"
-FAIL e.style['grid-column'] = "-19 zA" should set the property value assert_equals: serialization should be canonical expected "-19 zA" but got "-19 zA auto"
-FAIL e.style['grid-column'] = "-A0 33" should set the property value assert_equals: serialization should be canonical expected "33 -A0" but got "33 -A0 auto"
+FAIL e.style['grid-area'] = "1" should set the property value assert_equals: serialization should be canonical expected "1" but got "1 / auto / auto / auto"
+FAIL e.style['grid-area'] = "+90 -a-" should set the property value assert_equals: serialization should be canonical expected "90 -a-" but got "90 -a- / auto / auto / auto"
+FAIL e.style['grid-row'] = "az 2" should set the property value assert_equals: serialization should be canonical expected "2 az" but got "2 az / auto"
+FAIL e.style['grid-column'] = "9" should set the property value assert_equals: serialization should be canonical expected "9" but got "9 / auto"
+FAIL e.style['grid-column'] = "-19 zA" should set the property value assert_equals: serialization should be canonical expected "-19 zA" but got "-19 zA / auto"
+FAIL e.style['grid-column'] = "-A0 33" should set the property value assert_equals: serialization should be canonical expected "33 -A0" but got "33 -A0 / auto"
PASS e.style['grid-row-start'] = "-19" should set the property value
PASS e.style['grid-row-start'] = "9 -Z_" should set the property value
PASS e.style['grid-column-start'] = "+90" should set the property value
@@ -26,33 +26,33 @@
PASS e.style['grid-column-start'] = "Z -44" should set the property value
PASS e.style['grid-row-end'] = "1 -πA" should set the property value
PASS e.style['grid-column-end'] = "π_ +5" should set the property value
-FAIL e.style['grid-area'] = "span 2 i" should set the property value assert_equals: serialization should be canonical expected "span 2 i" but got "span 2 i auto auto auto"
-FAIL e.style['grid-area'] = "i 2 SpAn" should set the property value assert_equals: serialization should be canonical expected "span 2 i" but got "span 2 i auto auto auto"
-FAIL e.style['grid-row'] = "span 2" should set the property value assert_equals: serialization should be canonical expected "span 2" but got "span 2 auto"
-FAIL e.style['grid-column'] = "i SpAn" should set the property value assert_equals: serialization should be canonical expected "span i" but got "span i auto"
+FAIL e.style['grid-area'] = "span 2 i" should set the property value assert_equals: serialization should be canonical expected "span 2 i" but got "span 2 i / auto / auto / auto"
+FAIL e.style['grid-area'] = "i 2 SpAn" should set the property value assert_equals: serialization should be canonical expected "span 2 i" but got "span 2 i / auto / auto / auto"
+FAIL e.style['grid-row'] = "span 2" should set the property value assert_equals: serialization should be canonical expected "span 2" but got "span 2 / auto"
+FAIL e.style['grid-column'] = "i SpAn" should set the property value assert_equals: serialization should be canonical expected "span i" but got "span i / auto"
PASS e.style['grid-row-start'] = "span i" should set the property value
PASS e.style['grid-column-start'] = "SpAn i 2" should set the property value
PASS e.style['grid-row-end'] = "2 i span" should set the property value
PASS e.style['grid-column-end'] = "2 SpAn" should set the property value
-FAIL e.style['grid-area'] = "auto / i" should set the property value assert_equals: serialization should be canonical expected "auto / i" but got "auto i auto i"
-FAIL e.style['grid-area'] = "auto / i / auto / i" should set the property value assert_equals: serialization should be canonical expected "auto / i" but got "auto i auto i"
-FAIL e.style['grid-area'] = "auto / i / auto / 2 i" should set the property value assert_equals: serialization should be canonical expected "auto / i / auto / 2 i" but got "auto i auto 2 i"
-FAIL e.style['grid-area'] = "1 / i / auto / i" should set the property value assert_equals: serialization should be canonical expected "1 / i" but got "1 i auto i"
-FAIL e.style['grid-area'] = "1 / auto / auto / auto" should set the property value assert_equals: serialization should be canonical expected "1" but got "1 auto auto auto"
-FAIL e.style['grid-area'] = "1 / auto / i / auto" should set the property value assert_equals: serialization should be canonical expected "1 / auto / i" but got "1 auto i auto"
-FAIL e.style['grid-area'] = "1 / j / i / k" should set the property value assert_equals: serialization should be canonical expected "1 / j / i / k" but got "1 j i k"
-FAIL e.style['grid-area'] = "1 / auto / 2 / auto" should set the property value assert_equals: serialization should be canonical expected "1 / auto / 2" but got "1 auto 2 auto"
-FAIL e.style['grid-area'] = "1 / i / 2 / auto" should set the property value assert_equals: serialization should be canonical expected "1 / i / 2 / auto" but got "1 i 2 auto"
-FAIL e.style['grid-area'] = "i / i / auto / auto" should set the property value assert_equals: serialization should be canonical expected "i / i / auto / auto" but got "i i auto auto"
-FAIL e.style['grid-area'] = "i / auto / i / auto" should set the property value assert_equals: serialization should be canonical expected "i / auto" but got "i auto i auto"
-FAIL e.style['grid-area'] = "auto / i / 2 j" should set the property value assert_equals: serialization should be canonical expected "auto / i / 2 j" but got "auto i 2 j i"
-FAIL e.style['grid-area'] = "auto / i / 2 j / span 3 k" should set the property value assert_equals: serialization should be canonical expected "auto / i / 2 j / span 3 k" but got "auto i 2 j span 3 k"
-FAIL e.style['grid-row'] = "auto / i" should set the property value assert_equals: serialization should be canonical expected "auto / i" but got "auto i"
-FAIL e.style['grid-row'] = "i / auto" should set the property value assert_equals: serialization should be canonical expected "i / auto" but got "i auto"
-FAIL e.style['grid-row'] = "2 i / auto" should set the property value assert_equals: serialization should be canonical expected "2 i" but got "2 i auto"
-FAIL e.style['grid-row'] = "1 / auto" should set the property value assert_equals: serialization should be canonical expected "1" but got "1 auto"
-FAIL e.style['grid-column'] = "2 j / span 3 k" should set the property value assert_equals: serialization should be canonical expected "2 j / span 3 k" but got "2 j span 3 k"
+FAIL e.style['grid-area'] = "auto / i" should set the property value assert_equals: serialization should be canonical expected "auto / i" but got "auto / i / auto / i"
+FAIL e.style['grid-area'] = "auto / i / auto / i" should set the property value assert_equals: serialization should be canonical expected "auto / i" but got "auto / i / auto / i"
+PASS e.style['grid-area'] = "auto / i / auto / 2 i" should set the property value
+FAIL e.style['grid-area'] = "1 / i / auto / i" should set the property value assert_equals: serialization should be canonical expected "1 / i" but got "1 / i / auto / i"
+FAIL e.style['grid-area'] = "1 / auto / auto / auto" should set the property value assert_equals: serialization should be canonical expected "1" but got "1 / auto / auto / auto"
+FAIL e.style['grid-area'] = "1 / auto / i / auto" should set the property value assert_equals: serialization should be canonical expected "1 / auto / i" but got "1 / auto / i / auto"
+PASS e.style['grid-area'] = "1 / j / i / k" should set the property value
+FAIL e.style['grid-area'] = "1 / auto / 2 / auto" should set the property value assert_equals: serialization should be canonical expected "1 / auto / 2" but got "1 / auto / 2 / auto"
+PASS e.style['grid-area'] = "1 / i / 2 / auto" should set the property value
+PASS e.style['grid-area'] = "i / i / auto / auto" should set the property value
+FAIL e.style['grid-area'] = "i / auto / i / auto" should set the property value assert_equals: serialization should be canonical expected "i / auto" but got "i / auto / i / auto"
+FAIL e.style['grid-area'] = "auto / i / 2 j" should set the property value assert_equals: serialization should be canonical expected "auto / i / 2 j" but got "auto / i / 2 j / i"
+PASS e.style['grid-area'] = "auto / i / 2 j / span 3 k" should set the property value
+PASS e.style['grid-row'] = "auto / i" should set the property value
+PASS e.style['grid-row'] = "i / auto" should set the property value
+FAIL e.style['grid-row'] = "2 i / auto" should set the property value assert_equals: serialization should be canonical expected "2 i" but got "2 i / auto"
+FAIL e.style['grid-row'] = "1 / auto" should set the property value assert_equals: serialization should be canonical expected "1" but got "1 / auto"
+PASS e.style['grid-column'] = "2 j / span 3 k" should set the property value
FAIL e.style['grid-column-end'] = "\\31st" should set the property value assert_in_array: serialization should be sound value "\"1st\"" not in array ["\\31 st", "\\31st"]
FAIL e.style['grid-column-end'] = "\\31 st" should set the property value assert_in_array: serialization should be sound value "\"1st\"" not in array ["\\31 st", "\\31st"]
-FAIL e.style['grid-column'] = "\\31st / \\31 st" should set the property value assert_in_array: serialization should be sound value "\"1st\" \"1st\"" not in array ["\\31 st", "\\31st"]
+FAIL e.style['grid-column'] = "\\31st / \\31 st" should set the property value assert_in_array: serialization should be sound value "\"1st\" / \"1st\"" not in array ["\\31 st", "\\31st"]
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-shorthand-valid-expected.txt (252900 => 252901)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-shorthand-valid-expected.txt 2019-11-27 12:24:54 UTC (rev 252900)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-shorthand-valid-expected.txt 2019-11-27 12:44:20 UTC (rev 252901)
@@ -1,13 +1,13 @@
-FAIL e.style['grid'] = "auto / auto" should set the property value assert_equals: serialization should be canonical expected "auto / auto" but got "auto auto none"
-FAIL e.style['grid'] = "none / [a] 0px" should set the property value assert_equals: serialization should be canonical expected "none / [a] 0px" but got "none [a] 0px none"
-FAIL e.style['grid'] = "none / [] 0px" should set the property value assert_equals: serialization should be canonical expected "none / 0px" but got "none 0px none"
-FAIL e.style['grid'] = "[a] 10px / auto" should set the property value assert_equals: serialization should be canonical expected "[a] 10px / auto" but got "[a] 10px auto none"
-FAIL e.style['grid'] = "[a] 10px / none" should set the property value assert_equals: serialization should be canonical expected "[a] 10px / none" but got "[a] 10px none none"
-FAIL e.style['grid'] = "[] 10px [] / [] auto []" should set the property value assert_equals: serialization should be canonical expected "10px / auto" but got "10px auto none"
-FAIL e.style['grid'] = "[a] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px" but got "[a] 10px none \"a\""
-FAIL e.style['grid'] = "[a] \"a\" 10px []" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px" but got "[a] 10px none \"a\""
-FAIL e.style['grid'] = "\"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px none \"a\""
-FAIL e.style['grid'] = "[] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px none \"a\""
-FAIL e.style['grid'] = "[a] \"a\" 10px [a]" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px [a]" but got "[a] 10px [a] none \"a\""
+FAIL e.style['grid'] = "auto / auto" should set the property value assert_equals: serialization should be canonical expected "auto / auto" but got "auto / auto / none"
+FAIL e.style['grid'] = "none / [a] 0px" should set the property value assert_equals: serialization should be canonical expected "none / [a] 0px" but got "none / [a] 0px / none"
+FAIL e.style['grid'] = "none / [] 0px" should set the property value assert_equals: serialization should be canonical expected "none / 0px" but got "none / 0px / none"
+FAIL e.style['grid'] = "[a] 10px / auto" should set the property value assert_equals: serialization should be canonical expected "[a] 10px / auto" but got "[a] 10px / auto / none"
+FAIL e.style['grid'] = "[a] 10px / none" should set the property value assert_equals: serialization should be canonical expected "[a] 10px / none" but got "[a] 10px / none / none"
+FAIL e.style['grid'] = "[] 10px [] / [] auto []" should set the property value assert_equals: serialization should be canonical expected "10px / auto" but got "10px / auto / none"
+FAIL e.style['grid'] = "[a] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px" but got "[a] 10px / none / \"a\""
+FAIL e.style['grid'] = "[a] \"a\" 10px []" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px" but got "[a] 10px / none / \"a\""
+FAIL e.style['grid'] = "\"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px / none / \"a\""
+FAIL e.style['grid'] = "[] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px / none / \"a\""
+FAIL e.style['grid'] = "[a] \"a\" 10px [a]" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px [a]" but got "[a] 10px [a] / none / \"a\""
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-shorthand-valid-expected.txt (252900 => 252901)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-shorthand-valid-expected.txt 2019-11-27 12:24:54 UTC (rev 252900)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-shorthand-valid-expected.txt 2019-11-27 12:44:20 UTC (rev 252901)
@@ -1,13 +1,13 @@
-FAIL e.style['grid-template'] = "auto / auto" should set the property value assert_equals: serialization should be canonical expected "auto / auto" but got "auto auto none"
-FAIL e.style['grid-template'] = "none / [a] 0px" should set the property value assert_equals: serialization should be canonical expected "none / [a] 0px" but got "none [a] 0px none"
-FAIL e.style['grid-template'] = "none / [] 0px" should set the property value assert_equals: serialization should be canonical expected "none / 0px" but got "none 0px none"
-FAIL e.style['grid-template'] = "[a] 10px / auto" should set the property value assert_equals: serialization should be canonical expected "[a] 10px / auto" but got "[a] 10px auto none"
-FAIL e.style['grid-template'] = "[a] 10px / none" should set the property value assert_equals: serialization should be canonical expected "[a] 10px / none" but got "[a] 10px none none"
-FAIL e.style['grid-template'] = "[] 10px [] / [] auto []" should set the property value assert_equals: serialization should be canonical expected "10px / auto" but got "10px auto none"
-FAIL e.style['grid-template'] = "[a] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px" but got "[a] 10px none \"a\""
-FAIL e.style['grid-template'] = "[a] \"a\" 10px []" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px" but got "[a] 10px none \"a\""
-FAIL e.style['grid-template'] = "\"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px none \"a\""
-FAIL e.style['grid-template'] = "[] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px none \"a\""
-FAIL e.style['grid-template'] = "[a] \"a\" 10px [a]" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px [a]" but got "[a] 10px [a] none \"a\""
+FAIL e.style['grid-template'] = "auto / auto" should set the property value assert_equals: serialization should be canonical expected "auto / auto" but got "auto / auto / none"
+FAIL e.style['grid-template'] = "none / [a] 0px" should set the property value assert_equals: serialization should be canonical expected "none / [a] 0px" but got "none / [a] 0px / none"
+FAIL e.style['grid-template'] = "none / [] 0px" should set the property value assert_equals: serialization should be canonical expected "none / 0px" but got "none / 0px / none"
+FAIL e.style['grid-template'] = "[a] 10px / auto" should set the property value assert_equals: serialization should be canonical expected "[a] 10px / auto" but got "[a] 10px / auto / none"
+FAIL e.style['grid-template'] = "[a] 10px / none" should set the property value assert_equals: serialization should be canonical expected "[a] 10px / none" but got "[a] 10px / none / none"
+FAIL e.style['grid-template'] = "[] 10px [] / [] auto []" should set the property value assert_equals: serialization should be canonical expected "10px / auto" but got "10px / auto / none"
+FAIL e.style['grid-template'] = "[a] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px" but got "[a] 10px / none / \"a\""
+FAIL e.style['grid-template'] = "[a] \"a\" 10px []" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px" but got "[a] 10px / none / \"a\""
+FAIL e.style['grid-template'] = "\"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px / none / \"a\""
+FAIL e.style['grid-template'] = "[] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px / none / \"a\""
+FAIL e.style['grid-template'] = "[a] \"a\" 10px [a]" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" 10px [a]" but got "[a] 10px [a] / none / \"a\""
Modified: trunk/Source/WebCore/ChangeLog (252900 => 252901)
--- trunk/Source/WebCore/ChangeLog 2019-11-27 12:24:54 UTC (rev 252900)
+++ trunk/Source/WebCore/ChangeLog 2019-11-27 12:44:20 UTC (rev 252901)
@@ -1,3 +1,23 @@
+2019-11-27 Manuel Rego Casasnovas <r...@igalia.com>
+
+ [css-grid] Serialization of grid-area, grid-row and grid-column should include "/" separator
+ https://bugs.webkit.org/show_bug.cgi?id=204508
+
+ Reviewed by Javier Fernandez.
+
+ Just use "/" separator instead of a white space when serializing the grid shorthands.
+ There are still failures because serialization of grid shorthands still needs some extra work
+ (see webkit.org/b/204611), however this change puts WebKit in the same status than Chromium
+ regarding this topic.
+
+ Several WPT test cases are passing thanks to this change.
+
+ * css/StyleProperties.cpp:
+ (WebCore::StyleProperties::getPropertyValue const):
+ (WebCore::StyleProperties::getGridShorthandValue const):
+ (WebCore::StyleProperties::getShorthandValue const):
+ * css/StyleProperties.h:
+
2019-11-27 youenn fablet <you...@apple.com>
Protect ServiceWorkerThreadProxy while being stopped
Modified: trunk/Source/WebCore/css/StyleProperties.cpp (252900 => 252901)
--- trunk/Source/WebCore/css/StyleProperties.cpp 2019-11-27 12:24:54 UTC (rev 252900)
+++ trunk/Source/WebCore/css/StyleProperties.cpp 2019-11-27 12:44:20 UTC (rev 252901)
@@ -218,15 +218,15 @@
case CSSPropertyFlexFlow:
return getShorthandValue(flexFlowShorthand());
case CSSPropertyGridArea:
- return getShorthandValue(gridAreaShorthand());
+ return getGridShorthandValue(gridAreaShorthand());
case CSSPropertyGridTemplate:
- return getShorthandValue(gridTemplateShorthand());
+ return getGridShorthandValue(gridTemplateShorthand());
case CSSPropertyGrid:
- return getShorthandValue(gridShorthand());
+ return getGridShorthandValue(gridShorthand());
case CSSPropertyGridColumn:
- return getShorthandValue(gridColumnShorthand());
+ return getGridShorthandValue(gridColumnShorthand());
case CSSPropertyGridRow:
- return getShorthandValue(gridRowShorthand());
+ return getGridShorthandValue(gridRowShorthand());
case CSSPropertyPageBreakAfter:
return pageBreakPropertyValue(pageBreakAfterShorthand());
case CSSPropertyPageBreakBefore:
@@ -650,8 +650,13 @@
return result.toString();
}
-String StyleProperties::getShorthandValue(const StylePropertyShorthand& shorthand) const
+String StyleProperties::getGridShorthandValue(const StylePropertyShorthand& shorthand) const
{
+ return getShorthandValue(shorthand, " / ");
+}
+
+String StyleProperties::getShorthandValue(const StylePropertyShorthand& shorthand, const String& separator) const
+{
String commonValue;
StringBuilder result;
for (unsigned i = 0; i < shorthand.length(); ++i) {
@@ -667,7 +672,7 @@
if (value->isInitialValue())
continue;
if (!result.isEmpty())
- result.append(' ');
+ result.append(separator);
result.append(valueText);
} else
commonValue = String();
Modified: trunk/Source/WebCore/css/StyleProperties.h (252900 => 252901)
--- trunk/Source/WebCore/css/StyleProperties.h 2019-11-27 12:24:54 UTC (rev 252900)
+++ trunk/Source/WebCore/css/StyleProperties.h 2019-11-27 12:44:20 UTC (rev 252901)
@@ -159,7 +159,8 @@
int findCustomPropertyIndex(const String& propertyName) const;
private:
- String getShorthandValue(const StylePropertyShorthand&) const;
+ String getGridShorthandValue(const StylePropertyShorthand&) const;
+ String getShorthandValue(const StylePropertyShorthand&, const String& separator = " ") const;
String getCommonValue(const StylePropertyShorthand&) const;
String getAlignmentShorthandValue(const StylePropertyShorthand&) const;
String borderPropertyValue(const StylePropertyShorthand&, const StylePropertyShorthand&, const StylePropertyShorthand&) const;