Skip to content

Commit

Permalink
Adjust syntax of text-spacing[-trim] to match CSSWG resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
frivoal committed Dec 21, 2023
1 parent 8ac73b1 commit 028df8b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 22 deletions.
9 changes: 3 additions & 6 deletions css/css-text/parsing/text-spacing-computed.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@
test_computed_value("text-spacing", "no-autospace");

// `text-spacing-trim`.
test_computed_value("text-spacing", "space-first", "normal");
test_computed_value("text-spacing", "trim-start");
test_computed_value("text-spacing", "space-all");
// Two values syntax.
test_computed_value("text-spacing", "allow-end space-first");
test_computed_value("text-spacing", "space-first allow-end", "allow-end space-first");

// `text-autospace` and `text-spacing-trim`.
test_computed_value("text-spacing", "no-autospace space-first", "no-autospace");
test_computed_value("text-spacing", "no-autospace normal", "no-autospace");
test_computed_value("text-spacing", "no-autospace space-all", "none");
// Test the reversed order.
test_computed_value("text-spacing", "space-first no-autospace", "no-autospace");
test_computed_value("text-spacing", "normal no-autospace", "no-autospace");
test_computed_value("text-spacing", "space-all no-autospace", "none");
</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion css/css-text/parsing/text-spacing-invalid.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<body>
<script>
// These keywords must appear alone.
for (const keyword of ['normal', 'none', 'auto']) {
for (const keyword of ['none', 'auto']) {
test_invalid_value("text-spacing", `${keyword} ${keyword}`);
for (const keyword2 of ['no-autospace', 'space-first']) {
test_invalid_value("text-spacing", `${keyword} ${keyword2}`);
Expand Down
6 changes: 2 additions & 4 deletions css/css-text/parsing/text-spacing-trim-computed.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
<div id="target"></div>
<script>
test_computed_value("text-spacing-trim", "auto");
test_computed_value("text-spacing-trim", "normal");
test_computed_value("text-spacing-trim", "space-all");
test_computed_value("text-spacing-trim", "trim-auto");
test_computed_value("text-spacing-trim", "trim-all");
test_computed_value("text-spacing-trim", "allow-end");
test_computed_value("text-spacing-trim", "trim-start");
test_computed_value("text-spacing-trim", "space-first");

test_computed_value("text-spacing-trim", "allow-end space-first");
test_computed_value("text-spacing-trim", "space-first allow-end", "allow-end space-first");
</script>
</body>
</html>
5 changes: 4 additions & 1 deletion css/css-text/parsing/text-spacing-trim-invalid.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
</head>
<body>
<script>
test_invalid_value("text-spacing-trim", "normal");
test_invalid_value("text-spacing-trim", "none");
test_invalid_value("text-spacing-trim", "normal space-all");
test_invalid_value("text-spacing-trim", "normal space-first");
test_invalid_value("text-spacing-trim", "auto space-all");
test_invalid_value("text-spacing-trim", "auto space-first");
test_invalid_value("text-spacing-trim", "allow-end");
test_invalid_value("text-spacing-trim", "allow-end space-first");
test_invalid_value("text-spacing-trim", "space-first allow-end");
</script>
</body>
</html>
6 changes: 2 additions & 4 deletions css/css-text/parsing/text-spacing-trim-valid.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
</head>
<body>
<script>
test_valid_value("text-spacing-trim", "normal");
test_valid_value("text-spacing-trim", "auto");
test_valid_value("text-spacing-trim", "space-all");
test_valid_value("text-spacing-trim", "trim-auto");
test_valid_value("text-spacing-trim", "trim-all");
test_valid_value("text-spacing-trim", "allow-end");
test_valid_value("text-spacing-trim", "trim-start");
test_valid_value("text-spacing-trim", "space-first");

test_valid_value("text-spacing-trim", "allow-end space-first");
test_valid_value("text-spacing-trim", "space-first allow-end");
</script>
</body>
</html>
9 changes: 3 additions & 6 deletions css/css-text/parsing/text-spacing-valid.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@
test_valid_value("text-spacing", "no-autospace");

// `text-spacing-trim`.
test_valid_value("text-spacing", "space-first", "normal");
test_valid_value("text-spacing", "trim-start");
test_valid_value("text-spacing", "space-all");
// Two values syntax.
test_valid_value("text-spacing", "allow-end space-first");
test_valid_value("text-spacing", "space-first allow-end", "allow-end space-first");

// `text-autospace` and `text-spacing-trim`.
test_valid_value("text-spacing", "no-autospace space-first", "no-autospace");
test_valid_value("text-spacing", "no-autospace normal", "no-autospace");
test_valid_value("text-spacing", "no-autospace space-all", "none");
// Test the reversed order.
test_valid_value("text-spacing", "space-first no-autospace", "no-autospace");
test_valid_value("text-spacing", "normal no-autospace", "no-autospace");
test_valid_value("text-spacing", "space-all no-autospace", "none");
</script>
</body>
Expand Down

0 comments on commit 028df8b

Please sign in to comment.