Bug 60855 - hyphens:auto uses only rules for system language
Summary: hyphens:auto uses only rules for system language
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-15 08:55 PDT by Mathias Nater
Modified: 2011-08-04 13:50 PDT (History)
6 users (show)

See Also:


Attachments
Simple test case; resize window to see different hyphenation points (909 bytes, text/html)
2011-05-15 08:55 PDT, Mathias Nater
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mathias Nater 2011-05-15 08:55:42 PDT
Created attachment 93582 [details]
Simple test case; resize window to see different hyphenation points

If I'm using the CSS3-propery
    hyphens:auto;
I get rather confusing results:
On Safari on iOS all texts are hyphenated using the rules for the system language; regardless of the language of the hyphenated text.
On Webkit (Nightly 6533.21.1, r86499) hyphenation is only performed when the system language of OS X is set to 'English'.

I'd expect
a) Safari on iOS not to hyphenate text in an other language (i.e. when there's a lang-attribute with an other language).
b) Either Webkit on Mac OS X having other hyphenation patterns than just English or support for 'hyphenate-resource' to be able to load patterns.
Comment 1 Mathias Nater 2011-05-15 08:57:55 PDT
Comment on attachment 93582 [details]
Simple test case; resize window to see different hyphenation points

><!DOCTYPE HTML>
><html lang="en">
>    <head>
>        <title>Test1</title>
>        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
>        <style type="text/css">
>            body {
>                width:50%;
>            	margin-left: 25%;
>            	margin-right: 25%;
>            }
>            .hyphenate {
>            	-webkit-hyphens:auto;
>            }
>        </style>
>        </script>
>    </head>
>    <body>
>    	<h2>Paragraph with lang="de" is hyphenated with english patterns</h2>
>		<p class="hyphenate" lang="en">
>			A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart.
>		</p>
>		<p class="hyphenate" lang="de">
>			Eine wunderbare Heiterkeit hat meine ganze Seele eingenommen, gleich den süÃen Frühlingsmorgen, die ich mit ganzem Herzen genieÃe.
>		</p>
>    </body>
></html>
Comment 2 Mathias Nater 2011-05-15 08:58:15 PDT
Comment on attachment 93582 [details]
Simple test case; resize window to see different hyphenation points

><!DOCTYPE HTML>
><html lang="en">
>    <head>
>        <title>Test1</title>
>        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
>        <style type="text/css">
>            body {
>                width:50%;
>            	margin-left: 25%;
>            	margin-right: 25%;
>            }
>            .hyphenate {
>            	-webkit-hyphens:auto;
>            }
>        </style>
>        </script>
>    </head>
>    <body>
>    	<h2>Paragraph with lang="de" is hyphenated with english patterns</h2>
>		<p class="hyphenate" lang="en">
>			A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart.
>		</p>
>		<p class="hyphenate" lang="de">
>			Eine wunderbare Heiterkeit hat meine ganze Seele eingenommen, gleich den süÃen Frühlingsmorgen, die ich mit ganzem Herzen genieÃe.
>		</p>
>    </body>
></html>
Comment 3 mitz 2011-05-15 21:17:05 PDT
You are right that TOT WebKit does not consider the 'lang' attribute when applying hyphenation, and does not support external hyphenation resources. In WebKit nightly builds, you can specify the '-webkit-locale' CSS property to control hyphenation.
Comment 4 mitz 2011-07-20 13:22:29 PDT
In OS X Lion, auto-hyphenation is supported for English (US and GB), German, French, Italian, Dutch and Russian.
Comment 5 Mathias Nater 2011-08-04 13:50:54 PDT
Nice, thanks!