Skip to content
Permalink
Browse files
Omit the integer value for grid-lines when it's the default value.
https://bugs.webkit.org/show_bug.cgi?id=245025

Reviewed by Tim Nguyen.

As per the shortest possible serialization principle, we don't need to print the '1' default value.

* LayoutTests/fast/css-grid-layout/grid-item-area-get-set-expected.txt:
* LayoutTests/fast/css-grid-layout/grid-item-area-get-set.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/imported/w3c/web-platform-tests/css/css-grid/grid-layout-properties.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-area-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-area-computed.html:
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::valueForGridPosition):

Canonical link: https://commits.webkit.org/254821@main
  • Loading branch information
mattwoodrow authored and nt1m committed Sep 24, 2022
1 parent fe4695d commit fc4a525dc1504f16c392e5f6a3936f56f085e410
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 52 deletions.
@@ -88,12 +88,12 @@ PASS getComputedStyle(gridItemWithNonExistingCustomIdent, '').getPropertyValue('
PASS getComputedStyle(gridItemWithNonExistingCustomIdent, '').getPropertyValue('grid-row') is "foo / foo"
PASS getComputedStyle(gridItemWithNonExistingCustomIdent, '').getPropertyValue('grid-row-start') is "foo"
PASS getComputedStyle(gridItemWithNonExistingCustomIdent, '').getPropertyValue('grid-row-end') is "foo"
PASS getComputedStyle(gridItemWithSpanCustomIdent, '').getPropertyValue('grid-column') is "1 / span 1 first"
PASS getComputedStyle(gridItemWithSpanCustomIdent, '').getPropertyValue('grid-column') is "1 / span first"
PASS getComputedStyle(gridItemWithSpanCustomIdent, '').getPropertyValue('grid-column-start') is "1"
PASS getComputedStyle(gridItemWithSpanCustomIdent, '').getPropertyValue('grid-column-end') is "span 1 first"
PASS getComputedStyle(gridItemWithSpanCustomIdent, '').getPropertyValue('grid-row') is "-1 / span 1 last"
PASS getComputedStyle(gridItemWithSpanCustomIdent, '').getPropertyValue('grid-column-end') is "span first"
PASS getComputedStyle(gridItemWithSpanCustomIdent, '').getPropertyValue('grid-row') is "-1 / span last"
PASS getComputedStyle(gridItemWithSpanCustomIdent, '').getPropertyValue('grid-row-start') is "-1"
PASS getComputedStyle(gridItemWithSpanCustomIdent, '').getPropertyValue('grid-row-end') is "span 1 last"
PASS getComputedStyle(gridItemWithSpanCustomIdent, '').getPropertyValue('grid-row-end') is "span last"
PASS getComputedStyle(gridItemWithSpanNumberCustomIdent, '').getPropertyValue('grid-column') is "1 / span 3 first"
PASS getComputedStyle(gridItemWithSpanNumberCustomIdent, '').getPropertyValue('grid-column-start') is "1"
PASS getComputedStyle(gridItemWithSpanNumberCustomIdent, '').getPropertyValue('grid-column-end') is "span 3 first"
@@ -182,18 +182,18 @@ PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-end') is "3"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row') is "5 / span 1"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-start') is "5"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-end') is "span 1"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column') is "span 1 first / 3"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-start') is "span 1 first"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column') is "span first / 3"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-start') is "span first"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-end') is "3"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row') is "5 / span 1 last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row') is "5 / span last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-start') is "5"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-end') is "span 1 last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-end') is "span last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column') is "first / last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-start') is "first"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-end') is "last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row') is "nav / span 1 last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row') is "nav / span last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-start') is "nav"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-end') is "span 1 last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-end') is "span last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column') is "3 first / 2 last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-start') is "3 first"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-end') is "2 last"
@@ -221,15 +221,15 @@ PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-end') is "foobar"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column') is "span 3 first / none"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-start') is "span 3 first"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-end') is "none"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row') is "span 1 last / foobar"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-start') is "span 1 last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row') is "span last / foobar"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-start') is "span last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-end') is "foobar"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column') is "span 5 / span 2"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-start') is "span 5"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-end') is "span 2"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row') is "span 1 first / span 1 last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-start') is "span 1 first"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-end') is "span 1 last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row') is "span first / span last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-start') is "span first"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-end') is "span last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column') is "span 5 first / span 2 last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-start') is "span 5 first"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-end') is "span 2 last"
@@ -122,7 +122,7 @@
testColumnRowCSSParsing("gridItemWithNoSpaceElement", "auto / 1", "5 / auto");
testColumnRowCSSParsing("gridItemWithCustomIdent", "first / first", "last / last");
testColumnRowCSSParsing("gridItemWithNonExistingCustomIdent", "nav / nav", "foo / foo");
testColumnRowCSSParsing("gridItemWithSpanCustomIdent", "1 / span 1 first", "-1 / span 1 last");
testColumnRowCSSParsing("gridItemWithSpanCustomIdent", "1 / span first", "-1 / span last");
testColumnRowCSSParsing("gridItemWithSpanNumberCustomIdent", "1 / span 3 first", "-1 / span 2 last");
testColumnRowCSSParsing("gridItemWithSingleNamedGridArea", "thirdArea / thirdArea", "firstArea / firstArea");
testColumnRowCSSParsing("gridItemWithNamedGridAreaAndSpan", "thirdArea / span 1", "firstArea / span 2");
@@ -150,14 +150,14 @@
testColumnRowJSParsing("auto / 5", "auto / 8");
testColumnRowJSParsing("span / 3", "5 / span", "auto / auto", "auto / auto");
testColumnRowJSParsing("span 1 / 3", "5 / span 1", "span 1 / 3", "5 / span 1");
testColumnRowJSParsing("first span / 3", "5 / last span", "span 1 first / 3", "5 / span 1 last");
testColumnRowJSParsing("first / last", "nav / last span", "first / last", "nav / span 1 last");
testColumnRowJSParsing("first span / 3", "5 / last span", "span first / 3", "5 / span last");
testColumnRowJSParsing("first / last", "nav / last span", "first / last", "nav / span last");
testColumnRowJSParsing("3 first / 2 last", "5 nav / last 7 span", "3 first / 2 last", "5 nav / span 7 last");
testColumnRowJSParsing("3 first span / -3 last", "last 2 span / -1 nav", "span 3 first / -3 last", "span 2 last / -1 nav");
testColumnRowJSParsing("5 / none", "8 / foobar");
testColumnRowJSParsing("nonExistent / none", "nonExistent / foobar");
testColumnRowJSParsing("span first 3 / none", "last span / foobar", "span 3 first / none", "span 1 last / foobar");
testColumnRowJSParsing("5 span / span 2", "span first / last span", "span 5 / span 2", "span 1 first / span 1 last");
testColumnRowJSParsing("span first 3 / none", "last span / foobar", "span 3 first / none", "span last / foobar");
testColumnRowJSParsing("5 span / span 2", "span first / last span", "span 5 / span 2", "span first / span last");
testColumnRowJSParsing("span 5 first / span last 2", "3 first span / last 7 span", "span 5 first / span 2 last", "span 3 first / span 7 last");

debug("");
@@ -58,12 +58,12 @@ PASS getComputedStyle(gridItemWithNumberCustomIdent, '').getPropertyValue('grid-
PASS getComputedStyle(gridItemWithNumberCustomIdent, '').getPropertyValue('grid-row') is "auto / 3 last"
PASS getComputedStyle(gridItemWithNumberCustomIdent, '').getPropertyValue('grid-row-start') is "auto"
PASS getComputedStyle(gridItemWithNumberCustomIdent, '').getPropertyValue('grid-row-end') is "3 last"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-column') is "auto / span 1 first"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-column') is "auto / span first"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-column-start') is "auto"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-column-end') is "span 1 first"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-row') is "auto / span 1 last"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-column-end') is "span first"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-row') is "auto / span last"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-row-start') is "auto"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-row-end') is "span 1 last"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-row-end') is "span last"
PASS getComputedStyle(gridItemWithSpanNumberCustomIdentElement, '').getPropertyValue('grid-column') is "auto / span 2 first"
PASS getComputedStyle(gridItemWithSpanNumberCustomIdentElement, '').getPropertyValue('grid-column-start') is "auto"
PASS getComputedStyle(gridItemWithSpanNumberCustomIdentElement, '').getPropertyValue('grid-column-end') is "span 2 first"
@@ -108,12 +108,12 @@ PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-end') is "span
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row') is "auto / span 2"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-start') is "auto"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-end') is "span 2"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column') is "auto / span 1 first"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column') is "auto / span first"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-start') is "auto"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-end') is "span 1 first"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row') is "auto / span 1 last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-end') is "span first"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row') is "auto / span last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-start') is "auto"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-end') is "span 1 last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-end') is "span last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column') is "auto / auto"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-start') is "auto"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-end') is "auto"
@@ -85,7 +85,7 @@
testColumnRowCSSParsing("gridItemWithAutoElement", "auto / auto", "auto / auto");
testColumnRowCSSParsing("gridItemWithCustomIdent", "auto / first", "auto / last");
testColumnRowCSSParsing("gridItemWithNumberCustomIdent", "auto / 2 first", "auto / 3 last");
testColumnRowCSSParsing("gridItemWithSpanCustomIdentElement", "auto / span 1 first", "auto / span 1 last");
testColumnRowCSSParsing("gridItemWithSpanCustomIdentElement", "auto / span first", "auto / span last");
testColumnRowCSSParsing("gridItemWithSpanNumberCustomIdentElement", "auto / span 2 first", "auto / span 3 last");
testColumnRowCSSParsing("gridItemWithArea", "auto / firstArea", "auto / thirdArea");

@@ -104,7 +104,7 @@
testColumnEndRowEndJSParsing("-55", "-40");
testColumnEndRowEndJSParsing("first", "last", "first", "last");
testColumnEndRowEndJSParsing("span 7", "span 2");
testColumnEndRowEndJSParsing("span first", "span last", "span 1 first", "span 1 last");
testColumnEndRowEndJSParsing("span first", "span last", "span first", "span last");
testColumnEndRowEndJSParsing("auto", "auto");
testColumnEndRowEndJSParsing("thirdArea", "secondArea");
testColumnEndRowEndJSParsing("nonExistentArea", "secondArea");
@@ -56,11 +56,11 @@ PASS getComputedStyle(gridItemWithNumberCustomIdent, '').getPropertyValue('grid-
PASS getComputedStyle(gridItemWithNumberCustomIdent, '').getPropertyValue('grid-row') is "3 last / auto"
PASS getComputedStyle(gridItemWithNumberCustomIdent, '').getPropertyValue('grid-row-start') is "3 last"
PASS getComputedStyle(gridItemWithNumberCustomIdent, '').getPropertyValue('grid-row-end') is "auto"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-column') is "span 1 first / auto"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-column-start') is "span 1 first"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-column') is "span first / auto"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-column-start') is "span first"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-column-end') is "auto"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-row') is "span 1 last / auto"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-row-start') is "span 1 last"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-row') is "span last / auto"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-row-start') is "span last"
PASS getComputedStyle(gridItemWithSpanCustomIdentElement, '').getPropertyValue('grid-row-end') is "auto"
PASS getComputedStyle(gridItemWithSpanNumberCustomIdentElement, '').getPropertyValue('grid-column') is "span 2 first / auto"
PASS getComputedStyle(gridItemWithSpanNumberCustomIdentElement, '').getPropertyValue('grid-column-start') is "span 2 first"
@@ -106,11 +106,11 @@ PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-end') is "auto
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row') is "span 20 / auto"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-start') is "span 20"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-end') is "auto"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column') is "span 1 nav / auto"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-start') is "span 1 nav"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column') is "span nav / auto"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-start') is "span nav"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-end') is "auto"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row') is "span 1 last / auto"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-start') is "span 1 last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row') is "span last / auto"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-start') is "span last"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-row-end') is "auto"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column') is "auto / auto"
PASS getComputedStyle(gridItem, '').getPropertyValue('grid-column-start') is "auto"
@@ -90,7 +90,7 @@
testColumnRowCSSParsing("gridItemWithAutoElement", "auto / auto", "auto / auto");
testColumnRowCSSParsing("gridItemWithCustomIdent", "first / auto", "last / auto");
testColumnRowCSSParsing("gridItemWithNumberCustomIdent", "2 first / auto", "3 last / auto");
testColumnRowCSSParsing("gridItemWithSpanCustomIdentElement", "span 1 first / auto", "span 1 last / auto");
testColumnRowCSSParsing("gridItemWithSpanCustomIdentElement", "span first / auto", "span last / auto");
testColumnRowCSSParsing("gridItemWithSpanNumberCustomIdentElement", "span 2 first / auto", "span 3 last / auto");
testColumnRowCSSParsing("gridItemWithArea", "firstArea / auto", "thirdArea / auto");

@@ -109,7 +109,7 @@
testColumnStartRowStartJSParsing("-55", "-40");
testColumnStartRowStartJSParsing("nav", "last", "nav", "last");
testColumnStartRowStartJSParsing("span 3", "span 20");
testColumnStartRowStartJSParsing("span nav", "span last", "span 1 nav", "span 1 last");
testColumnStartRowStartJSParsing("span nav", "span last", "span nav", "span last");
testColumnStartRowStartJSParsing("auto", "auto");
testColumnStartRowStartJSParsing("thirdArea", "secondArea");
testColumnStartRowStartJSParsing("nonExistentArea", "secondArea");

0 comments on commit fc4a525

Please sign in to comment.