Skip to content

Commit 4772183

Browse files
kojiishimarcoscaceres
authored andcommitted
[text-autospace][text-spacing-trim] Update text-spacing shorthand
This patch updates the `text-spacing` shorthand parsing: 1. Update the initial value and supported values as per the resolution at: w3c/csswg-drafts#9511 2. Change the logic to handle `normal` as both properties accept `normal` after the spec change above. 3. Fix the canonical order to match the [spec] (`spacing-trim` comes first). Current supported values of longhands are: * `text-autospace`: `normal`, `no-autospace`. * `text-spacing-trim`: `normal`, `trim-start`, `space-all`, `space-first`. The `text-spacing` shorthands support values above and `none`. [spec]: https://drafts.csswg.org/css-text-4/#text-spacing-property Bug: 1463890, 1463891 Change-Id: I8a047f4b87ba728e2f577301b5a1fc3ce824341e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5232448 Reviewed-by: Anders Hartvoll Ruud Commit-Queue: Koji Ishii Cr-Commit-Position: refs/heads/main@{#1251995}
1 parent a9ca4f7 commit 4772183

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

css/css-text/parsing/text-spacing-computed.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,16 @@
2323
test_computed_value("text-spacing", "space-all");
2424

2525
// `text-autospace` and `text-spacing-trim`.
26+
test_computed_value("text-spacing", "normal normal", "normal");
27+
test_computed_value("text-spacing", "normal trim-start", "trim-start");
2628
test_computed_value("text-spacing", "no-autospace normal", "no-autospace");
2729
test_computed_value("text-spacing", "no-autospace space-all", "none");
30+
test_computed_value("text-spacing", "no-autospace trim-start", "trim-start no-autospace");
2831
// Test the reversed order.
32+
test_computed_value("text-spacing", "trim-start normal ", "trim-start");
2933
test_computed_value("text-spacing", "normal no-autospace", "no-autospace");
3034
test_computed_value("text-spacing", "space-all no-autospace", "none");
35+
test_computed_value("text-spacing", "trim-start no-autospace", "trim-start no-autospace");
3136
script>
3237
body>
3338
html>

css/css-text/parsing/text-spacing-invalid.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
test_invalid_value("text-spacing", `${keyword2} ${keyword}`);
1919
}
2020
}
21+
test_invalid_value("text-spacing", `normal normal no-autospace`);
2122
script>
2223
body>
2324
html>

css/css-text/parsing/text-spacing-valid.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@
2222
test_valid_value("text-spacing", "space-all");
2323

2424
// `text-autospace` and `text-spacing-trim`.
25+
test_valid_value("text-spacing", "normal normal", "normal");
26+
test_valid_value("text-spacing", "normal trim-start", "trim-start");
2527
test_valid_value("text-spacing", "no-autospace normal", "no-autospace");
2628
test_valid_value("text-spacing", "no-autospace space-all", "none");
29+
test_valid_value("text-spacing", "no-autospace trim-start", "trim-start no-autospace");
2730
// Test the reversed order.
31+
test_valid_value("text-spacing", "trim-start normal ", "trim-start");
2832
test_valid_value("text-spacing", "normal no-autospace", "no-autospace");
2933
test_valid_value("text-spacing", "space-all no-autospace", "none");
34+
test_valid_value("text-spacing", "trim-start no-autospace", "trim-start no-autospace");
3035
script>
3136
body>
3237
html>

0 commit comments

Comments
 (0)