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

> Actually, on the surface it seems like this contradicts the spirit of #3886

I see where you're coming from, but I don't see it this way. #3886 is about making sure that an unstyled span (or a span styled in an irrelevant way) doesn't change anything. In the case you're describing, the spans are styled, so they are having an effect. Yes, there's two of them, and they are contiguous, but it is because they are styled in a way that affects line breaking that something happens, not just because we added spans to the markup.

> I think the result this gives will tend to be counter-intuitive [...]
> Given that there isn't currently full interop in this area [...], is this something that we can/should reconsider

I don't find it counter intuitive, so I'd leave it as is, but yes, it does seem that the lack of interop makes it possible to reconsider if we want to.

As for why I think it's fine: the primary purpose of break-word is to deal with east-asian typography. If we think about it in the abstract based on the `abc<span>xyz</span>def` example you gave, your proposal may seem sound, but that example isn't really a use case. If we look at actual use cases, I think it the current definition does the intuitive thing. Examples:

1. turn off breaking in the middle of words but keep breaks between words for Japanese by applying word-break:keep-all to individually marked up words:

  ```css
   p { word-break: break-all; } /* this line optional, defaults are fine*/
  .word { word-break: keep-all; }
  ```
  ```html
   <p><span class=word>日本語を</span><span class=word>文節ごと</span><span class=word>分割する</span>
  ```
2. similar to 1, but turn off middle-of-the-word breaks for a single word (for example, a name, a brand, etc) in the middle of otherwise break-all text
  ```css
   p { word-break: break-all; } /* this line optional, defaults are fine*/
  .name { word-break: keep-all; }
  ```
  ```html
   <p>我叫<span class=name>罗阳</span>。
  ```
3. quoting some old-fashioned space-less text in modern space separated Korean:
  ```css
  :lang(ko) { word-break: keep-all; }
  :lang(zh) { word-break: break-all; }
  ```
  ```html
   <p lang=ko>훈민정음 첫 문장은 <q lang=zh>國之語音異乎中國</q> 입니다.
  ```

Example 3 would work with the rule you proposed as well as the current one, but example 1 or 2 would not work with the rule you propose.

All in all, I think it is a discussion worth having, but my preference would be no change (other than maybe editorial clarifications and additional examples).

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3897#issuecomment-490847382 using your GitHub account

Received on Thursday, 9 May 2019 10:23:22 UTC