[csswg-drafts] [css-text-3] Note about overflow-wrap: break-spaces seems wrong

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

== [css-text-3] Note about overflow-wrap: break-spaces seems wrong ==
https://drafts.csswg.org/css-text-3/#propdef-overflow-wrap

`overflow-wrap: break-word` says:

> An otherwise unbreakable sequence of characters may be broken at an arbitrary point if there are no otherwise-acceptable break points in the line.

`overflow-wrap: break-spaces` says:
> Any sequence of preserved white space ... must be broken ... before the first space in the sequence if none would fit and both break-word and break-spaces are specified.

Then, there's a note that says:

> This last clause is due to the fact that 'overflow-wrap: break-words'' allows breaks between any two characters to avoid overflow

But this isn't quite right. `break-word` only kicks in when there are no otherwise-acceptable break points in the line, but `break-spaces` applies in all situations.

Consider the following example, styled with `overflow-wrap: break-word break-spaces`, where the square represents a space character:
<img width="298" alt="screen shot 2017-11-21 at 11 09 21 am" src="https://user-images.githubusercontent.com/918903/33091617-79dc2eda-ceac-11e7-870a-ee39686f3eae.png">
In this situation, `break-word` is irrelevant, so it seems that the entire string should all be on one line.

However, in this example: 
<img width="231" alt="screen shot 2017-11-21 at 11 13 38 am" src="https://user-images.githubusercontent.com/918903/33091831-13666d40-cead-11e7-8293-e1c4e15fc501.png">
`break-word` kicks in, and would find the breaking position between the "t" and the space character, so it seems that the string should break between these characters.

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

Received on Tuesday, 21 November 2017 19:17:52 UTC