W3C home > Mailing lists > Public > public-css-archive@w3.org > January 2017

[csswg-drafts] [css-text] Should 'hyphens: auto' work if lang="" is not declared?

From: Simon Pieters via GitHub <sysbot+gh@w3.org>
Date: Sun, 08 Jan 2017 21:48:59 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-199449479-1483912138-sysbot+gh@w3.org>
zcorpan has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [css-text] Should 'hyphens: auto' work if lang="" is not declared? 
==
https://drafts.csswg.org/css-text-3/#hyphens-property

See
https://bugs.webkit.org/show_bug.cgi?id=166485
https://bugs.chromium.org/p/chromium/issues/detail?id=676270

WebKit and Chromium hyphenate text with 'hyphens: auto' when no 
language is declared. Gecko does not.

MDN says:

> Hyphenation rules are language-specific. In HTML, the language is 
determined by the lang attribute, and browsers will hyphenate only if 
this attribute is present and if an appropriate hyphenation dictionary
 is available.

Spec says:

> Correct automatic hyphenation requires a hyphenation resource 
appropriate to the language of the text being broken. The UA is 
therefore only required to automatically hyphenate text for which the 
content language is known and for which it has an appropriate 
hyphenation resource.
>
> Authors should correctly tag their content’s language (e.g. using 
the HTML lang attribute) in order to obtain correct automatic 
hyphenation. UAs may refuse to automatically hyphenate untagged 
content regardless of the hyphens property value.

https://drafts.csswg.org/css-text-3/#valdef-hyphens-auto

Now the spec doesn't forbid it, but I think the intent is that UAs 
should not hyphenate untagged content. (Correct?)

Test case/demo:
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4761

```
<!DOCTYPE html>
<style> div { border:solid; width:150px; -webkit-hyphens:auto; 
hyphens:auto; } </style>
No lang
<div>Long words like implementation, initialization, realization, and 
hyphenation.</div>
lang=en-US
<div lang=en-US>Long words like implementation, initialization, 
realization, and hyphenation.</div>
```

In the WebKit bug there is resistance to changing their behavior to 
that of Gecko.

I think it would be good to figure out what behavior we ideally want 
browsers to have when the language is not declared, and put that in 
the spec so we can achieve interoperable behavior for this case.

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/869 using your GitHub 
account
Received on Sunday, 8 January 2017 21:49:05 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 24 March 2022 20:26:37 UTC