Skip to content

Commit

Permalink
[css-grid] Use ShorthandSerializer for grid-area in CSSComputedStyleD…
Browse files Browse the repository at this point in the history
…eclaration::getPropertyValue.

https://bugs.webkit.org/show_bug.cgi?id=261577
rdar://115521493

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.

* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-layout-properties-expected.txt:
* Source/WebCore/css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyValue const):

Canonical link: https://commits.webkit.org/268026@main
  • Loading branch information
sammygill committed Sep 15, 2023
1 parent 3d6388b commit c07a7a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@ PASS grid-row.span <custom-ident>
PASS grid-row.span <integer> <custom-ident>
FAIL grid-row.reset assert_equals: reset expected "auto" but got "auto / auto"
PASS grid-area
FAIL grid-area.initial assert_equals: initial value of grid-area should be auto expected "auto" but got "auto / auto / auto / auto"
FAIL grid-area.auto assert_equals: auto expected "auto" but got "auto / auto / auto / auto"
PASS grid-area.initial
PASS grid-area.auto
PASS grid-area.<custom-ident>
FAIL grid-area.<integer> start assert_equals: <integer> start expected "1 / 2" but got "1 / 2 / auto / auto"
PASS grid-area.<integer> start
PASS grid-area.<integer>
PASS grid-area.<integer> <ident>
PASS grid-area.span <integer>
PASS grid-area.span <custom-ident>
PASS grid-area.span <integer> <custom-ident>
FAIL grid-area.reset assert_equals: reset expected "auto" but got "auto / auto / auto / auto"
PASS grid-area.reset
I T
IT
I
1 change: 1 addition & 0 deletions Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ String CSSComputedStyleDeclaration::getPropertyValue(CSSPropertyID propertyID) c
{
auto canUseShorthandSerializerForPropertyValue = [&]() {
switch (propertyID) {
case CSSPropertyGridArea:
case CSSPropertyGridTemplate:
return true;
default:
Expand Down

0 comments on commit c07a7a0

Please sign in to comment.