[csswg-drafts] [css-text-3] word-break:keep-all and overflow (#4286)

frivoal has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-text-3] word-break:keep-all and overflow ==
`word-break:keep-all` does not suppress all wrapping opportunities, but in languages where the normal behavior is to allow breaking between letters, it suppresses a lot of them. This can lead to overflow if we end up with a particularly long string of unwrappable letters in a somewhat short line. That's not terribly different from having a long english word on a short line, except that this is in a language where the _normal_ behavior is to allow wrapping in the middle of words, so there's an obvious solution as to how to avoid this overflow: revert back to allowing breaks inside words.

(Note: using `overflow-wrap: break-all` or `overflow-wrap: anyhwere` isn't the same, and isn't as good, because they allow wrapping at any point, even those that are unnatural for that language).

If overflow-wrap is normal (which is the common case), [css-text-3](https://drafts.csswg.org/css-text-3/#valdef-overflow-wrap-normal) already says:

> the restrictions introduced by word-break: keep-all may be relaxed to match word-break: normal if there are no otherwise-acceptable break points in the line. 

I'm thinking that the "may" here isn't quite right. Authors should reliably know if using keep-all will cause overflow in some situations, in which case they should deal with it somehow, or if there are built-in protections. And since overflow is bad, I think we ought to deal with it.

Ideally, I'd say we should switch this "may" to a "must", but given the state of implementations, I don't think we should block level 3 on this, so I'd suggest putting it as a should in level 3, add tests to back it up, and make it a must in L4.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4286 using your GitHub account

Received on Monday, 9 September 2019 03:19:37 UTC