CSS hyphens: auto should not work if lang="" is not declared |
||||
Issue descriptionFrom https://bugs.chromium.org/p/chromium/issues/detail?id=605840#c13 > - The language of the page is from the "lang" attribute (e.g., <html lang=en>) or from the system language. This is different from what Firefox does. It will not apply hyphenation if the language is not declared. 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. By hyphenating untagged content, we are introducing an interoperability issue. The system language is also not a great guess at what language the content in a Web page is in. If it should be automatic, then it seems more reliable to apply language detection. But I think for now we should just disable it and tell Web developers to specify lang="" correctly.
,
Dec 21 2016
Test case/demo http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4748 <!DOCTYPE html> <style> div { border:solid; width:150px; 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>
,
Dec 24 2016
Safari 10.0.2 also hyphenates even when no lang attribute is set.
,
Dec 26 2016
,
Jan 8 2017
Spec issue opened: https://github.com/w3c/csswg-drafts/issues/869
,
Feb 15 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Feb 15 2018
,
Sep 16
The spec issue has been resolved to disallow hyphenation when no language is declared. https://github.com/w3c/csswg-drafts/issues/869#issuecomment-394938653
,
Sep 25
,
Sep 25
|
||||
►
Sign in to add a comment |
||||
Comment 1 by kojii@chromium.org
, Dec 21 2016