<!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>[211228] 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/211228">211228</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2017-01-26 13:19:38 -0800 (Thu, 26 Jan 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Simple line layout: Add support for -webkit-hyphenate-limit-lines
https://bugs.webkit.org/show_bug.cgi?id=167446
&lt;rdar://problem/30194030&gt;

Reviewed by Antti Koivisto.

Source/WebCore:

Now we can set the limit on the number of lines that a word can split across through hyphenation.

Tests: fast/text/simple-line-layout-hyphen-limit-lines.html
       fast/text/simple-line-layout-hyphen-limit-lines2.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
(WebCore::SimpleLineLayout::splitFragmentToFitLine):
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::wrappingWithHyphenCounter):
(WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen): The right side of the split has +1 on the wrapping counter.

LayoutTests:

* fast/text/simple-line-layout-hyphen-limit-lines-expected.html: Added.
* fast/text/simple-line-layout-hyphen-limit-lines.html: Added.
* fast/text/simple-line-layout-hyphen-limit-lines2-expected.html: Added.
* fast/text/simple-line-layout-hyphen-limit-lines2.html: Added.
* platform/mac/fast/text/hyphenate-limit-lines-expected.txt: progression</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacfasttexthyphenatelimitlinesexpectedtxt">trunk/LayoutTests/platform/mac/fast/text/hyphenate-limit-lines-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingSimpleLineLayoutcpp">trunk/Source/WebCore/rendering/SimpleLineLayout.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingSimpleLineLayoutTextFragmentIteratorcpp">trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingSimpleLineLayoutTextFragmentIteratorh">trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasttextsimplelinelayouthyphenlimitlinesexpectedhtml">trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines-expected.html</a></li>
<li><a href="#trunkLayoutTestsfasttextsimplelinelayouthyphenlimitlineshtml">trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines.html</a></li>
<li><a href="#trunkLayoutTestsfasttextsimplelinelayouthyphenlimitlines2expectedhtml">trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines2-expected.html</a></li>
<li><a href="#trunkLayoutTestsfasttextsimplelinelayouthyphenlimitlines2html">trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines2.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (211227 => 211228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-01-26 20:58:08 UTC (rev 211227)
+++ trunk/LayoutTests/ChangeLog        2017-01-26 21:19:38 UTC (rev 211228)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2017-01-26  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Simple line layout: Add support for -webkit-hyphenate-limit-lines
+        https://bugs.webkit.org/show_bug.cgi?id=167446
+        &lt;rdar://problem/30194030&gt;
+
+        Reviewed by Antti Koivisto.
+
+        * fast/text/simple-line-layout-hyphen-limit-lines-expected.html: Added.
+        * fast/text/simple-line-layout-hyphen-limit-lines.html: Added.
+        * fast/text/simple-line-layout-hyphen-limit-lines2-expected.html: Added.
+        * fast/text/simple-line-layout-hyphen-limit-lines2.html: Added.
+        * platform/mac/fast/text/hyphenate-limit-lines-expected.txt: progression
+
+2017-01-26  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
</ins><span class="cx">         Simple line layout: Add support for -webkit-hyphenate-limit-after and -webkit-hyphenate-limit-before
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=167439
</span><span class="cx">         &lt;rdar://problem/30180184&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextsimplelinelayouthyphenlimitlinesexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines-expected.html (0 => 211228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines-expected.html        2017-01-26 21:19:38 UTC (rev 211228)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;This tests that simple and normal line layout produce the same lines with hyphenate-limit-lines&lt;/title&gt;
+&lt;style&gt;
+div {
+  display: inline-block;
+  -webkit-hyphens: auto; 
+  width: 35px;
+  border: 1px solid green;
+  margin-right: 100px;
+  vertical-align: top;
+}
+&lt;/style&gt;
+&lt;script&gt;
+if (internal.settings)
+    internals.settings.setSimpleLineLayoutEnabled(false);
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 0;&quot;&gt;accoutrements accessories anomalistic auspicious favorable prosperous circumlocution conviviality coruscant cuddlesome cynosure equanimity excogitate gasconading idiosyncratic luminescent magnanimous nidificate penultimate perfidiousness perspicacious proficuous profitable advantageous remunerative profitability saxicolous sesquipedalian superabundant unencumbered responsibilities unparagoned peerless&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 1;&quot;&gt;accoutrements accessories anomalistic auspicious favorable prosperous circumlocution conviviality coruscant cuddlesome cynosure equanimity excogitate gasconading idiosyncratic luminescent magnanimous nidificate penultimate perfidiousness perspicacious proficuous profitable advantageous remunerative profitability saxicolous sesquipedalian superabundant unencumbered responsibilities unparagoned peerless&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 2;&quot;&gt;accoutrements accessories anomalistic auspicious favorable prosperous circumlocution conviviality coruscant cuddlesome cynosure equanimity excogitate gasconading idiosyncratic luminescent magnanimous nidificate penultimate perfidiousness perspicacious proficuous profitable advantageous remunerative profitability saxicolous sesquipedalian superabundant unencumbered responsibilities unparagoned peerless&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 3;&quot;&gt;accoutrements accessories anomalistic auspicious favorable prosperous circumlocution conviviality coruscant cuddlesome cynosure equanimity excogitate gasconading idiosyncratic luminescent magnanimous nidificate penultimate perfidiousness perspicacious proficuous profitable advantageous remunerative profitability saxicolous sesquipedalian superabundant unencumbered responsibilities unparagoned peerless&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 4;&quot;&gt;accoutrements accessories anomalistic auspicious favorable prosperous circumlocution conviviality coruscant cuddlesome cynosure equanimity excogitate gasconading idiosyncratic luminescent magnanimous nidificate penultimate perfidiousness perspicacious proficuous profitable advantageous remunerative profitability saxicolous sesquipedalian superabundant unencumbered responsibilities unparagoned peerless&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 5;&quot;&gt;accoutrements accessories anomalistic auspicious favorable prosperous circumlocution conviviality coruscant cuddlesome cynosure equanimity excogitate gasconading idiosyncratic luminescent magnanimous nidificate penultimate perfidiousness perspicacious proficuous profitable advantageous remunerative profitability saxicolous sesquipedalian superabundant unencumbered responsibilities unparagoned peerless&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfasttextsimplelinelayouthyphenlimitlineshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines.html (0 => 211228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines.html                                (rev 0)
+++ trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines.html        2017-01-26 21:19:38 UTC (rev 211228)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;This tests that simple and normal line layout produce the same lines with hyphenate-limit-lines&lt;/title&gt;
+&lt;style&gt;
+div {
+  display: inline-block;
+  -webkit-hyphens: auto; 
+  width: 35px;
+  border: 1px solid green;
+  margin-right: 100px;
+  vertical-align: top;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 0;&quot;&gt;accoutrements accessories anomalistic auspicious favorable prosperous circumlocution conviviality coruscant cuddlesome cynosure equanimity excogitate gasconading idiosyncratic luminescent magnanimous nidificate penultimate perfidiousness perspicacious proficuous profitable advantageous remunerative profitability saxicolous sesquipedalian superabundant unencumbered responsibilities unparagoned peerless&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 1;&quot;&gt;accoutrements accessories anomalistic auspicious favorable prosperous circumlocution conviviality coruscant cuddlesome cynosure equanimity excogitate gasconading idiosyncratic luminescent magnanimous nidificate penultimate perfidiousness perspicacious proficuous profitable advantageous remunerative profitability saxicolous sesquipedalian superabundant unencumbered responsibilities unparagoned peerless&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 2;&quot;&gt;accoutrements accessories anomalistic auspicious favorable prosperous circumlocution conviviality coruscant cuddlesome cynosure equanimity excogitate gasconading idiosyncratic luminescent magnanimous nidificate penultimate perfidiousness perspicacious proficuous profitable advantageous remunerative profitability saxicolous sesquipedalian superabundant unencumbered responsibilities unparagoned peerless&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 3;&quot;&gt;accoutrements accessories anomalistic auspicious favorable prosperous circumlocution conviviality coruscant cuddlesome cynosure equanimity excogitate gasconading idiosyncratic luminescent magnanimous nidificate penultimate perfidiousness perspicacious proficuous profitable advantageous remunerative profitability saxicolous sesquipedalian superabundant unencumbered responsibilities unparagoned peerless&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 4;&quot;&gt;accoutrements accessories anomalistic auspicious favorable prosperous circumlocution conviviality coruscant cuddlesome cynosure equanimity excogitate gasconading idiosyncratic luminescent magnanimous nidificate penultimate perfidiousness perspicacious proficuous profitable advantageous remunerative profitability saxicolous sesquipedalian superabundant unencumbered responsibilities unparagoned peerless&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 5;&quot;&gt;accoutrements accessories anomalistic auspicious favorable prosperous circumlocution conviviality coruscant cuddlesome cynosure equanimity excogitate gasconading idiosyncratic luminescent magnanimous nidificate penultimate perfidiousness perspicacious proficuous profitable advantageous remunerative profitability saxicolous sesquipedalian superabundant unencumbered responsibilities unparagoned peerless&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfasttextsimplelinelayouthyphenlimitlines2expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines2-expected.html (0 => 211228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines2-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines2-expected.html        2017-01-26 21:19:38 UTC (rev 211228)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;This tests that simple and normal line layout produce the same lines with hyphenate-limit-lines&lt;/title&gt;
+&lt;style&gt;
+div {
+  display: inline-block;
+  -webkit-hyphens: auto;
+  width: 40px;
+  border: 1px solid green;
+  margin-right: 100px;
+  vertical-align: top;
+}
+&lt;/style&gt;
+&lt;script&gt;
+if (internal.settings)
+    internals.settings.setSimpleLineLayoutEnabled(false);
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 0;&quot;&gt;foobarness foobarnessability&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 1;&quot;&gt;foobarness foobarnessability&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 2;&quot;&gt;foobarness foobarnessability&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 3;&quot;&gt;foobarness foobarnessability&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 4;&quot;&gt;foobarness foobarnessability&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 5;&quot;&gt;foobarness foobarnessability&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfasttextsimplelinelayouthyphenlimitlines2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines2.html (0 => 211228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines2.html                                (rev 0)
+++ trunk/LayoutTests/fast/text/simple-line-layout-hyphen-limit-lines2.html        2017-01-26 21:19:38 UTC (rev 211228)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;This tests that simple and normal line layout produce the same lines with hyphenate-limit-lines&lt;/title&gt;
+&lt;style&gt;
+div {
+  display: inline-block;
+  -webkit-hyphens: auto;
+  width: 40px;
+  border: 1px solid green;
+  margin-right: 100px;
+  vertical-align: top;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 0;&quot;&gt;foobarness foobarnessability&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 1;&quot;&gt;foobarness foobarnessability&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 2;&quot;&gt;foobarness foobarnessability&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 3;&quot;&gt;foobarness foobarnessability&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 4;&quot;&gt;foobarness foobarnessability&lt;/div&gt;
+&lt;div style=&quot;-webkit-hyphenate-limit-lines: 5;&quot;&gt;foobarness foobarnessability&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfasttexthyphenatelimitlinesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/fast/text/hyphenate-limit-lines-expected.txt (211227 => 211228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/text/hyphenate-limit-lines-expected.txt        2017-01-26 20:58:08 UTC (rev 211227)
+++ trunk/LayoutTests/platform/mac/fast/text/hyphenate-limit-lines-expected.txt        2017-01-26 21:19:38 UTC (rev 211228)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><del>-layer at (0,0) size 785x1066
</del><ins>+layer at (0,0) size 785x1035
</ins><span class="cx">   RenderView at (0,0) size 785x600
</span><del>-layer at (0,0) size 785x1066
-  RenderBlock {HTML} at (0,0) size 785x1066
</del><ins>+layer at (0,0) size 785x1035
+  RenderBlock {HTML} at (0,0) size 785x1035
</ins><span class="cx">     RenderBody {BODY} at (8,8) size 769x584
</span><span class="cx">       RenderBlock (floating) {DIV} at (4,0) size 202x498 [border: (1px solid #ADD8E6)]
</span><span class="cx">         RenderText {#text} at (1,1) size 200x496
</span><span class="lines">@@ -47,8 +47,8 @@
</span><span class="cx">           text run at (1,435) width 200: &quot;probably first in&quot; + hyphen string &quot;-&quot;
</span><span class="cx">           text run at (1,466) width 109: &quot;vented by &quot;
</span><span class="cx">           text run at (109,466) width 61: &quot;Plato.&quot;
</span><del>-      RenderBlock (floating) {DIV} at (424,0) size 202x529 [border: (1px solid #ADD8E6)]
-        RenderText {#text} at (1,1) size 200x527
</del><ins>+      RenderBlock (floating) {DIV} at (424,0) size 202x498 [border: (1px solid #ADD8E6)]
+        RenderText {#text} at (1,1) size 200x496
</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,32) width 200: &quot;the mind into the&quot;
</span><span class="cx">           text run at (1,63) width 200: &quot;rational, concupis&quot; + hyphen string &quot;-&quot;
</span><span class="lines">@@ -57,18 +57,19 @@
</span><span class="cx">           text run at (1,125) width 200: &quot;elements, or of&quot;
</span><span class="cx">           text run at (1,156) width 200: &quot;pleasures and de&quot; + hyphen string &quot;-&quot;
</span><span class="cx">           text run at (1,187) width 200: &quot;sires into neces&quot; + hyphen string &quot;-&quot;
</span><del>-          text run at (1,218) width 200: &quot;sary and&quot;
-          text run at (1,249) width 154: &quot;unnecessary\x{2014}&quot;
-          text run at (1,280) width 200: &quot;these and other&quot;
-          text run at (1,311) width 200: &quot;great forms of&quot;
-          text run at (1,342) width 200: &quot;thought are all of&quot;
-          text run at (1,373) width 67: &quot;them &quot;
-          text run at (67,373) width 134: &quot;to be found&quot;
-          text run at (1,404) width 200: &quot;in the Republic,&quot;
-          text run at (1,435) width 200: &quot;and were probably&quot;
-          text run at (1,466) width 200: &quot;first invented by&quot;
-          text run at (1,497) width 60: &quot;Plato.&quot;
-      RenderBlock (floating) {DIV} at (4,529) size 202x498 [border: (1px solid #ADD8E6)]
</del><ins>+          text run at (1,218) width 108: &quot;sary and &quot;
+          text run at (108,218) width 93: &quot;unneces&quot; + hyphen string &quot;-&quot;
+          text run at (1,249) width 200: &quot;sary\x{2014}these and&quot;
+          text run at (1,280) width 200: &quot;other great forms&quot;
+          text run at (1,311) width 200: &quot;of thought are all&quot;
+          text run at (1,342) width 129: &quot;of them &quot;
+          text run at (129,342) width 72: &quot;to be&quot;
+          text run at (1,373) width 200: &quot;found in the Re&quot; + hyphen string &quot;-&quot;
+          text run at (1,404) width 200: &quot;public, and were&quot;
+          text run at (1,435) width 200: &quot;probably first in&quot; + hyphen string &quot;-&quot;
+          text run at (1,466) width 109: &quot;vented by &quot;
+          text run at (109,466) width 61: &quot;Plato.&quot;
+      RenderBlock (floating) {DIV} at (4,498) size 202x498 [border: (1px solid #ADD8E6)]
</ins><span class="cx">         RenderText {#text} at (1,1) size 200x496
</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,32) width 200: &quot;the mind into the&quot;
</span><span class="lines">@@ -77,20 +78,20 @@
</span><span class="cx">           text run at (112,94) width 89: &quot;irascible&quot;
</span><span class="cx">           text run at (1,125) width 200: &quot;elements, or of&quot;
</span><span class="cx">           text run at (1,156) width 200: &quot;pleasures and de&quot; + hyphen string &quot;-&quot;
</span><del>-          text run at (1,187) width 200: &quot;sires into&quot;
-          text run at (1,218) width 166: &quot;necessary and &quot;
-          text run at (166,218) width 35: &quot;un&quot; + hyphen string &quot;-&quot;
-          text run at (1,249) width 181: &quot;necessary\x{2014}these&quot;
-          text run at (1,280) width 200: &quot;and other great&quot;
-          text run at (1,311) width 200: &quot;forms of thought&quot;
-          text run at (1,342) width 180: &quot;are all of them &quot;
-          text run at (180,342) width 21: &quot;to&quot;
-          text run at (1,373) width 200: &quot;be found in the&quot;
-          text run at (1,404) width 200: &quot;Republic, and&quot;
-          text run at (1,435) width 200: &quot;were probably first&quot;
-          text run at (1,466) width 129: &quot;invented by &quot;
-          text run at (129,466) width 61: &quot;Plato.&quot;
-      RenderBlock (floating) {DIV} at (214,529) size 202x529 [border: (1px solid #ADD8E6)]
</del><ins>+          text run at (1,187) width 200: &quot;sires into neces&quot; + hyphen string &quot;-&quot;
+          text run at (1,218) width 108: &quot;sary and &quot;
+          text run at (108,218) width 93: &quot;unneces&quot; + hyphen string &quot;-&quot;
+          text run at (1,249) width 200: &quot;sary\x{2014}these and&quot;
+          text run at (1,280) width 200: &quot;other great forms&quot;
+          text run at (1,311) width 200: &quot;of thought are all&quot;
+          text run at (1,342) width 129: &quot;of them &quot;
+          text run at (129,342) width 72: &quot;to be&quot;
+          text run at (1,373) width 200: &quot;found in the Re&quot; + hyphen string &quot;-&quot;
+          text run at (1,404) width 200: &quot;public, and were&quot;
+          text run at (1,435) width 200: &quot;probably first in&quot; + hyphen string &quot;-&quot;
+          text run at (1,466) width 109: &quot;vented by &quot;
+          text run at (109,466) width 61: &quot;Plato.&quot;
+      RenderBlock (floating) {DIV} at (214,498) size 202x529 [border: (1px solid #ADD8E6)]
</ins><span class="cx">         RenderText {#text} at (1,1) size 200x527
</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,32) width 200: &quot;the mind into the&quot;
</span><span class="lines">@@ -100,7 +101,7 @@
</span><span class="cx">           text run at (1,156) width 200: &quot;or of pleasures and&quot;
</span><span class="cx">           text run at (1,187) width 200: &quot;desires into&quot;
</span><span class="cx">           text run at (1,218) width 200: &quot;necessary and&quot;
</span><del>-          text run at (1,249) width 154: &quot;unnecessary\x{2014}&quot;
</del><ins>+          text run at (1,249) width 200: &quot;unnecessary\x{2014}&quot;
</ins><span class="cx">           text run at (1,280) width 200: &quot;these and other&quot;
</span><span class="cx">           text run at (1,311) width 200: &quot;great forms of&quot;
</span><span class="cx">           text run at (1,342) width 200: &quot;thought are all of&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (211227 => 211228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-01-26 20:58:08 UTC (rev 211227)
+++ trunk/Source/WebCore/ChangeLog        2017-01-26 21:19:38 UTC (rev 211228)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2017-01-26  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        Simple line layout: Add support for -webkit-hyphenate-limit-lines
+        https://bugs.webkit.org/show_bug.cgi?id=167446
+        &lt;rdar://problem/30194030&gt;
+
+        Reviewed by Antti Koivisto.
+
+        Now we can set the limit on the number of lines that a word can split across through hyphenation.
+
+        Tests: fast/text/simple-line-layout-hyphen-limit-lines.html
+               fast/text/simple-line-layout-hyphen-limit-lines2.html
+
+        * rendering/SimpleLineLayout.cpp:
+        (WebCore::SimpleLineLayout::canUseForStyle):
+        (WebCore::SimpleLineLayout::splitFragmentToFitLine):
+        (WebCore::SimpleLineLayout::printReason):
+        * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
+        (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
+        * rendering/SimpleLineLayoutTextFragmentIterator.h:
+        (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
+        (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::wrappingWithHyphenCounter):
+        (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen): The right side of the split has +1 on the wrapping counter.
+
</ins><span class="cx"> 2017-01-26  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add support for recognizing data interaction gestures in WebKit2
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayout.cpp (211227 => 211228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayout.cpp        2017-01-26 20:58:08 UTC (rev 211227)
+++ trunk/Source/WebCore/rendering/SimpleLineLayout.cpp        2017-01-26 21:19:38 UTC (rev 211228)
</span><span class="lines">@@ -86,34 +86,33 @@
</span><span class="cx">     FlowHasRTLOrdering                    = 1LLU  &lt;&lt; 20,
</span><span class="cx">     FlowHasLineAlignEdges                 = 1LLU  &lt;&lt; 21,
</span><span class="cx">     FlowHasLineSnap                       = 1LLU  &lt;&lt; 22,
</span><del>-    FlowHasHypensLineLimit                = 1LLU  &lt;&lt; 23,
-    FlowHasTextEmphasisFillOrMark         = 1LLU  &lt;&lt; 24,
-    FlowHasTextShadow                     = 1LLU  &lt;&lt; 25,
-    FlowHasPseudoFirstLine                = 1LLU  &lt;&lt; 26,
-    FlowHasPseudoFirstLetter              = 1LLU  &lt;&lt; 27,
-    FlowHasTextCombine                    = 1LLU  &lt;&lt; 28,
-    FlowHasTextFillBox                    = 1LLU  &lt;&lt; 29,
-    FlowHasBorderFitLines                 = 1LLU  &lt;&lt; 30,
-    FlowHasNonAutoLineBreak               = 1LLU  &lt;&lt; 31,
-    FlowHasNonAutoTrailingWord            = 1LLU  &lt;&lt; 32,
-    FlowHasSVGFont                        = 1LLU  &lt;&lt; 33,
-    FlowTextIsEmpty                       = 1LLU  &lt;&lt; 34,
-    FlowTextHasSoftHyphen                 = 1LLU  &lt;&lt; 35,
-    FlowTextHasDirectionCharacter         = 1LLU  &lt;&lt; 36,
-    FlowIsMissingPrimaryFont              = 1LLU  &lt;&lt; 37,
-    FlowFontIsMissingGlyph                = 1LLU  &lt;&lt; 38,
-    FlowTextIsCombineText                 = 1LLU  &lt;&lt; 39,
-    FlowTextIsRenderCounter               = 1LLU  &lt;&lt; 40,
-    FlowTextIsRenderQuote                 = 1LLU  &lt;&lt; 41,
-    FlowTextIsTextFragment                = 1LLU  &lt;&lt; 42,
-    FlowTextIsSVGInlineText               = 1LLU  &lt;&lt; 43,
-    FlowFontIsNotSimple                   = 1LLU  &lt;&lt; 44,
-    FeatureIsDisabled                     = 1LLU  &lt;&lt; 45,
-    FlowHasNoParent                       = 1LLU  &lt;&lt; 46,
-    FlowHasNoChild                        = 1LLU  &lt;&lt; 47,
-    FlowChildIsSelected                   = 1LLU  &lt;&lt; 48,
-    FlowHasHangingPunctuation             = 1LLU  &lt;&lt; 49,
-    EndOfReasons                          = 1LLU  &lt;&lt; 50
</del><ins>+    FlowHasTextEmphasisFillOrMark         = 1LLU  &lt;&lt; 23,
+    FlowHasTextShadow                     = 1LLU  &lt;&lt; 24,
+    FlowHasPseudoFirstLine                = 1LLU  &lt;&lt; 25,
+    FlowHasPseudoFirstLetter              = 1LLU  &lt;&lt; 26,
+    FlowHasTextCombine                    = 1LLU  &lt;&lt; 27,
+    FlowHasTextFillBox                    = 1LLU  &lt;&lt; 28,
+    FlowHasBorderFitLines                 = 1LLU  &lt;&lt; 29,
+    FlowHasNonAutoLineBreak               = 1LLU  &lt;&lt; 30,
+    FlowHasNonAutoTrailingWord            = 1LLU  &lt;&lt; 31,
+    FlowHasSVGFont                        = 1LLU  &lt;&lt; 32,
+    FlowTextIsEmpty                       = 1LLU  &lt;&lt; 33,
+    FlowTextHasSoftHyphen                 = 1LLU  &lt;&lt; 34,
+    FlowTextHasDirectionCharacter         = 1LLU  &lt;&lt; 35,
+    FlowIsMissingPrimaryFont              = 1LLU  &lt;&lt; 36,
+    FlowFontIsMissingGlyph                = 1LLU  &lt;&lt; 37,
+    FlowTextIsCombineText                 = 1LLU  &lt;&lt; 38,
+    FlowTextIsRenderCounter               = 1LLU  &lt;&lt; 39,
+    FlowTextIsRenderQuote                 = 1LLU  &lt;&lt; 40,
+    FlowTextIsTextFragment                = 1LLU  &lt;&lt; 41,
+    FlowTextIsSVGInlineText               = 1LLU  &lt;&lt; 42,
+    FlowFontIsNotSimple                   = 1LLU  &lt;&lt; 43,
+    FeatureIsDisabled                     = 1LLU  &lt;&lt; 44,
+    FlowHasNoParent                       = 1LLU  &lt;&lt; 45,
+    FlowHasNoChild                        = 1LLU  &lt;&lt; 46,
+    FlowChildIsSelected                   = 1LLU  &lt;&lt; 47,
+    FlowHasHangingPunctuation             = 1LLU  &lt;&lt; 48,
+    EndOfReasons                          = 1LLU  &lt;&lt; 49
</ins><span class="cx"> };
</span><span class="cx"> const unsigned NoReason = 0;
</span><span class="cx"> 
</span><span class="lines">@@ -237,8 +236,6 @@
</span><span class="cx">         SET_REASON_AND_RETURN_IF_NEEDED(FlowHasLineAlignEdges, reasons, includeReasons);
</span><span class="cx">     if (style.lineSnap() != LineSnapNone)
</span><span class="cx">         SET_REASON_AND_RETURN_IF_NEEDED(FlowHasLineSnap, reasons, includeReasons);
</span><del>-    if (style.hyphenationLimitLines() != RenderStyle::initialHyphenationLimitLines())
-        SET_REASON_AND_RETURN_IF_NEEDED(FlowHasHypensLineLimit, reasons, includeReasons);
</del><span class="cx">     if (style.textEmphasisFill() != TextEmphasisFillFilled || style.textEmphasisMark() != TextEmphasisMarkNone)
</span><span class="cx">         SET_REASON_AND_RETURN_IF_NEEDED(FlowHasTextEmphasisFillOrMark, reasons, includeReasons);
</span><span class="cx">     if (style.textShadow())
</span><span class="lines">@@ -617,6 +614,31 @@
</span><span class="cx">     line.setAvailableWidth(std::max&lt;float&gt;(0, logicalRightOffset - line.logicalLeftOffset()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static std::optional&lt;unsigned&gt; hyphenPositionForFragment(unsigned splitPosition, TextFragmentIterator::TextFragment&amp; fragmentToSplit,
+    const TextFragmentIterator&amp; textFragmentIterator, float availableWidth)
+{
+    auto&amp; style = textFragmentIterator.style();
+    bool shouldHyphenate = style.shouldHyphenate &amp;&amp; (!style.hyphenLimitLines || fragmentToSplit.wrappingWithHyphenCounter() &lt; *style.hyphenLimitLines);
+    if (!shouldHyphenate)
+        return std::nullopt;
+
+    if (!enoughWidthForHyphenation(availableWidth, style.font.pixelSize()))
+        return std::nullopt;
+
+    // We might be able to fit the hyphen at the split position.
+    auto splitPositionWithHyphen = splitPosition;
+    // Find a splitting position where hyphen surely fits.
+    unsigned start = fragmentToSplit.start();
+    auto leftSideWidth = textFragmentIterator.textWidth(start, splitPosition, 0);
+    while (leftSideWidth + style.hyphenStringWidth &gt; availableWidth) {
+        if (--splitPositionWithHyphen &lt;= start)
+            return std::nullopt; // No space for hyphen.
+        leftSideWidth -= textFragmentIterator.textWidth(splitPositionWithHyphen, splitPositionWithHyphen + 1, 0);
+    }
+    ASSERT(splitPositionWithHyphen &gt; start);
+    return textFragmentIterator.lastHyphenPosition(fragmentToSplit, splitPositionWithHyphen + 1);
+}
+
</ins><span class="cx"> static TextFragmentIterator::TextFragment splitFragmentToFitLine(TextFragmentIterator::TextFragment&amp; fragmentToSplit, float availableWidth, bool keepAtLeastOneCharacter, const TextFragmentIterator&amp; textFragmentIterator)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: add surrogate pair support.
</span><span class="lines">@@ -626,26 +648,12 @@
</span><span class="cx">         return availableWidth &lt; textFragmentIterator.textWidth(start, index + 1, 0);
</span><span class="cx">     });
</span><span class="cx">     unsigned splitPosition = (*it);
</span><del>-    auto&amp; style = textFragmentIterator.style();
</del><span class="cx">     // Does first character fit this line?
</span><del>-    if (splitPosition == fragmentToSplit.start()) {
</del><ins>+    if (splitPosition == start) {
</ins><span class="cx">         if (keepAtLeastOneCharacter)
</span><span class="cx">             ++splitPosition;
</span><del>-    } else if (style.shouldHyphenate &amp;&amp; enoughWidthForHyphenation(availableWidth, style.font.pixelSize())) {
-        // We might be able to fit the hyphen at the split position.
-        auto splitPositionWithHyphen = splitPosition;
-        // Find a splitting position where hyphen surely fits.
-        auto leftSideWidth = textFragmentIterator.textWidth(start, splitPosition, 0);
-        while (leftSideWidth + style.hyphenStringWidth &gt; availableWidth) {
-            if (--splitPositionWithHyphen &lt;= start)
-                break; // No space for hyphen.
-            leftSideWidth -= textFragmentIterator.textWidth(splitPositionWithHyphen, splitPositionWithHyphen + 1, 0);
-        }
-        if (splitPositionWithHyphen &gt; start) {
-            if (auto hyphenPosition = textFragmentIterator.lastHyphenPosition(fragmentToSplit, splitPositionWithHyphen + 1))
-                return fragmentToSplit.splitWithHyphen(*hyphenPosition, textFragmentIterator);
-        }
-    }
</del><ins>+    } else if (auto hyphenPosition = hyphenPositionForFragment(splitPosition, fragmentToSplit, textFragmentIterator, availableWidth))
+        return fragmentToSplit.splitWithHyphen(*hyphenPosition, textFragmentIterator);
</ins><span class="cx">     return fragmentToSplit.split(splitPosition, textFragmentIterator);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -989,9 +997,6 @@
</span><span class="cx">     case FlowHasLineSnap:
</span><span class="cx">         stream &lt;&lt; &quot;-webkit-line-snap property&quot;;
</span><span class="cx">         break;
</span><del>-    case FlowHasHypensLineLimit:
-        stream &lt;&lt; &quot;-webkit-hyphenate-limit-lines property&quot;;
-        break;
</del><span class="cx">     case FlowHasTextEmphasisFillOrMark:
</span><span class="cx">         stream &lt;&lt; &quot;text-emphasis (fill/mark)&quot;;
</span><span class="cx">         break;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutTextFragmentIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp (211227 => 211228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp        2017-01-26 20:58:08 UTC (rev 211227)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp        2017-01-26 21:19:38 UTC (rev 211228)
</span><span class="lines">@@ -53,6 +53,8 @@
</span><span class="cx">     , hyphenLimitAfter(style.hyphenationLimitAfter() &lt; 0 ? 2 : style.hyphenationLimitAfter())
</span><span class="cx">     , locale(style.locale())
</span><span class="cx"> {
</span><ins>+    if (style.hyphenationLimitLines() &gt; -1)
+        hyphenLimitLines = style.hyphenationLimitLines();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TextFragmentIterator::TextFragmentIterator(const RenderBlockFlow&amp; flow)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutTextFragmentIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h (211227 => 211228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h        2017-01-26 20:58:08 UTC (rev 211227)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.h        2017-01-26 21:19:38 UTC (rev 211228)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">     public:
</span><span class="cx">         enum Type { ContentEnd, SoftLineBreak, HardLineBreak, Whitespace, NonWhitespace };
</span><span class="cx">         TextFragment() = default;
</span><del>-        TextFragment(unsigned start, unsigned end, float width, Type type, bool isLastInRenderer = false, bool overlapsToNextRenderer = false, bool isCollapsed = false, bool isCollapsible = false, bool hasHyphen = false)
</del><ins>+        TextFragment(unsigned start, unsigned end, float width, Type type, bool isLastInRenderer = false, bool overlapsToNextRenderer = false, bool isCollapsed = false, bool isCollapsible = false)
</ins><span class="cx">             : m_start(start)
</span><span class="cx">             , m_end(end)
</span><span class="cx">             , m_width(width)
</span><span class="lines">@@ -52,7 +52,6 @@
</span><span class="cx">             , m_overlapsToNextRenderer(overlapsToNextRenderer)
</span><span class="cx">             , m_isCollapsed(isCollapsed)
</span><span class="cx">             , m_isCollapsible(isCollapsible)
</span><del>-            , m_hasHyphen(hasHyphen)
</del><span class="cx">         {
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -66,6 +65,7 @@
</span><span class="cx">         bool isCollapsed() const { return m_isCollapsed; }
</span><span class="cx">         bool isCollapsible() const { return m_isCollapsible; }
</span><span class="cx">         bool hasHyphen() const { return m_hasHyphen; }
</span><ins>+        unsigned wrappingWithHyphenCounter() const { return m_hyphenationCounter; }
</ins><span class="cx"> 
</span><span class="cx">         bool isEmpty() const { return start() == end() &amp;&amp; !isLineBreak(); }
</span><span class="cx">         TextFragment split(unsigned splitPosition, const TextFragmentIterator&amp;);
</span><span class="lines">@@ -93,6 +93,7 @@
</span><span class="cx">         bool m_isCollapsed { false };
</span><span class="cx">         bool m_isCollapsible { false };
</span><span class="cx">         bool m_hasHyphen { false };
</span><ins>+        unsigned m_hyphenationCounter { 0 };
</ins><span class="cx">     };
</span><span class="cx">     TextFragment nextTextFragment(float xPosition = 0);
</span><span class="cx">     void revertToEndOfFragment(const TextFragment&amp;);
</span><span class="lines">@@ -121,6 +122,7 @@
</span><span class="cx">         unsigned hyphenLimitBefore;
</span><span class="cx">         unsigned hyphenLimitAfter;
</span><span class="cx">         AtomicString locale;
</span><ins>+        std::optional&lt;unsigned&gt; hyphenLimitLines;
</ins><span class="cx">     };
</span><span class="cx">     const Style&amp; style() const { return m_style; }
</span><span class="cx"> 
</span><span class="lines">@@ -168,6 +170,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(textFragmentIterator.style().shouldHyphenate);
</span><span class="cx">     auto rightSide = split(hyphenPosition, textFragmentIterator);
</span><ins>+    rightSide.m_hyphenationCounter = m_hyphenationCounter + 1;
</ins><span class="cx">     m_hasHyphen = true;
</span><span class="cx">     m_width += textFragmentIterator.style().hyphenStringWidth;
</span><span class="cx">     return rightSide;
</span></span></pre>
</div>
</div>

</body>
</html>