<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[183584] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/183584">183584</a></dd>
<dt>Author</dt> <dd>mrobinson@webkit.org</dd>
<dt>Date</dt> <dd>2015-04-29 15:46:15 -0700 (Wed, 29 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Add support for automatic hyphenation
https://bugs.webkit.org/show_bug.cgi?id=44478

Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/FindHyphen.cmake: Added. A CMake module for finding libhyphen.
* Source/cmake/OptionsGTK.cmake: Look for libhyphen and enable hyphenation if found.
* Source/cmakeconfig.h.cmake: Pass through the whether libhyphen is enabled.

Source/WebCore:

No new tests. This patch unskips and updates results for existing hyphenation tests.

* PlatformGTK.cmake: Add the libhypen implementation to the source list.
* platform/gtk/GtkUtilities.cpp:
(WebCore::topLevelPath): Add this helper function taken from the test harness.
(WebCore::getWebKitBuildDirectory): Ditto.
* platform/gtk/GtkUtilities.h: Add function declarations for the helper functions.
* platform/text/Hyphenation.cpp: Surround this implementation with !USE(LIBHYPHEN),
  so that it can still be shared.
* platform/text/gtk/HyphenationLibHyphen.cpp: Added.
(WebCore::extractLocaleFromDictionaryFilePath): Take in a dictionary filename and
determine the locale that it covers.
(WebCore::scanDirectoryForDicionaries): Look for all installed dictionaries as well
as ones in the JHBuild root for testing.
(WebCore::scanTestDictionariesDirectoryIfNecessary): Try to scan the dictionaries installed
in the JHBuild root.
(WebCore::availableLocales): Getter for global hash of installed dictionaries.
(WebCore::canHyphenate): Added libhyphen implementation.
(WebCore::HyphenationDictionary): Helper class that properly manages the memory of
an open libhyphen dictionary. This is useful so that they can be stored in an MRU
cache. This is a similar approach to the CoreFoundation implementation.
(WebCore::AtomicStringKeyedMRUCache&lt;RefPtr&lt;HyphenationDictionary&gt;&gt;::createValueForNullKey): MRU cache
helper.
(WebCore::AtomicStringKeyedMRUCache&lt;RefPtr&lt;HyphenationDictionary&gt;&gt;::createValueForKey): Ditto.
(WebCore::hyphenDictionaryCache): A cache for opened hyphenation dictionaries.
(WebCore::countLeadingSpaces): Count leading spaces, since WebCore often passes words with them.
(WebCore::lastHyphenLocation): Added libhyphen implementation.

Tools:

* gtk/jhbuild.modules: Add a module for testing dictionaries, so that
all systems will use the same dictionaries for testing purposes.

LayoutTests:

* platform/gtk/TestExpectations: Unskip most hyphenation tests.
* platform/gtk/fast/text/hyphenate-character-expected.png: Added.
* platform/gtk/fast/text/hyphenate-character-expected.txt:
* platform/gtk/fast/text/hyphenate-first-word-expected.png: Added.
* platform/gtk/fast/text/hyphenate-first-word-expected.txt:
* platform/gtk/fast/text/hyphenate-limit-before-after-expected.png:
* platform/gtk/fast/text/hyphenate-limit-before-after-expected.txt:
* platform/gtk/fast/text/hyphenate-limit-lines-expected.png:
* platform/gtk/fast/text/hyphenate-limit-lines-expected.txt:
* platform/gtk/fast/text/hyphenate-locale-expected.png: Added.
* platform/gtk/fast/text/hyphenate-locale-expected.txt:
* platform/gtk/fast/text/hyphens-expected.png: Added.
* platform/gtk/fast/text/hyphens-expected.txt:
* platform/gtk/fast/text/word-break-soft-hyphen-expected.png:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkChangeLog">trunk/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformgtkfasttexthyphenatecharacterexpectedtxt">trunk/LayoutTests/platform/gtk/fast/text/hyphenate-character-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformgtkfasttexthyphenatefirstwordexpectedtxt">trunk/LayoutTests/platform/gtk/fast/text/hyphenate-first-word-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformgtkfasttexthyphenatelimitbeforeafterexpectedpng">trunk/LayoutTests/platform/gtk/fast/text/hyphenate-limit-before-after-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformgtkfasttexthyphenatelimitbeforeafterexpectedtxt">trunk/LayoutTests/platform/gtk/fast/text/hyphenate-limit-before-after-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformgtkfasttexthyphenatelimitlinesexpectedpng">trunk/LayoutTests/platform/gtk/fast/text/hyphenate-limit-lines-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformgtkfasttexthyphenatelimitlinesexpectedtxt">trunk/LayoutTests/platform/gtk/fast/text/hyphenate-limit-lines-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformgtkfasttexthyphenatelocaleexpectedtxt">trunk/LayoutTests/platform/gtk/fast/text/hyphenate-locale-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformgtkfasttexthyphensexpectedtxt">trunk/LayoutTests/platform/gtk/fast/text/hyphens-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformgtkfasttextwordbreaksofthyphenexpectedpng">trunk/LayoutTests/platform/gtk/fast/text/word-break-soft-hyphen-expected.png</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformGTKcmake">trunk/Source/WebCore/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkGtkUtilitiescpp">trunk/Source/WebCore/platform/gtk/GtkUtilities.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkGtkUtilitiesh">trunk/Source/WebCore/platform/gtk/GtkUtilities.h</a></li>
<li><a href="#trunkSourceWebCoreplatformtextHyphenationcpp">trunk/Source/WebCore/platform/text/Hyphenation.cpp</a></li>
<li><a href="#trunkSourcecmakeOptionsGTKcmake">trunk/Source/cmake/OptionsGTK.cmake</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsgtkjhbuildmodules">trunk/Tools/gtk/jhbuild.modules</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformgtkfasttexthyphenatecharacterexpectedpng">trunk/LayoutTests/platform/gtk/fast/text/hyphenate-character-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformgtkfasttexthyphenatefirstwordexpectedpng">trunk/LayoutTests/platform/gtk/fast/text/hyphenate-first-word-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformgtkfasttexthyphenatelocaleexpectedpng">trunk/LayoutTests/platform/gtk/fast/text/hyphenate-locale-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformgtkfasttexthyphensexpectedpng">trunk/LayoutTests/platform/gtk/fast/text/hyphens-expected.png</a></li>
<li><a href="#trunkSourceWebCoreplatformtextgtkHyphenationLibHyphencpp">trunk/Source/WebCore/platform/text/gtk/HyphenationLibHyphen.cpp</a></li>
<li><a href="#trunkSourcecmakeFindHyphencmake">trunk/Source/cmake/FindHyphen.cmake</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/ChangeLog (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/ChangeLog        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/ChangeLog        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-04-29  Martin Robinson  &lt;mrobinson@igalia.com&gt;
+
+        [GTK] Add support for automatic hyphenation
+        https://bugs.webkit.org/show_bug.cgi?id=44478
+
+        Reviewed by Carlos Garcia Campos.
+
+        * Source/cmake/FindHyphen.cmake: Added. A CMake module for finding libhyphen.
+        * Source/cmake/OptionsGTK.cmake: Look for libhyphen and enable hyphenation if found.
+        * Source/cmakeconfig.h.cmake: Pass through the whether libhyphen is enabled.
+
</ins><span class="cx"> 2015-04-29  Jake Nielsen  &lt;jacob_nielsen@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Failure when building WebKit for appletvsimulator.
</span></span></pre></div>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/LayoutTests/ChangeLog        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2015-04-29  Martin Robinson  &lt;mrobinson@igalia.com&gt;
+
+        [GTK] Add support for automatic hyphenation
+        https://bugs.webkit.org/show_bug.cgi?id=44478
+
+        Reviewed by Carlos Garcia Campos.
+
+        * platform/gtk/TestExpectations: Unskip most hyphenation tests.
+        * platform/gtk/fast/text/hyphenate-character-expected.png: Added.
+        * platform/gtk/fast/text/hyphenate-character-expected.txt:
+        * platform/gtk/fast/text/hyphenate-first-word-expected.png: Added.
+        * platform/gtk/fast/text/hyphenate-first-word-expected.txt:
+        * platform/gtk/fast/text/hyphenate-limit-before-after-expected.png:
+        * platform/gtk/fast/text/hyphenate-limit-before-after-expected.txt:
+        * platform/gtk/fast/text/hyphenate-limit-lines-expected.png:
+        * platform/gtk/fast/text/hyphenate-limit-lines-expected.txt:
+        * platform/gtk/fast/text/hyphenate-locale-expected.png: Added.
+        * platform/gtk/fast/text/hyphenate-locale-expected.txt:
+        * platform/gtk/fast/text/hyphens-expected.png: Added.
+        * platform/gtk/fast/text/hyphens-expected.txt:
+        * platform/gtk/fast/text/word-break-soft-hyphen-expected.png:
+
</ins><span class="cx"> 2015-04-29  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Simple line layout: Web process spins endlessly below layoutSimpleLines.
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -1676,13 +1676,6 @@
</span><span class="cx"> # keygen element rendering is broken
</span><span class="cx"> webkit.org/b/54136 http/tests/misc/submit-post-keygen.html [ Failure ]
</span><span class="cx"> 
</span><del>-# [GTK] GTK+ does not support hyphenation
-webkit.org/b/44478 fast/text/hyphenate-character.html [ Skip ]
-webkit.org/b/44478 fast/text/hyphens.html [ Skip ]
-webkit.org/b/44478 fast/text/hyphenate-first-word.html [ Skip ]
-webkit.org/b/44478 fast/text/hyphenate-locale.html [ Skip ]
-webkit.org/b/44478 fast/text/hyphen-min-preferred-width.html [ Skip ]
-
</del><span class="cx"> webkit.org/b/122021 media/video-controls-captions-trackmenu.html [ Failure ]
</span><span class="cx"> webkit.org/b/123097 media/track/track-user-preferences.html [ Skip ]
</span><span class="cx"> webkit.org/b/121995 media/video-controls-captions-trackmenu-includes-enabled-track.html [ Failure ]
</span><span class="lines">@@ -2418,6 +2411,8 @@
</span><span class="cx"> webkit.org/b/143471 canvas/philip/tests/2d.drawImage.animated.poster.html [ Failure ]
</span><span class="cx"> webkit.org/b/143871 svg/W3C-SVG-1.1-SE/linking-uri-01-b.svg [ Failure ]
</span><span class="cx"> 
</span><ins>+webkit.org/b/143924 fast/text/hyphen-min-preferred-width.html [ Skip ]
+
</ins><span class="cx"> #////////////////////////////////////////////////////////////////////////////////////////
</span><span class="cx"> # End of Tests failing
</span><span class="cx"> #////////////////////////////////////////////////////////////////////////////////////////
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkfasttexthyphenatecharacterexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/gtk/fast/text/hyphenate-character-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/gtk/fast/text/hyphenate-character-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformgtkfasttexthyphenatecharacterexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/fast/text/hyphenate-character-expected.txt (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/fast/text/hyphenate-character-expected.txt        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/LayoutTests/platform/gtk/fast/text/hyphenate-character-expected.txt        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -3,103 +3,107 @@
</span><span class="cx"> layer at (0,0) size 800x600
</span><span class="cx">   RenderBlock {HTML} at (0,0) size 800x600
</span><span class="cx">     RenderBody {BODY} at (8,8) size 784x584
</span><del>-      RenderBlock (floating) {DIV} at (4,0) size 344x274
</del><ins>+      RenderBlock (floating) {DIV} at (4,0) size 344x264
</ins><span class="cx">         RenderBlock {P} at (0,16) size 344x18
</span><del>-          RenderText {#text} at (0,0) size 208x17
-            text run at (0,0) width 208: &quot;The initial value (should be like &quot;
-          RenderInline {TT} at (0,0) size 33x15
-            RenderText {#text} at (207,3) size 33x15
-              text run at (207,3) width 33: &quot;auto&quot;
-          RenderText {#text} at (239,0) size 6x17
-            text run at (239,0) width 6: &quot;)&quot;
-        RenderBlock {DIV} at (0,50) size 344x224 [border: (3px solid #000000)]
</del><ins>+          RenderText {#text} at (0,0) size 203x17
+            text run at (0,0) width 203: &quot;The initial value (should be like &quot;
+          RenderInline {TT} at (0,0) size 32x15
+            RenderText {#text} at (203,3) size 32x15
+              text run at (203,3) width 32: &quot;auto&quot;
+          RenderText {#text} at (235,0) size 5x17
+            text run at (235,0) width 5: &quot;)&quot;
+        RenderBlock {DIV} at (0,50) size 344x214 [border: (3px solid #000000)]
</ins><span class="cx">           RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
</span><del>-          RenderText {#text} at (7,7) size 330x209
</del><ins>+          RenderText {#text} at (7,7) size 330x200
</ins><span class="cx">             text run at (7,7) width 245: &quot;The chief difficulty Alice found&quot;
</span><del>-            text run at (7,28) width 245: &quot;at first was in managing her&quot;
-            text run at (7,49) width 245: &quot;flamingo: she succeeded in&quot;
-            text run at (7,70) width 245: &quot;getting its body tucked away,&quot;
-            text run at (7,91) width 245: &quot;comfortably enough, under her&quot;
-            text run at (7,112) width 307: &quot;arm, with its legs hanging down, &quot;
-            text run at (313,112) width 24: &quot;but&quot;
-            text run at (7,133) width 330: &quot;generally, just as she had got its neck nicely&quot;
-            text run at (7,154) width 96: &quot;straightened &quot;
-            text run at (102,154) width 235: &quot;out, and was going to give the&quot;
-            text run at (7,175) width 245: &quot;hedgehog a blow with its head, it &quot;
-            text run at (251,175) width 86: &quot;would twist&quot;
-            text run at (7,196) width 271: &quot;itself round and look up in her face\x{2026}&quot;
-      RenderBlock (floating) {DIV} at (356,0) size 344x274
</del><ins>+            text run at (7,27) width 245: &quot;at first was in managing her&quot;
+            text run at (7,47) width 245: &quot;flamingo: she succeeded in ge&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (7,67) width 222: &quot;tting its body tucked away, &quot;
+            text run at (229,67) width 23: &quot;co&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (7,87) width 245: &quot;mfortably enough, under her&quot;
+            text run at (7,107) width 248: &quot;arm, with its legs hanging down, &quot;
+            text run at (254,107) width 83: &quot;but genera&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (7,127) width 330: &quot;lly, just as she had got its neck nicely&quot;
+            text run at (7,147) width 96: &quot;straightened &quot;
+            text run at (102,147) width 235: &quot;out, and was going to give the&quot;
+            text run at (7,167) width 285: &quot;hedgehog a blow with its head, it &quot;
+            text run at (292,167) width 45: &quot;would&quot;
+            text run at (7,187) width 314: &quot;twist itself round and look up in her face\x{2026}&quot;
+      RenderBlock (floating) {DIV} at (356,0) size 344x264
</ins><span class="cx">         RenderBlock {P} at (0,16) size 344x18
</span><del>-          RenderText {#text} at (0,0) size 83x17
-            text run at (0,0) width 83: &quot;The default (&quot;
-          RenderInline {TT} at (0,0) size 196x15
-            RenderText {#text} at (82,3) size 196x15
-              text run at (82,3) width 196: &quot;hyphenate-character: auto&quot;
-          RenderText {#text} at (277,0) size 6x17
-            text run at (277,0) width 6: &quot;)&quot;
-        RenderBlock {DIV} at (0,50) size 344x224 [border: (3px solid #000000)]
</del><ins>+          RenderText {#text} at (0,0) size 81x17
+            text run at (0,0) width 81: &quot;The default (&quot;
+          RenderInline {TT} at (0,0) size 200x15
+            RenderText {#text} at (81,3) size 200x15
+              text run at (81,3) width 200: &quot;hyphenate-character: auto&quot;
+          RenderText {#text} at (281,0) size 5x17
+            text run at (281,0) width 5: &quot;)&quot;
+        RenderBlock {DIV} at (0,50) size 344x214 [border: (3px solid #000000)]
</ins><span class="cx">           RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
</span><del>-          RenderText {#text} at (7,7) size 330x209
</del><ins>+          RenderText {#text} at (7,7) size 330x200
</ins><span class="cx">             text run at (7,7) width 245: &quot;The chief difficulty Alice found&quot;
</span><del>-            text run at (7,28) width 245: &quot;at first was in managing her&quot;
-            text run at (7,49) width 245: &quot;flamingo: she succeeded in&quot;
-            text run at (7,70) width 245: &quot;getting its body tucked away,&quot;
-            text run at (7,91) width 245: &quot;comfortably enough, under her&quot;
-            text run at (7,112) width 307: &quot;arm, with its legs hanging down, &quot;
-            text run at (313,112) width 24: &quot;but&quot;
-            text run at (7,133) width 330: &quot;generally, just as she had got its neck nicely&quot;
-            text run at (7,154) width 96: &quot;straightened &quot;
-            text run at (102,154) width 235: &quot;out, and was going to give the&quot;
-            text run at (7,175) width 245: &quot;hedgehog a blow with its head, it &quot;
-            text run at (251,175) width 86: &quot;would twist&quot;
-            text run at (7,196) width 271: &quot;itself round and look up in her face\x{2026}&quot;
-      RenderBlock (floating) {DIV} at (4,274) size 344x274
</del><ins>+            text run at (7,27) width 245: &quot;at first was in managing her&quot;
+            text run at (7,47) width 245: &quot;flamingo: she succeeded in ge&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (7,67) width 222: &quot;tting its body tucked away, &quot;
+            text run at (229,67) width 23: &quot;co&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (7,87) width 245: &quot;mfortably enough, under her&quot;
+            text run at (7,107) width 248: &quot;arm, with its legs hanging down, &quot;
+            text run at (254,107) width 83: &quot;but genera&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (7,127) width 330: &quot;lly, just as she had got its neck nicely&quot;
+            text run at (7,147) width 96: &quot;straightened &quot;
+            text run at (102,147) width 235: &quot;out, and was going to give the&quot;
+            text run at (7,167) width 285: &quot;hedgehog a blow with its head, it &quot;
+            text run at (292,167) width 45: &quot;would&quot;
+            text run at (7,187) width 314: &quot;twist itself round and look up in her face\x{2026}&quot;
+      RenderBlock (floating) {DIV} at (4,264) size 344x264
</ins><span class="cx">         RenderBlock {P} at (0,16) size 344x18
</span><del>-          RenderText {#text} at (0,0) size 49x17
-            text run at (0,0) width 49: &quot;Bullet (&quot;
-          RenderInline {TT} at (0,0) size 219x15
-            RenderText {#text} at (48,3) size 219x15
-              text run at (48,3) width 219: &quot;hyphenate-character: \&quot;\\2022\&quot;&quot;
-          RenderText {#text} at (266,0) size 7x17
-            text run at (266,0) width 7: &quot;)&quot;
-        RenderBlock {DIV} at (0,50) size 344x224 [border: (3px solid #000000)]
</del><ins>+          RenderText {#text} at (0,0) size 47x17
+            text run at (0,0) width 47: &quot;Bullet (&quot;
+          RenderInline {TT} at (0,0) size 224x15
+            RenderText {#text} at (47,3) size 224x15
+              text run at (47,3) width 224: &quot;hyphenate-character: \&quot;\\2022\&quot;&quot;
+          RenderText {#text} at (271,0) size 5x17
+            text run at (271,0) width 5: &quot;)&quot;
+        RenderBlock {DIV} at (0,50) size 344x214 [border: (3px solid #000000)]
</ins><span class="cx">           RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
</span><del>-          RenderText {#text} at (7,7) size 330x209
</del><ins>+          RenderText {#text} at (7,7) size 330x200
</ins><span class="cx">             text run at (7,7) width 245: &quot;The chief difficulty Alice found&quot;
</span><del>-            text run at (7,28) width 245: &quot;at first was in managing her&quot;
-            text run at (7,49) width 245: &quot;flamingo: she succeeded in&quot;
-            text run at (7,70) width 245: &quot;getting its body tucked away,&quot;
-            text run at (7,91) width 245: &quot;comfortably enough, under her&quot;
-            text run at (7,112) width 307: &quot;arm, with its legs hanging down, &quot;
-            text run at (313,112) width 24: &quot;but&quot;
-            text run at (7,133) width 330: &quot;generally, just as she had got its neck nicely&quot;
-            text run at (7,154) width 96: &quot;straightened &quot;
-            text run at (102,154) width 235: &quot;out, and was going to give the&quot;
-            text run at (7,175) width 245: &quot;hedgehog a blow with its head, it &quot;
-            text run at (251,175) width 86: &quot;would twist&quot;
-            text run at (7,196) width 271: &quot;itself round and look up in her face\x{2026}&quot;
-      RenderBlock (floating) {DIV} at (356,274) size 356x274
-        RenderBlock {P} at (0,16) size 356x18
-          RenderText {#text} at (0,0) size 140x17
-            text run at (0,0) width 140: &quot;Middle dot and tilde (&quot;
-          RenderInline {TT} at (0,0) size 212x15
-            RenderText {#text} at (139,3) size 212x15
-              text run at (139,3) width 212: &quot;hyphenate-character: \&quot;\\B7~\&quot;&quot;
-          RenderText {#text} at (350,0) size 6x17
-            text run at (350,0) width 6: &quot;)&quot;
-        RenderBlock {DIV} at (0,50) size 344x224 [border: (3px solid #000000)]
</del><ins>+            text run at (7,27) width 245: &quot;at first was in managing her&quot;
+            text run at (7,47) width 245: &quot;flamingo: she succeeded in ge&quot; + hyphen string &quot;\x{2022}&quot;
+            text run at (7,67) width 222: &quot;tting its body tucked away, &quot;
+            text run at (229,67) width 23: &quot;co&quot; + hyphen string &quot;\x{2022}&quot;
+            text run at (7,87) width 245: &quot;mfortably enough, under her&quot;
+            text run at (7,107) width 248: &quot;arm, with its legs hanging down, &quot;
+            text run at (254,107) width 83: &quot;but genera&quot; + hyphen string &quot;\x{2022}&quot;
+            text run at (7,127) width 330: &quot;lly, just as she had got its neck nicely&quot;
+            text run at (7,147) width 96: &quot;straightened &quot;
+            text run at (102,147) width 235: &quot;out, and was going to give the&quot;
+            text run at (7,167) width 285: &quot;hedgehog a blow with its head, it &quot;
+            text run at (292,167) width 45: &quot;would&quot;
+            text run at (7,187) width 314: &quot;twist itself round and look up in her face\x{2026}&quot;
+      RenderBlock (floating) {DIV} at (356,264) size 357x264
+        RenderBlock {P} at (0,16) size 357x18
+          RenderText {#text} at (0,0) size 136x17
+            text run at (0,0) width 136: &quot;Middle dot and tilde (&quot;
+          RenderInline {TT} at (0,0) size 216x15
+            RenderText {#text} at (136,3) size 216x15
+              text run at (136,3) width 216: &quot;hyphenate-character: \&quot;\\B7~\&quot;&quot;
+          RenderText {#text} at (352,0) size 5x17
+            text run at (352,0) width 5: &quot;)&quot;
+        RenderBlock {DIV} at (0,50) size 344x214 [border: (3px solid #000000)]
</ins><span class="cx">           RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
</span><del>-          RenderText {#text} at (7,7) size 330x209
</del><ins>+          RenderText {#text} at (7,7) size 330x200
</ins><span class="cx">             text run at (7,7) width 245: &quot;The chief difficulty Alice found&quot;
</span><del>-            text run at (7,28) width 245: &quot;at first was in managing her&quot;
-            text run at (7,49) width 245: &quot;flamingo: she succeeded in&quot;
-            text run at (7,70) width 245: &quot;getting its body tucked away,&quot;
-            text run at (7,91) width 245: &quot;comfortably enough, under her&quot;
-            text run at (7,112) width 307: &quot;arm, with its legs hanging down, &quot;
-            text run at (313,112) width 24: &quot;but&quot;
-            text run at (7,133) width 330: &quot;generally, just as she had got its neck nicely&quot;
-            text run at (7,154) width 96: &quot;straightened &quot;
-            text run at (102,154) width 235: &quot;out, and was going to give the&quot;
-            text run at (7,175) width 245: &quot;hedgehog a blow with its head, it &quot;
-            text run at (251,175) width 86: &quot;would twist&quot;
-            text run at (7,196) width 271: &quot;itself round and look up in her face\x{2026}&quot;
</del><ins>+            text run at (7,27) width 245: &quot;at first was in managing her&quot;
+            text run at (7,47) width 245: &quot;flamingo: she succeeded in ge&quot; + hyphen string &quot;\x{B7}~&quot;
+            text run at (7,67) width 213: &quot;tting its body tucked away, &quot;
+            text run at (220,67) width 32: &quot;co&quot; + hyphen string &quot;\x{B7}~&quot;
+            text run at (7,87) width 245: &quot;mfortably enough, under her&quot;
+            text run at (7,107) width 252: &quot;arm, with its legs hanging down, &quot;
+            text run at (258,107) width 79: &quot;but gene&quot; + hyphen string &quot;\x{B7}~&quot;
+            text run at (7,127) width 330: &quot;rally, just as she had got its neck nicely&quot;
+            text run at (7,147) width 96: &quot;straightened &quot;
+            text run at (102,147) width 235: &quot;out, and was going to give the&quot;
+            text run at (7,167) width 285: &quot;hedgehog a blow with its head, it &quot;
+            text run at (292,167) width 45: &quot;would&quot;
+            text run at (7,187) width 314: &quot;twist itself round and look up in her face\x{2026}&quot;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformgtkfasttexthyphenatefirstwordexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/gtk/fast/text/hyphenate-first-word-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/gtk/fast/text/hyphenate-first-word-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformgtkfasttexthyphenatefirstwordexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/fast/text/hyphenate-first-word-expected.txt (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/fast/text/hyphenate-first-word-expected.txt        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/LayoutTests/platform/gtk/fast/text/hyphenate-first-word-expected.txt        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -3,6 +3,8 @@
</span><span class="cx"> layer at (0,0) size 800x600
</span><span class="cx">   RenderBlock {HTML} at (0,0) size 800x600
</span><span class="cx">     RenderBody {BODY} at (8,8) size 784x584
</span><del>-      RenderBlock {DIV} at (0,0) size 226x117 [border: (3px solid #000000)]
-        RenderText {#text} at (3,5) size 427x107
-          text run at (3,5) width 427: &quot;declination&quot;
</del><ins>+      RenderBlock {DIV} at (0,0) size 226x327 [border: (3px solid #000000)]
+        RenderText {#text} at (3,3) size 193x321
+          text run at (3,3) width 193: &quot;decl&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (3,110) width 107: &quot;in&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (3,217) width 193: &quot;ation&quot;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformgtkfasttexthyphenatelimitbeforeafterexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/gtk/fast/text/hyphenate-limit-before-after-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkfasttexthyphenatelimitbeforeafterexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/fast/text/hyphenate-limit-before-after-expected.txt (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/fast/text/hyphenate-limit-before-after-expected.txt        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/LayoutTests/platform/gtk/fast/text/hyphenate-limit-before-after-expected.txt        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -3,25 +3,22 @@
</span><span class="cx"> layer at (0,0) size 800x600
</span><span class="cx">   RenderBlock {HTML} at (0,0) size 800x600
</span><span class="cx">     RenderBody {BODY} at (8,8) size 784x584
</span><del>-      RenderBlock {DIV} at (8,8) size 126x57 [border: (3px solid #000000)]
-        RenderText {#text} at (3,3) size 70x51
-          text run at (3,3) width 51: &quot;There is&quot;
-          text run at (3,20) width 70: &quot;remarkable&quot;
-          text run at (3,37) width 60: &quot;evidence.&quot;
</del><ins>+      RenderBlock {DIV} at (8,25) size 126x40 [border: (3px solid #000000)]
+        RenderText {#text} at (3,3) size 98x34
+          text run at (3,3) width 96: &quot;There is remar&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (3,20) width 98: &quot;kable evidence.&quot;
</ins><span class="cx">       RenderText {#text} at (142,45) size 4x17
</span><span class="cx">         text run at (142,45) width 4: &quot; &quot;
</span><del>-      RenderBlock {DIV} at (154,8) size 126x57 [border: (3px solid #000000)]
-        RenderText {#text} at (3,3) size 70x51
-          text run at (3,3) width 51: &quot;There is&quot;
-          text run at (3,20) width 70: &quot;remarkable&quot;
-          text run at (3,37) width 60: &quot;evidence.&quot;
</del><ins>+      RenderBlock {DIV} at (154,25) size 126x40 [border: (3px solid #000000)]
+        RenderText {#text} at (3,3) size 98x34
+          text run at (3,3) width 96: &quot;There is remar&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (3,20) width 98: &quot;kable evidence.&quot;
</ins><span class="cx">       RenderText {#text} at (288,45) size 4x17
</span><span class="cx">         text run at (288,45) width 4: &quot; &quot;
</span><del>-      RenderBlock {DIV} at (300,8) size 126x57 [border: (3px solid #000000)]
-        RenderText {#text} at (3,3) size 70x51
-          text run at (3,3) width 51: &quot;There is&quot;
-          text run at (3,20) width 70: &quot;remarkable&quot;
-          text run at (3,37) width 60: &quot;evidence.&quot;
</del><ins>+      RenderBlock {DIV} at (300,25) size 126x40 [border: (3px solid #000000)]
+        RenderText {#text} at (3,3) size 98x34
+          text run at (3,3) width 96: &quot;There is remar&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (3,20) width 98: &quot;kable evidence.&quot;
</ins><span class="cx">       RenderText {#text} at (434,45) size 4x17
</span><span class="cx">         text run at (434,45) width 4: &quot; &quot;
</span><span class="cx">       RenderBlock {DIV} at (446,8) size 126x57 [border: (3px solid #000000)]
</span><span class="lines">@@ -38,37 +35,32 @@
</span><span class="cx">           text run at (3,37) width 60: &quot;evidence.&quot;
</span><span class="cx">       RenderText {#text} at (726,45) size 4x17
</span><span class="cx">         text run at (726,45) width 4: &quot; &quot;
</span><del>-      RenderBlock {DIV} at (8,81) size 126x57 [border: (3px solid #000000)]
-        RenderText {#text} at (3,3) size 70x51
-          text run at (3,3) width 51: &quot;There is&quot;
-          text run at (3,20) width 70: &quot;remarkable&quot;
-          text run at (3,37) width 60: &quot;evidence.&quot;
-      RenderText {#text} at (142,118) size 4x17
-        text run at (142,118) width 4: &quot; &quot;
-      RenderBlock {DIV} at (154,81) size 126x57 [border: (3px solid #000000)]
-        RenderText {#text} at (3,3) size 70x51
-          text run at (3,3) width 51: &quot;There is&quot;
-          text run at (3,20) width 70: &quot;remarkable&quot;
-          text run at (3,37) width 60: &quot;evidence.&quot;
-      RenderText {#text} at (288,118) size 4x17
-        text run at (288,118) width 4: &quot; &quot;
-      RenderBlock {DIV} at (300,81) size 126x57 [border: (3px solid #000000)]
-        RenderText {#text} at (3,3) size 70x51
-          text run at (3,3) width 51: &quot;There is&quot;
-          text run at (3,20) width 70: &quot;remarkable&quot;
-          text run at (3,37) width 60: &quot;evidence.&quot;
-      RenderText {#text} at (434,118) size 4x17
-        text run at (434,118) width 4: &quot; &quot;
-      RenderBlock {DIV} at (446,81) size 126x57 [border: (3px solid #000000)]
-        RenderText {#text} at (3,3) size 70x51
-          text run at (3,3) width 51: &quot;There is&quot;
-          text run at (3,20) width 70: &quot;remarkable&quot;
-          text run at (3,37) width 60: &quot;evidence.&quot;
-      RenderText {#text} at (580,118) size 4x17
-        text run at (580,118) width 4: &quot; &quot;
-      RenderBlock {DIV} at (592,81) size 126x57 [border: (3px solid #000000)]
-        RenderText {#text} at (3,3) size 70x51
-          text run at (3,3) width 51: &quot;There is&quot;
-          text run at (3,20) width 70: &quot;remarkable&quot;
-          text run at (3,37) width 60: &quot;evidence.&quot;
</del><ins>+      RenderBlock {DIV} at (8,81) size 126x40 [border: (3px solid #000000)]
+        RenderText {#text} at (3,3) size 98x34
+          text run at (3,3) width 96: &quot;There is remar&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (3,20) width 98: &quot;kable evidence.&quot;
+      RenderText {#text} at (142,101) size 4x17
+        text run at (142,101) width 4: &quot; &quot;
+      RenderBlock {DIV} at (154,81) size 126x40 [border: (3px solid #000000)]
+        RenderText {#text} at (3,3) size 98x34
+          text run at (3,3) width 96: &quot;There is remar&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (3,20) width 98: &quot;kable evidence.&quot;
+      RenderText {#text} at (288,101) size 4x17
+        text run at (288,101) width 4: &quot; &quot;
+      RenderBlock {DIV} at (300,81) size 126x40 [border: (3px solid #000000)]
+        RenderText {#text} at (3,3) size 98x34
+          text run at (3,3) width 96: &quot;There is remar&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (3,20) width 98: &quot;kable evidence.&quot;
+      RenderText {#text} at (434,101) size 4x17
+        text run at (434,101) width 4: &quot; &quot;
+      RenderBlock {DIV} at (446,81) size 126x40 [border: (3px solid #000000)]
+        RenderText {#text} at (3,3) size 98x34
+          text run at (3,3) width 96: &quot;There is remar&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (3,20) width 98: &quot;kable evidence.&quot;
+      RenderText {#text} at (580,101) size 4x17
+        text run at (580,101) width 4: &quot; &quot;
+      RenderBlock {DIV} at (592,81) size 126x40 [border: (3px solid #000000)]
+        RenderText {#text} at (3,3) size 98x34
+          text run at (3,3) width 96: &quot;There is remar&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (3,20) width 98: &quot;kable evidence.&quot;
</ins><span class="cx">       RenderText {#text} at (0,0) size 0x0
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkfasttexthyphenatelimitlinesexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/gtk/fast/text/hyphenate-limit-lines-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkfasttexthyphenatelimitlinesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/fast/text/hyphenate-limit-lines-expected.txt (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/fast/text/hyphenate-limit-lines-expected.txt        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/LayoutTests/platform/gtk/fast/text/hyphenate-limit-lines-expected.txt        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -1,74 +1,80 @@
</span><del>-layer at (0,0) size 785x998
</del><ins>+layer at (0,0) size 785x969
</ins><span class="cx">   RenderView at (0,0) size 785x600
</span><del>-layer at (0,0) size 785x998
-  RenderBlock {HTML} at (0,0) size 785x998
</del><ins>+layer at (0,0) size 785x969
+  RenderBlock {HTML} at (0,0) size 785x969
</ins><span class="cx">     RenderBody {BODY} at (8,8) size 769x584
</span><del>-      RenderBlock (floating) {DIV} at (4,0) size 202x495 [border: (1px solid #ADD8E6)]
-        RenderText {#text} at (1,1) size 200x493
</del><ins>+      RenderBlock (floating) {DIV} at (4,0) size 202x466 [border: (1px solid #ADD8E6)]
+        RenderText {#text} at (1,1) size 200x464
</ins><span class="cx">           text run at (1,1) width 200: &quot;also the division of&quot;
</span><span class="cx">           text run at (1,30) width 200: &quot;the mind into the&quot;
</span><del>-          text run at (1,59) width 87: &quot;rational,&quot;
-          text run at (1,88) width 200: &quot;concupiscent, and&quot;
-          text run at (1,117) width 200: &quot;irascible elements,&quot;
-          text run at (1,146) width 200: &quot;or of pleasures&quot;
-          text run at (1,175) width 200: &quot;and desires into&quot;
-          text run at (1,204) width 200: &quot;necessary and&quot;
-          text run at (1,233) width 155: &quot;unnecessary\x{2014}&quot;
-          text run at (1,262) width 200: &quot;these and other&quot;
-          text run at (1,291) width 200: &quot;great forms of&quot;
-          text run at (1,320) width 200: &quot;thought are all of&quot;
-          text run at (1,349) width 66: &quot;them &quot;
-          text run at (67,349) width 134: &quot;to be found&quot;
-          text run at (1,378) width 200: &quot;in the Republic,&quot;
-          text run at (1,407) width 200: &quot;and were probably&quot;
-          text run at (1,436) width 200: &quot;first invented by&quot;
-          text run at (1,465) width 60: &quot;Plato.&quot;
-      RenderBlock (floating) {DIV} at (214,0) size 202x495 [border: (1px solid #ADD8E6)]
-        RenderText {#text} at (1,1) size 200x493
</del><ins>+          text run at (1,59) width 200: &quot;rational, concupi&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,88) width 141: &quot;scent, and &quot;
+          text run at (142,88) width 59: &quot;irasc&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,117) width 200: &quot;ible elements, or&quot;
+          text run at (1,146) width 200: &quot;of pleasures and&quot;
+          text run at (1,175) width 200: &quot;desires into nece&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,204) width 116: &quot;ssary and &quot;
+          text run at (117,204) width 84: &quot;unnece&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,233) width 200: &quot;ssary\x{2014}these and&quot;
+          text run at (1,262) width 200: &quot;other great forms&quot;
+          text run at (1,291) width 200: &quot;of thought are all&quot;
+          text run at (1,320) width 128: &quot;of them &quot;
+          text run at (129,320) width 72: &quot;to be&quot;
+          text run at (1,349) width 200: &quot;found in the Repu&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,378) width 200: &quot;blic, and were&quot;
+          text run at (1,407) width 200: &quot;probably first&quot;
+          text run at (1,436) width 130: &quot;invented by &quot;
+          text run at (131,436) width 60: &quot;Plato.&quot;
+      RenderBlock (floating) {DIV} at (214,0) size 202x466 [border: (1px solid #ADD8E6)]
+        RenderText {#text} at (1,1) size 200x464
</ins><span class="cx">           text run at (1,1) width 200: &quot;also the division of&quot;
</span><span class="cx">           text run at (1,30) width 200: &quot;the mind into the&quot;
</span><del>-          text run at (1,59) width 87: &quot;rational,&quot;
-          text run at (1,88) width 200: &quot;concupiscent, and&quot;
-          text run at (1,117) width 200: &quot;irascible elements,&quot;
-          text run at (1,146) width 200: &quot;or of pleasures&quot;
-          text run at (1,175) width 200: &quot;and desires into&quot;
-          text run at (1,204) width 200: &quot;necessary and&quot;
-          text run at (1,233) width 155: &quot;unnecessary\x{2014}&quot;
-          text run at (1,262) width 200: &quot;these and other&quot;
-          text run at (1,291) width 200: &quot;great forms of&quot;
-          text run at (1,320) width 200: &quot;thought are all of&quot;
-          text run at (1,349) width 66: &quot;them &quot;
-          text run at (67,349) width 134: &quot;to be found&quot;
-          text run at (1,378) width 200: &quot;in the Republic,&quot;
-          text run at (1,407) width 200: &quot;and were probably&quot;
-          text run at (1,436) width 200: &quot;first invented by&quot;
-          text run at (1,465) width 60: &quot;Plato.&quot;
-      RenderBlock (floating) {DIV} at (424,0) size 202x495 [border: (1px solid #ADD8E6)]
-        RenderText {#text} at (1,1) size 200x493
</del><ins>+          text run at (1,59) width 200: &quot;rational, concupi&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,88) width 141: &quot;scent, and &quot;
+          text run at (142,88) width 59: &quot;irasc&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,117) width 200: &quot;ible elements, or&quot;
+          text run at (1,146) width 200: &quot;of pleasures and&quot;
+          text run at (1,175) width 200: &quot;desires into nece&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,204) width 116: &quot;ssary and &quot;
+          text run at (117,204) width 84: &quot;unnece&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,233) width 200: &quot;ssary\x{2014}these and&quot;
+          text run at (1,262) width 200: &quot;other great forms&quot;
+          text run at (1,291) width 200: &quot;of thought are all&quot;
+          text run at (1,320) width 128: &quot;of them &quot;
+          text run at (129,320) width 72: &quot;to be&quot;
+          text run at (1,349) width 200: &quot;found in the Repu&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,378) width 200: &quot;blic, and were&quot;
+          text run at (1,407) width 200: &quot;probably first&quot;
+          text run at (1,436) width 130: &quot;invented by &quot;
+          text run at (131,436) width 60: &quot;Plato.&quot;
+      RenderBlock (floating) {DIV} at (424,0) size 202x466 [border: (1px solid #ADD8E6)]
+        RenderText {#text} at (1,1) size 200x464
</ins><span class="cx">           text run at (1,1) width 200: &quot;also the division of&quot;
</span><span class="cx">           text run at (1,30) width 200: &quot;the mind into the&quot;
</span><del>-          text run at (1,59) width 87: &quot;rational,&quot;
-          text run at (1,88) width 200: &quot;concupiscent, and&quot;
-          text run at (1,117) width 200: &quot;irascible elements,&quot;
-          text run at (1,146) width 200: &quot;or of pleasures&quot;
-          text run at (1,175) width 200: &quot;and desires into&quot;
-          text run at (1,204) width 200: &quot;necessary and&quot;
-          text run at (1,233) width 155: &quot;unnecessary\x{2014}&quot;
-          text run at (1,262) width 200: &quot;these and other&quot;
-          text run at (1,291) width 200: &quot;great forms of&quot;
-          text run at (1,320) width 200: &quot;thought are all of&quot;
-          text run at (1,349) width 66: &quot;them &quot;
-          text run at (67,349) width 134: &quot;to be found&quot;
-          text run at (1,378) width 200: &quot;in the Republic,&quot;
-          text run at (1,407) width 200: &quot;and were probably&quot;
-          text run at (1,436) width 200: &quot;first invented by&quot;
-          text run at (1,465) width 60: &quot;Plato.&quot;
-      RenderBlock (floating) {DIV} at (4,495) size 202x495 [border: (1px solid #ADD8E6)]
</del><ins>+          text run at (1,59) width 200: &quot;rational, concupi&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,88) width 141: &quot;scent, and &quot;
+          text run at (142,88) width 59: &quot;irasc&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,117) width 200: &quot;ible elements, or&quot;
+          text run at (1,146) width 200: &quot;of pleasures and&quot;
+          text run at (1,175) width 200: &quot;desires into nece&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,204) width 116: &quot;ssary and &quot;
+          text run at (117,204) width 84: &quot;unnece&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,233) width 200: &quot;ssary\x{2014}these and&quot;
+          text run at (1,262) width 200: &quot;other great forms&quot;
+          text run at (1,291) width 200: &quot;of thought are all&quot;
+          text run at (1,320) width 128: &quot;of them &quot;
+          text run at (129,320) width 72: &quot;to be&quot;
+          text run at (1,349) width 200: &quot;found in the Repu&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,378) width 200: &quot;blic, and were&quot;
+          text run at (1,407) width 200: &quot;probably first&quot;
+          text run at (1,436) width 130: &quot;invented by &quot;
+          text run at (131,436) width 60: &quot;Plato.&quot;
+      RenderBlock (floating) {DIV} at (4,466) size 202x495 [border: (1px solid #ADD8E6)]
</ins><span class="cx">         RenderText {#text} at (1,1) size 200x493
</span><span class="cx">           text run at (1,1) width 200: &quot;also the division of&quot;
</span><span class="cx">           text run at (1,30) width 200: &quot;the mind into the&quot;
</span><del>-          text run at (1,59) width 87: &quot;rational,&quot;
-          text run at (1,88) width 200: &quot;concupiscent, and&quot;
</del><ins>+          text run at (1,59) width 200: &quot;rational, concupi&quot; + hyphen string &quot;\x{2010}&quot;
+          text run at (1,88) width 200: &quot;scent, and&quot;
</ins><span class="cx">           text run at (1,117) width 200: &quot;irascible elements,&quot;
</span><span class="cx">           text run at (1,146) width 200: &quot;or of pleasures&quot;
</span><span class="cx">           text run at (1,175) width 200: &quot;and desires into&quot;
</span><span class="lines">@@ -83,7 +89,7 @@
</span><span class="cx">           text run at (1,407) width 200: &quot;and were probably&quot;
</span><span class="cx">           text run at (1,436) width 200: &quot;first invented by&quot;
</span><span class="cx">           text run at (1,465) width 60: &quot;Plato.&quot;
</span><del>-      RenderBlock (floating) {DIV} at (214,495) size 202x495 [border: (1px solid #ADD8E6)]
</del><ins>+      RenderBlock (floating) {DIV} at (214,466) size 202x495 [border: (1px solid #ADD8E6)]
</ins><span class="cx">         RenderText {#text} at (1,1) size 200x493
</span><span class="cx">           text run at (1,1) width 200: &quot;also the division of&quot;
</span><span class="cx">           text run at (1,30) width 200: &quot;the mind into the&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkfasttexthyphenatelocaleexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/gtk/fast/text/hyphenate-locale-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/gtk/fast/text/hyphenate-locale-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformgtkfasttexthyphenatelocaleexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/fast/text/hyphenate-locale-expected.txt (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/fast/text/hyphenate-locale-expected.txt        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/LayoutTests/platform/gtk/fast/text/hyphenate-locale-expected.txt        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -3,35 +3,38 @@
</span><span class="cx"> layer at (0,0) size 800x600
</span><span class="cx">   RenderBlock {HTML} at (0,0) size 800x600
</span><span class="cx">     RenderBody {BODY} at (8,8) size 784x584
</span><del>-      RenderBlock {DIV} at (0,0) size 130x210
-        RenderBlock {DIV} at (0,0) size 130x42
-          RenderText {#text} at (0,1) size 158x40
-            text run at (0,1) width 158: &quot;throughout&quot;
-        RenderBlock {DIV} at (0,42) size 130x42
-          RenderText {#text} at (0,1) size 158x40
-            text run at (0,1) width 158: &quot;throughout&quot;
-        RenderBlock {DIV} at (0,84) size 130x42
-          RenderText {#text} at (0,1) size 158x40
-            text run at (0,1) width 158: &quot;throughout&quot;
-        RenderBlock {DIV} at (0,126) size 130x42
-          RenderText {#text} at (0,1) size 158x40
-            text run at (0,1) width 158: &quot;throughout&quot;
-        RenderBlock {DIV} at (0,168) size 130x42
-          RenderText {#text} at (0,1) size 158x40
-            text run at (0,1) width 158: &quot;throughout&quot;
-      RenderBlock {DIV} at (0,210) size 135x210
-        RenderBlock {DIV} at (0,0) size 135x42
-          RenderText {#text} at (0,1) size 156x40
-            text run at (0,1) width 156: &quot;reciprocity&quot;
-        RenderBlock {DIV} at (0,42) size 135x42
-          RenderText {#text} at (0,1) size 156x40
-            text run at (0,1) width 156: &quot;reciprocity&quot;
-        RenderBlock {DIV} at (0,84) size 135x42
-          RenderText {#text} at (0,1) size 156x40
-            text run at (0,1) width 156: &quot;reciprocity&quot;
-        RenderBlock {DIV} at (0,126) size 135x42
-          RenderText {#text} at (0,1) size 156x40
-            text run at (0,1) width 156: &quot;reciprocity&quot;
-        RenderBlock {DIV} at (0,168) size 135x42
-          RenderText {#text} at (0,1) size 156x40
-            text run at (0,1) width 156: &quot;reciprocity&quot;
</del><ins>+      RenderBlock {DIV} at (0,0) size 130x240
+        RenderBlock {DIV} at (0,0) size 130x40
+          RenderText {#text} at (0,0) size 158x40
+            text run at (0,0) width 158: &quot;throughout&quot;
+        RenderBlock {DIV} at (0,40) size 130x40
+          RenderText {#text} at (0,0) size 158x40
+            text run at (0,0) width 158: &quot;throughout&quot;
+        RenderBlock {DIV} at (0,80) size 130x80
+          RenderText {#text} at (0,0) size 106x80
+            text run at (0,0) width 106: &quot;throug&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (0,40) width 64: &quot;hout&quot;
+        RenderBlock {DIV} at (0,160) size 130x40
+          RenderText {#text} at (0,0) size 158x40
+            text run at (0,0) width 158: &quot;throughout&quot;
+        RenderBlock {DIV} at (0,200) size 130x40
+          RenderText {#text} at (0,0) size 158x40
+            text run at (0,0) width 158: &quot;throughout&quot;
+      RenderBlock {DIV} at (0,240) size 135x280
+        RenderBlock {DIV} at (0,0) size 135x40
+          RenderText {#text} at (0,0) size 156x40
+            text run at (0,0) width 156: &quot;reciprocity&quot;
+        RenderBlock {DIV} at (0,40) size 135x40
+          RenderText {#text} at (0,0) size 156x40
+            text run at (0,0) width 156: &quot;reciprocity&quot;
+        RenderBlock {DIV} at (0,80) size 135x80
+          RenderText {#text} at (0,0) size 114x80
+            text run at (0,0) width 114: &quot;recipro&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (0,40) width 54: &quot;city&quot;
+        RenderBlock {DIV} at (0,160) size 135x80
+          RenderText {#text} at (0,0) size 96x80
+            text run at (0,0) width 96: &quot;recipr&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (0,40) width 72: &quot;ocity&quot;
+        RenderBlock {DIV} at (0,240) size 135x40
+          RenderText {#text} at (0,0) size 156x40
+            text run at (0,0) width 156: &quot;reciprocity&quot;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformgtkfasttexthyphensexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/gtk/fast/text/hyphens-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/gtk/fast/text/hyphens-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformgtkfasttexthyphensexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/fast/text/hyphens-expected.txt (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/fast/text/hyphens-expected.txt        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/LayoutTests/platform/gtk/fast/text/hyphens-expected.txt        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -3,96 +3,97 @@
</span><span class="cx"> layer at (0,0) size 800x600
</span><span class="cx">   RenderBlock {HTML} at (0,0) size 800x600
</span><span class="cx">     RenderBody {BODY} at (8,8) size 784x584
</span><del>-      RenderBlock (floating) {DIV} at (4,0) size 344x274
</del><ins>+      RenderBlock (floating) {DIV} at (4,0) size 344x264
</ins><span class="cx">         RenderBlock {P} at (0,16) size 344x18
</span><del>-          RenderInline {TT} at (0,0) size 118x15
-            RenderText {#text} at (0,3) size 118x15
-              text run at (0,3) width 118: &quot;hyphens: manual&quot;
-          RenderText {#text} at (117,0) size 139x17
-            text run at (117,0) width 139: &quot; without soft hyphens&quot;
-        RenderBlock {DIV} at (0,50) size 344x224 [border: (3px solid #000000)]
</del><ins>+          RenderInline {TT} at (0,0) size 120x15
+            RenderText {#text} at (0,3) size 120x15
+              text run at (0,3) width 120: &quot;hyphens: manual&quot;
+          RenderText {#text} at (120,0) size 136x17
+            text run at (120,0) width 136: &quot; without soft hyphens&quot;
+        RenderBlock {DIV} at (0,50) size 344x214 [border: (3px solid #000000)]
</ins><span class="cx">           RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
</span><del>-          RenderText {#text} at (7,7) size 330x209
</del><ins>+          RenderText {#text} at (7,7) size 330x200
</ins><span class="cx">             text run at (7,7) width 245: &quot;The chief difficulty Alice found&quot;
</span><del>-            text run at (7,28) width 245: &quot;at first was in managing her&quot;
-            text run at (7,49) width 245: &quot;flamingo: she succeeded in&quot;
-            text run at (7,70) width 245: &quot;getting its body tucked away,&quot;
-            text run at (7,91) width 245: &quot;comfortably enough, under her&quot;
-            text run at (7,112) width 307: &quot;arm, with its legs hanging down, &quot;
-            text run at (313,112) width 24: &quot;but&quot;
-            text run at (7,133) width 330: &quot;generally, just as she had got its neck nicely&quot;
-            text run at (7,154) width 96: &quot;straightened &quot;
-            text run at (102,154) width 235: &quot;out, and was going to give the&quot;
-            text run at (7,175) width 245: &quot;hedgehog a blow with its head, it &quot;
-            text run at (251,175) width 86: &quot;would twist&quot;
-            text run at (7,196) width 271: &quot;itself round and look up in her face\x{2026}&quot;
-      RenderBlock (floating) {DIV} at (356,0) size 344x274
</del><ins>+            text run at (7,27) width 245: &quot;at first was in managing her&quot;
+            text run at (7,47) width 245: &quot;flamingo: she succeeded in&quot;
+            text run at (7,67) width 245: &quot;getting its body tucked away,&quot;
+            text run at (7,87) width 245: &quot;comfortably enough, under her&quot;
+            text run at (7,107) width 307: &quot;arm, with its legs hanging down, &quot;
+            text run at (314,107) width 23: &quot;but&quot;
+            text run at (7,127) width 330: &quot;generally, just as she had got its neck nicely&quot;
+            text run at (7,147) width 96: &quot;straightened &quot;
+            text run at (102,147) width 235: &quot;out, and was going to give the&quot;
+            text run at (7,167) width 285: &quot;hedgehog a blow with its head, it &quot;
+            text run at (292,167) width 45: &quot;would&quot;
+            text run at (7,187) width 314: &quot;twist itself round and look up in her face\x{2026}&quot;
+      RenderBlock (floating) {DIV} at (356,0) size 344x264
</ins><span class="cx">         RenderBlock {P} at (0,16) size 344x18
</span><del>-          RenderInline {TT} at (0,0) size 102x15
-            RenderText {#text} at (0,3) size 102x15
-              text run at (0,3) width 102: &quot;hyphens: none&quot;
-          RenderText {#text} at (101,0) size 119x17
-            text run at (101,0) width 119: &quot; with soft hyphens&quot;
-        RenderBlock {DIV} at (0,50) size 344x224 [border: (3px solid #000000)]
</del><ins>+          RenderInline {TT} at (0,0) size 104x15
+            RenderText {#text} at (0,3) size 104x15
+              text run at (0,3) width 104: &quot;hyphens: none&quot;
+          RenderText {#text} at (104,0) size 116x17
+            text run at (104,0) width 116: &quot; with soft hyphens&quot;
+        RenderBlock {DIV} at (0,50) size 344x214 [border: (3px solid #000000)]
</ins><span class="cx">           RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
</span><del>-          RenderText {#text} at (7,7) size 330x209
</del><ins>+          RenderText {#text} at (7,7) size 330x200
</ins><span class="cx">             text run at (7,7) width 245: &quot;The chief difficulty Alice found&quot;
</span><del>-            text run at (7,28) width 245: &quot;at first was in managing her&quot;
-            text run at (7,49) width 245: &quot;flamingo: she succeeded in&quot;
-            text run at (7,70) width 245: &quot;get\x{AD}ting its body tucked away,&quot;
-            text run at (7,91) width 245: &quot;com\x{AD}fortably enough, under her&quot;
-            text run at (7,112) width 307: &quot;arm, with its legs hanging down, &quot;
-            text run at (313,112) width 24: &quot;but&quot;
-            text run at (7,133) width 330: &quot;generally, just as she had got its neck nicely&quot;
-            text run at (7,154) width 96: &quot;straight\x{AD}ened &quot;
-            text run at (102,154) width 235: &quot;out, and was going to give the&quot;
-            text run at (7,175) width 245: &quot;hedge\x{AD}hog a blow with its head, it &quot;
-            text run at (251,175) width 86: &quot;would twist&quot;
-            text run at (7,196) width 271: &quot;itself round and look up in her face\x{2026}&quot;
-      RenderBlock (floating) {DIV} at (4,274) size 344x274
</del><ins>+            text run at (7,27) width 245: &quot;at first was in managing her&quot;
+            text run at (7,47) width 245: &quot;flamingo: she succeeded in&quot;
+            text run at (7,67) width 245: &quot;get\x{AD}ting its body tucked away,&quot;
+            text run at (7,87) width 245: &quot;com\x{AD}fortably enough, under her&quot;
+            text run at (7,107) width 307: &quot;arm, with its legs hanging down, &quot;
+            text run at (314,107) width 23: &quot;but&quot;
+            text run at (7,127) width 330: &quot;generally, just as she had got its neck nicely&quot;
+            text run at (7,147) width 96: &quot;straight\x{AD}ened &quot;
+            text run at (102,147) width 235: &quot;out, and was going to give the&quot;
+            text run at (7,167) width 285: &quot;hedge\x{AD}hog a blow with its head, it &quot;
+            text run at (292,167) width 45: &quot;would&quot;
+            text run at (7,187) width 314: &quot;twist itself round and look up in her face\x{2026}&quot;
+      RenderBlock (floating) {DIV} at (4,264) size 344x264
</ins><span class="cx">         RenderBlock {P} at (0,16) size 344x18
</span><del>-          RenderInline {TT} at (0,0) size 118x15
-            RenderText {#text} at (0,3) size 118x15
-              text run at (0,3) width 118: &quot;hyphens: manual&quot;
-          RenderText {#text} at (117,0) size 118x17
-            text run at (117,0) width 118: &quot; with soft hyphens&quot;
-        RenderBlock {DIV} at (0,50) size 344x224 [border: (3px solid #000000)]
</del><ins>+          RenderInline {TT} at (0,0) size 120x15
+            RenderText {#text} at (0,3) size 120x15
+              text run at (0,3) width 120: &quot;hyphens: manual&quot;
+          RenderText {#text} at (120,0) size 116x17
+            text run at (120,0) width 116: &quot; with soft hyphens&quot;
+        RenderBlock {DIV} at (0,50) size 344x214 [border: (3px solid #000000)]
</ins><span class="cx">           RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
</span><del>-          RenderText {#text} at (7,7) size 330x209
</del><ins>+          RenderText {#text} at (7,7) size 330x200
</ins><span class="cx">             text run at (7,7) width 245: &quot;The chief difficulty Alice found&quot;
</span><del>-            text run at (7,28) width 245: &quot;at first was in managing her&quot;
-            text run at (7,49) width 245: &quot;flamingo: she succeeded in get\x{AD}&quot; + hyphen string &quot;\x{2010}&quot;
-            text run at (7,70) width 209: &quot;ting its body tucked away, &quot;
-            text run at (215,70) width 37: &quot;com\x{AD}&quot; + hyphen string &quot;\x{2010}&quot;
-            text run at (7,91) width 245: &quot;fortably enough, under her arm,&quot;
-            text run at (7,112) width 226: &quot;with its legs hanging down, &quot;
-            text run at (232,112) width 105: &quot;but generally,&quot;
-            text run at (7,133) width 330: &quot;just as she had got its neck nicely straight\x{AD}&quot; + hyphen string &quot;\x{2010}&quot;
-            text run at (7,154) width 39: &quot;ened &quot;
-            text run at (45,154) width 292: &quot;out, and was going to give the hedge\x{AD}hog&quot;
-            text run at (7,175) width 196: &quot;a blow with its head, it &quot;
-            text run at (202,175) width 135: &quot;would twist itself&quot;
-            text run at (7,196) width 230: &quot;round and look up in her face\x{2026}&quot;
-      RenderBlock (floating) {DIV} at (356,274) size 344x274
</del><ins>+            text run at (7,27) width 245: &quot;at first was in managing her&quot;
+            text run at (7,47) width 245: &quot;flamingo: she succeeded in get\x{AD}&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (7,67) width 208: &quot;ting its body tucked away, &quot;
+            text run at (215,67) width 37: &quot;com\x{AD}&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (7,87) width 245: &quot;fortably enough, under her arm,&quot;
+            text run at (7,107) width 226: &quot;with its legs hanging down, &quot;
+            text run at (233,107) width 104: &quot;but generally,&quot;
+            text run at (7,127) width 330: &quot;just as she had got its neck nicely straight\x{AD}&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (7,147) width 42: &quot;ened &quot;
+            text run at (48,147) width 289: &quot;out, and was going to give the hedge\x{AD}&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (7,167) width 204: &quot;hog a blow with its head, it &quot;
+            text run at (211,167) width 126: &quot;would twist itself&quot;
+            text run at (7,187) width 233: &quot;round and look up in her face\x{2026}&quot;
+      RenderBlock (floating) {DIV} at (356,264) size 344x264
</ins><span class="cx">         RenderBlock {P} at (0,16) size 344x18
</span><del>-          RenderInline {TT} at (0,0) size 102x15
-            RenderText {#text} at (0,3) size 102x15
-              text run at (0,3) width 102: &quot;hyphens: auto&quot;
-          RenderText {#text} at (101,0) size 139x17
-            text run at (101,0) width 139: &quot; without soft hyphens&quot;
-        RenderBlock {DIV} at (0,50) size 344x224 [border: (3px solid #000000)]
</del><ins>+          RenderInline {TT} at (0,0) size 104x15
+            RenderText {#text} at (0,3) size 104x15
+              text run at (0,3) width 104: &quot;hyphens: auto&quot;
+          RenderText {#text} at (104,0) size 136x17
+            text run at (104,0) width 136: &quot; without soft hyphens&quot;
+        RenderBlock {DIV} at (0,50) size 344x214 [border: (3px solid #000000)]
</ins><span class="cx">           RenderBlock (floating) {DIV} at (262,7) size 75x90 [bgcolor=#F0F8FF]
</span><del>-          RenderText {#text} at (7,7) size 330x209
</del><ins>+          RenderText {#text} at (7,7) size 330x200
</ins><span class="cx">             text run at (7,7) width 245: &quot;The chief difficulty Alice found&quot;
</span><del>-            text run at (7,28) width 245: &quot;at first was in managing her&quot;
-            text run at (7,49) width 245: &quot;flamingo: she succeeded in&quot;
-            text run at (7,70) width 245: &quot;getting its body tucked away,&quot;
-            text run at (7,91) width 245: &quot;comfortably enough, under her&quot;
-            text run at (7,112) width 307: &quot;arm, with its legs hanging down, &quot;
-            text run at (313,112) width 24: &quot;but&quot;
-            text run at (7,133) width 330: &quot;generally, just as she had got its neck nicely&quot;
-            text run at (7,154) width 96: &quot;straightened &quot;
-            text run at (102,154) width 235: &quot;out, and was going to give the&quot;
-            text run at (7,175) width 245: &quot;hedgehog a blow with its head, it &quot;
-            text run at (251,175) width 86: &quot;would twist&quot;
-            text run at (7,196) width 271: &quot;itself round and look up in her face\x{2026}&quot;
</del><ins>+            text run at (7,27) width 245: &quot;at first was in managing her&quot;
+            text run at (7,47) width 245: &quot;flamingo: she succeeded in ge&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (7,67) width 222: &quot;tting its body tucked away, &quot;
+            text run at (229,67) width 23: &quot;co&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (7,87) width 245: &quot;mfortably enough, under her&quot;
+            text run at (7,107) width 248: &quot;arm, with its legs hanging down, &quot;
+            text run at (254,107) width 83: &quot;but genera&quot; + hyphen string &quot;\x{2010}&quot;
+            text run at (7,127) width 330: &quot;lly, just as she had got its neck nicely&quot;
+            text run at (7,147) width 96: &quot;straightened &quot;
+            text run at (102,147) width 235: &quot;out, and was going to give the&quot;
+            text run at (7,167) width 285: &quot;hedgehog a blow with its head, it &quot;
+            text run at (292,167) width 45: &quot;would&quot;
+            text run at (7,187) width 314: &quot;twist itself round and look up in her face\x{2026}&quot;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformgtkfasttextwordbreaksofthyphenexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/gtk/fast/text/word-break-soft-hyphen-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/Source/WebCore/ChangeLog        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2015-04-29  Martin Robinson  &lt;mrobinson@igalia.com&gt;
+
+        [GTK] Add support for automatic hyphenation
+        https://bugs.webkit.org/show_bug.cgi?id=44478
+
+        Reviewed by Carlos Garcia Campos.
+
+        No new tests. This patch unskips and updates results for existing hyphenation tests.
+
+        * PlatformGTK.cmake: Add the libhypen implementation to the source list.
+        * platform/gtk/GtkUtilities.cpp:
+        (WebCore::topLevelPath): Add this helper function taken from the test harness.
+        (WebCore::getWebKitBuildDirectory): Ditto.
+        * platform/gtk/GtkUtilities.h: Add function declarations for the helper functions.
+        * platform/text/Hyphenation.cpp: Surround this implementation with !USE(LIBHYPHEN),
+          so that it can still be shared.
+        * platform/text/gtk/HyphenationLibHyphen.cpp: Added.
+        (WebCore::extractLocaleFromDictionaryFilePath): Take in a dictionary filename and
+        determine the locale that it covers.
+        (WebCore::scanDirectoryForDicionaries): Look for all installed dictionaries as well
+        as ones in the JHBuild root for testing.
+        (WebCore::scanTestDictionariesDirectoryIfNecessary): Try to scan the dictionaries installed
+        in the JHBuild root.
+        (WebCore::availableLocales): Getter for global hash of installed dictionaries.
+        (WebCore::canHyphenate): Added libhyphen implementation.
+        (WebCore::HyphenationDictionary): Helper class that properly manages the memory of
+        an open libhyphen dictionary. This is useful so that they can be stored in an MRU
+        cache. This is a similar approach to the CoreFoundation implementation.
+        (WebCore::AtomicStringKeyedMRUCache&lt;RefPtr&lt;HyphenationDictionary&gt;&gt;::createValueForNullKey): MRU cache
+        helper.
+        (WebCore::AtomicStringKeyedMRUCache&lt;RefPtr&lt;HyphenationDictionary&gt;&gt;::createValueForKey): Ditto.
+        (WebCore::hyphenDictionaryCache): A cache for opened hyphenation dictionaries.
+        (WebCore::countLeadingSpaces): Count leading spaces, since WebCore often passes words with them.
+        (WebCore::lastHyphenLocation): Added libhyphen implementation.
+
</ins><span class="cx"> 2015-04-29  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed build fix.
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/Source/WebCore/PlatformGTK.cmake        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -179,6 +179,7 @@
</span><span class="cx"> 
</span><span class="cx">     platform/text/enchant/TextCheckerEnchant.cpp
</span><span class="cx"> 
</span><ins>+    platform/text/gtk/HyphenationLibHyphen.cpp
</ins><span class="cx">     platform/text/gtk/TextBreakIteratorInternalICUGtk.cpp
</span><span class="cx"> 
</span><span class="cx">     platform/network/gtk/CredentialBackingStore.cpp
</span><span class="lines">@@ -269,6 +270,7 @@
</span><span class="cx">     ${LIBSOUP_LIBRARIES}
</span><span class="cx">     ${LIBXML2_LIBRARIES}
</span><span class="cx">     ${LIBXSLT_LIBRARIES}
</span><ins>+    ${HYPHEN_LIBRARIES}
</ins><span class="cx">     ${PNG_LIBRARIES}
</span><span class="cx">     ${SQLITE_LIBRARIES}
</span><span class="cx">     ${WEBP_LIBRARIES}
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkGtkUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/GtkUtilities.cpp (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/GtkUtilities.cpp        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/Source/WebCore/platform/gtk/GtkUtilities.cpp        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011, Igalia S.L.
</del><ins>+ * Copyright (C) 2011, 2013 Igalia S.L.
</ins><span class="cx">  *
</span><span class="cx">  *  This library is free software; you can redistribute it and/or
</span><span class="cx">  *  modify it under the terms of the GNU Lesser General Public
</span><span class="lines">@@ -21,6 +21,8 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;IntPoint.h&quot;
</span><span class="cx"> #include &lt;gtk/gtk.h&gt;
</span><ins>+#include &lt;wtf/gobject/GUniquePtr.h&gt;
+#include &lt;wtf/gobject/GlibUtilities.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(X11)
</span><span class="cx"> #include &lt;gdk/gdkx.h&gt;
</span><span class="lines">@@ -81,4 +83,30 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if defined(DEVELOPMENT_BUILD)
+static CString topLevelPath()
+{
+    if (const char* topLevelDirectory = g_getenv(&quot;WEBKIT_TOP_LEVEL&quot;))
+        return topLevelDirectory;
+
+    // If the environment variable wasn't provided then assume we were built into
+    // WebKitBuild/Debug or WebKitBuild/Release. Obviously this will fail if the build
+    // directory is non-standard, but we can't do much more about this.
+    GUniquePtr&lt;char&gt; parentPath(g_path_get_dirname(getCurrentExecutablePath().data()));
+    GUniquePtr&lt;char&gt; layoutTestsPath(g_build_filename(parentPath.get(), &quot;..&quot;, &quot;..&quot;, &quot;..&quot;, nullptr));
+    GUniquePtr&lt;char&gt; absoluteTopLevelPath(realpath(layoutTestsPath.get(), 0));
+    return absoluteTopLevelPath.get();
+}
+
+CString webkitBuildDirectory()
+{
+    const char* webkitOutputDir = g_getenv(&quot;WEBKIT_OUTPUTDIR&quot;);
+    if (webkitOutputDir)
+        return webkitOutputDir;
+
+    GUniquePtr&lt;char&gt; outputDir(g_build_filename(topLevelPath().data(), &quot;WebKitBuild&quot;, nullptr));
+    return outputDir.get();
+}
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkGtkUtilitiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/GtkUtilities.h (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/GtkUtilities.h        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/Source/WebCore/platform/gtk/GtkUtilities.h        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -19,6 +19,8 @@
</span><span class="cx"> #ifndef GtkUtilities_h 
</span><span class="cx"> #define GtkUtilities_h 
</span><span class="cx"> 
</span><ins>+#include &lt;wtf/text/CString.h&gt;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class IntPoint;
</span><span class="lines">@@ -33,6 +35,10 @@
</span><span class="cx"> 
</span><span class="cx"> DisplaySystemType getDisplaySystemType();
</span><span class="cx"> 
</span><ins>+#if defined(DEVELOPMENT_BUILD)
+CString webkitBuildDirectory();
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // GtkUtilities_h
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextHyphenationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/Hyphenation.cpp (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/Hyphenation.cpp        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/Source/WebCore/platform/text/Hyphenation.cpp        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;Hyphenation.h&quot;
</span><span class="cx"> 
</span><ins>+#if !USE(LIBHYPHEN)
+
</ins><span class="cx"> #include &quot;NotImplemented.h&quot;
</span><span class="cx"> #include &lt;wtf/text/StringView.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -43,3 +45,5 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><ins>+
+#endif // !USE(LIBHYPHEN)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformtextgtkHyphenationLibHyphencpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/text/gtk/HyphenationLibHyphen.cpp (0 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/gtk/HyphenationLibHyphen.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/text/gtk/HyphenationLibHyphen.cpp        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -0,0 +1,240 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;Hyphenation.h&quot;
+
+#if USE(LIBHYPHEN)
+
+#include &quot;AtomicStringKeyedMRUCache.h&quot;
+#include &quot;FileSystem.h&quot;
+#include &quot;GtkUtilities.h&quot;
+#include &lt;hyphen.h&gt;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/NeverDestroyed.h&gt;
+#include &lt;wtf/gobject/GUniquePtr.h&gt;
+#include &lt;wtf/text/AtomicStringHash.h&gt;
+#include &lt;wtf/text/CString.h&gt;
+#include &lt;wtf/text/StringView.h&gt;
+
+namespace WebCore {
+
+static const char* const gDictionaryDirectories[] = {
+    &quot;/usr/share/hyphen&quot;,
+    &quot;/usr/local/share/hyphen&quot;,
+};
+
+static String extractLocaleFromDictionaryFilePath(const String&amp; filePath)
+{
+    // Dictionary files always have the form &quot;hyph_&lt;locale name&gt;.dic&quot;
+    // so we strip everything except the locale.
+    String fileName = pathGetFileName(filePath);
+    static const int prefixLength = 5;
+    static const int suffixLength = 4;
+    return fileName.substring(prefixLength, fileName.length() - prefixLength - suffixLength);
+}
+
+static void scanDirectoryForDicionaries(const char* directoryPath, HashMap&lt;AtomicString, String&gt;&amp; availableLocales)
+{
+    for (const auto&amp; filePath : listDirectory(directoryPath, &quot;hyph_*.dic&quot;))
+        availableLocales.set(AtomicString(extractLocaleFromDictionaryFilePath(filePath)), filePath);
+}
+
+#if defined(DEVELOPMENT_BUILD)
+static void scanTestDictionariesDirectoryIfNecessary(HashMap&lt;AtomicString, String&gt;&amp; availableLocales)
+{
+    // It's unfortunate that we need to look for the dictionaries this way, but
+    // libhyphen doesn't have the concept of installed dictionaries. Instead,
+    // we have this special case for WebKit tests.
+    CString buildDirectory = webkitBuildDirectory();
+    GUniquePtr&lt;char&gt; dictionariesPath(g_build_filename(buildDirectory.data(), &quot;DependenciesGTK&quot;, &quot;Root&quot;, &quot;webkitgtk-test-dicts&quot;, nullptr));
+    if (g_file_test(dictionariesPath.get(), static_cast&lt;GFileTest&gt;(G_FILE_TEST_IS_DIR))) {
+        scanDirectoryForDicionaries(dictionariesPath.get(), availableLocales);
+        return;
+    }
+
+    // Try alternative dictionaries path for people not using JHBuild.
+    dictionariesPath.reset(g_build_filename(buildDirectory.data(), &quot;webkitgtk-test-dicts&quot;, nullptr));
+    scanDirectoryForDicionaries(dictionariesPath.get(), availableLocales);
+}
+#endif
+
+static HashMap&lt;AtomicString, String&gt;&amp; availableLocales()
+{
+    static bool scannedLocales = false;
+    static HashMap&lt;AtomicString, String&gt; availableLocales;
+
+    if (!scannedLocales) {
+        for (size_t i = 0; i &lt; WTF_ARRAY_LENGTH(gDictionaryDirectories); i++)
+            scanDirectoryForDicionaries(gDictionaryDirectories[i], availableLocales);
+
+#if defined(DEVELOPMENT_BUILD)
+        scanTestDictionariesDirectoryIfNecessary(availableLocales);
+#endif
+
+        scannedLocales = true;
+    }
+
+    return availableLocales;
+}
+
+bool canHyphenate(const AtomicString&amp; localeIdentifier)
+{
+    if (localeIdentifier.isNull())
+        return false;
+    return availableLocales().contains(localeIdentifier);
+}
+
+class HyphenationDictionary : public RefCounted&lt;HyphenationDictionary&gt; {
+    WTF_MAKE_NONCOPYABLE(HyphenationDictionary);
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    typedef std::unique_ptr&lt;HyphenDict, void(*)(HyphenDict*)&gt; HyphenDictUniquePtr;
+
+    virtual ~HyphenationDictionary() { }
+    static RefPtr&lt;HyphenationDictionary&gt; createNull()
+    {
+        return adoptRef(new HyphenationDictionary());
+    }
+
+    static RefPtr&lt;HyphenationDictionary&gt; create(const CString&amp; dictPath)
+    {
+        return adoptRef(new HyphenationDictionary(dictPath));
+    }
+
+    HyphenDict* libhyphenDictionary() const
+    {
+        return m_libhyphenDictionary.get();
+    }
+
+private:
+    HyphenationDictionary(const CString&amp; dictPath)
+        : m_libhyphenDictionary(HyphenDictUniquePtr(hnj_hyphen_load(dictPath.data()), hnj_hyphen_free))
+    {
+    }
+
+    HyphenationDictionary()
+        : m_libhyphenDictionary(HyphenDictUniquePtr(nullptr, hnj_hyphen_free))
+    {
+    }
+
+    HyphenDictUniquePtr m_libhyphenDictionary;
+};
+
+template&lt;&gt;
+RefPtr&lt;HyphenationDictionary&gt; AtomicStringKeyedMRUCache&lt;RefPtr&lt;HyphenationDictionary&gt;&gt;::createValueForNullKey()
+{
+    return HyphenationDictionary::createNull();
+}
+
+template&lt;&gt;
+RefPtr&lt;HyphenationDictionary&gt; AtomicStringKeyedMRUCache&lt;RefPtr&lt;HyphenationDictionary&gt;&gt;::createValueForKey(const AtomicString&amp; localeIdentifier)
+{
+    ASSERT(availableLocales().get(localeIdentifier));
+    return HyphenationDictionary::create(fileSystemRepresentation(availableLocales().get(localeIdentifier)));
+}
+
+static AtomicStringKeyedMRUCache&lt;RefPtr&lt;HyphenationDictionary&gt;&gt;&amp; hyphenDictionaryCache()
+{
+    static NeverDestroyed&lt;AtomicStringKeyedMRUCache&lt;RefPtr&lt;HyphenationDictionary&gt;&gt;&gt; cache;
+    return cache;
+}
+
+static void countLeadingSpaces(const CString&amp; utf8String, int32_t&amp; pointerOffset, int32_t&amp; characterOffset)
+{
+    pointerOffset = 0;
+    characterOffset = 0;
+    const char* stringData = utf8String.data();
+    UChar32 character = 0;
+    while (static_cast&lt;unsigned&gt;(pointerOffset) &lt; utf8String.length()) {
+        int32_t nextPointerOffset = pointerOffset;
+        U8_NEXT(stringData, nextPointerOffset, static_cast&lt;int32_t&gt;(utf8String.length()), character);
+
+        if (character &lt; 0 || !u_isUWhiteSpace(character))
+            return;
+
+        pointerOffset = nextPointerOffset;
+        characterOffset++;
+    }
+}
+
+size_t lastHyphenLocation(StringView string, size_t beforeIndex, const AtomicString&amp; localeIdentifier)
+{
+    ASSERT(availableLocales().contains(localeIdentifier));
+    RefPtr&lt;HyphenationDictionary&gt; dictionary = hyphenDictionaryCache().get(localeIdentifier);
+
+    // libhyphen accepts strings in UTF-8 format, but WebCore can only provide StringView
+    // which stores either UTF-16 or Latin1 data. This is unfortunate for performance
+    // reasons and we should consider switching to a more flexible hyphenation library
+    // if it is available.
+    CString utf8StringCopy = string.toStringWithoutCopying().utf8();
+
+    // WebCore often passes strings like &quot; wordtohyphenate&quot; to the platform layer. Since
+    // libhyphen isn't advanced enough to deal with leading spaces (presumably CoreFoundation
+    // can), we should find the appropriate indexes into the string to skip them.
+    int32_t leadingSpaceBytes;
+    int32_t leadingSpaceCharacters;
+    countLeadingSpaces(utf8StringCopy, leadingSpaceBytes, leadingSpaceCharacters);
+
+    // The libhyphen documentation specifies that this array should be 5 bytes longer than
+    // the byte length of the input string.
+    Vector&lt;char&gt; hyphenArray(utf8StringCopy.length() - leadingSpaceBytes + 5);
+    char* hyphenArrayData = hyphenArray.data();
+
+    char** replacements = nullptr;
+    int* positions = nullptr;
+    int* removedCharacterCounts = nullptr;
+    hnj_hyphen_hyphenate2(dictionary-&gt;libhyphenDictionary(),
+        utf8StringCopy.data() + leadingSpaceBytes,
+        utf8StringCopy.length() - leadingSpaceBytes,
+        hyphenArrayData,
+        nullptr, /* output parameter for hyphenated word */
+        &amp;replacements,
+        &amp;positions,
+        &amp;removedCharacterCounts);
+
+    if (replacements) {
+        for (unsigned i = 0; i &lt; utf8StringCopy.length() - leadingSpaceBytes - 1; i++)
+            free(replacements[i]);
+        free(replacements);
+    }
+
+    free(positions);
+    free(removedCharacterCounts);
+
+    for (int i = beforeIndex - leadingSpaceCharacters - 1; i &gt;= 0; i--) {
+        // libhyphen will put an odd number in hyphenArrayData at all
+        // hyphenation points. A number &amp; 1 will be true for odd numbers.
+        if (hyphenArrayData[i] &amp; 1)
+            return i + leadingSpaceCharacters;
+    }
+
+    return 0;
+}
+
+} // namespace WebCore
+
+#endif // USE(LIBHYPHEN)
</ins><span class="cx">Property changes on: trunk/Source/WebCore/platform/text/gtk/HyphenationLibHyphen.cpp
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourcecmakeFindHyphencmake"></a>
<div class="addfile"><h4>Added: trunk/Source/cmake/FindHyphen.cmake (0 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/FindHyphen.cmake                                (rev 0)
+++ trunk/Source/cmake/FindHyphen.cmake        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+# - Try to find libhyphen
+# Once done, this will define
+#
+#  HYPHEN_FOUND - system has libhyphen installed.
+#  HYPHEN_INCLUDE_DIR - directories which contain the libhyphen headers.
+#  HYPHEN_LIBRARY - libraries required to link against libhyphen.
+#
+# Copyright (C) 2012 Intel Corporation. All rights reserved.
+# Copyright (C) 2015 Igalia S.L.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
+# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+find_path(HYPHEN_INCLUDE_DIR NAMES hyphen.h)
+find_library(HYPHEN_LIBRARIES NAMES hyphen hnj)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(HYPHEN DEFAULT_MSG HYPHEN_INCLUDE_DIR HYPHEN_LIBRARIES)
+
+if (HYPHEN_INCLUDE_DIR AND HYPHEN_LIBRARIES)
+    set(HYPHEN_FOUND 1)
+else ()
+    set(HYPHEN_FOUND 0)
+endif ()
+
+mark_as_advanced(HYPHEN_INCLUDE_DIR HYPHEN_LIBRARIES HYPHEN_FOUND)
</ins></span></pre></div>
<a id="trunkSourcecmakeOptionsGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/cmake/OptionsGTK.cmake (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/OptionsGTK.cmake        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/Source/cmake/OptionsGTK.cmake        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> WEBKIT_OPTION_DEFINE(ENABLE_X11_TARGET &quot;Whether to enable support for the X11 windowing target.&quot; PUBLIC ON)
</span><span class="cx"> WEBKIT_OPTION_DEFINE(ENABLE_WAYLAND_TARGET &quot;Whether to enable support for the Wayland windowing target.&quot; PUBLIC OFF)
</span><span class="cx"> WEBKIT_OPTION_DEFINE(USE_LIBNOTIFY &quot;Whether to enable the default web notification implementation.&quot; PUBLIC ON)
</span><ins>+WEBKIT_OPTION_DEFINE(USE_LIBHYPHEN &quot;Whether to enable the default automatic hyphenation implementation.&quot; PUBLIC ON)
</ins><span class="cx"> 
</span><span class="cx"> WEBKIT_OPTION_DEFINE(USE_GSTREAMER_GL &quot;Whether to enable support for GStreamer GL&quot; PRIVATE OFF)
</span><span class="cx"> WEBKIT_OPTION_DEFINE(USE_GSTREAMER_MPEGTS &quot;Whether to enable support for MPEG-TS&quot; PRIVATE OFF)
</span><span class="lines">@@ -378,6 +379,14 @@
</span><span class="cx">     SET_AND_EXPOSE_TO_BUILD(WTF_USE_LIBNOTIFY TRUE)
</span><span class="cx"> endif ()
</span><span class="cx"> 
</span><ins>+if (HYPHEN_FOUND)
+    find_package(Hyphen)
+    if (NOT LIBHYPHEN_FOUND)
+       message(FATAL_ERROR &quot;libhyphen is needed for USE_LIBHYPHEN.&quot;)
+    endif ()
+    SET_AND_EXPOSE_TO_BUILD(WTF_USE_LIBHYPHEN 1)
+endif ()
+
</ins><span class="cx"> set(DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR ${DERIVED_SOURCES_DIR}/webkitdom)
</span><span class="cx"> set(DERIVED_SOURCES_WEBKITGTK_DIR ${DERIVED_SOURCES_DIR}/webkitgtk)
</span><span class="cx"> set(DERIVED_SOURCES_WEBKITGTK_API_DIR ${DERIVED_SOURCES_WEBKITGTK_DIR}/webkit)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/Tools/ChangeLog        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-04-29  Martin Robinson  &lt;mrobinson@igalia.com&gt;
+
+        [GTK] Add support for automatic hyphenation
+        https://bugs.webkit.org/show_bug.cgi?id=44478
+
+        Reviewed by Carlos Garcia Campos.
+
+        * gtk/jhbuild.modules: Add a module for testing dictionaries, so that
+        all systems will use the same dictionaries for testing purposes.
+
</ins><span class="cx"> 2015-04-29  Jake Nielsen  &lt;jacob_nielsen@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Failure when building WebKit for appletvsimulator.
</span></span></pre></div>
<a id="trunkToolsgtkjhbuildmodules"></a>
<div class="modfile"><h4>Modified: trunk/Tools/gtk/jhbuild.modules (183583 => 183584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/gtk/jhbuild.modules        2015-04-29 22:41:18 UTC (rev 183583)
+++ trunk/Tools/gtk/jhbuild.modules        2015-04-29 22:46:15 UTC (rev 183584)
</span><span class="lines">@@ -91,6 +91,11 @@
</span><span class="cx">     &lt;branch repo=&quot;github.com&quot; module=&quot;mrobinson/webkitgtk-test-fonts.git&quot; checkoutdir=&quot;webkitgtk-test-fonts&quot; tag=&quot;0.0.5&quot;/&gt;
</span><span class="cx">   &lt;/autotools&gt;
</span><span class="cx"> 
</span><ins>+  &lt;autotools id=&quot;dicts&quot;
+             skip-autogen=&quot;true&quot;&gt;
+    &lt;branch repo=&quot;github.com&quot; module=&quot;mrobinson/webkitgtk-test-dicts.git&quot; checkoutdir=&quot;webkitgtk-test-dicts&quot; tag=&quot;0.0.1&quot;/&gt;
+  &lt;/autotools&gt;
+
</ins><span class="cx">   &lt;autotools id=&quot;freetype6&quot; autogen-sh=&quot;configure&quot;&gt;
</span><span class="cx">     &lt;branch module=&quot;freetype/freetype-2.4.11.tar.bz2&quot; version=&quot;2.4.11&quot;
</span><span class="cx">             repo=&quot;savannah.gnu.org&quot;
</span></span></pre>
</div>
</div>

</body>
</html>