Changeset 252901 in webkit


Ignore:
Timestamp:
Nov 27, 2019 4:44:20 AM (4 years ago)
Author:
Manuel Rego Casasnovas
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:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r252883 r252901  
     12019-11-27  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] Serialization of grid-area, grid-row and grid-column should include "/" separator
     4        https://bugs.webkit.org/show_bug.cgi?id=204508
     5
     6        Reviewed by Javier Fernandez.
     7
     8        After this patch several test cases are passing.
     9        There are still failures as the serialization is still not the right one in all the cases,
     10        but this makes WebKit behave like Chromium for these shorthands.
     11
     12        * web-platform-tests/css/css-grid/grid-layout-properties-expected.txt:
     13        * web-platform-tests/css/css-grid/parsing/grid-area-valid-expected.txt:
     14        * web-platform-tests/css/css-grid/parsing/grid-shorthand-valid-expected.txt:
     15        * web-platform-tests/css/css-grid/parsing/grid-template-shorthand-valid-expected.txt:
     16
    1172019-11-26  Manuel Rego Casasnovas  <rego@igalia.com>
    218
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-layout-properties-expected.txt

    r232903 r252901  
    3434FAIL 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"
    3535FAIL grid-template.none assert_equals: none expected "150px / 50px 50px 50px" but got "50px 50px 50px / 150px / none"
    36 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"
    37 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"
    38 FAIL grid-template.<string>+ assert_equals: <string>+ expected "\"a b\" \"a b\"" but got "auto auto none \"a b\" \"a b\""
    39 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\""
     36FAIL 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"
     37FAIL 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"
     38FAIL grid-template.<string>+ assert_equals: <string>+ expected "\"a b\" \"a b\"" but got "auto auto / none / \"a b\" \"a b\""
     39FAIL grid-template.<string><track-size>+ assert_equals: <string><track-size>+ expected "100px / \"a b\" 50px" but got "auto auto / none / \"a b\" \"a b\""
    4040FAIL grid-template.reset assert_equals: reset expected "150px / 50px 50px 50px" but got "50px 50px 50px / 150px / none"
    4141PASS grid-auto-columns
     
    109109PASS grid-column
    110110FAIL grid-column.initial assert_equals: initial value of grid-column should be auto expected "auto" but got "auto / auto"
    111 FAIL grid-column.auto assert_equals: auto expected "auto" but got "auto auto"
    112 FAIL grid-column.<custom-ident> assert_equals: <custom-ident> expected "a / b" but got "a b"
    113 FAIL grid-column.<integer> start assert_equals: <integer> start expected "1" but got "1 auto"
    114 FAIL grid-column.<integer> assert_equals: <integer> expected "1 / 3" but got "1 3"
    115 FAIL grid-column.<integer> <ident> assert_equals: <integer> <ident> expected "1 a / 2 b" but got "1 a 2 b"
    116 FAIL grid-column.span <integer> assert_equals: span <integer> expected "span 1 / span 2" but got "span 1 span 2"
    117 FAIL grid-column.span <custom-ident> assert_equals: span <custom-ident> expected "span a / span b" but got "span a span b"
    118 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"
    119 FAIL grid-column.reset assert_equals: reset expected "auto" but got "auto auto"
     111FAIL grid-column.auto assert_equals: auto expected "auto" but got "auto / auto"
     112PASS grid-column.<custom-ident>
     113FAIL grid-column.<integer> start assert_equals: <integer> start expected "1" but got "1 / auto"
     114PASS grid-column.<integer>
     115PASS grid-column.<integer> <ident>
     116PASS grid-column.span <integer>
     117PASS grid-column.span <custom-ident>
     118PASS grid-column.span <integer> <custom-ident>
     119FAIL grid-column.reset assert_equals: reset expected "auto" but got "auto / auto"
    120120PASS grid-row
    121121FAIL grid-row.initial assert_equals: initial value of grid-row should be auto expected "auto" but got "auto / auto"
    122 FAIL grid-row.auto assert_equals: auto expected "auto" but got "auto auto"
    123 FAIL grid-row.<custom-ident> assert_equals: <custom-ident> expected "a / b" but got "a b"
    124 FAIL grid-row.<integer> start assert_equals: <integer> start expected "1" but got "1 auto"
    125 FAIL grid-row.<integer> assert_equals: <integer> expected "1 / 3" but got "1 3"
    126 FAIL grid-row.<integer> <ident> assert_equals: <integer> <ident> expected "1 a / 2 b" but got "1 a 2 b"
    127 FAIL grid-row.span <integer> assert_equals: span <integer> expected "span 1 / span 2" but got "span 1 span 2"
    128 FAIL grid-row.span <custom-ident> assert_equals: span <custom-ident> expected "span a / span b" but got "span a span b"
    129 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"
    130 FAIL grid-row.reset assert_equals: reset expected "auto" but got "auto auto"
     122FAIL grid-row.auto assert_equals: auto expected "auto" but got "auto / auto"
     123PASS grid-row.<custom-ident>
     124FAIL grid-row.<integer> start assert_equals: <integer> start expected "1" but got "1 / auto"
     125PASS grid-row.<integer>
     126PASS grid-row.<integer> <ident>
     127PASS grid-row.span <integer>
     128PASS grid-row.span <custom-ident>
     129PASS grid-row.span <integer> <custom-ident>
     130FAIL grid-row.reset assert_equals: reset expected "auto" but got "auto / auto"
    131131PASS grid-area
    132132FAIL grid-area.initial assert_equals: initial value of grid-area should be auto expected "auto" but got "auto / auto / auto / auto"
    133 FAIL grid-area.auto assert_equals: auto expected "auto" but got "auto auto auto auto"
    134 FAIL grid-area.<custom-ident> assert_equals: <custom-ident> expected "a / b / c / d" but got "a b c d"
    135 FAIL grid-area.<integer> start assert_equals: <integer> start expected "1 / 2" but got "1 2 auto auto"
    136 FAIL grid-area.<integer> assert_equals: <integer> expected "1 / 2 / 3 / 4" but got "1 2 3 4"
    137 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"
    138 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"
    139 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"
    140 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"
    141 FAIL grid-area.reset assert_equals: reset expected "auto" but got "auto auto auto auto"
     133FAIL grid-area.auto assert_equals: auto expected "auto" but got "auto / auto / auto / auto"
     134PASS grid-area.<custom-ident>
     135FAIL grid-area.<integer> start assert_equals: <integer> start expected "1 / 2" but got "1 / 2 / auto / auto"
     136PASS grid-area.<integer>
     137PASS grid-area.<integer> <ident>
     138PASS grid-area.span <integer>
     139PASS grid-area.span <custom-ident>
     140PASS grid-area.span <integer> <custom-ident>
     141FAIL grid-area.reset assert_equals: reset expected "auto" but got "auto / auto / auto / auto"
    142142I T
    143143IT
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-area-valid-expected.txt

    r252867 r252901  
    11
    2 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"
    3 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"
    4 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"
    5 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"
    6 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"
    7 FAIL e.style['grid-row'] = "auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto auto"
    8 FAIL e.style['grid-row'] = "auto/auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto auto"
     2FAIL e.style['grid-area'] = "auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto / auto / auto / auto"
     3FAIL 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"
     4FAIL 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"
     5FAIL 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"
     6FAIL e.style['grid-area'] = "AuTo" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto / auto / auto / auto"
     7FAIL e.style['grid-row'] = "auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto / auto"
     8FAIL e.style['grid-row'] = "auto/auto" should set the property value assert_equals: serialization should be canonical expected "auto" but got "auto / auto"
    99PASS e.style['grid-column-end'] = "AuTo" should set the property value
    10 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\""
    11 FAIL e.style['grid-row'] = "-zπ" should set the property value assert_equals: serialization should be canonical expected "-zπ" but got "-zπ -zπ"
    12 FAIL e.style['grid-row'] = "-zπ/-zπ" should set the property value assert_equals: serialization should be canonical expected "-zπ" but got "-zπ -zπ"
    13 FAIL e.style['grid-row'] = "i / i" should set the property value assert_equals: serialization should be canonical expected "i" but got "i i"
     10FAIL e.style['grid-area'] = "--a" should set the property value assert_equals: serialization should be canonical expected "--a" but got "\"--a\" / \"--a\" / \"--a\" / \"--a\""
     11FAIL e.style['grid-row'] = "-zπ" should set the property value assert_equals: serialization should be canonical expected "-zπ" but got "-zπ / -zπ"
     12FAIL e.style['grid-row'] = "-zπ/-zπ" should set the property value assert_equals: serialization should be canonical expected "-zπ" but got "-zπ / -zπ"
     13FAIL e.style['grid-row'] = "i / i" should set the property value assert_equals: serialization should be canonical expected "i" but got "i / i"
    1414PASS e.style['grid-row-start'] = "AZ" should set the property value
    1515PASS e.style['grid-column-start'] = "-_π" should set the property value
    1616PASS e.style['grid-row-end'] = "_9" should set the property value
    17 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"
    18 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"
    19 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"
    20 FAIL e.style['grid-column'] = "9" should set the property value assert_equals: serialization should be canonical expected "9" but got "9 auto"
    21 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"
    22 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"
     17FAIL e.style['grid-area'] = "1" should set the property value assert_equals: serialization should be canonical expected "1" but got "1 / auto / auto / auto"
     18FAIL 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"
     19FAIL 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"
     20FAIL e.style['grid-column'] = "9" should set the property value assert_equals: serialization should be canonical expected "9" but got "9 / auto"
     21FAIL 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"
     22FAIL 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"
    2323PASS e.style['grid-row-start'] = "-19" should set the property value
    2424PASS e.style['grid-row-start'] = "9 -Z_" should set the property value
     
    2727PASS e.style['grid-row-end'] = "1 -πA" should set the property value
    2828PASS e.style['grid-column-end'] = "π_ +5" should set the property value
    29 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"
    30 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"
    31 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"
    32 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"
     29FAIL 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"
     30FAIL 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"
     31FAIL 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"
     32FAIL 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"
    3333PASS e.style['grid-row-start'] = "span i" should set the property value
    3434PASS e.style['grid-column-start'] = "SpAn i 2" should set the property value
    3535PASS e.style['grid-row-end'] = "2 i span" should set the property value
    3636PASS e.style['grid-column-end'] = "2 SpAn" should set the property value
    37 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"
    38 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"
    39 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"
    40 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"
    41 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"
    42 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"
    43 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"
    44 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"
    45 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"
    46 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"
    47 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"
    48 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"
    49 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"
    50 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"
    51 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"
    52 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"
    53 FAIL e.style['grid-row'] = "1 / auto" should set the property value assert_equals: serialization should be canonical expected "1" but got "1 auto"
    54 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"
     37FAIL 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"
     38FAIL 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"
     39PASS e.style['grid-area'] = "auto / i / auto / 2 i" should set the property value
     40FAIL 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"
     41FAIL 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"
     42FAIL 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"
     43PASS e.style['grid-area'] = "1 / j / i / k" should set the property value
     44FAIL 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"
     45PASS e.style['grid-area'] = "1 / i / 2 / auto" should set the property value
     46PASS e.style['grid-area'] = "i / i / auto / auto" should set the property value
     47FAIL 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"
     48FAIL 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"
     49PASS e.style['grid-area'] = "auto / i / 2 j / span 3 k" should set the property value
     50PASS e.style['grid-row'] = "auto / i" should set the property value
     51PASS e.style['grid-row'] = "i / auto" should set the property value
     52FAIL 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"
     53FAIL e.style['grid-row'] = "1 / auto" should set the property value assert_equals: serialization should be canonical expected "1" but got "1 / auto"
     54PASS e.style['grid-column'] = "2 j / span 3 k" should set the property value
    5555FAIL 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"]
    5656FAIL 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"]
    57 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"]
     57FAIL 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"]
    5858
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-shorthand-valid-expected.txt

    r252883 r252901  
    11
    2 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"
    3 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"
    4 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"
    5 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"
    6 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"
    7 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"
    8 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\""
    9 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\""
    10 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\""
    11 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\""
    12 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\""
     2FAIL e.style['grid'] = "auto / auto" should set the property value assert_equals: serialization should be canonical expected "auto / auto" but got "auto / auto / none"
     3FAIL 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"
     4FAIL e.style['grid'] = "none / [] 0px" should set the property value assert_equals: serialization should be canonical expected "none / 0px" but got "none / 0px / none"
     5FAIL 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"
     6FAIL 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"
     7FAIL e.style['grid'] = "[] 10px [] / [] auto []" should set the property value assert_equals: serialization should be canonical expected "10px / auto" but got "10px / auto / none"
     8FAIL 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\""
     9FAIL 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\""
     10FAIL e.style['grid'] = "\"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px / none / \"a\""
     11FAIL e.style['grid'] = "[] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px / none / \"a\""
     12FAIL 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\""
    1313
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-shorthand-valid-expected.txt

    r252883 r252901  
    11
    2 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"
    3 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"
    4 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"
    5 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"
    6 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"
    7 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"
    8 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\""
    9 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\""
    10 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\""
    11 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\""
    12 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\""
     2FAIL 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"
     3FAIL 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"
     4FAIL 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"
     5FAIL 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"
     6FAIL 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"
     7FAIL 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"
     8FAIL 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\""
     9FAIL 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\""
     10FAIL 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\""
     11FAIL 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\""
     12FAIL 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\""
    1313
  • trunk/Source/WebCore/ChangeLog

    r252897 r252901  
     12019-11-27  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] Serialization of grid-area, grid-row and grid-column should include "/" separator
     4        https://bugs.webkit.org/show_bug.cgi?id=204508
     5
     6        Reviewed by Javier Fernandez.
     7
     8        Just use "/" separator instead of a white space when serializing the grid shorthands.
     9        There are still failures because serialization of grid shorthands still needs some extra work
     10        (see webkit.org/b/204611), however this change puts WebKit in the same status than Chromium
     11        regarding this topic.
     12
     13        Several WPT test cases are passing thanks to this change.
     14
     15        * css/StyleProperties.cpp:
     16        (WebCore::StyleProperties::getPropertyValue const):
     17        (WebCore::StyleProperties::getGridShorthandValue const):
     18        (WebCore::StyleProperties::getShorthandValue const):
     19        * css/StyleProperties.h:
     20
    1212019-11-27  youenn fablet  <youenn@apple.com>
    222
  • trunk/Source/WebCore/css/StyleProperties.cpp

    r252392 r252901  
    219219        return getShorthandValue(flexFlowShorthand());
    220220    case CSSPropertyGridArea:
    221         return getShorthandValue(gridAreaShorthand());
     221        return getGridShorthandValue(gridAreaShorthand());
    222222    case CSSPropertyGridTemplate:
    223         return getShorthandValue(gridTemplateShorthand());
     223        return getGridShorthandValue(gridTemplateShorthand());
    224224    case CSSPropertyGrid:
    225         return getShorthandValue(gridShorthand());
     225        return getGridShorthandValue(gridShorthand());
    226226    case CSSPropertyGridColumn:
    227         return getShorthandValue(gridColumnShorthand());
     227        return getGridShorthandValue(gridColumnShorthand());
    228228    case CSSPropertyGridRow:
    229         return getShorthandValue(gridRowShorthand());
     229        return getGridShorthandValue(gridRowShorthand());
    230230    case CSSPropertyPageBreakAfter:
    231231        return pageBreakPropertyValue(pageBreakAfterShorthand());
     
    651651}
    652652
    653 String StyleProperties::getShorthandValue(const StylePropertyShorthand& shorthand) const
     653String StyleProperties::getGridShorthandValue(const StylePropertyShorthand& shorthand) const
     654{
     655    return getShorthandValue(shorthand, " / ");
     656}
     657
     658String StyleProperties::getShorthandValue(const StylePropertyShorthand& shorthand, const String& separator) const
    654659{
    655660    String commonValue;
     
    668673                continue;
    669674            if (!result.isEmpty())
    670                 result.append(' ');
     675                result.append(separator);
    671676            result.append(valueText);
    672677        } else
  • trunk/Source/WebCore/css/StyleProperties.h

    r251581 r252901  
    160160
    161161private:
    162     String getShorthandValue(const StylePropertyShorthand&) const;
     162    String getGridShorthandValue(const StylePropertyShorthand&) const;
     163    String getShorthandValue(const StylePropertyShorthand&, const String& separator = " ") const;
    163164    String getCommonValue(const StylePropertyShorthand&) const;
    164165    String getAlignmentShorthandValue(const StylePropertyShorthand&) const;
Note: See TracChangeset for help on using the changeset viewer.