Skip to content

Commit

Permalink
[¢ss-grid] Fix grid-template-shorthand-composition.html
Browse files Browse the repository at this point in the history
Some cases were wrong: shorthands should serialize to empty string when
they can't represent the values of their longhands.

Also adding more cases for completeness, and improving formatting.
  • Loading branch information
Loirooriol committed Dec 10, 2024
1 parent 692415a commit f4c026a
Showing 1 changed file with 54 additions and 3 deletions.
57 changes: 54 additions & 3 deletions css/css-grid/parsing/grid-template-shorthand-composition.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,60 @@
testValidGridTemplate("auto", "auto", "none", "auto / auto");

// `[ <line-names>? <string> <track-size>? <line-names>? ]+ [ / <explicit-track-list> ]?`
testValidGridTemplate("[header-top] auto [header-bottom main-top] 1fr [main-bottom]", "auto 1fr auto", "\"a a a\" \"b b b\"", "[header-top] \"a a a\" [header-bottom main-top] \"b b b\" 1fr [main-bottom] / auto 1fr auto");
testValidGridTemplate("auto", "auto", "\"a a a\" \"b b b\"", "\"a a a\" \"b b b\" / auto");
testValidGridTemplate("min-content", "min-content", "\"a a a\" \"b b b\" \"c c c\" \"d d d\"", "\"a a a\" min-content \"b b b\" \"c c c\" \"d d d\" / min-content");
testValidGridTemplate(
"[header-top] auto [header-bottom main-top] 1fr [main-bottom]",
"auto 1fr auto",
'"a a a" "b b b"',
'[header-top] "a a a" [header-bottom main-top] "b b b" 1fr [main-bottom] / auto 1fr auto',
);
testValidGridTemplate(
"auto",
"auto",
'"a a a" "b b b"',
"",
);
testValidGridTemplate(
"auto",
"auto auto",
'"a a a" "b b b"',
"",
);
testValidGridTemplate(
"auto auto",
"auto",
'"a a a" "b b b"',
'"a a a" "b b b" / auto',
);
testValidGridTemplate(
"auto auto",
"auto auto",
'"a a a" "b b b"',
'"a a a" "b b b" / auto auto',
);
testValidGridTemplate(
"min-content",
"min-content",
'"a a a" "b b b" "c c c" "d d d"',
"",
);
testValidGridTemplate(
"min-content",
"min-content auto auto auto",
'"a a a" "b b b" "c c c" "d d d"',
"",
);
testValidGridTemplate(
"min-content auto auto auto",
"min-content",
'"a a a" "b b b" "c c c" "d d d"',
'"a a a" min-content "b b b" "c c c" "d d d" / min-content',
);
testValidGridTemplate(
"min-content auto auto auto",
"min-content auto auto auto",
'"a a a" "b b b" "c c c" "d d d"',
'"a a a" min-content "b b b" "c c c" "d d d" / min-content auto auto auto',
);
</script>
</body>
</html>

0 comments on commit f4c026a

Please sign in to comment.