Changeset 221668 in webkit


Ignore:
Timestamp:
Sep 6, 2017 2:59:26 AM (7 years ago)
Author:
Manuel Rego Casasnovas
Message:

[css-grid] grid shorthand should not reset the gutter properties
https://bugs.webkit.org/show_bug.cgi?id=176375

Reviewed by Sergio Villar Senin.

LayoutTests/imported/w3c:

Import new test from WPT.

  • web-platform-tests/css/css-grid-1/grid-definition/grid-shorthand-001-expected.txt: Added.
  • web-platform-tests/css/css-grid-1/grid-definition/grid-shorthand-001.html: Added.
  • web-platform-tests/css/css-grid-1/grid-definition/w3c-import.log:

Source/WebCore:

The CSS WG has resolved that the "grid" shorthand shouldn't reset
the gutter properties anymore:
https://github.com/w3c/csswg-drafts/issues/1036

This was originally implemented in r195529, so this is somehow
a revert of that change.

Test: imported/w3c/web-platform-tests/css/css-grid-1/grid-definition/grid-shorthand-001.html

  • css/CSSProperties.json:
  • css/parser/CSSPropertyParser.cpp:

(WebCore::CSSPropertyParser::consumeGridShorthand):

LayoutTests:

Update the test to check the new behavior.

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r221667 r221668  
     12017-09-06  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] grid shorthand should not reset the gutter properties
     4        https://bugs.webkit.org/show_bug.cgi?id=176375
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        Update the test to check the new behavior.
     9
     10        * fast/css-grid-layout/grid-shorthand-get-set-expected.txt:
     11        * fast/css-grid-layout/grid-shorthand-get-set.html:
     12
    1132017-09-06  Zan Dobersek  <zdobersek@igalia.com>
    214
  • trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set-expected.txt

    r206161 r221668  
    332332PASS element.style.gridAutoRows is "initial"
    333333
    334 Test the inherit value on reset-only subproperties (grid-*-gap)
     334Test the inherit value does not affect gutter properties (grid-*-gap)
    335335PASS getComputedStyle(anotherElement, '').getPropertyValue('grid-column-gap') is "0px"
    336336PASS getComputedStyle(anotherElement, '').getPropertyValue('grid-row-gap') is "0px"
    337 PASS getComputedStyle(anotherElement, '').getPropertyValue('grid-column-gap') is "20px"
    338 PASS getComputedStyle(anotherElement, '').getPropertyValue('grid-row-gap') is "100px"
     337PASS getComputedStyle(anotherElement, '').getPropertyValue('grid-column-gap') is "0px"
     338PASS getComputedStyle(anotherElement, '').getPropertyValue('grid-row-gap') is "0px"
    339339PASS successfullyParsed is true
    340340
  • trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set.html

    r206161 r221668  
    206206
    207207    debug("");
    208     debug("Test the inherit value on reset-only subproperties (grid-*-gap)");
     208    debug("Test the inherit value does not affect gutter properties (grid-*-gap)");
    209209    document.body.style.gridRowGap = "100px";
    210210    document.body.style.gridColumnGap = "20px";
     
    214214    shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('grid-row-gap')", "0px");
    215215    anotherElement.style.grid = "inherit";
    216     shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('grid-column-gap')", "20px");
    217     shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('grid-row-gap')", "100px");
     216    shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('grid-column-gap')", "0px");
     217    shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('grid-row-gap')", "0px");
    218218</script>
    219219</body>
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r221545 r221668  
     12017-09-06  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] grid shorthand should not reset the gutter properties
     4        https://bugs.webkit.org/show_bug.cgi?id=176375
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        Import new test from WPT.
     9
     10        * web-platform-tests/css/css-grid-1/grid-definition/grid-shorthand-001-expected.txt: Added.
     11        * web-platform-tests/css/css-grid-1/grid-definition/grid-shorthand-001.html: Added.
     12        * web-platform-tests/css/css-grid-1/grid-definition/w3c-import.log:
     13
    1142017-09-02  Sam Weinig  <sam@webkit.org>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid-1/grid-definition/w3c-import.log

    r217652 r221668  
    3131/LayoutTests/imported/w3c/web-platform-tests/css/css-grid-1/grid-definition/grid-layout-repeat-notation-expected.html
    3232/LayoutTests/imported/w3c/web-platform-tests/css/css-grid-1/grid-definition/grid-layout-repeat-notation.html
     33/LayoutTests/imported/w3c/web-platform-tests/css/css-grid-1/grid-definition/grid-shorthand-001.html
    3334/LayoutTests/imported/w3c/web-platform-tests/css/css-grid-1/grid-definition/grid-support-flexible-lengths-001.html
    3435/LayoutTests/imported/w3c/web-platform-tests/css/css-grid-1/grid-definition/grid-support-grid-template-areas-001.html
  • trunk/Source/WebCore/ChangeLog

    r221667 r221668  
     12017-09-06  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] grid shorthand should not reset the gutter properties
     4        https://bugs.webkit.org/show_bug.cgi?id=176375
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        The CSS WG has resolved that the "grid" shorthand shouldn't reset
     9        the gutter properties anymore:
     10        https://github.com/w3c/csswg-drafts/issues/1036
     11
     12        This was originally implemented in r195529, so this is somehow
     13        a revert of that change.
     14
     15        Test: imported/w3c/web-platform-tests/css/css-grid-1/grid-definition/grid-shorthand-001.html
     16
     17        * css/CSSProperties.json:
     18        * css/parser/CSSPropertyParser.cpp:
     19        (WebCore::CSSPropertyParser::consumeGridShorthand):
     20
    1212017-09-06  Zan Dobersek  <zdobersek@igalia.com>
    222
  • trunk/Source/WebCore/css/CSSProperties.json

    r220725 r221668  
    47734773                    "grid-auto-flow",
    47744774                    "grid-auto-rows",
    4775                     "grid-auto-columns",
    4776                     "grid-column-gap",
    4777                     "grid-row-gap"
     4775                    "grid-auto-columns"
    47784776                ]
    47794777            },
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r220725 r221668  
    54105410bool CSSPropertyParser::consumeGridShorthand(bool important)
    54115411{
    5412     ASSERT(shorthandForProperty(CSSPropertyGrid).length() == 8);
     5412    ASSERT(shorthandForProperty(CSSPropertyGrid).length() == 6);
    54135413
    54145414    CSSParserTokenRange rangeCopy = m_range;
     
    54215421        addProperty(CSSPropertyGridAutoColumns, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
    54225422        addProperty(CSSPropertyGridAutoRows, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
    5423         addProperty(CSSPropertyGridColumnGap, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
    5424         addProperty(CSSPropertyGridRowGap, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
    54255423        return true;
    54265424    }
     
    54875485    addProperty(CSSPropertyGridAutoColumns, CSSPropertyGrid, autoColumnsValue.releaseNonNull(), important);
    54885486    addProperty(CSSPropertyGridAutoRows, CSSPropertyGrid, autoRowsValue.releaseNonNull(), important);
    5489     addProperty(CSSPropertyGridColumnGap, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
    5490     addProperty(CSSPropertyGridRowGap, CSSPropertyGrid, CSSValuePool::singleton().createImplicitInitialValue(), important);
    54915487   
    54925488    return true;
Note: See TracChangeset for help on using the changeset viewer.