[webkit-changes] [WebKit/WebKit] ad8e8d: [css-grid] Use ShorthandSerializer for grid-column...

Sammy Gill noreply at github.com
Tue Sep 19 17:52:37 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ad8e8db1b46be5e928eccbae1370fa3c09170f4a
      https://github.com/WebKit/WebKit/commit/ad8e8db1b46be5e928eccbae1370fa3c09170f4a
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2023-09-19 (Tue, 19 Sep 2023)

  Changed paths:
    M LayoutTests/fast/css-grid-layout/grid-item-column-row-get-set-expected.txt
    M LayoutTests/fast/css-grid-layout/grid-item-column-row-get-set.html
    M LayoutTests/fast/css-grid-layout/grid-item-end-after-get-set-expected.txt
    M LayoutTests/fast/css-grid-layout/grid-item-end-after-get-set.html
    M LayoutTests/fast/css-grid-layout/grid-item-start-before-get-set-expected.txt
    M LayoutTests/fast/css-grid-layout/grid-item-start-before-get-set.html
    M LayoutTests/fast/css-grid-layout/named-grid-lines-with-named-grid-areas-get-set-expected.txt
    M LayoutTests/fast/css-grid-layout/named-grid-lines-with-named-grid-areas-get-set.html
    M LayoutTests/fast/css-grid-layout/resources/grid-item-column-row-parsing-utils.js
    M LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-layout-properties-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-column-invalid-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-column-invalid.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-column-shortest-serialization-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-column-shortest-serialization.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-column-shorthand-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-column-shorthand.html
    M Source/WebCore/css/CSSComputedStyleDeclaration.cpp

  Log Message:
  -----------
  [css-grid] Use ShorthandSerializer for grid-column in CSSComputedStyleDeclaration::getPropertyValue.
https://bugs.webkit.org/show_bug.cgi?id=261575
rdar://115521440

Reviewed by Tim Nguyen.

We can reuse the logic that the ShorthandSerializer provides to
correctly serialize the computed style of this property. This will
help us avoid duplicating logic to get the computed value.

This change also exposed some incorrect tests within
fast/css-grid-layout. The underlying issue between all of the subtests
was the same as in 268132 at main but for the grid-column property:
the tests did not correctly use the shortest possible
serialization for the grid-column property. For the same reason as in
268132 at main, we moved these incorrect tests to their WPT version.

The tests were expecting the computed value of grid-column to serialize
to one of the following forms which is incorrect:
- auto / auto
- <integer> / auto
- span <integer> / auto
- <integer> <custom-ident> / auto
- span <custom-ident> / auto
- span <integer> <custom-ident> / auto
- <custom-ident> / <custom-ident> (where the idents were exactly the
same)
In all of these cases the computed value of grid-column should serialize
to just the grid-column portion in the grammars above as that is the
shortest possible representation for each. These type of tests were
moved to css/css-grid/parsing/grid-column-shortest-serialization.html

All of the subtests testing the invalid values for this property were
moved to css/css-grid/parsing/grid-column-invalid.html

The modified inheritance tests were also problematic because in some
cases they were setting the value of grid-column to one of the problematic
versions, so I simply ended up modifying the value of grid-column they
were using since they were testing inheritance rather than the
serialization of a specific value.

Tests that were testing the value of "initial," for grid-column could also
be removed with no issue as this is already being tested in
css/css-grid/grid-layout-properties.html.

* LayoutTests/fast/css-grid-layout/grid-item-column-row-get-set-expected.txt:
* LayoutTests/fast/css-grid-layout/grid-item-column-row-get-set.html:
* LayoutTests/fast/css-grid-layout/grid-item-end-after-get-set-expected.txt:
* LayoutTests/fast/css-grid-layout/grid-item-end-after-get-set.html:
* LayoutTests/fast/css-grid-layout/grid-item-start-before-get-set-expected.txt:
* LayoutTests/fast/css-grid-layout/grid-item-start-before-get-set.html:
* LayoutTests/fast/css-grid-layout/named-grid-lines-with-named-grid-areas-get-set-expected.txt:
* LayoutTests/fast/css-grid-layout/named-grid-lines-with-named-grid-areas-get-set.html:
* LayoutTests/fast/css-grid-layout/resources/grid-item-column-row-parsing-utils.js:
(window.testRowCSSParsing):
(window.testColumnRowJSParsing):
(window.testColumnJSParsing): Deleted.
(window.testColumnRowInvalidJSParsing): Deleted.
(window.testColumnInvalidJSParsing): Deleted.
(window.testColumnEndJSParsing): Deleted.
(window.testColumnInitialJSParsing): Deleted.
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-layout-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-column-invalid-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-column-invalid.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-column-shortest-serialization-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-column-shortest-serialization.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-column-shorthand-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-column-shorthand.html: Added.
* Source/WebCore/css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyValue const):

Canonical link: https://commits.webkit.org/268167@main




More information about the webkit-changes mailing list