Skip to content

Commit

Permalink
[text-autospace][text-spacing-trim] Update text-spacing shorthand
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kojiishi authored and chromium-wpt-export-bot committed Jan 24, 2024
1 parent e0a5f38 commit 70ebdbf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions css/css-text/parsing/text-spacing-computed.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@
test_computed_value("text-spacing", "space-all");

// `text-autospace` and `text-spacing-trim`.
test_computed_value("text-spacing", "normal normal", "normal");
test_computed_value("text-spacing", "normal trim-start", "trim-start");
test_computed_value("text-spacing", "no-autospace normal", "no-autospace");
test_computed_value("text-spacing", "no-autospace space-all", "none");
test_computed_value("text-spacing", "no-autospace trim-start", "trim-start no-autospace");
// Test the reversed order.
test_computed_value("text-spacing", "trim-start normal ", "trim-start");
test_computed_value("text-spacing", "normal no-autospace", "no-autospace");
test_computed_value("text-spacing", "space-all no-autospace", "none");
test_computed_value("text-spacing", "trim-start no-autospace", "trim-start no-autospace");
</script>
</body>
</html>
5 changes: 5 additions & 0 deletions css/css-text/parsing/text-spacing-valid.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@
test_valid_value("text-spacing", "space-all");

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

0 comments on commit 70ebdbf

Please sign in to comment.