<!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>[213144] releases/WebKitGTK/webkit-2.16/Source/WebCore</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/213144">213144</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2017-02-28 01:53:01 -0800 (Tue, 28 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/213009">r213009</a> - Simple line layout: Move coverage functions out of SimpleLineLayout.cpp
https://bugs.webkit.org/show_bug.cgi?id=168872

Reviewed by Simon Fraser.

SimpleLineLayout.cpp is for core functions only.

No change in functionality.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderingAllInOne.cpp:
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
(WebCore::SimpleLineLayout::printReason): Deleted.
(WebCore::SimpleLineLayout::printReasons): Deleted.
(WebCore::SimpleLineLayout::printTextForSubtree): Deleted.
(WebCore::SimpleLineLayout::textLengthForSubtree): Deleted.
(WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows): Deleted.
(WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage): Deleted.
(WebCore::SimpleLineLayout::toggleSimpleLineLayout): Deleted.
(WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList): Deleted.
(WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage): Deleted.
* rendering/SimpleLineLayout.h:
* rendering/SimpleLineLayoutCoverage.cpp: Added.
(WebCore::SimpleLineLayout::printReason):
(WebCore::SimpleLineLayout::printReasons):
(WebCore::SimpleLineLayout::printTextForSubtree):
(WebCore::SimpleLineLayout::textLengthForSubtree):
(WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows):
(WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
(WebCore::SimpleLineLayout::toggleSimpleLineLayout):
(WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
(WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
* rendering/SimpleLineLayoutCoverage.h: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit216SourceWebCoreCMakeListstxt">releases/WebKitGTK/webkit-2.16/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebCoreWebCorexcodeprojprojectpbxproj">releases/WebKitGTK/webkit-2.16/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebCorerenderingRenderingAllInOnecpp">releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderingAllInOne.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebCorerenderingSimpleLineLayoutcpp">releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayout.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebCorerenderingSimpleLineLayouth">releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayout.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit216SourceWebCorerenderingSimpleLineLayoutCoveragecpp">releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayoutCoverage.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceWebCorerenderingSimpleLineLayoutCoverageh">releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayoutCoverage.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit216SourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/CMakeLists.txt (213143 => 213144)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebCore/CMakeLists.txt        2017-02-28 09:48:50 UTC (rev 213143)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/CMakeLists.txt        2017-02-28 09:53:01 UTC (rev 213144)
</span><span class="lines">@@ -2477,6 +2477,7 @@
</span><span class="cx">     rendering/ScrollAlignment.cpp
</span><span class="cx">     rendering/SelectionSubtreeRoot.cpp
</span><span class="cx">     rendering/SimpleLineLayout.cpp
</span><ins>+    rendering/SimpleLineLayoutCoverage.cpp
</ins><span class="cx">     rendering/SimpleLineLayoutFlowContents.cpp
</span><span class="cx">     rendering/SimpleLineLayoutFunctions.cpp
</span><span class="cx">     rendering/SimpleLineLayoutPagination.cpp
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog (213143 => 213144)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog        2017-02-28 09:48:50 UTC (rev 213143)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog        2017-02-28 09:53:01 UTC (rev 213144)
</span><span class="lines">@@ -1,5 +1,43 @@
</span><span class="cx"> 2017-02-25  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Simple line layout: Move coverage functions out of SimpleLineLayout.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=168872
+        
+        Reviewed by Simon Fraser.
+
+        SimpleLineLayout.cpp is for core functions only.
+
+        No change in functionality.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * rendering/RenderingAllInOne.cpp:
+        * rendering/SimpleLineLayout.cpp:
+        (WebCore::SimpleLineLayout::canUseForWithReason):
+        (WebCore::SimpleLineLayout::printReason): Deleted.
+        (WebCore::SimpleLineLayout::printReasons): Deleted.
+        (WebCore::SimpleLineLayout::printTextForSubtree): Deleted.
+        (WebCore::SimpleLineLayout::textLengthForSubtree): Deleted.
+        (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows): Deleted.
+        (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage): Deleted.
+        (WebCore::SimpleLineLayout::toggleSimpleLineLayout): Deleted.
+        (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList): Deleted.
+        (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage): Deleted.
+        * rendering/SimpleLineLayout.h:
+        * rendering/SimpleLineLayoutCoverage.cpp: Added.
+        (WebCore::SimpleLineLayout::printReason):
+        (WebCore::SimpleLineLayout::printReasons):
+        (WebCore::SimpleLineLayout::printTextForSubtree):
+        (WebCore::SimpleLineLayout::textLengthForSubtree):
+        (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows):
+        (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
+        (WebCore::SimpleLineLayout::toggleSimpleLineLayout):
+        (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
+        (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
+        * rendering/SimpleLineLayoutCoverage.h: Added.
+
+2017-02-25  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
</ins><span class="cx">         Text might wrap when its preferred logical width is used for sizing the containing block.
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=168864
</span><span class="cx">         &lt;rdar://problem/30690734&gt;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/WebCore.xcodeproj/project.pbxproj (213143 => 213144)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-02-28 09:48:50 UTC (rev 213143)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-02-28 09:53:01 UTC (rev 213144)
</span><span class="lines">@@ -569,6 +569,8 @@
</span><span class="cx">                 10FB084B14E15C7E00A3DB98 /* PublicURLManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FB084A14E15C7E00A3DB98 /* PublicURLManager.h */; };
</span><span class="cx">                 112B34D21E60B8A700BB310A /* SimpleLineLayoutPagination.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 112B34D01E60B8A700BB310A /* SimpleLineLayoutPagination.cpp */; };
</span><span class="cx">                 112B34D51E60B98300BB310A /* SimpleLineLayoutPagination.h in Headers */ = {isa = PBXBuildFile; fileRef = 112B34D41E60B98300BB310A /* SimpleLineLayoutPagination.h */; };
</span><ins>+                11E067EC1E62461300162D16 /* SimpleLineLayoutCoverage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 11E067EB1E62461300162D16 /* SimpleLineLayoutCoverage.cpp */; };
+                11E067EE1E6246E500162D16 /* SimpleLineLayoutCoverage.h in Headers */ = {isa = PBXBuildFile; fileRef = 11E067ED1E6246E500162D16 /* SimpleLineLayoutCoverage.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 120DE3ED1C86CA3E00B6D4DD /* WebAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 120DE3EA1C80161C00B6D4DD /* WebAnimation.cpp */; };
</span><span class="cx">                 120DE3F11C86CCC600B6D4DD /* AnimationEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 120DE3EE1C86CCBD00B6D4DD /* AnimationEffect.cpp */; };
</span><span class="cx">                 120DE3F81C87C5A800B6D4DD /* JSWebAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 120DE3F51C87C58E00B6D4DD /* JSWebAnimation.h */; };
</span><span class="lines">@@ -7680,6 +7682,8 @@
</span><span class="cx">                 10FB084A14E15C7E00A3DB98 /* PublicURLManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PublicURLManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 112B34D01E60B8A700BB310A /* SimpleLineLayoutPagination.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutPagination.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 112B34D41E60B98300BB310A /* SimpleLineLayoutPagination.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutPagination.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                11E067EB1E62461300162D16 /* SimpleLineLayoutCoverage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutCoverage.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                11E067ED1E6246E500162D16 /* SimpleLineLayoutCoverage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutCoverage.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 120DE3EA1C80161C00B6D4DD /* WebAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebAnimation.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 120DE3EB1C80161C00B6D4DD /* WebAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAnimation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 120DE3EC1C80161C00B6D4DD /* WebAnimation.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebAnimation.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -24309,6 +24313,8 @@
</span><span class="cx">                                 CDCFABBB18C0AE31006F8450 /* SelectionSubtreeRoot.h */,
</span><span class="cx">                                 E48944A0180B57D800F165D8 /* SimpleLineLayout.cpp */,
</span><span class="cx">                                 E48944A1180B57D800F165D8 /* SimpleLineLayout.h */,
</span><ins>+                                11E067EB1E62461300162D16 /* SimpleLineLayoutCoverage.cpp */,
+                                11E067ED1E6246E500162D16 /* SimpleLineLayoutCoverage.h */,
</ins><span class="cx">                                 585D6E011A1A792E00FA4F12 /* SimpleLineLayoutFlowContents.cpp */,
</span><span class="cx">                                 585D6E021A1A792E00FA4F12 /* SimpleLineLayoutFlowContents.h */,
</span><span class="cx">                                 E4E9B11A18145692003ACCDF /* SimpleLineLayoutFunctions.cpp */,
</span><span class="lines">@@ -25918,6 +25924,7 @@
</span><span class="cx">                                 97B38E27151C4271004622E9 /* DOMWindowNotifications.h in Headers */,
</span><span class="cx">                                 97D2AD0414B823A60093DF32 /* DOMWindowProperty.h in Headers */,
</span><span class="cx">                                 89F60B11157F686E0075E157 /* DOMWindowQuota.h in Headers */,
</span><ins>+                                11E067EE1E6246E500162D16 /* SimpleLineLayoutCoverage.h in Headers */,
</ins><span class="cx">                                 AA2A5AD616A4861600975A25 /* DOMWindowSpeechSynthesis.h in Headers */,
</span><span class="cx">                                 A8CCBB49151F831600AB7CE9 /* DOMWindowWebDatabase.h in Headers */,
</span><span class="cx">                                 BC53DA2E1143121E000D817E /* DOMWrapperWorld.h in Headers */,
</span><span class="lines">@@ -32083,6 +32090,7 @@
</span><span class="cx">                                 9759E94214EF1CF80026A2DD /* TextTrackCue.cpp in Sources */,
</span><span class="cx">                                 071A9EC2168FBC43002629F9 /* TextTrackCueGeneric.cpp in Sources */,
</span><span class="cx">                                 9759E94514EF1CF80026A2DD /* TextTrackCueList.cpp in Sources */,
</span><ins>+                                11E067EC1E62461300162D16 /* SimpleLineLayoutCoverage.cpp in Sources */,
</ins><span class="cx">                                 076970861463AD8700F502CF /* TextTrackList.cpp in Sources */,
</span><span class="cx">                                 B1AD4E7313A12A4600846B27 /* TextTrackLoader.cpp in Sources */,
</span><span class="cx">                                 CD1E7347167BC78E009A885D /* TextTrackRepresentation.cpp in Sources */,
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebCorerenderingRenderingAllInOnecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderingAllInOne.cpp (213143 => 213144)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderingAllInOne.cpp        2017-02-28 09:48:50 UTC (rev 213143)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/RenderingAllInOne.cpp        2017-02-28 09:53:01 UTC (rev 213144)
</span><span class="lines">@@ -142,6 +142,7 @@
</span><span class="cx"> #include &quot;ScrollAlignment.cpp&quot;
</span><span class="cx"> #include &quot;SelectionSubtreeRoot.cpp&quot;
</span><span class="cx"> #include &quot;SimpleLineLayout.cpp&quot;
</span><ins>+#include &quot;SimpleLineLayoutCoverage.cpp&quot;
</ins><span class="cx"> #include &quot;SimpleLineLayoutFlowContents.cpp&quot;
</span><span class="cx"> #include &quot;SimpleLineLayoutFunctions.cpp&quot;
</span><span class="cx"> #include &quot;SimpleLineLayoutPagination.cpp&quot;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebCorerenderingSimpleLineLayoutcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayout.cpp (213143 => 213144)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayout.cpp        2017-02-28 09:48:50 UTC (rev 213143)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayout.cpp        2017-02-28 09:53:01 UTC (rev 213144)
</span><span class="lines">@@ -44,7 +44,6 @@
</span><span class="cx"> #include &quot;RenderStyle.h&quot;
</span><span class="cx"> #include &quot;RenderText.h&quot;
</span><span class="cx"> #include &quot;RenderTextControl.h&quot;
</span><del>-#include &quot;RenderView.h&quot;
</del><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="cx"> #include &quot;SimpleLineLayoutFlowContents.h&quot;
</span><span class="cx"> #include &quot;SimpleLineLayoutFunctions.h&quot;
</span><span class="lines">@@ -51,79 +50,11 @@
</span><span class="cx"> #include &quot;SimpleLineLayoutTextFragmentIterator.h&quot;
</span><span class="cx"> #include &quot;Text.h&quot;
</span><span class="cx"> #include &quot;TextPaintStyle.h&quot;
</span><del>-#include &quot;TextStream.h&quot;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> namespace SimpleLineLayout {
</span><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span><del>-void printSimpleLineLayoutCoverage();
-void printSimpleLineLayoutBlockList();
-void toggleSimpleLineLayout();
-#endif
-
-enum AvoidanceReason_ : uint64_t {
-    FlowIsInsideRegion                    = 1LLU  &lt;&lt; 0,
-    FlowHasHorizonalWritingMode           = 1LLU  &lt;&lt; 1,
-    FlowHasOutline                        = 1LLU  &lt;&lt; 2,
-    FlowIsRuby                            = 1LLU  &lt;&lt; 3,
-    FlowIsPaginated                       = 1LLU  &lt;&lt; 4,
-    FlowHasTextOverflow                   = 1LLU  &lt;&lt; 5,
-    FlowIsDepricatedFlexBox               = 1LLU  &lt;&lt; 6,
-    FlowParentIsPlaceholderElement        = 1LLU  &lt;&lt; 7,
-    FlowParentIsTextAreaWithWrapping      = 1LLU  &lt;&lt; 8,
-    FlowHasNonSupportedChild              = 1LLU  &lt;&lt; 9,
-    FlowHasUnsupportedFloat               = 1LLU  &lt;&lt; 10,
-    FlowHasUnsupportedUnderlineDecoration = 1LLU  &lt;&lt; 11,
-    FlowHasJustifiedNonLatinText          = 1LLU  &lt;&lt; 12,
-    FlowHasOverflowNotVisible             = 1LLU  &lt;&lt; 13,
-    FlowHasWebKitNBSPMode                 = 1LLU  &lt;&lt; 14,
-    FlowIsNotLTR                          = 1LLU  &lt;&lt; 15,
-    FlowHasLineBoxContainProperty         = 1LLU  &lt;&lt; 16,
-    FlowIsNotTopToBottom                  = 1LLU  &lt;&lt; 17,
-    FlowHasLineBreak                      = 1LLU  &lt;&lt; 18,
-    FlowHasNonNormalUnicodeBiDi           = 1LLU  &lt;&lt; 19,
-    FlowHasRTLOrdering                    = 1LLU  &lt;&lt; 20,
-    FlowHasLineAlignEdges                 = 1LLU  &lt;&lt; 21,
-    FlowHasLineSnap                       = 1LLU  &lt;&lt; 22,
-    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,
-    FlowPrimaryFontIsInsufficient         = 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,
-    FlowHasComplexFontCodePath            = 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,
-    FlowFontHasOverflowGlyph              = 1LLU  &lt;&lt; 49,
-    FlowTextHasSurrogatePair              = 1LLU  &lt;&lt; 50,
-    EndOfReasons                          = 1LLU  &lt;&lt; 51
-};
-const unsigned NoReason = 0;
-
-typedef uint64_t AvoidanceReason;
-typedef uint64_t AvoidanceReasonFlags;
-
-enum class IncludeReasons { First , All };
-
-#ifndef NDEBUG
</del><span class="cx"> #define SET_REASON_AND_RETURN_IF_NEEDED(reason, reasons, includeReasons) { \
</span><span class="cx">         reasons |= reason; \
</span><span class="cx">         if (includeReasons == IncludeReasons::First) \
</span><span class="lines">@@ -298,7 +229,7 @@
</span><span class="cx">     return reasons;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static AvoidanceReasonFlags canUseForWithReason(const RenderBlockFlow&amp; flow, IncludeReasons includeReasons)
</del><ins>+AvoidanceReasonFlags canUseForWithReason(const RenderBlockFlow&amp; flow, IncludeReasons includeReasons)
</ins><span class="cx"> {
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     static std::once_flag onceFlag;
</span><span class="lines">@@ -948,319 +879,5 @@
</span><span class="cx">     memcpy(m_runs, runVector.data(), m_runCount * sizeof(Run));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#ifndef NDEBUG
-static void printReason(AvoidanceReason reason, TextStream&amp; stream)
-{
-    switch (reason) {
-    case FlowIsInsideRegion:
-        stream &lt;&lt; &quot;flow is inside region&quot;;
-        break;
-    case FlowHasHorizonalWritingMode:
-        stream &lt;&lt; &quot;horizontal writing mode&quot;;
-        break;
-    case FlowHasOutline:
-        stream &lt;&lt; &quot;outline&quot;;
-        break;
-    case FlowIsRuby:
-        stream &lt;&lt; &quot;ruby&quot;;
-        break;
-    case FlowHasHangingPunctuation:
-        stream &lt;&lt; &quot;hanging punctuation&quot;;
-        break;
-    case FlowIsPaginated:
-        stream &lt;&lt; &quot;paginated&quot;;
-        break;
-    case FlowHasTextOverflow:
-        stream &lt;&lt; &quot;text-overflow&quot;;
-        break;
-    case FlowIsDepricatedFlexBox:
-        stream &lt;&lt; &quot;depricatedFlexBox&quot;;
-        break;
-    case FlowParentIsPlaceholderElement:
-        stream &lt;&lt; &quot;placeholder element&quot;;
-        break;
-    case FlowParentIsTextAreaWithWrapping:
-        stream &lt;&lt; &quot;wrapping textarea&quot;;
-        break;
-    case FlowHasNonSupportedChild:
-        stream &lt;&lt; &quot;nested renderers&quot;;
-        break;
-    case FlowHasUnsupportedFloat:
-        stream &lt;&lt; &quot;complicated float&quot;;
-        break;
-    case FlowHasUnsupportedUnderlineDecoration:
-        stream &lt;&lt; &quot;text-underline-position: under&quot;;
-        break;
-    case FlowHasJustifiedNonLatinText:
-        stream &lt;&lt; &quot;text-align: justify with non-latin text&quot;;
-        break;
-    case FlowHasOverflowNotVisible:
-        stream &lt;&lt; &quot;overflow: hidden | scroll | auto&quot;;
-        break;
-    case FlowHasWebKitNBSPMode:
-        stream &lt;&lt; &quot;-webkit-nbsp-mode: space&quot;;
-        break;
-    case FlowIsNotLTR:
-        stream &lt;&lt; &quot;dir is not LTR&quot;;
-        break;
-    case FlowHasLineBoxContainProperty:
-        stream &lt;&lt; &quot;line-box-contain value indicates variable line height&quot;;
-        break;
-    case FlowIsNotTopToBottom:
-        stream &lt;&lt; &quot;non top-to-bottom flow&quot;;
-        break;
-    case FlowHasLineBreak:
-        stream &lt;&lt; &quot;line-break property&quot;;
-        break;
-    case FlowHasNonNormalUnicodeBiDi:
-        stream &lt;&lt; &quot;non-normal Unicode bidi&quot;;
-        break;
-    case FlowHasRTLOrdering:
-        stream &lt;&lt; &quot;-webkit-rtl-ordering&quot;;
-        break;
-    case FlowHasLineAlignEdges:
-        stream &lt;&lt; &quot;-webkit-line-align edges&quot;;
-        break;
-    case FlowHasLineSnap:
-        stream &lt;&lt; &quot;-webkit-line-snap property&quot;;
-        break;
-    case FlowHasTextEmphasisFillOrMark:
-        stream &lt;&lt; &quot;text-emphasis (fill/mark)&quot;;
-        break;
-    case FlowHasPseudoFirstLine:
-        stream &lt;&lt; &quot;first-line&quot;;
-        break;
-    case FlowHasPseudoFirstLetter:
-        stream &lt;&lt; &quot;first-letter&quot;;
-        break;
-    case FlowHasTextCombine:
-        stream &lt;&lt; &quot;text combine&quot;;
-        break;
-    case FlowHasTextFillBox:
-        stream &lt;&lt; &quot;background-color (text-fill)&quot;;
-        break;
-    case FlowHasBorderFitLines:
-        stream &lt;&lt; &quot;-webkit-border-fit&quot;;
-        break;
-    case FlowHasNonAutoLineBreak:
-        stream &lt;&lt; &quot;line-break is not auto&quot;;
-        break;
-    case FlowHasNonAutoTrailingWord:
-        stream &lt;&lt; &quot;-apple-trailing-word is not auto&quot;;
-        break;
-    case FlowHasSVGFont:
-        stream &lt;&lt; &quot;SVG font&quot;;
-        break;
-    case FlowTextHasSoftHyphen:
-        stream &lt;&lt; &quot;soft hyphen character&quot;;
-        break;
-    case FlowTextHasDirectionCharacter:
-        stream &lt;&lt; &quot;direction character&quot;;
-        break;
-    case FlowIsMissingPrimaryFont:
-        stream &lt;&lt; &quot;missing primary font&quot;;
-        break;
-    case FlowPrimaryFontIsInsufficient:
-        stream &lt;&lt; &quot;missing glyph or glyph needs another font&quot;;
-        break;
-    case FlowTextIsCombineText:
-        stream &lt;&lt; &quot;text is combine&quot;;
-        break;
-    case FlowTextIsRenderCounter:
-        stream &lt;&lt; &quot;unsupported RenderCounter&quot;;
-        break;
-    case FlowTextIsRenderQuote:
-        stream &lt;&lt; &quot;unsupported RenderQuote&quot;;
-        break;
-    case FlowTextIsTextFragment:
-        stream &lt;&lt; &quot;unsupported TextFragment&quot;;
-        break;
-    case FlowTextIsSVGInlineText:
-        stream &lt;&lt; &quot;unsupported SVGInlineText&quot;;
-        break;
-    case FlowHasComplexFontCodePath:
-        stream &lt;&lt; &quot;text with complex font codepath&quot;;
-        break;
-    case FlowHasTextShadow:
-        stream &lt;&lt; &quot;text-shadow&quot;;
-        break;
-    case FlowChildIsSelected:
-        stream &lt;&lt; &quot;selected content&quot;;
-        break;
-    case FlowFontHasOverflowGlyph:
-        stream &lt;&lt; &quot;-webkit-line-box-contain: glyphs with overflowing text.&quot;;
-        break;
-    case FlowTextHasSurrogatePair:
-        stream &lt;&lt; &quot;surrogate pair&quot;;
-        break;
-    case FlowTextIsEmpty:
-    case FlowHasNoChild:
-    case FlowHasNoParent:
-    case FeatureIsDisabled:
-    default:
-        break;
-    }
</del><span class="cx"> }
</span><del>-
-static void printReasons(AvoidanceReasonFlags reasons, TextStream&amp; stream)
-{
-    bool first = true;
-    for (auto reasonItem = EndOfReasons &gt;&gt; 1; reasonItem != NoReason; reasonItem &gt;&gt;= 1) {
-        if (!(reasons &amp; reasonItem))
-            continue;
-        stream &lt;&lt; (first ? &quot; &quot; : &quot;, &quot;);
-        first = false;
-        printReason(reasonItem, stream);
-    }
</del><span class="cx"> }
</span><del>-
-static void printTextForSubtree(const RenderObject&amp; renderer, unsigned&amp; charactersLeft, TextStream&amp; stream)
-{
-    if (!charactersLeft)
-        return;
-    if (is&lt;RenderText&gt;(renderer)) {
-        String text = downcast&lt;RenderText&gt;(renderer).text();
-        text = text.stripWhiteSpace();
-        unsigned len = std::min(charactersLeft, text.length());
-        stream &lt;&lt; text.left(len);
-        charactersLeft -= len;
-        return;
-    }
-    if (!is&lt;RenderElement&gt;(renderer))
-        return;
-    for (const auto* child = downcast&lt;RenderElement&gt;(renderer).firstChild(); child; child = child-&gt;nextSibling())
-        printTextForSubtree(*child, charactersLeft, stream);
-}
-
-static unsigned textLengthForSubtree(const RenderObject&amp; renderer)
-{
-    if (is&lt;RenderText&gt;(renderer))
-        return downcast&lt;RenderText&gt;(renderer).textLength();
-    if (!is&lt;RenderElement&gt;(renderer))
-        return 0;
-    unsigned textLength = 0;
-    for (const auto* child = downcast&lt;RenderElement&gt;(renderer).firstChild(); child; child = child-&gt;nextSibling())
-        textLength += textLengthForSubtree(*child);
-    return textLength;
-}
-
-static void collectNonEmptyLeafRenderBlockFlows(const RenderObject&amp; renderer, HashSet&lt;const RenderBlockFlow*&gt;&amp; leafRenderers)
-{
-    if (is&lt;RenderText&gt;(renderer)) {
-        if (!downcast&lt;RenderText&gt;(renderer).textLength())
-            return;
-        // Find RenderBlockFlow ancestor.
-        for (const auto* current = renderer.parent(); current; current = current-&gt;parent()) {
-            if (!is&lt;RenderBlockFlow&gt;(current))
-                continue;
-            leafRenderers.add(downcast&lt;RenderBlockFlow&gt;(current));
-            break;
-        }
-        return;
-    }
-    if (!is&lt;RenderElement&gt;(renderer))
-        return;
-    for (const auto* child = downcast&lt;RenderElement&gt;(renderer).firstChild(); child; child = child-&gt;nextSibling())
-        collectNonEmptyLeafRenderBlockFlows(*child, leafRenderers);
-}
-
-static void collectNonEmptyLeafRenderBlockFlowsForCurrentPage(HashSet&lt;const RenderBlockFlow*&gt;&amp; leafRenderers)
-{
-    for (const auto* document : Document::allDocuments()) {
-        if (!document-&gt;renderView() || document-&gt;pageCacheState() != Document::NotInPageCache)
-            continue;
-        if (!document-&gt;isHTMLDocument() &amp;&amp; !document-&gt;isXHTMLDocument())
-            continue;
-        collectNonEmptyLeafRenderBlockFlows(*document-&gt;renderView(), leafRenderers);
-    }
-}
-
-void toggleSimpleLineLayout()
-{
-    for (auto* document : Document::allDocuments()) {
-        auto&amp; settings = document-&gt;mutableSettings();
-        settings.setSimpleLineLayoutEnabled(!settings.simpleLineLayoutEnabled());
-    }
-}
-
-void printSimpleLineLayoutBlockList()
-{
-    HashSet&lt;const RenderBlockFlow*&gt; leafRenderers;
-    collectNonEmptyLeafRenderBlockFlowsForCurrentPage(leafRenderers);
-    if (!leafRenderers.size()) {
-        WTFLogAlways(&quot;No text found in this document\n&quot;);
-        return;
-    }
-    TextStream stream;
-    stream &lt;&lt; &quot;---------------------------------------------------\n&quot;;
-    for (const auto* flow : leafRenderers) {
-        auto reason = canUseForWithReason(*flow, IncludeReasons::All);
-        if (reason == NoReason)
-            continue;
-        unsigned printedLength = 30;
-        stream &lt;&lt; &quot;\&quot;&quot;;
-        printTextForSubtree(*flow, printedLength, stream);
-        for (;printedLength &gt; 0; --printedLength)
-            stream &lt;&lt; &quot; &quot;;
-        stream &lt;&lt; &quot;\&quot;(&quot; &lt;&lt; textLengthForSubtree(*flow) &lt;&lt; &quot;):&quot;;
-        printReasons(reason, stream);
-        stream &lt;&lt; &quot;\n&quot;;
-    }
-    stream &lt;&lt; &quot;---------------------------------------------------\n&quot;;
-    WTFLogAlways(&quot;%s&quot;, stream.release().utf8().data());
-}
-
-void printSimpleLineLayoutCoverage()
-{
-    HashSet&lt;const RenderBlockFlow*&gt; leafRenderers;
-    collectNonEmptyLeafRenderBlockFlowsForCurrentPage(leafRenderers);
-    if (!leafRenderers.size()) {
-        WTFLogAlways(&quot;No text found in this document\n&quot;);
-        return;
-    }
-    TextStream stream;
-    HashMap&lt;AvoidanceReason, unsigned&gt; flowStatistics;
-    unsigned textLength = 0;
-    unsigned unsupportedTextLength = 0;
-    unsigned numberOfUnsupportedLeafBlocks = 0;
-    unsigned supportedButForcedToLineLayoutTextLength = 0;
-    unsigned numberOfSupportedButForcedToLineLayoutLeafBlocks = 0;
-    for (const auto* flow : leafRenderers) {
-        auto flowLength = textLengthForSubtree(*flow);
-        textLength += flowLength;
-        auto reasons = canUseForWithReason(*flow, IncludeReasons::All);
-        if (reasons == NoReason) {
-            if (flow-&gt;lineLayoutPath() == RenderBlockFlow::ForceLineBoxesPath) {
-                supportedButForcedToLineLayoutTextLength += flowLength;
-                ++numberOfSupportedButForcedToLineLayoutLeafBlocks;
-            }
-            continue;
-        }
-        ++numberOfUnsupportedLeafBlocks;
-        unsupportedTextLength += flowLength;
-        for (auto reasonItem = EndOfReasons &gt;&gt; 1; reasonItem != NoReason; reasonItem &gt;&gt;= 1) {
-            if (!(reasons &amp; reasonItem))
-                continue;
-            auto result = flowStatistics.add(reasonItem, flowLength);
-            if (!result.isNewEntry)
-                result.iterator-&gt;value += flowLength;
-        }
-    }
-    stream &lt;&lt; &quot;---------------------------------------------------\n&quot;;
-    stream &lt;&lt; &quot;Number of blocks: total(&quot; &lt;&lt;  leafRenderers.size() &lt;&lt; &quot;) non-simple(&quot; &lt;&lt; numberOfUnsupportedLeafBlocks &lt;&lt; &quot;)\nContent length: total(&quot; &lt;&lt;
-        textLength &lt;&lt; &quot;) non-simple(&quot; &lt;&lt; unsupportedTextLength &lt;&lt; &quot;)\n&quot;;
-    for (const auto reasonEntry : flowStatistics) {
-        printReason(reasonEntry.key, stream);
-        stream &lt;&lt; &quot;: &quot; &lt;&lt; (float)reasonEntry.value / (float)textLength * 100 &lt;&lt; &quot;%\n&quot;;
-    }
-    if (supportedButForcedToLineLayoutTextLength) {
-        stream &lt;&lt; &quot;Simple line layout potential coverage: &quot; &lt;&lt; (float)(textLength - unsupportedTextLength) / (float)textLength * 100 &lt;&lt; &quot;%\n\n&quot;;
-        stream &lt;&lt; &quot;Simple line layout actual coverage: &quot; &lt;&lt; (float)(textLength - unsupportedTextLength - supportedButForcedToLineLayoutTextLength) / (float)textLength * 100 &lt;&lt; &quot;%\nForced line layout blocks: &quot; &lt;&lt; numberOfSupportedButForcedToLineLayoutLeafBlocks &lt;&lt; &quot; content length: &quot; &lt;&lt; supportedButForcedToLineLayoutTextLength &lt;&lt; &quot;(&quot; &lt;&lt; (float)supportedButForcedToLineLayoutTextLength / (float)textLength * 100 &lt;&lt; &quot;%)&quot;;
-    } else
-        stream &lt;&lt; &quot;Simple line layout coverage: &quot; &lt;&lt; (float)(textLength - unsupportedTextLength) / (float)textLength * 100 &lt;&lt; &quot;%&quot;;
-    stream &lt;&lt; &quot;\n---------------------------------------------------\n&quot;;
-    WTFLogAlways(&quot;%s&quot;, stream.release().utf8().data());
-}
-#endif
-}
-}
</del></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebCorerenderingSimpleLineLayouth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayout.h (213143 => 213144)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayout.h        2017-02-28 09:48:50 UTC (rev 213143)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayout.h        2017-02-28 09:53:01 UTC (rev 213144)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#include &quot;SimpleLineLayoutCoverage.h&quot;
</ins><span class="cx"> #include &quot;TextFlags.h&quot;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="lines">@@ -41,7 +42,9 @@
</span><span class="cx"> namespace SimpleLineLayout {
</span><span class="cx"> 
</span><span class="cx"> bool canUseFor(const RenderBlockFlow&amp;);
</span><ins>+AvoidanceReasonFlags canUseForWithReason(const RenderBlockFlow&amp;, IncludeReasons);
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx"> struct Run {
</span><span class="cx"> #if COMPILER(MSVC)
</span><span class="cx">     Run() { }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebCorerenderingSimpleLineLayoutCoveragecpp"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayoutCoverage.cpp (0 => 213144)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayoutCoverage.cpp                                (rev 0)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayoutCoverage.cpp        2017-02-28 09:53:01 UTC (rev 213144)
</span><span class="lines">@@ -0,0 +1,357 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * 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;SimpleLineLayoutCoverage.h&quot;
+
+#include &quot;Logging.h&quot;
+#include &quot;RenderBlockFlow.h&quot;
+#include &quot;RenderChildIterator.h&quot;
+#include &quot;RenderStyle.h&quot;
+#include &quot;RenderView.h&quot;
+#include &quot;Settings.h&quot;
+#include &quot;SimpleLineLayout.h&quot;
+#include &quot;TextStream.h&quot;
+
+namespace WebCore {
+namespace SimpleLineLayout {
+
+#ifndef NDEBUG
+static void printReason(AvoidanceReason reason, TextStream&amp; stream)
+{
+    switch (reason) {
+    case FlowIsInsideRegion:
+        stream &lt;&lt; &quot;flow is inside region&quot;;
+        break;
+    case FlowHasHorizonalWritingMode:
+        stream &lt;&lt; &quot;horizontal writing mode&quot;;
+        break;
+    case FlowHasOutline:
+        stream &lt;&lt; &quot;outline&quot;;
+        break;
+    case FlowIsRuby:
+        stream &lt;&lt; &quot;ruby&quot;;
+        break;
+    case FlowHasHangingPunctuation:
+        stream &lt;&lt; &quot;hanging punctuation&quot;;
+        break;
+    case FlowIsPaginated:
+        stream &lt;&lt; &quot;paginated&quot;;
+        break;
+    case FlowHasTextOverflow:
+        stream &lt;&lt; &quot;text-overflow&quot;;
+        break;
+    case FlowIsDepricatedFlexBox:
+        stream &lt;&lt; &quot;depricatedFlexBox&quot;;
+        break;
+    case FlowParentIsPlaceholderElement:
+        stream &lt;&lt; &quot;placeholder element&quot;;
+        break;
+    case FlowParentIsTextAreaWithWrapping:
+        stream &lt;&lt; &quot;wrapping textarea&quot;;
+        break;
+    case FlowHasNonSupportedChild:
+        stream &lt;&lt; &quot;nested renderers&quot;;
+        break;
+    case FlowHasUnsupportedFloat:
+        stream &lt;&lt; &quot;complicated float&quot;;
+        break;
+    case FlowHasUnsupportedUnderlineDecoration:
+        stream &lt;&lt; &quot;text-underline-position: under&quot;;
+        break;
+    case FlowHasJustifiedNonLatinText:
+        stream &lt;&lt; &quot;text-align: justify with non-latin text&quot;;
+        break;
+    case FlowHasOverflowNotVisible:
+        stream &lt;&lt; &quot;overflow: hidden | scroll | auto&quot;;
+        break;
+    case FlowHasWebKitNBSPMode:
+        stream &lt;&lt; &quot;-webkit-nbsp-mode: space&quot;;
+        break;
+    case FlowIsNotLTR:
+        stream &lt;&lt; &quot;dir is not LTR&quot;;
+        break;
+    case FlowHasLineBoxContainProperty:
+        stream &lt;&lt; &quot;line-box-contain value indicates variable line height&quot;;
+        break;
+    case FlowIsNotTopToBottom:
+        stream &lt;&lt; &quot;non top-to-bottom flow&quot;;
+        break;
+    case FlowHasLineBreak:
+        stream &lt;&lt; &quot;line-break property&quot;;
+        break;
+    case FlowHasNonNormalUnicodeBiDi:
+        stream &lt;&lt; &quot;non-normal Unicode bidi&quot;;
+        break;
+    case FlowHasRTLOrdering:
+        stream &lt;&lt; &quot;-webkit-rtl-ordering&quot;;
+        break;
+    case FlowHasLineAlignEdges:
+        stream &lt;&lt; &quot;-webkit-line-align edges&quot;;
+        break;
+    case FlowHasLineSnap:
+        stream &lt;&lt; &quot;-webkit-line-snap property&quot;;
+        break;
+    case FlowHasTextEmphasisFillOrMark:
+        stream &lt;&lt; &quot;text-emphasis (fill/mark)&quot;;
+        break;
+    case FlowHasPseudoFirstLine:
+        stream &lt;&lt; &quot;first-line&quot;;
+        break;
+    case FlowHasPseudoFirstLetter:
+        stream &lt;&lt; &quot;first-letter&quot;;
+        break;
+    case FlowHasTextCombine:
+        stream &lt;&lt; &quot;text combine&quot;;
+        break;
+    case FlowHasTextFillBox:
+        stream &lt;&lt; &quot;background-color (text-fill)&quot;;
+        break;
+    case FlowHasBorderFitLines:
+        stream &lt;&lt; &quot;-webkit-border-fit&quot;;
+        break;
+    case FlowHasNonAutoLineBreak:
+        stream &lt;&lt; &quot;line-break is not auto&quot;;
+        break;
+    case FlowHasNonAutoTrailingWord:
+        stream &lt;&lt; &quot;-apple-trailing-word is not auto&quot;;
+        break;
+    case FlowHasSVGFont:
+        stream &lt;&lt; &quot;SVG font&quot;;
+        break;
+    case FlowTextHasSoftHyphen:
+        stream &lt;&lt; &quot;soft hyphen character&quot;;
+        break;
+    case FlowTextHasDirectionCharacter:
+        stream &lt;&lt; &quot;direction character&quot;;
+        break;
+    case FlowIsMissingPrimaryFont:
+        stream &lt;&lt; &quot;missing primary font&quot;;
+        break;
+    case FlowPrimaryFontIsInsufficient:
+        stream &lt;&lt; &quot;missing glyph or glyph needs another font&quot;;
+        break;
+    case FlowTextIsCombineText:
+        stream &lt;&lt; &quot;text is combine&quot;;
+        break;
+    case FlowTextIsRenderCounter:
+        stream &lt;&lt; &quot;unsupported RenderCounter&quot;;
+        break;
+    case FlowTextIsRenderQuote:
+        stream &lt;&lt; &quot;unsupported RenderQuote&quot;;
+        break;
+    case FlowTextIsTextFragment:
+        stream &lt;&lt; &quot;unsupported TextFragment&quot;;
+        break;
+    case FlowTextIsSVGInlineText:
+        stream &lt;&lt; &quot;unsupported SVGInlineText&quot;;
+        break;
+    case FlowHasComplexFontCodePath:
+        stream &lt;&lt; &quot;text with complex font codepath&quot;;
+        break;
+    case FlowHasTextShadow:
+        stream &lt;&lt; &quot;text-shadow&quot;;
+        break;
+    case FlowChildIsSelected:
+        stream &lt;&lt; &quot;selected content&quot;;
+        break;
+    case FlowFontHasOverflowGlyph:
+        stream &lt;&lt; &quot;-webkit-line-box-contain: glyphs with overflowing text.&quot;;
+        break;
+    case FlowTextHasSurrogatePair:
+        stream &lt;&lt; &quot;surrogate pair&quot;;
+        break;
+    case FlowTextIsEmpty:
+    case FlowHasNoChild:
+    case FlowHasNoParent:
+    case FeatureIsDisabled:
+    default:
+        break;
+    }
+}
+
+static void printReasons(AvoidanceReasonFlags reasons, TextStream&amp; stream)
+{
+    bool first = true;
+    for (auto reasonItem = EndOfReasons &gt;&gt; 1; reasonItem != NoReason; reasonItem &gt;&gt;= 1) {
+        if (!(reasons &amp; reasonItem))
+            continue;
+        stream &lt;&lt; (first ? &quot; &quot; : &quot;, &quot;);
+        first = false;
+        printReason(reasonItem, stream);
+    }
+}
+
+static void printTextForSubtree(const RenderObject&amp; renderer, unsigned&amp; charactersLeft, TextStream&amp; stream)
+{
+    if (!charactersLeft)
+        return;
+    if (is&lt;RenderText&gt;(renderer)) {
+        String text = downcast&lt;RenderText&gt;(renderer).text();
+        text = text.stripWhiteSpace();
+        unsigned len = std::min(charactersLeft, text.length());
+        stream &lt;&lt; text.left(len);
+        charactersLeft -= len;
+        return;
+    }
+    if (!is&lt;RenderElement&gt;(renderer))
+        return;
+    for (const auto* child = downcast&lt;RenderElement&gt;(renderer).firstChild(); child; child = child-&gt;nextSibling())
+        printTextForSubtree(*child, charactersLeft, stream);
+}
+
+static unsigned textLengthForSubtree(const RenderObject&amp; renderer)
+{
+    if (is&lt;RenderText&gt;(renderer))
+        return downcast&lt;RenderText&gt;(renderer).textLength();
+    if (!is&lt;RenderElement&gt;(renderer))
+        return 0;
+    unsigned textLength = 0;
+    for (const auto* child = downcast&lt;RenderElement&gt;(renderer).firstChild(); child; child = child-&gt;nextSibling())
+        textLength += textLengthForSubtree(*child);
+    return textLength;
+}
+
+static void collectNonEmptyLeafRenderBlockFlows(const RenderObject&amp; renderer, HashSet&lt;const RenderBlockFlow*&gt;&amp; leafRenderers)
+{
+    if (is&lt;RenderText&gt;(renderer)) {
+        if (!downcast&lt;RenderText&gt;(renderer).textLength())
+            return;
+        // Find RenderBlockFlow ancestor.
+        for (const auto* current = renderer.parent(); current; current = current-&gt;parent()) {
+            if (!is&lt;RenderBlockFlow&gt;(current))
+                continue;
+            leafRenderers.add(downcast&lt;RenderBlockFlow&gt;(current));
+            break;
+        }
+        return;
+    }
+    if (!is&lt;RenderElement&gt;(renderer))
+        return;
+    for (const auto* child = downcast&lt;RenderElement&gt;(renderer).firstChild(); child; child = child-&gt;nextSibling())
+        collectNonEmptyLeafRenderBlockFlows(*child, leafRenderers);
+}
+
+static void collectNonEmptyLeafRenderBlockFlowsForCurrentPage(HashSet&lt;const RenderBlockFlow*&gt;&amp; leafRenderers)
+{
+    for (const auto* document : Document::allDocuments()) {
+        if (!document-&gt;renderView() || document-&gt;pageCacheState() != Document::NotInPageCache)
+            continue;
+        if (!document-&gt;isHTMLDocument() &amp;&amp; !document-&gt;isXHTMLDocument())
+            continue;
+        collectNonEmptyLeafRenderBlockFlows(*document-&gt;renderView(), leafRenderers);
+    }
+}
+
+void toggleSimpleLineLayout()
+{
+    for (auto* document : Document::allDocuments()) {
+        auto&amp; settings = document-&gt;mutableSettings();
+        settings.setSimpleLineLayoutEnabled(!settings.simpleLineLayoutEnabled());
+    }
+}
+
+void printSimpleLineLayoutBlockList()
+{
+    HashSet&lt;const RenderBlockFlow*&gt; leafRenderers;
+    collectNonEmptyLeafRenderBlockFlowsForCurrentPage(leafRenderers);
+    if (!leafRenderers.size()) {
+        WTFLogAlways(&quot;No text found in this document\n&quot;);
+        return;
+    }
+    TextStream stream;
+    stream &lt;&lt; &quot;---------------------------------------------------\n&quot;;
+    for (const auto* flow : leafRenderers) {
+        auto reason = canUseForWithReason(*flow, IncludeReasons::All);
+        if (reason == NoReason)
+            continue;
+        unsigned printedLength = 30;
+        stream &lt;&lt; &quot;\&quot;&quot;;
+        printTextForSubtree(*flow, printedLength, stream);
+        for (;printedLength &gt; 0; --printedLength)
+            stream &lt;&lt; &quot; &quot;;
+        stream &lt;&lt; &quot;\&quot;(&quot; &lt;&lt; textLengthForSubtree(*flow) &lt;&lt; &quot;):&quot;;
+        printReasons(reason, stream);
+        stream &lt;&lt; &quot;\n&quot;;
+    }
+    stream &lt;&lt; &quot;---------------------------------------------------\n&quot;;
+    WTFLogAlways(&quot;%s&quot;, stream.release().utf8().data());
+}
+
+void printSimpleLineLayoutCoverage()
+{
+    HashSet&lt;const RenderBlockFlow*&gt; leafRenderers;
+    collectNonEmptyLeafRenderBlockFlowsForCurrentPage(leafRenderers);
+    if (!leafRenderers.size()) {
+        WTFLogAlways(&quot;No text found in this document\n&quot;);
+        return;
+    }
+    TextStream stream;
+    HashMap&lt;AvoidanceReason, unsigned&gt; flowStatistics;
+    unsigned textLength = 0;
+    unsigned unsupportedTextLength = 0;
+    unsigned numberOfUnsupportedLeafBlocks = 0;
+    unsigned supportedButForcedToLineLayoutTextLength = 0;
+    unsigned numberOfSupportedButForcedToLineLayoutLeafBlocks = 0;
+    for (const auto* flow : leafRenderers) {
+        auto flowLength = textLengthForSubtree(*flow);
+        textLength += flowLength;
+        auto reasons = canUseForWithReason(*flow, IncludeReasons::All);
+        if (reasons == NoReason) {
+            if (flow-&gt;lineLayoutPath() == RenderBlockFlow::ForceLineBoxesPath) {
+                supportedButForcedToLineLayoutTextLength += flowLength;
+                ++numberOfSupportedButForcedToLineLayoutLeafBlocks;
+            }
+            continue;
+        }
+        ++numberOfUnsupportedLeafBlocks;
+        unsupportedTextLength += flowLength;
+        for (auto reasonItem = EndOfReasons &gt;&gt; 1; reasonItem != NoReason; reasonItem &gt;&gt;= 1) {
+            if (!(reasons &amp; reasonItem))
+                continue;
+            auto result = flowStatistics.add(reasonItem, flowLength);
+            if (!result.isNewEntry)
+                result.iterator-&gt;value += flowLength;
+        }
+    }
+    stream &lt;&lt; &quot;---------------------------------------------------\n&quot;;
+    stream &lt;&lt; &quot;Number of blocks: total(&quot; &lt;&lt;  leafRenderers.size() &lt;&lt; &quot;) non-simple(&quot; &lt;&lt; numberOfUnsupportedLeafBlocks &lt;&lt; &quot;)\nContent length: total(&quot; &lt;&lt;
+        textLength &lt;&lt; &quot;) non-simple(&quot; &lt;&lt; unsupportedTextLength &lt;&lt; &quot;)\n&quot;;
+    for (const auto reasonEntry : flowStatistics) {
+        printReason(reasonEntry.key, stream);
+        stream &lt;&lt; &quot;: &quot; &lt;&lt; (float)reasonEntry.value / (float)textLength * 100 &lt;&lt; &quot;%\n&quot;;
+    }
+    if (supportedButForcedToLineLayoutTextLength) {
+        stream &lt;&lt; &quot;Simple line layout potential coverage: &quot; &lt;&lt; (float)(textLength - unsupportedTextLength) / (float)textLength * 100 &lt;&lt; &quot;%\n\n&quot;;
+        stream &lt;&lt; &quot;Simple line layout actual coverage: &quot; &lt;&lt; (float)(textLength - unsupportedTextLength - supportedButForcedToLineLayoutTextLength) / (float)textLength * 100 &lt;&lt; &quot;%\nForced line layout blocks: &quot; &lt;&lt; numberOfSupportedButForcedToLineLayoutLeafBlocks &lt;&lt; &quot; content length: &quot; &lt;&lt; supportedButForcedToLineLayoutTextLength &lt;&lt; &quot;(&quot; &lt;&lt; (float)supportedButForcedToLineLayoutTextLength / (float)textLength * 100 &lt;&lt; &quot;%)&quot;;
+    } else
+        stream &lt;&lt; &quot;Simple line layout coverage: &quot; &lt;&lt; (float)(textLength - unsupportedTextLength) / (float)textLength * 100 &lt;&lt; &quot;%&quot;;
+    stream &lt;&lt; &quot;\n---------------------------------------------------\n&quot;;
+    WTFLogAlways(&quot;%s&quot;, stream.release().utf8().data());
+}
+#endif
+
+}
+}
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceWebCorerenderingSimpleLineLayoutCoverageh"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayoutCoverage.h (0 => 213144)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayoutCoverage.h                                (rev 0)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/rendering/SimpleLineLayoutCoverage.h        2017-02-28 09:53:01 UTC (rev 213144)
</span><span class="lines">@@ -0,0 +1,99 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+namespace WebCore {
+namespace SimpleLineLayout {
+
+#ifndef NDEBUG
+void printSimpleLineLayoutCoverage();
+void printSimpleLineLayoutBlockList();
+void toggleSimpleLineLayout();
+#endif
+
+enum AvoidanceReason_ : uint64_t {
+    FlowIsInsideRegion                    = 1LLU  &lt;&lt; 0,
+    FlowHasHorizonalWritingMode           = 1LLU  &lt;&lt; 1,
+    FlowHasOutline                        = 1LLU  &lt;&lt; 2,
+    FlowIsRuby                            = 1LLU  &lt;&lt; 3,
+    FlowIsPaginated                       = 1LLU  &lt;&lt; 4,
+    FlowHasTextOverflow                   = 1LLU  &lt;&lt; 5,
+    FlowIsDepricatedFlexBox               = 1LLU  &lt;&lt; 6,
+    FlowParentIsPlaceholderElement        = 1LLU  &lt;&lt; 7,
+    FlowParentIsTextAreaWithWrapping      = 1LLU  &lt;&lt; 8,
+    FlowHasNonSupportedChild              = 1LLU  &lt;&lt; 9,
+    FlowHasUnsupportedFloat               = 1LLU  &lt;&lt; 10,
+    FlowHasUnsupportedUnderlineDecoration = 1LLU  &lt;&lt; 11,
+    FlowHasJustifiedNonLatinText          = 1LLU  &lt;&lt; 12,
+    FlowHasOverflowNotVisible             = 1LLU  &lt;&lt; 13,
+    FlowHasWebKitNBSPMode                 = 1LLU  &lt;&lt; 14,
+    FlowIsNotLTR                          = 1LLU  &lt;&lt; 15,
+    FlowHasLineBoxContainProperty         = 1LLU  &lt;&lt; 16,
+    FlowIsNotTopToBottom                  = 1LLU  &lt;&lt; 17,
+    FlowHasLineBreak                      = 1LLU  &lt;&lt; 18,
+    FlowHasNonNormalUnicodeBiDi           = 1LLU  &lt;&lt; 19,
+    FlowHasRTLOrdering                    = 1LLU  &lt;&lt; 20,
+    FlowHasLineAlignEdges                 = 1LLU  &lt;&lt; 21,
+    FlowHasLineSnap                       = 1LLU  &lt;&lt; 22,
+    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,
+    FlowPrimaryFontIsInsufficient         = 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,
+    FlowHasComplexFontCodePath            = 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,
+    FlowFontHasOverflowGlyph              = 1LLU  &lt;&lt; 49,
+    FlowTextHasSurrogatePair              = 1LLU  &lt;&lt; 50,
+    EndOfReasons                          = 1LLU  &lt;&lt; 51
+};
+const unsigned NoReason = 0;
+
+typedef uint64_t AvoidanceReason;
+typedef uint64_t AvoidanceReasonFlags;
+
+enum class IncludeReasons { First , All };
+
+}
+}
</ins></span></pre>
</div>
</div>

</body>
</html>