[css-text] Clarify whether soft breaks exist at boundaries of an inline element with word-break:break-all
· Issue #3897 · w3c/csswg-drafts (original) (raw)
While looking into some Gecko bugs related to word-break
, I'm trying to understand exactly where the break-all
value should be allowing soft line break opportunities, and it's not clear to me that the spec text addresses some edge cases.[1]
Consider an example like <div>abc<span>xyz</span>def</div>
, where the div has word-break:normal
and the span has word-break:break-all
.
It's clear that break opportunities exist between 'x' and 'y', and between 'y' and 'z'. But is there a break opportunity between 'c' and 'x'? Between 'z' and 'd'?
Existing browsers disagree on this: AFAICT, Webkit allows a break between 'c' and 'x', but not between 'z' and 'd', while Blink does not allow it in either of these positions. So if this div is reflowed with a width of 0, Safari will render it as
while Chrome will render as
I can't tell from the spec which of these, if either, is correct; am I overlooking text somewhere that makes this clear, or is it unspecified?
Personally, I think the most intuitive result would be
and would like to patch Gecko such that it would have this behavior - i.e. if the letter on either side of the boundary has word-break:break-all
, then a break opportunity exists. If it's not currently clear in the spec, could we agree that this is the best result and converge on it?
[1] https://drafts.csswg.org/css-text-3/#word-break-property