[csswg-drafts] [css-text] Does break-spaces + break-word allow breaking before the first trailing white-space ?

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

== [css-text]  Does break-spaces + break-word allow breaking before the first trailing white-space ? ==
According to the spec, 'white-space: break-space' allows breaking AFTER any preserved white space.

https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces
> A line breaking opportunity exists after every preserved white space character, including between white space characters.

Additionally, the spec states the following on 'overflow-wrap: break-word':

https://drafts.csswg.org/css-text-3/#valdef-overflow-wrap-break-word
> An otherwise unbreakable sequence of characters may be broken at an arbitrary point if there are no otherwise-acceptable break points in the line.

So, combining both properties with such values I understand that a there is a breaking opportunity before the first preserved white-space following a word if it overflows. However, this shouldn't be allowed if there are other breaking opportunities before (eg, a leading white-space).

If I understood it correctly, then I think that these two test are somehow contradictory:

- [css/css-text/white-space/break-spaces-003.html](https://github.com/web-platform-tests/wpt/blob/master/css/css-text/white-space/break-spaces-003.html)

- [css/css-text/overflow-wrap/overflow-wrap-break-word-002.html](https://github.com/web-platform-tests/wpt/blob/master/css/css-text/overflow-wrap/overflow-wrap-break-word-002.html)

The first test (break-spaces-003.html) expects the second ' XX' string to be wrapped, preserving the white-space as leading character. However, the second test expects the word to be wrapped after the leading white-space, so that 'FAIL ' goes to the second line. 


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

Received on Wednesday, 17 October 2018 21:23:26 UTC