w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.5k stars 660 forks source link

[css-text] Performance risks of text-wrap:pretty #10785

Open jyasskin opened 2 months ago

jyasskin commented 2 months ago

In the TAG review for text-wrap: pretty, the TAG was worried that if adoption is too widespread, then engines will feel benchmark pressure to make text-wrap: pretty cheaper and less pretty, perhaps reducing it all the way to an alias of text-wrap: auto. There was a suggestion to rename pretty to some term that indicates that the mode has costs as well as benefits.

Could the CSSWG consider whether there's a risk that "too many" sites will adopt this for too many elements and thereby either hurt the web's overall performance or drive implementations to effectively ignore the property value? And if there is that risk, try to find a way to mitigate it.

bfgeek commented 2 months ago

Blink's implementation of pretty has explicitly added guardrails such that the overhead is minimal if a site added it to every paragraph, and during development we measured performance of page load times in this scenario and found it acceptable.

The feedback regarding the naming not indicating the cost is somewhat late, (one year post filing the tag review initially). Given its current relatively high usage I think we'd be opposed any name-change.