Re: [csswg-drafts] [css-text-4] Add support for content-detection, phrase-based line breaking (#6730)

A few thoughts:

1. I think this (abstract) feature is a good idea. Browsers can do much better in their line breaking than they do.
2. Guarding this behind an opt-in is a good idea for performance
3. I'm not sure that this is implementable today. I'm not aware that either Foundation or ICU has any functionality to determine these breaking locations. Without a demonstration of how to implement this, I'd be against this proposal.
4. As for the mechanism of exposing this in CSS, I don't think I have opinions. We already have `text-wrap: pretty` so this seems like it may want to be another value to the `text-wrap` property.
5. I wonder whether the algorithm for this new line breaking mode would be "it's just like the greedy approach we have today, but the opportunities are in different places" or if it's more complicated like "you can break in some particular position, but there's a cost, and it's only worth it if breaking there means you can choose better positions in the rest of the paragraph"
6. We (or Unicode) would also need to determine how this would work in all languages, not just Japanese. English has phrases, and there is an art of laying out a title (e.g. in print publications). Would it apply there?
7. `wrap-inside:avoid` is kind of similar to `hyphens:manual`, but the real feature here would be the equivalent of `hyphens:auto`. That's why I don't think that `wrap-inside:avoid` is sufficient. You'd want a single switch to flip on this kind of line breaking, rather than having the author have to implement it themselves. And, if the author actually _wants_ to implement it themselves, `wrap-inside:avoid` is there for them, and that will cause consistent renderings across browsers.

-- 
GitHub Notification of comment by litherum
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6730#issuecomment-1043837281 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 18 February 2022 03:47:34 UTC