Changeset 288544 in webkit


Ignore:
Timestamp:
Jan 25, 2022 1:57:44 AM (6 months ago)
Author:
Ziran Sun
Message:

[css-grid] Fix grid shorthand expansion of initial values
https://bugs.webkit.org/show_bug.cgi?id=234430

Reviewed by Sergio Villar Senin.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-grid/parsing/grid-shorthand-expected.txt:
  • web-platform-tests/css/css-grid/parsing/grid-shorthand-valid-expected.txt:

Source/WebCore:

This CL is to add the InitialValue support when parsing the grid shorthand for 6 grid properties
including grid-auto-columns, grid-auto-flow, grid-auto-rows, grid-template-areas,
grid-template-columns and grid-template-rows. The original code only adds a CSSInitial.

This is an import of chromium change at
https://chromium-review.googlesource.com/c/chromium/src/+/3299364

Apart from fixing wpt test imported/w3c/web-platform-tests/css/css-grid/parsing/grid-shorthand.html,
The CL also updates the expectation file for test
imported/w3c/web-platform-tests/css/css-grid/parsing/grid-shorthand-valid.html. This test fails before
this CL and need to be investigated as a seperated issue. Related bugs have been raised at -
https://bugs.chromium.org/p/chromium/issues/detail?id=1028283 &
https://bugs.webkit.org/show_bug.cgi?id=204611

  • css/parser/CSSPropertyParser.cpp:

(WebCore::consumeImplicitGridAutoFlow):
(WebCore::CSSPropertyParser::consumeGridShorthand):

  • style/StyleBuilderConverter.h:

(WebCore::Style::BuilderConverter::convertGridTrackSizeList):
(WebCore::Style::BuilderConverter::convertGridAutoFlow):

LayoutTests:

  • fast/css-grid-layout/grid-shorthand-get-set-expected.txt:
  • fast/css-grid-layout/grid-shorthand-get-set.html:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r288543 r288544  
     12022-01-25  Ziran Sun  <zsun@igalia.com>
     2
     3        [css-grid] Fix grid shorthand expansion of initial values
     4        https://bugs.webkit.org/show_bug.cgi?id=234430
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        * fast/css-grid-layout/grid-shorthand-get-set-expected.txt:
     9        * fast/css-grid-layout/grid-shorthand-get-set.html:
     10       
    1112022-01-24  Myles C. Maxfield  <mmaxfield@apple.com>
    212
  • trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set-expected.txt

    r284876 r288544  
    202202PASS element.style.gridTemplateAreas is "none"
    203203PASS getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is "row"
    204 PASS element.style.gridAutoFlow is "initial"
    205 PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "auto"
    206 PASS element.style.gridAutoColumns is "initial"
    207 PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "auto"
    208 PASS element.style.gridAutoRows is "initial"
     204PASS element.style.gridAutoFlow is "row"
     205PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "auto"
     206PASS element.style.gridAutoColumns is "auto"
     207PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "auto"
     208PASS element.style.gridAutoRows is "auto"
    209209PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "10px"
    210210PASS element.style.gridTemplateColumns is "10px"
     
    214214PASS element.style.gridTemplateAreas is "\"a\""
    215215PASS getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is "row"
    216 PASS element.style.gridAutoFlow is "initial"
    217 PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "auto"
    218 PASS element.style.gridAutoColumns is "initial"
    219 PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "auto"
    220 PASS element.style.gridAutoRows is "initial"
     216PASS element.style.gridAutoFlow is "row"
     217PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "auto"
     218PASS element.style.gridAutoColumns is "auto"
     219PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "auto"
     220PASS element.style.gridAutoRows is "auto"
    221221PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
    222222PASS element.style.gridTemplateColumns is "none"
    223223PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"
    224 PASS element.style.gridTemplateRows is "initial"
    225 PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
    226 PASS element.style.gridTemplateAreas is "initial"
     224PASS element.style.gridTemplateRows is "none"
     225PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
     226PASS element.style.gridTemplateAreas is "none"
    227227PASS getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is "dense"
    228 PASS element.style.gridAutoFlow is "row dense"
    229 PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "auto"
    230 PASS element.style.gridAutoColumns is "initial"
     228PASS element.style.gridAutoFlow is "dense"
     229PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "auto"
     230PASS element.style.gridAutoColumns is "auto"
    231231PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "20px"
    232232PASS element.style.gridAutoRows is "20px"
    233233PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
    234 PASS element.style.gridTemplateColumns is "initial"
     234PASS element.style.gridTemplateColumns is "none"
    235235PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "20px"
    236236PASS element.style.gridTemplateRows is "20px"
    237237PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
    238 PASS element.style.gridTemplateAreas is "initial"
     238PASS element.style.gridTemplateAreas is "none"
    239239PASS getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is "column"
    240240PASS element.style.gridAutoFlow is "column"
     
    242242PASS element.style.gridAutoColumns is "10px"
    243243PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "auto"
    244 PASS element.style.gridAutoRows is "initial"
    245 PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
    246 PASS element.style.gridTemplateColumns is "initial"
     244PASS element.style.gridAutoRows is "auto"
     245PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
     246PASS element.style.gridTemplateColumns is "none"
    247247PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "none"
    248248PASS element.style.gridTemplateRows is "none"
    249249PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
    250 PASS element.style.gridTemplateAreas is "initial"
     250PASS element.style.gridTemplateAreas is "none"
    251251PASS getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is "column dense"
    252252PASS element.style.gridAutoFlow is "column dense"
     
    254254PASS element.style.gridAutoColumns is "20px"
    255255PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "auto"
    256 PASS element.style.gridAutoRows is "initial"
    257 PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
    258 PASS element.style.gridTemplateColumns is "initial"
     256PASS element.style.gridAutoRows is "auto"
     257PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
     258PASS element.style.gridTemplateColumns is "none"
    259259PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "10px"
    260260PASS element.style.gridTemplateRows is "10px"
    261261PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
    262 PASS element.style.gridTemplateAreas is "initial"
     262PASS element.style.gridTemplateAreas is "none"
    263263PASS getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is "column"
    264264PASS element.style.gridAutoFlow is "column"
     
    266266PASS element.style.gridAutoColumns is "20px"
    267267PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "auto"
    268 PASS element.style.gridAutoRows is "initial"
     268PASS element.style.gridAutoRows is "auto"
    269269
    270270Test the initial value
     
    284284Test setting grid-template-columns and grid-template-rows back to 'none' through JS
    285285PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
    286 PASS element.style.gridTemplateColumns is "initial"
     286PASS element.style.gridTemplateColumns is "none"
    287287PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "10px"
    288288PASS element.style.gridTemplateRows is "10px"
    289289PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
    290 PASS element.style.gridTemplateAreas is "initial"
     290PASS element.style.gridTemplateAreas is "none"
    291291PASS getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is "column"
    292292PASS element.style.gridAutoFlow is "column"
     
    294294PASS element.style.gridAutoColumns is "20px"
    295295PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "auto"
    296 PASS element.style.gridAutoRows is "initial"
     296PASS element.style.gridAutoRows is "auto"
    297297PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
    298298PASS element.style.gridTemplateColumns is "none"
     
    302302PASS element.style.gridTemplateAreas is "none"
    303303PASS getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is "row"
    304 PASS element.style.gridAutoFlow is "initial"
    305 PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "auto"
    306 PASS element.style.gridAutoColumns is "initial"
    307 PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "auto"
    308 PASS element.style.gridAutoRows is "initial"
    309 PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
    310 PASS element.style.gridTemplateColumns is "initial"
     304PASS element.style.gridAutoFlow is "row"
     305PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "auto"
     306PASS element.style.gridAutoColumns is "auto"
     307PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "auto"
     308PASS element.style.gridAutoRows is "auto"
     309PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
     310PASS element.style.gridTemplateColumns is "none"
    311311PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "20px"
    312312PASS element.style.gridTemplateRows is "20px"
    313313PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
    314 PASS element.style.gridTemplateAreas is "initial"
     314PASS element.style.gridTemplateAreas is "none"
    315315PASS getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is "column"
    316316PASS element.style.gridAutoFlow is "column"
     
    318318PASS element.style.gridAutoColumns is "10px"
    319319PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "auto"
    320 PASS element.style.gridAutoRows is "initial"
     320PASS element.style.gridAutoRows is "auto"
    321321PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
    322322PASS element.style.gridTemplateColumns is "none"
     
    326326PASS element.style.gridTemplateAreas is "none"
    327327PASS getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is "row"
    328 PASS element.style.gridAutoFlow is "initial"
    329 PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "auto"
    330 PASS element.style.gridAutoColumns is "initial"
    331 PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "auto"
    332 PASS element.style.gridAutoRows is "initial"
     328PASS element.style.gridAutoFlow is "row"
     329PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "auto"
     330PASS element.style.gridAutoColumns is "auto"
     331PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "auto"
     332PASS element.style.gridAutoRows is "auto"
    333333
    334334Test the inherit value does not affect gutter properties (grid-*-gap)
  • trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set.html

    r284876 r288544  
    179179    debug("");
    180180    debug("Test getting and setting 'grid' shorthand through JS");
    181     testGridDefinitionsSetJSValues("20px / 10px", "10px", "20px", "none", "row", "auto", "auto", "10px", "20px", "none", "initial", "initial", "initial");
    182     testGridDefinitionsSetJSValues("[line] 'a' 20px / 10px", "10px", "[line] 20px", "\"a\"", "row", "auto", "auto", "10px", "[line] 20px", "\"a\"", "initial", "initial", "initial");
    183     testGridDefinitionsSetJSValues("auto-flow dense 20px / none", "none", "none", "none", "dense", "auto", "20px", "none", "initial", "initial", "row dense", "initial", "20px");
    184     testGridDefinitionsSetJSValues("20px / auto-flow 10px", "none", "20px", "none", "column", "10px", "auto", "initial", "20px", "initial", "column", "10px", "initial");
    185     testGridDefinitionsSetJSValues("none / auto-flow dense 20px", "none", "none", "none", "column dense", "20px", "auto", "initial", "none", "initial", "column dense", "20px", "initial");
    186     testGridDefinitionsSetJSValues("10px / auto-flow 20px", "none", "10px", "none", "column", "20px", "auto", "initial", "10px", "initial", "column", "20px", "initial");
     181    testGridDefinitionsSetJSValues("20px / 10px", "10px", "20px", "none", "row", "auto", "auto", "10px", "20px", "none", "row", "auto", "auto");
     182    testGridDefinitionsSetJSValues("[line] 'a' 20px / 10px", "10px", "[line] 20px", "\"a\"", "row", "auto", "auto", "10px", "[line] 20px", "\"a\"", "row", "auto", "auto");
     183    testGridDefinitionsSetJSValues("auto-flow dense 20px / none", "none", "none", "none", "dense", "auto", "20px", "none", "none", "none", "dense", "auto", "20px");
     184    testGridDefinitionsSetJSValues("20px / auto-flow 10px", "none", "20px", "none", "column", "10px", "auto", "none", "20px", "none", "column", "10px", "auto");
     185    testGridDefinitionsSetJSValues("none / auto-flow dense 20px", "none", "none", "none", "column dense", "20px", "auto", "none", "none", "none", "column dense", "20px", "auto");
     186    testGridDefinitionsSetJSValues("10px / auto-flow 20px", "none", "10px", "none", "column", "20px", "auto", "none", "10px", "none", "column", "20px", "auto");
    187187
    188188    debug("");
     
    200200    debug("");
    201201    debug("Test setting grid-template-columns and grid-template-rows back to 'none' through JS");
    202     testGridDefinitionsSetJSValues("10px / auto-flow 20px", "none", "10px", "none", "column", "20px", "auto", "initial", "10px", "initial", "column", "20px", "initial");
    203     testGridDefinitionsSetJSValues("none", "none", "none", "none", "row", "auto", "auto", "none", "none", "none", "initial", "initial", "initial");
    204     testGridDefinitionsSetJSValues("20px / auto-flow 10px", "none", "20px", "none", "column", "10px", "auto", "initial", "20px", "initial", "column", "10px", "initial");
    205     testGridDefinitionsSetJSValues("none", "none", "none", "none", "row", "auto", "auto", "none", "none", "none", "initial", "initial", "initial");
     202    testGridDefinitionsSetJSValues("10px / auto-flow 20px", "none", "10px", "none", "column", "20px", "auto", "none", "10px", "none", "column", "20px", "auto");
     203    testGridDefinitionsSetJSValues("none", "none", "none", "none", "row", "auto", "auto", "none", "none", "none", "row", "auto", "auto");
     204    testGridDefinitionsSetJSValues("20px / auto-flow 10px", "none", "20px", "none", "column", "10px", "auto", "none", "20px", "none", "column", "10px", "auto");
     205    testGridDefinitionsSetJSValues("none", "none", "none", "none", "row", "auto", "auto", "none", "none", "none", "row", "auto", "auto");
    206206
    207207    debug("");
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r288542 r288544  
     12022-01-25  Ziran Sun  <zsun@igalia.com>
     2
     3        [css-grid] Fix grid shorthand expansion of initial values
     4        https://bugs.webkit.org/show_bug.cgi?id=234430
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        * web-platform-tests/css/css-grid/parsing/grid-shorthand-expected.txt:
     9        * web-platform-tests/css/css-grid/parsing/grid-shorthand-valid-expected.txt:
     10
    1112022-01-24  Youenn Fablet  <youenn@apple.com>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-shorthand-expected.txt

    r267650 r288544  
    11
    2 FAIL e.style['grid'] = "none" should set grid-auto-columns assert_equals: grid-auto-columns should be canonical expected "auto" but got "initial"
    3 FAIL e.style['grid'] = "none" should set grid-auto-flow assert_equals: grid-auto-flow should be canonical expected "row" but got "initial"
    4 FAIL e.style['grid'] = "none" should set grid-auto-rows assert_equals: grid-auto-rows should be canonical expected "auto" but got "initial"
     2PASS e.style['grid'] = "none" should set grid-auto-columns
     3PASS e.style['grid'] = "none" should set grid-auto-flow
     4PASS e.style['grid'] = "none" should set grid-auto-rows
    55PASS e.style['grid'] = "none" should set grid-template-areas
    66PASS e.style['grid'] = "none" should set grid-template-columns
    77PASS e.style['grid'] = "none" should set grid-template-rows
    88PASS e.style['grid'] = "none" should not set unrelated longhands
    9 FAIL e.style['grid'] = "10px / 20%" should set grid-auto-columns assert_equals: grid-auto-columns should be canonical expected "auto" but got "initial"
    10 FAIL e.style['grid'] = "10px / 20%" should set grid-auto-flow assert_equals: grid-auto-flow should be canonical expected "row" but got "initial"
    11 FAIL e.style['grid'] = "10px / 20%" should set grid-auto-rows assert_equals: grid-auto-rows should be canonical expected "auto" but got "initial"
     9PASS e.style['grid'] = "10px / 20%" should set grid-auto-columns
     10PASS e.style['grid'] = "10px / 20%" should set grid-auto-flow
     11PASS e.style['grid'] = "10px / 20%" should set grid-auto-rows
    1212PASS e.style['grid'] = "10px / 20%" should set grid-template-areas
    1313PASS e.style['grid'] = "10px / 20%" should set grid-template-columns
    1414PASS e.style['grid'] = "10px / 20%" should set grid-template-rows
    1515PASS e.style['grid'] = "10px / 20%" should not set unrelated longhands
    16 FAIL e.style['grid'] = "fit-content(calc(-0.5em + 10px)) / fit-content(calc(0.5em + 10px))" should set grid-auto-columns assert_equals: grid-auto-columns should be canonical expected "auto" but got "initial"
    17 FAIL e.style['grid'] = "fit-content(calc(-0.5em + 10px)) / fit-content(calc(0.5em + 10px))" should set grid-auto-flow assert_equals: grid-auto-flow should be canonical expected "row" but got "initial"
    18 FAIL e.style['grid'] = "fit-content(calc(-0.5em + 10px)) / fit-content(calc(0.5em + 10px))" should set grid-auto-rows assert_equals: grid-auto-rows should be canonical expected "auto" but got "initial"
     16PASS e.style['grid'] = "fit-content(calc(-0.5em + 10px)) / fit-content(calc(0.5em + 10px))" should set grid-auto-columns
     17PASS e.style['grid'] = "fit-content(calc(-0.5em + 10px)) / fit-content(calc(0.5em + 10px))" should set grid-auto-flow
     18PASS e.style['grid'] = "fit-content(calc(-0.5em + 10px)) / fit-content(calc(0.5em + 10px))" should set grid-auto-rows
    1919PASS e.style['grid'] = "fit-content(calc(-0.5em + 10px)) / fit-content(calc(0.5em + 10px))" should set grid-template-areas
    2020PASS e.style['grid'] = "fit-content(calc(-0.5em + 10px)) / fit-content(calc(0.5em + 10px))" should set grid-template-columns
    2121PASS e.style['grid'] = "fit-content(calc(-0.5em + 10px)) / fit-content(calc(0.5em + 10px))" should set grid-template-rows
    2222PASS e.style['grid'] = "fit-content(calc(-0.5em + 10px)) / fit-content(calc(0.5em + 10px))" should not set unrelated longhands
    23 FAIL e.style['grid'] = "[header-top] \"a a a\"     [header-bottom]  [main-top] \"b b b\" 1fr [main-bottom]           / auto 1fr auto" should set grid-auto-columns assert_equals: grid-auto-columns should be canonical expected "auto" but got "initial"
    24 FAIL e.style['grid'] = "[header-top] \"a a a\"     [header-bottom]  [main-top] \"b b b\" 1fr [main-bottom]           / auto 1fr auto" should set grid-auto-flow assert_equals: grid-auto-flow should be canonical expected "row" but got "initial"
    25 FAIL e.style['grid'] = "[header-top] \"a a a\"     [header-bottom]  [main-top] \"b b b\" 1fr [main-bottom]           / auto 1fr auto" should set grid-auto-rows assert_equals: grid-auto-rows should be canonical expected "auto" but got "initial"
     23PASS e.style['grid'] = "[header-top] \"a a a\"     [header-bottom]  [main-top] \"b b b\" 1fr [main-bottom]           / auto 1fr auto" should set grid-auto-columns
     24PASS e.style['grid'] = "[header-top] \"a a a\"     [header-bottom]  [main-top] \"b b b\" 1fr [main-bottom]           / auto 1fr auto" should set grid-auto-flow
     25PASS e.style['grid'] = "[header-top] \"a a a\"     [header-bottom]  [main-top] \"b b b\" 1fr [main-bottom]           / auto 1fr auto" should set grid-auto-rows
    2626PASS e.style['grid'] = "[header-top] \"a a a\"     [header-bottom]  [main-top] \"b b b\" 1fr [main-bottom]           / auto 1fr auto" should set grid-template-areas
    2727PASS e.style['grid'] = "[header-top] \"a a a\"     [header-bottom]  [main-top] \"b b b\" 1fr [main-bottom]           / auto 1fr auto" should set grid-template-columns
    2828PASS e.style['grid'] = "[header-top] \"a a a\"     [header-bottom]  [main-top] \"b b b\" 1fr [main-bottom]           / auto 1fr auto" should set grid-template-rows
    2929PASS e.style['grid'] = "[header-top] \"a a a\"     [header-bottom]  [main-top] \"b b b\" 1fr [main-bottom]           / auto 1fr auto" should not set unrelated longhands
    30 FAIL e.style['grid'] = "  \"a a a\"  \"b b b\" 1fr/ auto 1fr auto" should set grid-auto-columns assert_equals: grid-auto-columns should be canonical expected "auto" but got "initial"
    31 FAIL e.style['grid'] = "  \"a a a\"  \"b b b\" 1fr/ auto 1fr auto" should set grid-auto-flow assert_equals: grid-auto-flow should be canonical expected "row" but got "initial"
    32 FAIL e.style['grid'] = "  \"a a a\"  \"b b b\" 1fr/ auto 1fr auto" should set grid-auto-rows assert_equals: grid-auto-rows should be canonical expected "auto" but got "initial"
     30PASS e.style['grid'] = "  \"a a a\"  \"b b b\" 1fr/ auto 1fr auto" should set grid-auto-columns
     31PASS e.style['grid'] = "  \"a a a\"  \"b b b\" 1fr/ auto 1fr auto" should set grid-auto-flow
     32PASS e.style['grid'] = "  \"a a a\"  \"b b b\" 1fr/ auto 1fr auto" should set grid-auto-rows
    3333PASS e.style['grid'] = "  \"a a a\"  \"b b b\" 1fr/ auto 1fr auto" should set grid-template-areas
    3434PASS e.style['grid'] = "  \"a a a\"  \"b b b\" 1fr/ auto 1fr auto" should set grid-template-columns
    3535PASS e.style['grid'] = "  \"a a a\"  \"b b b\" 1fr/ auto 1fr auto" should set grid-template-rows
    3636PASS e.style['grid'] = "  \"a a a\"  \"b b b\" 1fr/ auto 1fr auto" should not set unrelated longhands
    37 FAIL e.style['grid'] = " [] \"a a a\"     [] [] \"b b b\" 1fr []  / [] auto 1fr [] auto []" should set grid-auto-columns assert_equals: grid-auto-columns should be canonical expected "auto" but got "initial"
    38 FAIL e.style['grid'] = " [] \"a a a\"     [] [] \"b b b\" 1fr []  / [] auto 1fr [] auto []" should set grid-auto-flow assert_equals: grid-auto-flow should be canonical expected "row" but got "initial"
    39 FAIL e.style['grid'] = " [] \"a a a\"     [] [] \"b b b\" 1fr []  / [] auto 1fr [] auto []" should set grid-auto-rows assert_equals: grid-auto-rows should be canonical expected "auto" but got "initial"
     37PASS e.style['grid'] = " [] \"a a a\"     [] [] \"b b b\" 1fr []  / [] auto 1fr [] auto []" should set grid-auto-columns
     38PASS e.style['grid'] = " [] \"a a a\"     [] [] \"b b b\" 1fr []  / [] auto 1fr [] auto []" should set grid-auto-flow
     39PASS e.style['grid'] = " [] \"a a a\"     [] [] \"b b b\" 1fr []  / [] auto 1fr [] auto []" should set grid-auto-rows
    4040PASS e.style['grid'] = " [] \"a a a\"     [] [] \"b b b\" 1fr []  / [] auto 1fr [] auto []" should set grid-template-areas
    4141PASS e.style['grid'] = " [] \"a a a\"     [] [] \"b b b\" 1fr []  / [] auto 1fr [] auto []" should set grid-template-columns
     
    4444PASS e.style['grid'] = "10px / auto-flow dense 20px" should set grid-auto-columns
    4545PASS e.style['grid'] = "10px / auto-flow dense 20px" should set grid-auto-flow
    46 FAIL e.style['grid'] = "10px / auto-flow dense 20px" should set grid-auto-rows assert_equals: grid-auto-rows should be canonical expected "auto" but got "initial"
    47 FAIL e.style['grid'] = "10px / auto-flow dense 20px" should set grid-template-areas assert_equals: grid-template-areas should be canonical expected "none" but got "initial"
    48 FAIL e.style['grid'] = "10px / auto-flow dense 20px" should set grid-template-columns assert_equals: grid-template-columns should be canonical expected "none" but got "initial"
     46PASS e.style['grid'] = "10px / auto-flow dense 20px" should set grid-auto-rows
     47PASS e.style['grid'] = "10px / auto-flow dense 20px" should set grid-template-areas
     48PASS e.style['grid'] = "10px / auto-flow dense 20px" should set grid-template-columns
    4949PASS e.style['grid'] = "10px / auto-flow dense 20px" should set grid-template-rows
    5050PASS e.style['grid'] = "10px / auto-flow dense 20px" should not set unrelated longhands
    51 FAIL e.style['grid'] = "auto-flow dense 30px / 40px" should set grid-auto-columns assert_equals: grid-auto-columns should be canonical expected "auto" but got "initial"
    52 FAIL e.style['grid'] = "auto-flow dense 30px / 40px" should set grid-auto-flow assert_equals: grid-auto-flow should be canonical expected "dense" but got "row dense"
     51PASS e.style['grid'] = "auto-flow dense 30px / 40px" should set grid-auto-columns
     52PASS e.style['grid'] = "auto-flow dense 30px / 40px" should set grid-auto-flow
    5353PASS e.style['grid'] = "auto-flow dense 30px / 40px" should set grid-auto-rows
    54 FAIL e.style['grid'] = "auto-flow dense 30px / 40px" should set grid-template-areas assert_equals: grid-template-areas should be canonical expected "none" but got "initial"
     54PASS e.style['grid'] = "auto-flow dense 30px / 40px" should set grid-template-areas
    5555PASS e.style['grid'] = "auto-flow dense 30px / 40px" should set grid-template-columns
    56 FAIL e.style['grid'] = "auto-flow dense 30px / 40px" should set grid-template-rows assert_equals: grid-template-rows should be canonical expected "none" but got "initial"
     56PASS e.style['grid'] = "auto-flow dense 30px / 40px" should set grid-template-rows
    5757PASS e.style['grid'] = "auto-flow dense 30px / 40px" should not set unrelated longhands
    5858
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-shorthand-valid-expected.txt

    r262130 r288544  
    11
    2 FAIL e.style['grid'] = "none" should set the property value assert_equals: serialization should be canonical expected "none" but got "none / none / none"
    3 FAIL e.style['grid'] = "none / none" should set the property value assert_equals: serialization should be canonical expected "none" but got "none / none / none"
    4 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"
    5 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"
    6 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"
    7 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"
    8 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"
    9 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"
    10 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\""
    11 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\""
    12 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\""
    13 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\""
    14 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\""
    15 FAIL e.style['grid'] = "\"a\"" should set the property value assert_equals: serialization should be canonical expected "\"a\"" but got "auto / none / \"a\""
    16 FAIL e.style['grid'] = "\"a\" auto" should set the property value assert_equals: serialization should be canonical expected "\"a\"" but got "auto / none / \"a\""
    17 FAIL e.style['grid'] = "\"a\" / 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" / 10px" but got "auto / 10px / \"a\""
    18 FAIL e.style['grid'] = "\"a\" / 20%" should set the property value assert_equals: serialization should be canonical expected "\"a\" / 20%" but got "auto / 20% / \"a\""
    19 FAIL e.style['grid'] = "\"a\" / 5fr" should set the property value assert_equals: serialization should be canonical expected "\"a\" / 5fr" but got "auto / 5fr / \"a\""
    20 FAIL e.style['grid'] = "[a] \"a\"" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\"" but got "[a] auto / none / \"a\""
    21 FAIL e.style['grid'] = "[a] \"a\" [a]" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" [a]" but got "[a] auto [a] / none / \"a\""
    22 FAIL e.style['grid'] = "[] \"a\"" should set the property value assert_equals: serialization should be canonical expected "\"a\"" but got "auto / none / \"a\""
    23 FAIL e.style['grid'] = "\"a\" [] [] \"b\"" should set the property value assert_equals: serialization should be canonical expected "\"a\" \"b\"" but got "auto auto / none / \"a\" \"b\""
    24 FAIL e.style['grid'] = "\"a\" [] \"b\"" should set the property value assert_equals: serialization should be canonical expected "\"a\" \"b\"" but got "auto auto / none / \"a\" \"b\""
    25 FAIL e.style['grid'] = "\"a\" [a] [b] \"b\"" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a b] \"b\"" but got "auto [a b] auto / none / \"a\" \"b\""
    26 FAIL e.style['grid'] = "\"a\" [a] \"b\"" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a] \"b\"" but got "auto [a] auto / none / \"a\" \"b\""
    27 FAIL e.style['grid'] = "\"a\" / 0" should set the property value assert_equals: serialization should be canonical expected "\"a\" / 0px" but got "auto / 0px / \"a\""
    28 FAIL e.style['grid'] = "\"a\" 10px / 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px / 10px" but got "10px / 10px / \"a\""
    29 FAIL e.style['grid'] = "\"a\" [a] \"b\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a] \"b\" 10px" but got "auto [a] 10px / none / \"a\" \"b\""
    30 FAIL e.style['grid'] = "\"a\" [a] \"b\" 10px [a]" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a] \"b\" 10px [a]" but got "auto [a] 10px [a] / none / \"a\" \"b\""
    31 FAIL e.style['grid'] = "\"a\" [a] [a] \"b\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a a] \"b\" 10px" but got "auto [a a] 10px / none / \"a\" \"b\""
    32 FAIL e.style['grid'] = "\"a\" [a] [] \"b\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a] \"b\" 10px" but got "auto [a] 10px / none / \"a\" \"b\""
    33 FAIL e.style['grid'] = "\"a\" 10px [a] \"b\" [a]" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px [a] \"b\" [a]" but got "10px [a] auto [a] / none / \"a\" \"b\""
    34 FAIL e.style['grid'] = "\"a\" [a] \"b\" [a]" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a] \"b\" [a]" but got "auto [a] auto [a] / none / \"a\" \"b\""
    35 FAIL e.style['grid'] = "[a] \"a\" [a] \"b\" [a]" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" [a] \"b\" [a]" but got "[a] auto [a] auto [a] / none / \"a\" \"b\""
    36 FAIL e.style['grid'] = "\"a\" \"a\" [a] \"b\" [a]" should set the property value assert_equals: serialization should be canonical expected "\"a\" \"a\" [a] \"b\" [a]" but got "auto auto [a] auto [a] / none / \"a\" \"a\" \"b\""
    37 FAIL e.style['grid'] = "\"a\" [a] \"b\" [a] / 0" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a] \"b\" [a] / 0px" but got "auto [a] auto [a] / 0px / \"a\" \"b\""
    38 FAIL e.style['grid'] = "\"a\" \"a\" [a] [a] \"b\" / auto" should set the property value assert_equals: serialization should be canonical expected "\"a\" \"a\" [a a] \"b\" / auto" but got "auto auto [a a] auto / auto / \"a\" \"a\" \"b\""
     2FAIL e.style['grid'] = "none" should set the property value assert_equals: serialization should be canonical expected "none" but got "none / none / none / row / auto / auto"
     3FAIL e.style['grid'] = "none / none" should set the property value assert_equals: serialization should be canonical expected "none" but got "none / none / none / row / auto / auto"
     4FAIL e.style['grid'] = "auto / auto" should set the property value assert_equals: serialization should be canonical expected "auto / auto" but got "auto / auto / none / row / auto / auto"
     5FAIL 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 / row / auto / auto"
     6FAIL e.style['grid'] = "none / [] 0px" should set the property value assert_equals: serialization should be canonical expected "none / 0px" but got "none / 0px / none / row / auto / auto"
     7FAIL 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 / row / auto / auto"
     8FAIL 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 / row / auto / auto"
     9FAIL e.style['grid'] = "[] 10px [] / [] auto []" should set the property value assert_equals: serialization should be canonical expected "10px / auto" but got "10px / auto / none / row / auto / auto"
     10FAIL 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\" / row / auto / auto"
     11FAIL 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\" / row / auto / auto"
     12FAIL e.style['grid'] = "\"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px / none / \"a\" / row / auto / auto"
     13FAIL e.style['grid'] = "[] \"a\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px" but got "10px / none / \"a\" / row / auto / auto"
     14FAIL 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\" / row / auto / auto"
     15FAIL e.style['grid'] = "\"a\"" should set the property value assert_equals: serialization should be canonical expected "\"a\"" but got "auto / none / \"a\" / row / auto / auto"
     16FAIL e.style['grid'] = "\"a\" auto" should set the property value assert_equals: serialization should be canonical expected "\"a\"" but got "auto / none / \"a\" / row / auto / auto"
     17FAIL e.style['grid'] = "\"a\" / 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" / 10px" but got "auto / 10px / \"a\" / row / auto / auto"
     18FAIL e.style['grid'] = "\"a\" / 20%" should set the property value assert_equals: serialization should be canonical expected "\"a\" / 20%" but got "auto / 20% / \"a\" / row / auto / auto"
     19FAIL e.style['grid'] = "\"a\" / 5fr" should set the property value assert_equals: serialization should be canonical expected "\"a\" / 5fr" but got "auto / 5fr / \"a\" / row / auto / auto"
     20FAIL e.style['grid'] = "[a] \"a\"" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\"" but got "[a] auto / none / \"a\" / row / auto / auto"
     21FAIL e.style['grid'] = "[a] \"a\" [a]" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" [a]" but got "[a] auto [a] / none / \"a\" / row / auto / auto"
     22FAIL e.style['grid'] = "[] \"a\"" should set the property value assert_equals: serialization should be canonical expected "\"a\"" but got "auto / none / \"a\" / row / auto / auto"
     23FAIL e.style['grid'] = "\"a\" [] [] \"b\"" should set the property value assert_equals: serialization should be canonical expected "\"a\" \"b\"" but got "auto auto / none / \"a\" \"b\" / row / auto / auto"
     24FAIL e.style['grid'] = "\"a\" [] \"b\"" should set the property value assert_equals: serialization should be canonical expected "\"a\" \"b\"" but got "auto auto / none / \"a\" \"b\" / row / auto / auto"
     25FAIL e.style['grid'] = "\"a\" [a] [b] \"b\"" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a b] \"b\"" but got "auto [a b] auto / none / \"a\" \"b\" / row / auto / auto"
     26FAIL e.style['grid'] = "\"a\" [a] \"b\"" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a] \"b\"" but got "auto [a] auto / none / \"a\" \"b\" / row / auto / auto"
     27FAIL e.style['grid'] = "\"a\" / 0" should set the property value assert_equals: serialization should be canonical expected "\"a\" / 0px" but got "auto / 0px / \"a\" / row / auto / auto"
     28FAIL e.style['grid'] = "\"a\" 10px / 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px / 10px" but got "10px / 10px / \"a\" / row / auto / auto"
     29FAIL e.style['grid'] = "\"a\" [a] \"b\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a] \"b\" 10px" but got "auto [a] 10px / none / \"a\" \"b\" / row / auto / auto"
     30FAIL e.style['grid'] = "\"a\" [a] \"b\" 10px [a]" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a] \"b\" 10px [a]" but got "auto [a] 10px [a] / none / \"a\" \"b\" / row / auto / auto"
     31FAIL e.style['grid'] = "\"a\" [a] [a] \"b\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a a] \"b\" 10px" but got "auto [a a] 10px / none / \"a\" \"b\" / row / auto / auto"
     32FAIL e.style['grid'] = "\"a\" [a] [] \"b\" 10px" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a] \"b\" 10px" but got "auto [a] 10px / none / \"a\" \"b\" / row / auto / auto"
     33FAIL e.style['grid'] = "\"a\" 10px [a] \"b\" [a]" should set the property value assert_equals: serialization should be canonical expected "\"a\" 10px [a] \"b\" [a]" but got "10px [a] auto [a] / none / \"a\" \"b\" / row / auto / auto"
     34FAIL e.style['grid'] = "\"a\" [a] \"b\" [a]" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a] \"b\" [a]" but got "auto [a] auto [a] / none / \"a\" \"b\" / row / auto / auto"
     35FAIL e.style['grid'] = "[a] \"a\" [a] \"b\" [a]" should set the property value assert_equals: serialization should be canonical expected "[a] \"a\" [a] \"b\" [a]" but got "[a] auto [a] auto [a] / none / \"a\" \"b\" / row / auto / auto"
     36FAIL e.style['grid'] = "\"a\" \"a\" [a] \"b\" [a]" should set the property value assert_equals: serialization should be canonical expected "\"a\" \"a\" [a] \"b\" [a]" but got "auto auto [a] auto [a] / none / \"a\" \"a\" \"b\" / row / auto / auto"
     37FAIL e.style['grid'] = "\"a\" [a] \"b\" [a] / 0" should set the property value assert_equals: serialization should be canonical expected "\"a\" [a] \"b\" [a] / 0px" but got "auto [a] auto [a] / 0px / \"a\" \"b\" / row / auto / auto"
     38FAIL e.style['grid'] = "\"a\" \"a\" [a] [a] \"b\" / auto" should set the property value assert_equals: serialization should be canonical expected "\"a\" \"a\" [a a] \"b\" / auto" but got "auto auto [a a] auto / auto / \"a\" \"a\" \"b\" / row / auto / auto"
    3939
  • trunk/Source/WebCore/ChangeLog

    r288542 r288544  
     12022-01-25  Ziran Sun  <zsun@igalia.com>
     2
     3        [css-grid] Fix grid shorthand expansion of initial values
     4        https://bugs.webkit.org/show_bug.cgi?id=234430
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        This CL is to add the InitialValue support when parsing the grid shorthand for 6 grid properties
     9        including grid-auto-columns, grid-auto-flow, grid-auto-rows, grid-template-areas,
     10        grid-template-columns and grid-template-rows. The original code only adds a CSSInitial.
     11
     12        This is an import of chromium change at
     13        https://chromium-review.googlesource.com/c/chromium/src/+/3299364
     14
     15        Apart from fixing wpt test imported/w3c/web-platform-tests/css/css-grid/parsing/grid-shorthand.html,
     16        The CL also updates the expectation file for test
     17        imported/w3c/web-platform-tests/css/css-grid/parsing/grid-shorthand-valid.html. This test fails before
     18        this CL and need to be investigated as a seperated issue. Related bugs have been raised at -
     19        https://bugs.chromium.org/p/chromium/issues/detail?id=1028283 &
     20        https://bugs.webkit.org/show_bug.cgi?id=204611       
     21       
     22        * css/parser/CSSPropertyParser.cpp:
     23        (WebCore::consumeImplicitGridAutoFlow):
     24        (WebCore::CSSPropertyParser::consumeGridShorthand):
     25        * style/StyleBuilderConverter.h:
     26        (WebCore::Style::BuilderConverter::convertGridTrackSizeList):
     27        (WebCore::Style::BuilderConverter::convertGridAutoFlow):
     28
    1292022-01-24  Youenn Fablet  <youenn@apple.com>
    230
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r288433 r288544  
    59145914    if (range.atEnd())
    59155915        return nullptr;
    5916     auto list = CSSValueList::createSpaceSeparated();
    5917     list->append(WTFMove(flowDirection));
     5916    RefPtr<CSSValue> denseIdent;
    59185917    if (range.peek().id() == CSSValueAutoFlow) {
    59195918        range.consumeIncludingWhitespace();
    5920         RefPtr<CSSValue> denseIdent = consumeIdent<CSSValueDense>(range);
    5921         if (denseIdent)
    5922             list->append(denseIdent.releaseNonNull());
     5919        denseIdent = consumeIdent<CSSValueDense>(range);
    59235920    } else {
    59245921        // Dense case
    59255922        if (range.peek().id() != CSSValueDense)
    59265923            return nullptr;
    5927         range.consumeIncludingWhitespace();
    5928         if (range.atEnd() || range.peek().id() != CSSValueAutoFlow)
    5929             return nullptr;
    5930         range.consumeIncludingWhitespace();
    5931         list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueDense));
    5932     }
     5924        denseIdent = consumeIdent<CSSValueDense>(range);
     5925        if (!denseIdent || !consumeIdent<CSSValueAutoFlow>(range))
     5926            return nullptr;
     5927    }
     5928    auto list = CSSValueList::createSpaceSeparated();
     5929    if (flowDirection->valueID() == CSSValueColumn || !denseIdent)
     5930        list->append(WTFMove(flowDirection));
     5931    if (denseIdent)
     5932        list->append(denseIdent.releaseNonNull());
    59335933   
    59345934    return list;
     
    59455945        // It can only be specified the explicit or the implicit grid properties in a single grid declaration.
    59465946        // The sub-properties not specified are set to their initial value, as normal for shorthands.
    5947         addProperty(CSSPropertyGridAutoFlow, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
    5948         addProperty(CSSPropertyGridAutoColumns, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
    5949         addProperty(CSSPropertyGridAutoRows, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
     5947        addProperty(CSSPropertyGridAutoFlow, CSSPropertyGrid, CSSValuePool::singleton().createIdentifierValue(CSSValueRow), important);
     5948        addProperty(CSSPropertyGridAutoColumns, CSSPropertyGrid, CSSValuePool::singleton().createIdentifierValue(CSSValueAuto), important);
     5949        addProperty(CSSPropertyGridAutoRows, CSSPropertyGrid, CSSValuePool::singleton().createIdentifierValue(CSSValueAuto), important);
     5950
    59505951        return true;
    59515952    }
     
    59655966            return false;
    59665967        if (consumeSlashIncludingWhitespace(m_range))
    5967             autoRowsValue = CSSValuePool::singleton().createImplicitInitialValue();
     5968            autoRowsValue = CSSValuePool::singleton().createIdentifierValue(CSSValueAuto);
    59685969        else {
    59695970            autoRowsValue = consumeGridTrackList(m_range, m_context.mode, GridAuto);
     
    59785979        if (!templateColumns)
    59795980            return false;
    5980         templateRows = CSSValuePool::singleton().createImplicitInitialValue();
    5981         autoColumnsValue = CSSValuePool::singleton().createImplicitInitialValue();
     5981        templateRows = CSSValuePool::singleton().createIdentifierValue(CSSValueNone);
     5982        autoColumnsValue = CSSValuePool::singleton().createIdentifierValue(CSSValueAuto);
    59825983    } else {
    59835984        // 3- <grid-template-rows> / [ auto-flow && dense? ] <grid-auto-columns>?
     
    59915992            return false;
    59925993        if (m_range.atEnd())
    5993             autoColumnsValue = CSSValuePool::singleton().createImplicitInitialValue();
     5994            autoColumnsValue = CSSValuePool::singleton().createIdentifierValue(CSSValueAuto);
    59945995        else {
    59955996            autoColumnsValue = consumeGridTrackList(m_range, m_context.mode, GridAuto);
     
    59975998                return false;
    59985999        }
    5999         templateColumns = CSSValuePool::singleton().createImplicitInitialValue();
    6000         autoRowsValue = CSSValuePool::singleton().createImplicitInitialValue();
     6000        templateColumns = CSSValuePool::singleton().createIdentifierValue(CSSValueNone);
     6001        autoRowsValue = CSSValuePool::singleton().createIdentifierValue(CSSValueAuto);
    60016002    }
    60026003   
     
    60086009    addProperty(CSSPropertyGridTemplateColumns, CSSPropertyGrid, templateColumns.releaseNonNull(), important);
    60096010    addProperty(CSSPropertyGridTemplateRows, CSSPropertyGrid, templateRows.releaseNonNull(), important);
    6010     addProperty(CSSPropertyGridTemplateAreas, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
     6011    addProperty(CSSPropertyGridTemplateAreas, CSSPropertyGrid, CSSValuePool::singleton().createIdentifierValue(CSSValueNone), important);
    60116012    addProperty(CSSPropertyGridAutoFlow, CSSPropertyGrid, gridAutoFlow.releaseNonNull(), important);
    60126013    addProperty(CSSPropertyGridAutoColumns, CSSPropertyGrid, autoColumnsValue.releaseNonNull(), important);
  • trunk/Source/WebCore/style/StyleBuilderConverter.h

    r287909 r288544  
    11301130inline Vector<GridTrackSize> BuilderConverter::convertGridTrackSizeList(BuilderState& builderState, const CSSValue& value)
    11311131{
     1132    if (is<CSSPrimitiveValue>(value)) {
     1133        ASSERT(downcast<CSSPrimitiveValue>(value).isValueID() && downcast<CSSPrimitiveValue>(value).valueID() == CSSValueAuto);
     1134        return RenderStyle::initialGridAutoRows();
     1135    }
     1136
    11321137    ASSERT(value.isValueList());
    11331138    auto& valueList = downcast<CSSValueList>(value);
     
    11581163inline GridAutoFlow BuilderConverter::convertGridAutoFlow(BuilderState&, const CSSValue& value)
    11591164{
    1160     auto& list = downcast<CSSValueList>(value);
    1161     if (!list.length())
    1162         return RenderStyle::initialGridAutoFlow();
    1163 
    1164     auto& first = downcast<CSSPrimitiveValue>(*list.item(0));
    1165     auto* second = downcast<CSSPrimitiveValue>(list.item(1));
     1165    ASSERT(!is<CSSPrimitiveValue>(value) || downcast<CSSPrimitiveValue>(value).isValueID());
     1166
     1167    bool isValuelist = is<CSSValueList>(value);
     1168    if (isValuelist) {
     1169        auto& list = downcast<CSSValueList>(value);
     1170        if (!list.length())
     1171            return RenderStyle::initialGridAutoFlow();
     1172    }
     1173
     1174    auto& first = downcast<CSSPrimitiveValue>(isValuelist ? *(downcast<CSSValueList>(value).item(0)) : value);
     1175    auto* second = downcast<CSSPrimitiveValue>(isValuelist && downcast<CSSValueList>(value).length() == 2 ? downcast<CSSValueList>(value).item(1) : nullptr);
    11661176
    11671177    GridAutoFlow autoFlow;
Note: See TracChangeset for help on using the changeset viewer.