Changeset 284876 in webkit


Ignore:
Timestamp:
Oct 26, 2021 10:08:08 AM (9 months ago)
Author:
Ziran Sun
Message:

Fix CSS serialization affecting grid-auto-flow
https://bugs.webkit.org/show_bug.cgi?id=232240

Reviewed by Sergio Villar Senin.

LayoutTests/imported/w3c:

Update the following test and expectation files -

  • LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set-expected.txt:
  • LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set.html:
  • LayoutTests/fast/css-grid-layout/grid-shorthand-get-set-expected.txt:
  • LayoutTests/fast/css-grid-layout/grid-shorthand-get-set.html:
  • web-platform-tests/css/css-grid/grid-layout-properties-expected.txt:
  • web-platform-tests/css/css-grid/parsing/grid-auto-flow-computed-expected.txt:
  • web-platform-tests/css/css-grid/parsing/grid-auto-flow-valid-expected.txt:
  • web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/grid-auto-flow.html:

Source/WebCore:

This is to fix the serialization issue of grid-auto-flow where the word 'row' has been
included necessarily.

This Change is an import of chromium CL at
https://chromium-review.googlesource.com/c/chromium/src/+/3179598

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

  • css/parser/CSSPropertyParser.cpp:

(WebCore::consumeGridAutoFlow):

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set-expected.txt

    r209562 r284876  
    77PASS window.getComputedStyle(gridAutoFlowColumnSparse, '').getPropertyValue('grid-auto-flow') is 'column'
    88PASS window.getComputedStyle(gridAutoFlowRowSparse, '').getPropertyValue('grid-auto-flow') is 'row'
    9 PASS window.getComputedStyle(gridAutoFlowDense, '').getPropertyValue('grid-auto-flow') is 'row dense'
     9PASS window.getComputedStyle(gridAutoFlowDense, '').getPropertyValue('grid-auto-flow') is 'dense'
    1010PASS window.getComputedStyle(gridAutoFlowColumnDense, '').getPropertyValue('grid-auto-flow') is 'column dense'
    11 PASS window.getComputedStyle(gridAutoFlowRowDense, '').getPropertyValue('grid-auto-flow') is 'row dense'
     11PASS window.getComputedStyle(gridAutoFlowRowDense, '').getPropertyValue('grid-auto-flow') is 'dense'
    1212PASS window.getComputedStyle(gridAutoFlowDenseColumn, '').getPropertyValue('grid-auto-flow') is 'column dense'
    13 PASS window.getComputedStyle(gridAutoFlowDenseRow, '').getPropertyValue('grid-auto-flow') is 'row dense'
     13PASS window.getComputedStyle(gridAutoFlowDenseRow, '').getPropertyValue('grid-auto-flow') is 'dense'
    1414PASS window.getComputedStyle(gridAutoFlowInherit, '').getPropertyValue('grid-auto-flow') is 'column'
    1515PASS window.getComputedStyle(gridAutoFlowNoInherit, '').getPropertyValue('grid-auto-flow') is 'row'
     
    3333PASS window.getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is 'column dense'
    3434PASS element.style.gridAutoFlow is 'dense'
    35 PASS window.getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is 'row dense'
    36 PASS element.style.gridAutoFlow is 'row dense'
    37 PASS window.getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is 'row dense'
     35PASS window.getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is 'dense'
     36PASS element.style.gridAutoFlow is 'dense'
     37PASS window.getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is 'dense'
    3838PASS element.style.gridAutoFlow is 'column dense'
    3939PASS window.getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is 'column dense'
    40 PASS element.style.gridAutoFlow is 'row dense'
    41 PASS window.getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is 'row dense'
     40PASS element.style.gridAutoFlow is 'dense'
     41PASS window.getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is 'dense'
    4242PASS element.style.gridAutoFlow is 'row'
    4343PASS window.getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is 'row'
  • trunk/LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set.html

    r209562 r284876  
    7272    checkGridAutoFlowSetCSSValue("gridAutoFlowColumnSparse", "column");
    7373    checkGridAutoFlowSetCSSValue("gridAutoFlowRowSparse", "row");
    74     checkGridAutoFlowSetCSSValue("gridAutoFlowDense", "row dense");
     74    checkGridAutoFlowSetCSSValue("gridAutoFlowDense", "dense");
    7575    checkGridAutoFlowSetCSSValue("gridAutoFlowColumnDense", "column dense");
    76     checkGridAutoFlowSetCSSValue("gridAutoFlowRowDense", "row dense");
     76    checkGridAutoFlowSetCSSValue("gridAutoFlowRowDense", "dense");
    7777    checkGridAutoFlowSetCSSValue("gridAutoFlowDenseColumn", "column dense");
    78     checkGridAutoFlowSetCSSValue("gridAutoFlowDenseRow", "row dense");
     78    checkGridAutoFlowSetCSSValue("gridAutoFlowDenseRow", "dense");
    7979    checkGridAutoFlowSetCSSValue("gridAutoFlowInherit", "column");
    8080    checkGridAutoFlowSetCSSValue("gridAutoFlowNoInherit", "row");
     
    9797    checkGridAutoFlowSetJSValue("column", "column", "column");
    9898    checkGridAutoFlowSetJSValue("column dense", "column dense", "column dense");
    99     checkGridAutoFlowSetJSValue("dense", "dense", "row dense");
    100     checkGridAutoFlowSetJSValue("row dense", "row dense", "row dense");
     99    checkGridAutoFlowSetJSValue("dense", "dense", "dense");
     100    checkGridAutoFlowSetJSValue("row dense", "dense", "dense");
    101101    checkGridAutoFlowSetJSValue("dense column", "column dense", "column dense");
    102     checkGridAutoFlowSetJSValue("dense row", "row dense", "row dense");
     102    checkGridAutoFlowSetJSValue("dense row", "dense", "dense");
    103103    checkGridAutoFlowSetJSValue("row", "row", "row");
    104104
  • trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set-expected.txt

    r228095 r284876  
    5050PASS window.getComputedStyle(gridWithAutoFlowDenseRow, '').getPropertyValue('grid-template-rows') is "none"
    5151PASS window.getComputedStyle(gridWithAutoFlowDenseRow, '').getPropertyValue('grid-template-areas') is "none"
    52 PASS window.getComputedStyle(gridWithAutoFlowDenseRow, '').getPropertyValue('grid-auto-flow') is "row dense"
     52PASS window.getComputedStyle(gridWithAutoFlowDenseRow, '').getPropertyValue('grid-auto-flow') is "dense"
    5353PASS window.getComputedStyle(gridWithAutoFlowDenseRow, '').getPropertyValue('grid-auto-columns') is "auto"
    5454PASS window.getComputedStyle(gridWithAutoFlowDenseRow, '').getPropertyValue('grid-auto-rows') is "auto"
     
    8686PASS window.getComputedStyle(gridWithColumnsAndDenseAutoFlow, '').getPropertyValue('grid-template-rows') is "none"
    8787PASS window.getComputedStyle(gridWithColumnsAndDenseAutoFlow, '').getPropertyValue('grid-template-areas') is "none"
    88 PASS window.getComputedStyle(gridWithColumnsAndDenseAutoFlow, '').getPropertyValue('grid-auto-flow') is "row dense"
     88PASS window.getComputedStyle(gridWithColumnsAndDenseAutoFlow, '').getPropertyValue('grid-auto-flow') is "dense"
    8989PASS window.getComputedStyle(gridWithColumnsAndDenseAutoFlow, '').getPropertyValue('grid-auto-columns') is "auto"
    9090PASS window.getComputedStyle(gridWithColumnsAndDenseAutoFlow, '').getPropertyValue('grid-auto-rows') is "auto"
     
    225225PASS getComputedStyle(element, '').getPropertyValue('grid-template-areas') is "none"
    226226PASS element.style.gridTemplateAreas is "initial"
    227 PASS getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is "row dense"
     227PASS getComputedStyle(element, '').getPropertyValue('grid-auto-flow') is "dense"
    228228PASS element.style.gridAutoFlow is "row dense"
    229229PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "auto"
  • trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set.html

    r228095 r284876  
    148148    testGridDefinitionsValues(document.getElementById("gridWithAutoFlowAndAutoRows"), "none", "none", "none", "row", "auto", "10px");
    149149    testGridDefinitionsValues(document.getElementById("gridWithAutoFlowColumnDense"), "none", "none", "none", "column dense", "auto", "auto");
    150     testGridDefinitionsValues(document.getElementById("gridWithAutoFlowDenseRow"), "none", "none", "none", "row dense", "auto", "auto");
     150    testGridDefinitionsValues(document.getElementById("gridWithAutoFlowDenseRow"), "none", "none", "none", "dense", "auto", "auto");
    151151    testGridDefinitionsValues(document.getElementById("gridWithAutoFlowAndAutoRowsAndColumns"), "20px", "none", "none", "row", "auto", "10px");
    152152    testGridDefinitionsValues(document.getElementById("gridWithAutoFlowAndMultipleAutoTracks"), "100px 50px", "none", "none", "row", "auto", "20px 10px");
     
    155155    testGridDefinitionsValues(document.getElementById("gridWithRowsNoneAndAutoFlowAndAutoColumn"), "none", "none", "none", "column", "10px", "auto");
    156156    testGridDefinitionsValues(document.getElementById("gridWithRowsAndAutoFlowDenseColumn"), "none", "10px", "none", "column dense", "auto", "auto");
    157     testGridDefinitionsValues(document.getElementById("gridWithColumnsAndDenseAutoFlow"), "10px", "none", "none", "row dense", "auto", "auto");
     157    testGridDefinitionsValues(document.getElementById("gridWithColumnsAndDenseAutoFlow"), "10px", "none", "none", "dense", "auto", "auto");
    158158    testGridDefinitionsValues(document.getElementById("gridWithRowsAndAutoFlowAndAutoColumns"), "none", "20px", "none", "column", "10px", "auto");
    159159    testGridDefinitionsValues(document.getElementById("gridWithRowsAndAutoFlowAndMultipleAutoTracks"), "none", "100px 50px", "none", "column", "20px 10px", "auto");
     
    181181    testGridDefinitionsSetJSValues("20px / 10px", "10px", "20px", "none", "row", "auto", "auto", "10px", "20px", "none", "initial", "initial", "initial");
    182182    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", "row dense", "auto", "20px", "none", "initial", "initial", "row dense", "initial", "20px");
     183    testGridDefinitionsSetJSValues("auto-flow dense 20px / none", "none", "none", "none", "dense", "auto", "20px", "none", "initial", "initial", "row dense", "initial", "20px");
    184184    testGridDefinitionsSetJSValues("20px / auto-flow 10px", "none", "20px", "none", "column", "10px", "auto", "initial", "20px", "initial", "column", "10px", "initial");
    185185    testGridDefinitionsSetJSValues("none / auto-flow dense 20px", "none", "none", "none", "column dense", "20px", "auto", "initial", "none", "initial", "column dense", "20px", "initial");
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r284869 r284876  
     12021-10-26  Ziran Sun  <zsun@igalia.com>
     2
     3        Fix CSS serialization affecting grid-auto-flow
     4        https://bugs.webkit.org/show_bug.cgi?id=232240
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        Update the following test and expectation files -
     9        * LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set-expected.txt:
     10        * LayoutTests/fast/css-grid-layout/grid-auto-flow-get-set.html:
     11        * LayoutTests/fast/css-grid-layout/grid-shorthand-get-set-expected.txt:
     12        * LayoutTests/fast/css-grid-layout/grid-shorthand-get-set.html:
     13        * web-platform-tests/css/css-grid/grid-layout-properties-expected.txt:
     14        * web-platform-tests/css/css-grid/parsing/grid-auto-flow-computed-expected.txt:
     15        * web-platform-tests/css/css-grid/parsing/grid-auto-flow-valid-expected.txt:
     16        * web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/grid-auto-flow.html:
     17
    1182021-10-26  Martin Robinson  <mrobinson@webkit.org>
    219
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-layout-properties-expected.txt

    r267650 r284876  
    6363PASS grid-auto-flow.row
    6464PASS grid-auto-flow.column
    65 FAIL grid-auto-flow.dense assert_equals: dense expected "dense" but got "row dense"
    66 FAIL grid-auto-flow.row dense assert_equals: row dense expected "dense" but got "row dense"
     65PASS grid-auto-flow.dense
     66PASS grid-auto-flow.row dense
    6767PASS grid-auto-flow.column dense
    6868PASS grid-auto-flow.reset
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-auto-flow-computed-expected.txt

    r267650 r284876  
    22PASS Property grid-auto-flow value 'row'
    33PASS Property grid-auto-flow value 'column'
    4 FAIL Property grid-auto-flow value 'row dense' assert_equals: expected "dense" but got "row dense"
     4PASS Property grid-auto-flow value 'row dense'
    55PASS Property grid-auto-flow value 'column dense'
    6 FAIL Property grid-auto-flow value 'dense row' assert_equals: expected "dense" but got "row dense"
     6PASS Property grid-auto-flow value 'dense row'
    77PASS Property grid-auto-flow value 'dense column'
    8 FAIL Property grid-auto-flow value 'dense' assert_equals: expected "dense" but got "row dense"
     8PASS Property grid-auto-flow value 'dense'
    99
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-auto-flow-valid-expected.txt

    r267650 r284876  
    22PASS e.style['grid-auto-flow'] = "row" should set the property value
    33PASS e.style['grid-auto-flow'] = "column" should set the property value
    4 FAIL e.style['grid-auto-flow'] = "row dense" should set the property value assert_equals: serialization should be canonical expected "dense" but got "row dense"
    5 FAIL e.style['grid-auto-flow'] = "dense row" should set the property value assert_equals: serialization should be canonical expected "dense" but got "row dense"
     4PASS e.style['grid-auto-flow'] = "row dense" should set the property value
     5PASS e.style['grid-auto-flow'] = "dense row" should set the property value
    66PASS e.style['grid-auto-flow'] = "dense" should set the property value
    77PASS e.style['grid-auto-flow'] = "column dense" should set the property value
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/grid-auto-flow.html

    r281127 r284876  
    2020
    2121runUnsupportedPropertyTests('grid-auto-flow', [
    22   'row dense', 'column dense',
     22  'column dense',
    2323]);
    2424
  • trunk/Source/WebCore/ChangeLog

    r284871 r284876  
     12021-10-26  Ziran Sun  <zsun@igalia.com>
     2
     3        Fix CSS serialization affecting grid-auto-flow
     4        https://bugs.webkit.org/show_bug.cgi?id=232240
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        This is to fix the serialization issue of grid-auto-flow where the word 'row' has been
     9        included necessarily.
     10
     11        This Change is an import of chromium CL at
     12        https://chromium-review.googlesource.com/c/chromium/src/+/3179598
     13
     14        * css/CSSComputedStyleDeclaration.cpp:
     15        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
     16        * css/parser/CSSPropertyParser.cpp:
     17        (WebCore::consumeGridAutoFlow):
     18
    1192021-10-26  Gabriel Nava Marino  <gnavamarino@apple.com>
    220
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r284718 r284876  
    30083008            auto list = CSSValueList::createSpaceSeparated();
    30093009            ASSERT(style.isGridAutoFlowDirectionRow() || style.isGridAutoFlowDirectionColumn());
    3010             if (style.isGridAutoFlowDirectionRow())
     3010            if (style.isGridAutoFlowDirectionColumn())
     3011                list->append(cssValuePool.createIdentifierValue(CSSValueColumn));
     3012            else if (!style.isGridAutoFlowAlgorithmDense())
    30113013                list->append(cssValuePool.createIdentifierValue(CSSValueRow));
    3012             else
    3013                 list->append(cssValuePool.createIdentifierValue(CSSValueColumn));
    30143014
    30153015            if (style.isGridAutoFlowAlgorithmDense())
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r284857 r284876  
    31363136    }
    31373137    RefPtr<CSSValueList> parsedValues = CSSValueList::createSpaceSeparated();
    3138     if (rowOrColumnValue)
    3139         parsedValues->append(rowOrColumnValue.releaseNonNull());
     3138    if (rowOrColumnValue) {
     3139        CSSValueID value = rowOrColumnValue->valueID();
     3140        if (value == CSSValueID::CSSValueColumn || (value == CSSValueID::CSSValueRow && !denseAlgorithm))
     3141            parsedValues->append(rowOrColumnValue.releaseNonNull());
     3142    }
    31403143    if (denseAlgorithm)
    31413144        parsedValues->append(denseAlgorithm.releaseNonNull());
Note: See TracChangeset for help on using the changeset viewer.