[csswg-drafts] [css-text] Clarify whether soft breaks exist at boundaries of an inline element with `word-break:break-all` (#3897)

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

== [css-text] Clarify whether soft breaks exist at boundaries of an inline element with `word-break:break-all` ==
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

    abc
    x
    y
    zdef

while Chrome will render as

    abcx
    y
    zdef

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

    abc
    x
    y
    z
    def

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

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

Received on Tuesday, 7 May 2019 17:04:17 UTC