LibWeb: Improve grid-template-area parsing and serialization

This commit is contained in:
Gingeh 2024-11-15 16:16:03 +11:00 committed by Sam Atkins
commit 0afd7f166a
Notes: github-actions[bot] 2024-12-02 16:20:49 +00:00
13 changed files with 274 additions and 62 deletions

View file

@ -0,0 +1,56 @@
Summary
Harness status: OK
Rerun
Found 45 tests
36 Pass
9 Fail
Details
Result Test Name MessagePass 'grid' with: grid-template-areas: none;
Pass 'grid' with: grid-template-areas: "a";
Pass 'grid' with: grid-template-areas: ".";
Pass 'grid' with: grid-template-areas: "lower UPPER 10 -minus _low 1-st ©copy_right line¶";
Pass 'grid' with: grid-template-areas: "a b";
Pass 'grid' with: grid-template-areas: "a b" "c d";
Pass 'grid' with: grid-template-areas: "a b" "c d";
Pass 'grid' with: grid-template-areas: "a b""c d";
Pass 'grid' with: grid-template-areas: "a b" "c d";
Pass 'grid' with: grid-template-areas: "a b" "c d";
Pass 'grid' with: grid-template-areas: "a b" "a b";
Pass 'grid' with: grid-template-areas: "a a" "b b";
Pass 'grid' with: grid-template-areas: ". a ." "b a c";
Pass 'grid' with: grid-template-areas: ".. a ..." "b a c";
Pass 'grid' with: grid-template-areas: ".a..." "b a c";
Pass 'grid' with: grid-template-areas: "head head" "nav main" "foot .";
Pass 'grid' with: grid-template-areas: "head head" "nav main" "foot ....";
Pass 'grid' with: grid-template-areas: "head head" "nav main" "foot.";
Pass 'grid' with: grid-template-areas: ". header header ." "nav main main main" "nav footer footer .";
Pass 'grid' with: grid-template-areas: "... header header ...." "nav main main main" "nav footer footer ....";
Pass 'grid' with: grid-template-areas: "...header header...." "nav main main main" "nav footer footer....";
Pass 'grid' with: grid-template-areas: "title stats" "score stats" "board board" "ctrls ctrls";
Pass 'grid' with: grid-template-areas: "title board" "stats board" "score ctrls";
Pass 'grid' with: grid-template-areas: ". a" "b a" ". a";
Pass 'grid' with: grid-template-areas: ".. a" "b a" "... a";
Pass 'grid' with: grid-template-areas: "..a" "b a" ".a";
Pass 'grid' with: grid-template-areas: "a a a" "b b b";
Pass 'grid' with: grid-template-areas: ". ." "a a";
Pass 'grid' with: grid-template-areas: "... ...." "a a";
Pass 'grid' with: grid-template-areas: a;
Pass 'grid' with: grid-template-areas: "a" "b c";
Pass 'grid' with: grid-template-areas: "a b" "c" "d e";
Pass 'grid' with: grid-template-areas: "a b c" "d e";
Pass 'grid' with: grid-template-areas: "a b"-"c d";
Pass 'grid' with: grid-template-areas: "a b" - "c d";
Pass 'grid' with: grid-template-areas: "a b" . "c d";
Fail 'grid' with: grid-template-areas: "a b a";
Fail 'grid' with: grid-template-areas: "a" "b" "a";
Fail 'grid' with: grid-template-areas: "a b" "b b";
Fail 'grid' with: grid-template-areas: "b a" "b b";
Fail 'grid' with: grid-template-areas: "a b" "b a";
Fail 'grid' with: grid-template-areas: "a ." ". a";
Fail 'grid' with: grid-template-areas: ",";
Fail 'grid' with: grid-template-areas: "10%";
Fail 'grid' with: grid-template-areas: "USD$";

View file

@ -6,15 +6,15 @@ Rerun
Found 121 tests
30 Pass
91 Fail
35 Pass
86 Fail
Details
Result Test Name MessageFail e.style.cssText = grid: auto-flow auto / 100px 100px should set grid
Fail e.style.cssText = grid: auto-flow auto / 100px 100px should set grid-template-areas
Pass e.style.cssText = grid: auto-flow auto / 100px 100px; grid-template-areas: "one two" "three four" should set grid
Fail e.style.cssText = grid: auto-flow auto / 100px 100px; grid-template-areas: "one two" "three four" should set grid-auto-flow
Fail e.style.cssText = grid: auto-flow auto / 100px 100px; grid-template-areas: "one two" "three four" should set grid-auto-rows
Fail e.style.cssText = grid: auto-flow auto / 100px 100px; grid-template-areas: "one two" "three four" should set grid-template-areas
Pass e.style.cssText = grid: auto-flow auto / 100px 100px; grid-template-areas: "one two" "three four" should set grid-template-areas
Fail e.style.cssText = grid: 30px 40px / 50px 60px; grid-auto-flow: column should set grid
Pass e.style.cssText = grid: 30px 40px / 50px 60px; grid-auto-flow: column should set grid-auto-flow
Pass e.style.cssText = grid: 30px 40px / 50px 60px; grid-auto-flow: column should set grid-template
@ -115,18 +115,18 @@ Fail e.style.cssText = grid: auto-flow 1px / none; grid-template-rows: repeat(au
Fail e.style.cssText = grid: auto-flow 1px / none; grid-template-rows: repeat(auto-fit, 3px) should set grid-template-columns
Fail e.style.cssText = grid: auto-flow 1px / none; grid-template-rows: repeat(auto-fit, 3px) should set grid-template-rows
Fail e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(2, 3px); grid-template-areas: "one two" "three four" should set grid
Fail e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(2, 3px); grid-template-areas: "one two" "three four" should set grid-template-areas
Pass e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(2, 3px); grid-template-areas: "one two" "three four" should set grid-template-areas
Pass e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(2, 3px); grid-template-areas: "one two" "three four" should set grid-template-columns
Pass e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(2, 3px); grid-template-areas: "one two" "three four" should set grid-template-rows
Fail e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(2, 1fr); grid-template-areas: "one two" "three four" should set grid
Fail e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(2, 1fr); grid-template-areas: "one two" "three four" should set grid-template-areas
Pass e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(2, 1fr); grid-template-areas: "one two" "three four" should set grid-template-areas
Pass e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(2, 1fr); grid-template-areas: "one two" "three four" should set grid-template-columns
Pass e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(2, 1fr); grid-template-areas: "one two" "three four" should set grid-template-rows
Fail e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(auto-fill, 3px); grid-template-areas: "one two" "three four" should set grid
Fail e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(auto-fill, 3px); grid-template-areas: "one two" "three four" should set grid-template-areas
Pass e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(auto-fill, 3px); grid-template-areas: "one two" "three four" should set grid-template-areas
Fail e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(auto-fill, 3px); grid-template-areas: "one two" "three four" should set grid-template-columns
Pass e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(auto-fill, 3px); grid-template-areas: "one two" "three four" should set grid-template-rows
Fail e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(auto-fit, 3px); grid-template-areas: "one two" "three four" should set grid
Fail e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(auto-fit, 3px); grid-template-areas: "one two" "three four" should set grid-template-areas
Pass e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(auto-fit, 3px); grid-template-areas: "one two" "three four" should set grid-template-areas
Fail e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(auto-fit, 3px); grid-template-areas: "one two" "three four" should set grid-template-columns
Pass e.style.cssText = grid-template-rows: auto auto; grid-template-columns: repeat(auto-fit, 3px); grid-template-areas: "one two" "three four" should set grid-template-rows

View file

@ -6,8 +6,8 @@ Rerun
Found 63 tests
18 Pass
45 Fail
21 Pass
42 Fail
Details
Result Test Name MessageFail e.style['grid'] = "none" should set grid-auto-columns
Fail e.style['grid'] = "none" should set grid-auto-flow
@ -40,21 +40,21 @@ Pass e.style['grid'] = "fit-content(calc(-0.5em + 10px)) / fit-content(calc(0.5e
Fail e.style['grid'] = "[header-top] \"a a a\" [header-bottom] [main-top] \"b b b\" 1fr [main-bottom] / auto 1fr auto" should set grid-auto-columns
Fail e.style['grid'] = "[header-top] \"a a a\" [header-bottom] [main-top] \"b b b\" 1fr [main-bottom] / auto 1fr auto" should set grid-auto-flow
Fail e.style['grid'] = "[header-top] \"a a a\" [header-bottom] [main-top] \"b b b\" 1fr [main-bottom] / auto 1fr auto" should set grid-auto-rows
Fail e.style['grid'] = "[header-top] \"a a a\" [header-bottom] [main-top] \"b b b\" 1fr [main-bottom] / auto 1fr auto" should set grid-template-areas
Pass e.style['grid'] = "[header-top] \"a a a\" [header-bottom] [main-top] \"b b b\" 1fr [main-bottom] / auto 1fr auto" should set grid-template-areas
Pass e.style['grid'] = "[header-top] \"a a a\" [header-bottom] [main-top] \"b b b\" 1fr [main-bottom] / auto 1fr auto" should set grid-template-columns
Fail e.style['grid'] = "[header-top] \"a a a\" [header-bottom] [main-top] \"b b b\" 1fr [main-bottom] / auto 1fr auto" should set grid-template-rows
Pass e.style['grid'] = "[header-top] \"a a a\" [header-bottom] [main-top] \"b b b\" 1fr [main-bottom] / auto 1fr auto" should not set unrelated longhands
Fail e.style['grid'] = " \"a a a\" \"b b b\" 1fr/ auto 1fr auto" should set grid-auto-columns
Fail e.style['grid'] = " \"a a a\" \"b b b\" 1fr/ auto 1fr auto" should set grid-auto-flow
Fail e.style['grid'] = " \"a a a\" \"b b b\" 1fr/ auto 1fr auto" should set grid-auto-rows
Fail e.style['grid'] = " \"a a a\" \"b b b\" 1fr/ auto 1fr auto" should set grid-template-areas
Pass e.style['grid'] = " \"a a a\" \"b b b\" 1fr/ auto 1fr auto" should set grid-template-areas
Pass e.style['grid'] = " \"a a a\" \"b b b\" 1fr/ auto 1fr auto" should set grid-template-columns
Fail e.style['grid'] = " \"a a a\" \"b b b\" 1fr/ auto 1fr auto" should set grid-template-rows
Pass e.style['grid'] = " \"a a a\" \"b b b\" 1fr/ auto 1fr auto" should not set unrelated longhands
Fail e.style['grid'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-auto-columns
Fail e.style['grid'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-auto-flow
Fail e.style['grid'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-auto-rows
Fail e.style['grid'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-areas
Pass e.style['grid'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-areas
Fail e.style['grid'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-columns
Fail e.style['grid'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-rows
Pass e.style['grid'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should not set unrelated longhands

View file

@ -6,15 +6,14 @@ Rerun
Found 9 tests
1 Pass
8 Fail
9 Pass
Details
Result Test Name MessagePass Property grid-template-areas value 'none'
Fail Property grid-template-areas value '"first"'
Fail Property grid-template-areas value '"first second"'
Fail Property grid-template-areas value '"1st 2nd 3rd"'
Fail Property grid-template-areas value '"first second" "third fourth"'
Fail Property grid-template-areas value '"first second" "third ." "1st 2nd" "3rd 4th"'
Fail Property grid-template-areas value '" a b "'
Fail Property grid-template-areas value '"c d"'
Fail Property grid-template-areas value '"first ..."'
Pass Property grid-template-areas value '"first"'
Pass Property grid-template-areas value '"first second"'
Pass Property grid-template-areas value '"1st 2nd 3rd"'
Pass Property grid-template-areas value '"first second" "third fourth"'
Pass Property grid-template-areas value '"first second" "third ." "1st 2nd" "3rd 4th"'
Pass Property grid-template-areas value '" a b "'
Pass Property grid-template-areas value '"c d"'
Pass Property grid-template-areas value '"first ..."'

View file

@ -6,17 +6,16 @@ Rerun
Found 11 tests
6 Pass
5 Fail
11 Pass
Details
Result Test Name MessagePass e.style['grid-template-areas'] = "auto" should not set the property value
Pass e.style['grid-template-areas'] = "none \"first\"" should not set the property value
Pass e.style['grid-template-areas'] = "\"first\" none" should not set the property value
Pass e.style['grid-template-areas'] = "\"\"" should not set the property value
Pass e.style['grid-template-areas'] = "\" \"" should not set the property value
Fail e.style['grid-template-areas'] = "\".\" \"\"" should not set the property value
Fail e.style['grid-template-areas'] = "\".\" \" \"" should not set the property value
Fail e.style['grid-template-areas'] = "\"first\" \"\"" should not set the property value
Fail e.style['grid-template-areas'] = "\"first\" \"\" \"second\"" should not set the property value
Fail e.style['grid-template-areas'] = "\"first\" \" \"" should not set the property value
Pass e.style['grid-template-areas'] = "\".\" \"\"" should not set the property value
Pass e.style['grid-template-areas'] = "\".\" \" \"" should not set the property value
Pass e.style['grid-template-areas'] = "\"first\" \"\"" should not set the property value
Pass e.style['grid-template-areas'] = "\"first\" \"\" \"second\"" should not set the property value
Pass e.style['grid-template-areas'] = "\"first\" \" \"" should not set the property value
Pass e.style['grid-template-areas'] = "\"\" none" should not set the property value

View file

@ -6,12 +6,11 @@ Rerun
Found 6 tests
4 Pass
2 Fail
6 Pass
Details
Result Test Name MessagePass "grid-template-areas: 'a';" should be valid.
Pass "grid-template-areas: '.';" should be valid.
Pass "grid-template-areas: '';" should be invalid.
Fail "grid-template-areas: '' '';" should be invalid.
Fail "grid-template-areas: '$';" should be invalid.
Pass "grid-template-areas: '' '';" should be invalid.
Pass "grid-template-areas: '$';" should be invalid.
Pass "grid-template-areas: ' ';" should be invalid.

View file

@ -6,15 +6,14 @@ Rerun
Found 9 tests
1 Pass
8 Fail
9 Pass
Details
Result Test Name MessagePass e.style['grid-template-areas'] = "none" should set the property value
Fail e.style['grid-template-areas'] = "\"first\"" should set the property value
Fail e.style['grid-template-areas'] = "\"first second\"" should set the property value
Fail e.style['grid-template-areas'] = "\"1st 2nd 3rd\"" should set the property value
Fail e.style['grid-template-areas'] = "\"first second\" \"third fourth\"" should set the property value
Fail e.style['grid-template-areas'] = "\"first second\" \"third .\" \"1st 2nd\" \"3rd 4th\"" should set the property value
Fail e.style['grid-template-areas'] = "\" a \t b \"" should set the property value
Fail e.style['grid-template-areas'] = "\"c\td\"" should set the property value
Fail e.style['grid-template-areas'] = "\"first ...\"" should set the property value
Pass e.style['grid-template-areas'] = "\"first\"" should set the property value
Pass e.style['grid-template-areas'] = "\"first second\"" should set the property value
Pass e.style['grid-template-areas'] = "\"1st 2nd 3rd\"" should set the property value
Pass e.style['grid-template-areas'] = "\"first second\" \"third fourth\"" should set the property value
Pass e.style['grid-template-areas'] = "\"first second\" \"third .\" \"1st 2nd\" \"3rd 4th\"" should set the property value
Pass e.style['grid-template-areas'] = "\" a \t b \"" should set the property value
Pass e.style['grid-template-areas'] = "\"c\td\"" should set the property value
Pass e.style['grid-template-areas'] = "\"first ...\"" should set the property value

View file

@ -6,10 +6,11 @@ Rerun
Found 5 tests
5 Fail
2 Pass
3 Fail
Details
Result Test Name MessageFail grid-template: none / 1px and "grid-template-areas: "a";" should be valid.
Fail grid-template: none / none and "grid-template-areas: "a";" should be valid.
Pass grid-template: none / none and "grid-template-areas: "a";" should be valid.
Fail grid-template: auto / 1px and "grid-template-areas: "a a a";" should be valid.
Fail grid-template: auto / auto and "grid-template-areas: "a a a";" should be valid.
Fail grid-template: 10px 20px 30px / 40px 50px 60px 70px and "grid-template-areas: "a . b ." "c d . e" "f g h .";" should be valid.
Pass grid-template: 10px 20px 30px / 40px 50px 60px 70px and "grid-template-areas: "a . b ." "c d . e" "f g h .";" should be valid.

View file

@ -6,8 +6,8 @@ Rerun
Found 24 tests
15 Pass
9 Fail
18 Pass
6 Fail
Details
Result Test Name MessagePass e.style['grid-template'] = "none" should set grid-template-areas
Fail e.style['grid-template'] = "none" should set grid-template-columns
@ -21,15 +21,15 @@ Pass e.style['grid-template'] = "fit-content(calc(-0.5em + 10px)) / fit-content(
Pass e.style['grid-template'] = "fit-content(calc(-0.5em + 10px)) / fit-content(calc(0.5em + 10px))" should set grid-template-columns
Pass e.style['grid-template'] = "fit-content(calc(-0.5em + 10px)) / fit-content(calc(0.5em + 10px))" should set grid-template-rows
Pass e.style['grid-template'] = "fit-content(calc(-0.5em + 10px)) / fit-content(calc(0.5em + 10px))" should not set unrelated longhands
Fail e.style['grid-template'] = "[header-top] \"a a a\" [header-bottom] [main-top] \"b b b\" 1fr [main-bottom] / auto 1fr auto" should set grid-template-areas
Pass e.style['grid-template'] = "[header-top] \"a a a\" [header-bottom] [main-top] \"b b b\" 1fr [main-bottom] / auto 1fr auto" should set grid-template-areas
Pass e.style['grid-template'] = "[header-top] \"a a a\" [header-bottom] [main-top] \"b b b\" 1fr [main-bottom] / auto 1fr auto" should set grid-template-columns
Fail e.style['grid-template'] = "[header-top] \"a a a\" [header-bottom] [main-top] \"b b b\" 1fr [main-bottom] / auto 1fr auto" should set grid-template-rows
Pass e.style['grid-template'] = "[header-top] \"a a a\" [header-bottom] [main-top] \"b b b\" 1fr [main-bottom] / auto 1fr auto" should not set unrelated longhands
Fail e.style['grid-template'] = " \"a a a\" \"b b b\" 1fr/ auto 1fr auto" should set grid-template-areas
Pass e.style['grid-template'] = " \"a a a\" \"b b b\" 1fr/ auto 1fr auto" should set grid-template-areas
Pass e.style['grid-template'] = " \"a a a\" \"b b b\" 1fr/ auto 1fr auto" should set grid-template-columns
Fail e.style['grid-template'] = " \"a a a\" \"b b b\" 1fr/ auto 1fr auto" should set grid-template-rows
Pass e.style['grid-template'] = " \"a a a\" \"b b b\" 1fr/ auto 1fr auto" should not set unrelated longhands
Fail e.style['grid-template'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-areas
Pass e.style['grid-template'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-areas
Fail e.style['grid-template'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-columns
Fail e.style['grid-template'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should set grid-template-rows
Pass e.style['grid-template'] = " [] \"a a a\" [] [] \"b b b\" 1fr [] / [] auto 1fr [] auto []" should not set unrelated longhands