You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree that it's desirable to have the option of better line-breaking than the default "greedy" algorithm that all browsers have traditionally used.
Such an option needs to be opt-in for authors (rather than simply a change in browser behavior, even though it could be argued to be an overall improvement) because
it has the potential to unexpectedly disrupt the layout of existing content
in some cases (especially editable content) the stability of the greedy algorithm may be preferred
a "prettier" algorithm is likely to come at significant performance cost
Therefore, in principle I'm in favor of text-wrap-style: pretty (or some similar/equivalent mechanism)
Having said that, I do have some concerns:
From an implementation point of view, it may be difficult to fully implement something akin to Knuth-Plass line breaking, which I think is the common understanding of what "pretty" ought to mean, or at least a good guide. The interaction with other aspects of CSS (such as floats and fragmentation) can make things pretty complex. (More so than in TeX, for instance.)
Some implementers (I'm particularly looking at Blink here) seem to have focused quite narrowly on preventing short last lines. I believe this is an inadequate approach that fails to deliver what text-wrap-style: pretty promises, and indeed in some cases can make a block/paragraph look substantially worse than its default layout. I would be quite unhappy to see anyone ship such a crippled implementation of `text-wrap-style: pretty", as
it has the potential to significantly mislead authors as to what they should expect from the feature
if it becomes widely used in that state, it may create compat problems for eventually shipping more complete versions.
Reacted by R. N. West (Nat), Yisi, Caleb Jasik and Saku Erla
Activity
zcorpan commentedon Mar 11, 2024
@jfkthame thoughts?
jfkthame commentedon Mar 11, 2024
A couple of things come to mind:
text-wrap-style: pretty(or some similar/equivalent mechanism)Having said that, I do have some concerns:
text-wrap-style: prettypromises, and indeed in some cases can make a block/paragraph look substantially worse than its default layout. I would be quite unhappy to see anyone ship such a crippled implementation of `text-wrap-style: pretty", as[-]CSS `text-wrap-style: pretty` property[/-][+]CSS `text-wrap-style: pretty`[/+]