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 

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


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.


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

Test case/demo:

<!DOCTYPE html>
<style> div { border:solid; width:150px; -webkit-hyphens:auto; 
hyphens:auto; } </style>
No lang
<div>Long words like implementation, initialization, realization, and 
<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 
Received on Sunday, 8 January 2017 21:49:05 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:07 UTC