W3C home > Mailing lists > Public > www-style@w3.org > May 2012

Re: [css3-text] overflow-wrap vs word-wrap

From: Kang-Hao (Kenny) Lu <kennyluck@csail.mit.edu>
Date: Thu, 03 May 2012 17:10:36 +0800
Message-ID: <4FA24B8C.7010500@csail.mit.edu>
To: fantasai <fantasai.lists@inkedblade.net>
CC: WWW Style <www-style@w3.org>
(12/05/01 13:01), fantasai wrote:
> On 04/30/2012 08:17 PM, Kang-Hao (Kenny) Lu wrote:
>> But 'word-wrap'/'overflow-wrap' and 'word-break' share a same
>> precondition: they only apply when 'text-wrap' is not 'none'. (This was
>> changed from IE7 to IE8 it seems: in IE9, 'word-wrap' does apply even
>> when 'white-space' is 'nowrap'[1].)
> All of the properties that control line-breaking only apply when text-wrap
> is not 'none'. If 'text-wrap' is none, then you're not allowed to line
> break!

I don't disagree nor do I have any opinion about this. I am just
pointing out this behavior was changed from IE7 to IE8 and remains in
IE9 (all other browsers, including Firefox12, Chromium 18 and
Operal12alpha follow the spec). Did people working on IE say anything
about why they changed this behavior?

>> I believe dividing the line breaking process into "deciding legitimate
>> break point" and "controlling a legitimate break point" is not as
>> intuitive as the following description
>> "word-break: overflow;" breaks the word when it's about to overflow no
>> matter what (i.e. there's no other possible breaking point in the same
>> line).
>> "word-break: break-all;" always break the word.
>> because what authors would care is whether and how words are broken and
>> not complicated logic around "line breaking opportunity". This also
>> disallows "word-break: break-all; word-wrap: break-word;" which is
>> mostly a useless combination. (I doubt there are use cases for
>> "word-break: keep-all; word-wrap: break-word;" too)
> Note that "word-break: break-all" doesn't allow breaks between,
> e.g. きょ or immediately before a period, or between two consecutive
> dashes, whereas word-wrap: break-word means, if it's necessary to
> make it not overflow, you can break *anywhere*.

Indeed, and that's why I said *mostly* but not *completely*:
"word-break: break-all;" *mostly* covers the behavior of "word-wrap:
break-word;" and I doubt there's a use case for the rest that isn't
covered. If you want the text to break everywhere, you should use
"line-break: loose; word-break: break-all;" instead of "word-break:
break-all; word-wrap: break-word;".

> Also if they are all combined, you can't have
> "word/overflow-wrap: break-word; word-break: keep-all", and that
> is a useful combination.

Probably. I am still having doubts that it really has use cases, but in
any case you can still make word-break accept multiple value, so I guess
my proposal is:

  normal | break-all | [ keep-all || (prevent-)overflow ]

Going back to what you said at the beginning.

 (12/05/01 10:07), fantasai wrote:
> The -wrap properties determine whether you're allowed to soft-wrap,
> whereas the -break properties determine a legitimate break point is.
> So there is a logic to that distinction.

I think what's mentally difficult to understand is that, after
'word-break' (and 'line-break') determines where the legitimate break
points are, 'word/overflow-wrap' can still create new break points that
were previously not legitimate. (note that 'text-wrap' only enables or
disables legitimate break points, not creating new ones). Instead of
this, why don't we just provide a mental model saying "the word at the
boundary creates legitimate break point(s) to avoid overflow when

(Having said all these, my opinion here is under the assumption that we
will change the syntax of 'word-wrap' in some way. I don't really think
it's a good idea given concerns about backwards compatibility.)

Received on Thursday, 3 May 2012 09:11:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 11 February 2015 12:35:09 UTC