[Webkit-unassigned] [Bug 166485] New: CSS hyphens: auto should not work if lang="" is not declared

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 26 15:13:01 PST 2016


https://bugs.webkit.org/show_bug.cgi?id=166485

            Bug ID: 166485
           Summary: CSS hyphens: auto should not work if lang="" is not
                    declared
    Classification: Unclassified
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: zcorpan at gmail.com

Equivalent Chromium bug: https://bugs.chromium.org/p/chromium/issues/detail?id=676270

WebKit hyphenates text with 'hyphens: auto' when no language is declared. Firefox 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.

I don't know if WebKit uses the system language when it is not declared, or if it uses language-agnostic rules, or something else (but does not seem to auto-detect English in my simple test). If it should be automatic, then it seems more reliable to apply language detection than using system language. But I think for now we should just disable it and tell Web developers to specify lang="" correctly.


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>

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20161226/0d8187c7/attachment.html>


More information about the webkit-unassigned mailing list