Intent to Prototype: CSS text-box-trim and text-box-edge

312 views
Skip to first unread message

Lingqi Chi

unread,
Jan 25, 2024, 2:03:49 AMJan 25
to blink-dev, Koji Ishii

We're resending I2P since the specification will change a lot after this discussion (https://github.com/w3c/csswg-drafts/issues/8829).

For previous I2P, see this link.


Contact emails

lin...@chromium.org, ko...@chromium.org


Explainer

None


Specification

https://drafts.csswg.org/css-inline-3/#text-edges

https://drafts.csswg.org/css-inline-3/#leading-trim 

* Note: the specification is out-of-date. 


Summary

This feature includes two CSS properties,  text-box-trim and text-box-edge.

text-box-trim specifies whether start/end/both sides should be trimmed or not, and text-box-edge specifies how each edge should be trimmed.

These properties allow developers to have precise control over spacing, and ensure font metrics are respected during layout in terms of spacing.


Blink component

Blink>Layout>Inline


Motivation


Developers and designers sometimes find the texts are not visually aligned, as browsers would pad extra spaces to ensure line height without taking the font-reserved space into account.

This feature aims to improve this.




Initial public proposal

https://github.com/w3c/csswg-drafts/issues/5426 

See also https://github.com/w3c/csswg-drafts/issues/8829 which concludes the latest decision.


TAG review

None


TAG review status

Not applicable


Risks

Interoperability and Compatibility

None

Gecko: No signal


WebKit: https://webkit.org/css-status/#property-text-box-edge 

https://webkit.org/blog/13839/release-notes-for-safari-technology-preview-163/   


Web developers: No signals

The community wants browsers to implement and unify this property. https://forum.figma.com/t/text-box-trim-edge-inconsistency-with-browser/52463 


Other signals:


WebView application risks

No



Debuggability

None



Is this feature fully tested by web-platform-tests?

No. Will add more. 


Flag name on chrome://flags

None


Finch feature name

None


Non-finch justification

We do not need an A/B test for it.


Requires code in //chrome?

False


Estimated milestones

No milestones specified


Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1411581 


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5174589850648576 


Links to previous Intent discussions

Intent to prototype: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2B99URLC-V9Zrscj8F%3D%3DkGmnmp0OmNhGB11Uyy%2B-y5ZExSK5MQ%40mail.gmail.com

Reply all
Reply to author
Forward
0 new messages