Closed Bug 1980104 Opened 23 days ago Closed 13 days ago

Style system support for CSS text-autospace

Categories

(Core :: Layout: Block and Inline, enhancement)

enhancement
Points:
2

Tracking

()

RESOLVED FIXED
143 Branch
Tracking Status
firefox143 --- fixed

People

(Reporter: jfkthame, Assigned: TYLin)

References

(Blocks 1 open bug, )

Details

(Keywords: dev-doc-needed, Whiteboard: [jp-mvp], [wptsync upstream])

Attachments

(3 files, 2 obsolete files)

Grammar:

normal | <autospace> | auto

where <autospace> is

no-autospace | [ ideograph-alpha || ideograph-numeric || punctuation ] || [ insert | replace ]

See this issue regarding what the initial value should be.

Once implemented, this should be documented. I assume, this will initially be behind a pref, so it should then be added to https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Experimental_features and BCD.

Sebastian

Keywords: dev-doc-needed

Jonathan, I'm going to pick this up. If you have any WIP or information I could use as a starting point, that would be great!

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED
Flags: needinfo?(jfkthame)

I've attached some WIP patches here for the stylo part of this.

One thing that will need updating is that we're probably not going to implement the 'replace' value at first (note that Chrome doesn't have it either, AFAICT), but as it stands these patches will parse it. So we'll need to split that out behind a separate pref and leave it disabled initially, assuming we only do insert rendering support.

The tests and/or metadata will also need adjusting to reflect that. Probably it'd make sense to split tests for the replace value off from the rest, given that it'll be implemented separately/later.

Flags: needinfo?(jfkthame)
Points: --- → 2
Whiteboard: [jp-mvp]

This patch is based on a WIP by Jonathan Kew <jkew@mozilla.com>
in https://phabricator.services.mozilla.com/D259303

Support for text-autospace: replace is deferred to Bug 1980111, as neither
Chrome nor Safari currently implements it.

use_counter_metrics.yaml is generated by ./mach gen-use-counter-metrics.

For these meta files, the pref layout.css.text-autospace.enabled is added
manually. Other annotations are updated automatically using the following
commands.

./mach wpt testing/web-platform/tests/css/css-text/parsing/text-autospace-* --log-wptreport wptreport.json
./mach wpt-update wptreport.json

Attachment #9504101 - Attachment description: WIP: Bug 1980104 - Update WPT expectations for parsing/text-autospace tests to reflect current grammar and canonical serialization. → Bug 1980104 - Update WPT expectations for parsing/text-autospace tests to reflect current grammar and canonical serialization.
Attachment #9504102 - Attachment is obsolete: true
Attachment #9504100 - Attachment is obsolete: true
Pushed by aethanyc@gmail.com: https://github.com/mozilla-firefox/firefox/commit/24c010439ed2 https://hg.mozilla.org/integration/autoland/rev/3f373b28dab2 Add style system support for the text-autospace property. r=firefox-style-system-reviewers,layout-jp-market-reviewers,emilio,jfkthame https://github.com/mozilla-firefox/firefox/commit/6a61dd844bf7 https://hg.mozilla.org/integration/autoland/rev/f554c23bc3a0 Update WPT expectations for parsing/text-autospace tests to reflect current grammar and canonical serialization. r=layout-jp-market-reviewers,TYLin https://github.com/mozilla-firefox/firefox/commit/2220e07ec052 https://hg.mozilla.org/integration/autoland/rev/04abf2f9b2c3 Update WPT meta files for text-autospace parsing tests. r=layout-jp-market-reviewers,jfkthame
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/54202 for changes under testing/web-platform/tests
Whiteboard: [jp-mvp] → [jp-mvp], [wptsync upstream]
Status: ASSIGNED → RESOLVED
Closed: 13 days ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
Upstream PR merged by moz-wptsync-bot

I have tested this in Firefox Nightly 143.0a1 (2025-08-18) with the flag layout.css.text-autospace.enabled set to true.

I have used this codepen and turning the text-autospace property on and off in devtools has no effect and this appears different to what I see in Safari 18.6 and Chrome Canary 141.0.7362.0.

Am I just missing something here?

Re comment 13:

Am I just missing something here?

Firefox has just added parsing support for text-autospace, but the rendering has not yet ready. If you are still interesting in following the development in Firefox, Bug 1981086 is the bug to keep an eye on. We'll set layout.css.text-autospace.enabled to true when the feature is complete and ready to ship.

QA Whiteboard: [qa-triage-done-c144/b143]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: