<!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 <zalan@apple.com>
</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 <zalan@apple.com>
+
</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"> <rdar://problem/30690734>
</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 = "<group>"; };
</span><span class="cx">                 112B34D01E60B8A700BB310A /* SimpleLineLayoutPagination.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutPagination.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 112B34D41E60B98300BB310A /* SimpleLineLayoutPagination.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutPagination.h; sourceTree = "<group>"; };
</span><ins>+                11E067EB1E62461300162D16 /* SimpleLineLayoutCoverage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutCoverage.cpp; sourceTree = "<group>"; };
+                11E067ED1E6246E500162D16 /* SimpleLineLayoutCoverage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutCoverage.h; sourceTree = "<group>"; };
</ins><span class="cx">                 120DE3EA1C80161C00B6D4DD /* WebAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebAnimation.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 120DE3EB1C80161C00B6D4DD /* WebAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebAnimation.h; sourceTree = "<group>"; };
</span><span class="cx">                 120DE3EC1C80161C00B6D4DD /* WebAnimation.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebAnimation.idl; sourceTree = "<group>"; };
</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 "ScrollAlignment.cpp"
</span><span class="cx"> #include "SelectionSubtreeRoot.cpp"
</span><span class="cx"> #include "SimpleLineLayout.cpp"
</span><ins>+#include "SimpleLineLayoutCoverage.cpp"
</ins><span class="cx"> #include "SimpleLineLayoutFlowContents.cpp"
</span><span class="cx"> #include "SimpleLineLayoutFunctions.cpp"
</span><span class="cx"> #include "SimpleLineLayoutPagination.cpp"
</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 "RenderStyle.h"
</span><span class="cx"> #include "RenderText.h"
</span><span class="cx"> #include "RenderTextControl.h"
</span><del>-#include "RenderView.h"
</del><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "SimpleLineLayoutFlowContents.h"
</span><span class="cx"> #include "SimpleLineLayoutFunctions.h"
</span><span class="lines">@@ -51,79 +50,11 @@
</span><span class="cx"> #include "SimpleLineLayoutTextFragmentIterator.h"
</span><span class="cx"> #include "Text.h"
</span><span class="cx"> #include "TextPaintStyle.h"
</span><del>-#include "TextStream.h"
</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 << 0,
- FlowHasHorizonalWritingMode = 1LLU << 1,
- FlowHasOutline = 1LLU << 2,
- FlowIsRuby = 1LLU << 3,
- FlowIsPaginated = 1LLU << 4,
- FlowHasTextOverflow = 1LLU << 5,
- FlowIsDepricatedFlexBox = 1LLU << 6,
- FlowParentIsPlaceholderElement = 1LLU << 7,
- FlowParentIsTextAreaWithWrapping = 1LLU << 8,
- FlowHasNonSupportedChild = 1LLU << 9,
- FlowHasUnsupportedFloat = 1LLU << 10,
- FlowHasUnsupportedUnderlineDecoration = 1LLU << 11,
- FlowHasJustifiedNonLatinText = 1LLU << 12,
- FlowHasOverflowNotVisible = 1LLU << 13,
- FlowHasWebKitNBSPMode = 1LLU << 14,
- FlowIsNotLTR = 1LLU << 15,
- FlowHasLineBoxContainProperty = 1LLU << 16,
- FlowIsNotTopToBottom = 1LLU << 17,
- FlowHasLineBreak = 1LLU << 18,
- FlowHasNonNormalUnicodeBiDi = 1LLU << 19,
- FlowHasRTLOrdering = 1LLU << 20,
- FlowHasLineAlignEdges = 1LLU << 21,
- FlowHasLineSnap = 1LLU << 22,
- FlowHasTextEmphasisFillOrMark = 1LLU << 23,
- FlowHasTextShadow = 1LLU << 24,
- FlowHasPseudoFirstLine = 1LLU << 25,
- FlowHasPseudoFirstLetter = 1LLU << 26,
- FlowHasTextCombine = 1LLU << 27,
- FlowHasTextFillBox = 1LLU << 28,
- FlowHasBorderFitLines = 1LLU << 29,
- FlowHasNonAutoLineBreak = 1LLU << 30,
- FlowHasNonAutoTrailingWord = 1LLU << 31,
- FlowHasSVGFont = 1LLU << 32,
- FlowTextIsEmpty = 1LLU << 33,
- FlowTextHasSoftHyphen = 1LLU << 34,
- FlowTextHasDirectionCharacter = 1LLU << 35,
- FlowIsMissingPrimaryFont = 1LLU << 36,
- FlowPrimaryFontIsInsufficient = 1LLU << 37,
- FlowTextIsCombineText = 1LLU << 38,
- FlowTextIsRenderCounter = 1LLU << 39,
- FlowTextIsRenderQuote = 1LLU << 40,
- FlowTextIsTextFragment = 1LLU << 41,
- FlowTextIsSVGInlineText = 1LLU << 42,
- FlowHasComplexFontCodePath = 1LLU << 43,
- FeatureIsDisabled = 1LLU << 44,
- FlowHasNoParent = 1LLU << 45,
- FlowHasNoChild = 1LLU << 46,
- FlowChildIsSelected = 1LLU << 47,
- FlowHasHangingPunctuation = 1LLU << 48,
- FlowFontHasOverflowGlyph = 1LLU << 49,
- FlowTextHasSurrogatePair = 1LLU << 50,
- EndOfReasons = 1LLU << 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& flow, IncludeReasons includeReasons)
</del><ins>+AvoidanceReasonFlags canUseForWithReason(const RenderBlockFlow& 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& stream)
-{
- switch (reason) {
- case FlowIsInsideRegion:
- stream << "flow is inside region";
- break;
- case FlowHasHorizonalWritingMode:
- stream << "horizontal writing mode";
- break;
- case FlowHasOutline:
- stream << "outline";
- break;
- case FlowIsRuby:
- stream << "ruby";
- break;
- case FlowHasHangingPunctuation:
- stream << "hanging punctuation";
- break;
- case FlowIsPaginated:
- stream << "paginated";
- break;
- case FlowHasTextOverflow:
- stream << "text-overflow";
- break;
- case FlowIsDepricatedFlexBox:
- stream << "depricatedFlexBox";
- break;
- case FlowParentIsPlaceholderElement:
- stream << "placeholder element";
- break;
- case FlowParentIsTextAreaWithWrapping:
- stream << "wrapping textarea";
- break;
- case FlowHasNonSupportedChild:
- stream << "nested renderers";
- break;
- case FlowHasUnsupportedFloat:
- stream << "complicated float";
- break;
- case FlowHasUnsupportedUnderlineDecoration:
- stream << "text-underline-position: under";
- break;
- case FlowHasJustifiedNonLatinText:
- stream << "text-align: justify with non-latin text";
- break;
- case FlowHasOverflowNotVisible:
- stream << "overflow: hidden | scroll | auto";
- break;
- case FlowHasWebKitNBSPMode:
- stream << "-webkit-nbsp-mode: space";
- break;
- case FlowIsNotLTR:
- stream << "dir is not LTR";
- break;
- case FlowHasLineBoxContainProperty:
- stream << "line-box-contain value indicates variable line height";
- break;
- case FlowIsNotTopToBottom:
- stream << "non top-to-bottom flow";
- break;
- case FlowHasLineBreak:
- stream << "line-break property";
- break;
- case FlowHasNonNormalUnicodeBiDi:
- stream << "non-normal Unicode bidi";
- break;
- case FlowHasRTLOrdering:
- stream << "-webkit-rtl-ordering";
- break;
- case FlowHasLineAlignEdges:
- stream << "-webkit-line-align edges";
- break;
- case FlowHasLineSnap:
- stream << "-webkit-line-snap property";
- break;
- case FlowHasTextEmphasisFillOrMark:
- stream << "text-emphasis (fill/mark)";
- break;
- case FlowHasPseudoFirstLine:
- stream << "first-line";
- break;
- case FlowHasPseudoFirstLetter:
- stream << "first-letter";
- break;
- case FlowHasTextCombine:
- stream << "text combine";
- break;
- case FlowHasTextFillBox:
- stream << "background-color (text-fill)";
- break;
- case FlowHasBorderFitLines:
- stream << "-webkit-border-fit";
- break;
- case FlowHasNonAutoLineBreak:
- stream << "line-break is not auto";
- break;
- case FlowHasNonAutoTrailingWord:
- stream << "-apple-trailing-word is not auto";
- break;
- case FlowHasSVGFont:
- stream << "SVG font";
- break;
- case FlowTextHasSoftHyphen:
- stream << "soft hyphen character";
- break;
- case FlowTextHasDirectionCharacter:
- stream << "direction character";
- break;
- case FlowIsMissingPrimaryFont:
- stream << "missing primary font";
- break;
- case FlowPrimaryFontIsInsufficient:
- stream << "missing glyph or glyph needs another font";
- break;
- case FlowTextIsCombineText:
- stream << "text is combine";
- break;
- case FlowTextIsRenderCounter:
- stream << "unsupported RenderCounter";
- break;
- case FlowTextIsRenderQuote:
- stream << "unsupported RenderQuote";
- break;
- case FlowTextIsTextFragment:
- stream << "unsupported TextFragment";
- break;
- case FlowTextIsSVGInlineText:
- stream << "unsupported SVGInlineText";
- break;
- case FlowHasComplexFontCodePath:
- stream << "text with complex font codepath";
- break;
- case FlowHasTextShadow:
- stream << "text-shadow";
- break;
- case FlowChildIsSelected:
- stream << "selected content";
- break;
- case FlowFontHasOverflowGlyph:
- stream << "-webkit-line-box-contain: glyphs with overflowing text.";
- break;
- case FlowTextHasSurrogatePair:
- stream << "surrogate pair";
- break;
- case FlowTextIsEmpty:
- case FlowHasNoChild:
- case FlowHasNoParent:
- case FeatureIsDisabled:
- default:
- break;
- }
</del><span class="cx"> }
</span><del>-
-static void printReasons(AvoidanceReasonFlags reasons, TextStream& stream)
-{
- bool first = true;
- for (auto reasonItem = EndOfReasons >> 1; reasonItem != NoReason; reasonItem >>= 1) {
- if (!(reasons & reasonItem))
- continue;
- stream << (first ? " " : ", ");
- first = false;
- printReason(reasonItem, stream);
- }
</del><span class="cx"> }
</span><del>-
-static void printTextForSubtree(const RenderObject& renderer, unsigned& charactersLeft, TextStream& stream)
-{
- if (!charactersLeft)
- return;
- if (is<RenderText>(renderer)) {
- String text = downcast<RenderText>(renderer).text();
- text = text.stripWhiteSpace();
- unsigned len = std::min(charactersLeft, text.length());
- stream << text.left(len);
- charactersLeft -= len;
- return;
- }
- if (!is<RenderElement>(renderer))
- return;
- for (const auto* child = downcast<RenderElement>(renderer).firstChild(); child; child = child->nextSibling())
- printTextForSubtree(*child, charactersLeft, stream);
-}
-
-static unsigned textLengthForSubtree(const RenderObject& renderer)
-{
- if (is<RenderText>(renderer))
- return downcast<RenderText>(renderer).textLength();
- if (!is<RenderElement>(renderer))
- return 0;
- unsigned textLength = 0;
- for (const auto* child = downcast<RenderElement>(renderer).firstChild(); child; child = child->nextSibling())
- textLength += textLengthForSubtree(*child);
- return textLength;
-}
-
-static void collectNonEmptyLeafRenderBlockFlows(const RenderObject& renderer, HashSet<const RenderBlockFlow*>& leafRenderers)
-{
- if (is<RenderText>(renderer)) {
- if (!downcast<RenderText>(renderer).textLength())
- return;
- // Find RenderBlockFlow ancestor.
- for (const auto* current = renderer.parent(); current; current = current->parent()) {
- if (!is<RenderBlockFlow>(current))
- continue;
- leafRenderers.add(downcast<RenderBlockFlow>(current));
- break;
- }
- return;
- }
- if (!is<RenderElement>(renderer))
- return;
- for (const auto* child = downcast<RenderElement>(renderer).firstChild(); child; child = child->nextSibling())
- collectNonEmptyLeafRenderBlockFlows(*child, leafRenderers);
-}
-
-static void collectNonEmptyLeafRenderBlockFlowsForCurrentPage(HashSet<const RenderBlockFlow*>& leafRenderers)
-{
- for (const auto* document : Document::allDocuments()) {
- if (!document->renderView() || document->pageCacheState() != Document::NotInPageCache)
- continue;
- if (!document->isHTMLDocument() && !document->isXHTMLDocument())
- continue;
- collectNonEmptyLeafRenderBlockFlows(*document->renderView(), leafRenderers);
- }
-}
-
-void toggleSimpleLineLayout()
-{
- for (auto* document : Document::allDocuments()) {
- auto& settings = document->mutableSettings();
- settings.setSimpleLineLayoutEnabled(!settings.simpleLineLayoutEnabled());
- }
-}
-
-void printSimpleLineLayoutBlockList()
-{
- HashSet<const RenderBlockFlow*> leafRenderers;
- collectNonEmptyLeafRenderBlockFlowsForCurrentPage(leafRenderers);
- if (!leafRenderers.size()) {
- WTFLogAlways("No text found in this document\n");
- return;
- }
- TextStream stream;
- stream << "---------------------------------------------------\n";
- for (const auto* flow : leafRenderers) {
- auto reason = canUseForWithReason(*flow, IncludeReasons::All);
- if (reason == NoReason)
- continue;
- unsigned printedLength = 30;
- stream << "\"";
- printTextForSubtree(*flow, printedLength, stream);
- for (;printedLength > 0; --printedLength)
- stream << " ";
- stream << "\"(" << textLengthForSubtree(*flow) << "):";
- printReasons(reason, stream);
- stream << "\n";
- }
- stream << "---------------------------------------------------\n";
- WTFLogAlways("%s", stream.release().utf8().data());
-}
-
-void printSimpleLineLayoutCoverage()
-{
- HashSet<const RenderBlockFlow*> leafRenderers;
- collectNonEmptyLeafRenderBlockFlowsForCurrentPage(leafRenderers);
- if (!leafRenderers.size()) {
- WTFLogAlways("No text found in this document\n");
- return;
- }
- TextStream stream;
- HashMap<AvoidanceReason, unsigned> 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->lineLayoutPath() == RenderBlockFlow::ForceLineBoxesPath) {
- supportedButForcedToLineLayoutTextLength += flowLength;
- ++numberOfSupportedButForcedToLineLayoutLeafBlocks;
- }
- continue;
- }
- ++numberOfUnsupportedLeafBlocks;
- unsupportedTextLength += flowLength;
- for (auto reasonItem = EndOfReasons >> 1; reasonItem != NoReason; reasonItem >>= 1) {
- if (!(reasons & reasonItem))
- continue;
- auto result = flowStatistics.add(reasonItem, flowLength);
- if (!result.isNewEntry)
- result.iterator->value += flowLength;
- }
- }
- stream << "---------------------------------------------------\n";
- stream << "Number of blocks: total(" << leafRenderers.size() << ") non-simple(" << numberOfUnsupportedLeafBlocks << ")\nContent length: total(" <<
- textLength << ") non-simple(" << unsupportedTextLength << ")\n";
- for (const auto reasonEntry : flowStatistics) {
- printReason(reasonEntry.key, stream);
- stream << ": " << (float)reasonEntry.value / (float)textLength * 100 << "%\n";
- }
- if (supportedButForcedToLineLayoutTextLength) {
- stream << "Simple line layout potential coverage: " << (float)(textLength - unsupportedTextLength) / (float)textLength * 100 << "%\n\n";
- stream << "Simple line layout actual coverage: " << (float)(textLength - unsupportedTextLength - supportedButForcedToLineLayoutTextLength) / (float)textLength * 100 << "%\nForced line layout blocks: " << numberOfSupportedButForcedToLineLayoutLeafBlocks << " content length: " << supportedButForcedToLineLayoutTextLength << "(" << (float)supportedButForcedToLineLayoutTextLength / (float)textLength * 100 << "%)";
- } else
- stream << "Simple line layout coverage: " << (float)(textLength - unsupportedTextLength) / (float)textLength * 100 << "%";
- stream << "\n---------------------------------------------------\n";
- WTFLogAlways("%s", 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 "SimpleLineLayoutCoverage.h"
</ins><span class="cx"> #include "TextFlags.h"
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</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&);
</span><ins>+AvoidanceReasonFlags canUseForWithReason(const RenderBlockFlow&, 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 "config.h"
+#include "SimpleLineLayoutCoverage.h"
+
+#include "Logging.h"
+#include "RenderBlockFlow.h"
+#include "RenderChildIterator.h"
+#include "RenderStyle.h"
+#include "RenderView.h"
+#include "Settings.h"
+#include "SimpleLineLayout.h"
+#include "TextStream.h"
+
+namespace WebCore {
+namespace SimpleLineLayout {
+
+#ifndef NDEBUG
+static void printReason(AvoidanceReason reason, TextStream& stream)
+{
+ switch (reason) {
+ case FlowIsInsideRegion:
+ stream << "flow is inside region";
+ break;
+ case FlowHasHorizonalWritingMode:
+ stream << "horizontal writing mode";
+ break;
+ case FlowHasOutline:
+ stream << "outline";
+ break;
+ case FlowIsRuby:
+ stream << "ruby";
+ break;
+ case FlowHasHangingPunctuation:
+ stream << "hanging punctuation";
+ break;
+ case FlowIsPaginated:
+ stream << "paginated";
+ break;
+ case FlowHasTextOverflow:
+ stream << "text-overflow";
+ break;
+ case FlowIsDepricatedFlexBox:
+ stream << "depricatedFlexBox";
+ break;
+ case FlowParentIsPlaceholderElement:
+ stream << "placeholder element";
+ break;
+ case FlowParentIsTextAreaWithWrapping:
+ stream << "wrapping textarea";
+ break;
+ case FlowHasNonSupportedChild:
+ stream << "nested renderers";
+ break;
+ case FlowHasUnsupportedFloat:
+ stream << "complicated float";
+ break;
+ case FlowHasUnsupportedUnderlineDecoration:
+ stream << "text-underline-position: under";
+ break;
+ case FlowHasJustifiedNonLatinText:
+ stream << "text-align: justify with non-latin text";
+ break;
+ case FlowHasOverflowNotVisible:
+ stream << "overflow: hidden | scroll | auto";
+ break;
+ case FlowHasWebKitNBSPMode:
+ stream << "-webkit-nbsp-mode: space";
+ break;
+ case FlowIsNotLTR:
+ stream << "dir is not LTR";
+ break;
+ case FlowHasLineBoxContainProperty:
+ stream << "line-box-contain value indicates variable line height";
+ break;
+ case FlowIsNotTopToBottom:
+ stream << "non top-to-bottom flow";
+ break;
+ case FlowHasLineBreak:
+ stream << "line-break property";
+ break;
+ case FlowHasNonNormalUnicodeBiDi:
+ stream << "non-normal Unicode bidi";
+ break;
+ case FlowHasRTLOrdering:
+ stream << "-webkit-rtl-ordering";
+ break;
+ case FlowHasLineAlignEdges:
+ stream << "-webkit-line-align edges";
+ break;
+ case FlowHasLineSnap:
+ stream << "-webkit-line-snap property";
+ break;
+ case FlowHasTextEmphasisFillOrMark:
+ stream << "text-emphasis (fill/mark)";
+ break;
+ case FlowHasPseudoFirstLine:
+ stream << "first-line";
+ break;
+ case FlowHasPseudoFirstLetter:
+ stream << "first-letter";
+ break;
+ case FlowHasTextCombine:
+ stream << "text combine";
+ break;
+ case FlowHasTextFillBox:
+ stream << "background-color (text-fill)";
+ break;
+ case FlowHasBorderFitLines:
+ stream << "-webkit-border-fit";
+ break;
+ case FlowHasNonAutoLineBreak:
+ stream << "line-break is not auto";
+ break;
+ case FlowHasNonAutoTrailingWord:
+ stream << "-apple-trailing-word is not auto";
+ break;
+ case FlowHasSVGFont:
+ stream << "SVG font";
+ break;
+ case FlowTextHasSoftHyphen:
+ stream << "soft hyphen character";
+ break;
+ case FlowTextHasDirectionCharacter:
+ stream << "direction character";
+ break;
+ case FlowIsMissingPrimaryFont:
+ stream << "missing primary font";
+ break;
+ case FlowPrimaryFontIsInsufficient:
+ stream << "missing glyph or glyph needs another font";
+ break;
+ case FlowTextIsCombineText:
+ stream << "text is combine";
+ break;
+ case FlowTextIsRenderCounter:
+ stream << "unsupported RenderCounter";
+ break;
+ case FlowTextIsRenderQuote:
+ stream << "unsupported RenderQuote";
+ break;
+ case FlowTextIsTextFragment:
+ stream << "unsupported TextFragment";
+ break;
+ case FlowTextIsSVGInlineText:
+ stream << "unsupported SVGInlineText";
+ break;
+ case FlowHasComplexFontCodePath:
+ stream << "text with complex font codepath";
+ break;
+ case FlowHasTextShadow:
+ stream << "text-shadow";
+ break;
+ case FlowChildIsSelected:
+ stream << "selected content";
+ break;
+ case FlowFontHasOverflowGlyph:
+ stream << "-webkit-line-box-contain: glyphs with overflowing text.";
+ break;
+ case FlowTextHasSurrogatePair:
+ stream << "surrogate pair";
+ break;
+ case FlowTextIsEmpty:
+ case FlowHasNoChild:
+ case FlowHasNoParent:
+ case FeatureIsDisabled:
+ default:
+ break;
+ }
+}
+
+static void printReasons(AvoidanceReasonFlags reasons, TextStream& stream)
+{
+ bool first = true;
+ for (auto reasonItem = EndOfReasons >> 1; reasonItem != NoReason; reasonItem >>= 1) {
+ if (!(reasons & reasonItem))
+ continue;
+ stream << (first ? " " : ", ");
+ first = false;
+ printReason(reasonItem, stream);
+ }
+}
+
+static void printTextForSubtree(const RenderObject& renderer, unsigned& charactersLeft, TextStream& stream)
+{
+ if (!charactersLeft)
+ return;
+ if (is<RenderText>(renderer)) {
+ String text = downcast<RenderText>(renderer).text();
+ text = text.stripWhiteSpace();
+ unsigned len = std::min(charactersLeft, text.length());
+ stream << text.left(len);
+ charactersLeft -= len;
+ return;
+ }
+ if (!is<RenderElement>(renderer))
+ return;
+ for (const auto* child = downcast<RenderElement>(renderer).firstChild(); child; child = child->nextSibling())
+ printTextForSubtree(*child, charactersLeft, stream);
+}
+
+static unsigned textLengthForSubtree(const RenderObject& renderer)
+{
+ if (is<RenderText>(renderer))
+ return downcast<RenderText>(renderer).textLength();
+ if (!is<RenderElement>(renderer))
+ return 0;
+ unsigned textLength = 0;
+ for (const auto* child = downcast<RenderElement>(renderer).firstChild(); child; child = child->nextSibling())
+ textLength += textLengthForSubtree(*child);
+ return textLength;
+}
+
+static void collectNonEmptyLeafRenderBlockFlows(const RenderObject& renderer, HashSet<const RenderBlockFlow*>& leafRenderers)
+{
+ if (is<RenderText>(renderer)) {
+ if (!downcast<RenderText>(renderer).textLength())
+ return;
+ // Find RenderBlockFlow ancestor.
+ for (const auto* current = renderer.parent(); current; current = current->parent()) {
+ if (!is<RenderBlockFlow>(current))
+ continue;
+ leafRenderers.add(downcast<RenderBlockFlow>(current));
+ break;
+ }
+ return;
+ }
+ if (!is<RenderElement>(renderer))
+ return;
+ for (const auto* child = downcast<RenderElement>(renderer).firstChild(); child; child = child->nextSibling())
+ collectNonEmptyLeafRenderBlockFlows(*child, leafRenderers);
+}
+
+static void collectNonEmptyLeafRenderBlockFlowsForCurrentPage(HashSet<const RenderBlockFlow*>& leafRenderers)
+{
+ for (const auto* document : Document::allDocuments()) {
+ if (!document->renderView() || document->pageCacheState() != Document::NotInPageCache)
+ continue;
+ if (!document->isHTMLDocument() && !document->isXHTMLDocument())
+ continue;
+ collectNonEmptyLeafRenderBlockFlows(*document->renderView(), leafRenderers);
+ }
+}
+
+void toggleSimpleLineLayout()
+{
+ for (auto* document : Document::allDocuments()) {
+ auto& settings = document->mutableSettings();
+ settings.setSimpleLineLayoutEnabled(!settings.simpleLineLayoutEnabled());
+ }
+}
+
+void printSimpleLineLayoutBlockList()
+{
+ HashSet<const RenderBlockFlow*> leafRenderers;
+ collectNonEmptyLeafRenderBlockFlowsForCurrentPage(leafRenderers);
+ if (!leafRenderers.size()) {
+ WTFLogAlways("No text found in this document\n");
+ return;
+ }
+ TextStream stream;
+ stream << "---------------------------------------------------\n";
+ for (const auto* flow : leafRenderers) {
+ auto reason = canUseForWithReason(*flow, IncludeReasons::All);
+ if (reason == NoReason)
+ continue;
+ unsigned printedLength = 30;
+ stream << "\"";
+ printTextForSubtree(*flow, printedLength, stream);
+ for (;printedLength > 0; --printedLength)
+ stream << " ";
+ stream << "\"(" << textLengthForSubtree(*flow) << "):";
+ printReasons(reason, stream);
+ stream << "\n";
+ }
+ stream << "---------------------------------------------------\n";
+ WTFLogAlways("%s", stream.release().utf8().data());
+}
+
+void printSimpleLineLayoutCoverage()
+{
+ HashSet<const RenderBlockFlow*> leafRenderers;
+ collectNonEmptyLeafRenderBlockFlowsForCurrentPage(leafRenderers);
+ if (!leafRenderers.size()) {
+ WTFLogAlways("No text found in this document\n");
+ return;
+ }
+ TextStream stream;
+ HashMap<AvoidanceReason, unsigned> 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->lineLayoutPath() == RenderBlockFlow::ForceLineBoxesPath) {
+ supportedButForcedToLineLayoutTextLength += flowLength;
+ ++numberOfSupportedButForcedToLineLayoutLeafBlocks;
+ }
+ continue;
+ }
+ ++numberOfUnsupportedLeafBlocks;
+ unsupportedTextLength += flowLength;
+ for (auto reasonItem = EndOfReasons >> 1; reasonItem != NoReason; reasonItem >>= 1) {
+ if (!(reasons & reasonItem))
+ continue;
+ auto result = flowStatistics.add(reasonItem, flowLength);
+ if (!result.isNewEntry)
+ result.iterator->value += flowLength;
+ }
+ }
+ stream << "---------------------------------------------------\n";
+ stream << "Number of blocks: total(" << leafRenderers.size() << ") non-simple(" << numberOfUnsupportedLeafBlocks << ")\nContent length: total(" <<
+ textLength << ") non-simple(" << unsupportedTextLength << ")\n";
+ for (const auto reasonEntry : flowStatistics) {
+ printReason(reasonEntry.key, stream);
+ stream << ": " << (float)reasonEntry.value / (float)textLength * 100 << "%\n";
+ }
+ if (supportedButForcedToLineLayoutTextLength) {
+ stream << "Simple line layout potential coverage: " << (float)(textLength - unsupportedTextLength) / (float)textLength * 100 << "%\n\n";
+ stream << "Simple line layout actual coverage: " << (float)(textLength - unsupportedTextLength - supportedButForcedToLineLayoutTextLength) / (float)textLength * 100 << "%\nForced line layout blocks: " << numberOfSupportedButForcedToLineLayoutLeafBlocks << " content length: " << supportedButForcedToLineLayoutTextLength << "(" << (float)supportedButForcedToLineLayoutTextLength / (float)textLength * 100 << "%)";
+ } else
+ stream << "Simple line layout coverage: " << (float)(textLength - unsupportedTextLength) / (float)textLength * 100 << "%";
+ stream << "\n---------------------------------------------------\n";
+ WTFLogAlways("%s", 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 << 0,
+ FlowHasHorizonalWritingMode = 1LLU << 1,
+ FlowHasOutline = 1LLU << 2,
+ FlowIsRuby = 1LLU << 3,
+ FlowIsPaginated = 1LLU << 4,
+ FlowHasTextOverflow = 1LLU << 5,
+ FlowIsDepricatedFlexBox = 1LLU << 6,
+ FlowParentIsPlaceholderElement = 1LLU << 7,
+ FlowParentIsTextAreaWithWrapping = 1LLU << 8,
+ FlowHasNonSupportedChild = 1LLU << 9,
+ FlowHasUnsupportedFloat = 1LLU << 10,
+ FlowHasUnsupportedUnderlineDecoration = 1LLU << 11,
+ FlowHasJustifiedNonLatinText = 1LLU << 12,
+ FlowHasOverflowNotVisible = 1LLU << 13,
+ FlowHasWebKitNBSPMode = 1LLU << 14,
+ FlowIsNotLTR = 1LLU << 15,
+ FlowHasLineBoxContainProperty = 1LLU << 16,
+ FlowIsNotTopToBottom = 1LLU << 17,
+ FlowHasLineBreak = 1LLU << 18,
+ FlowHasNonNormalUnicodeBiDi = 1LLU << 19,
+ FlowHasRTLOrdering = 1LLU << 20,
+ FlowHasLineAlignEdges = 1LLU << 21,
+ FlowHasLineSnap = 1LLU << 22,
+ FlowHasTextEmphasisFillOrMark = 1LLU << 23,
+ FlowHasTextShadow = 1LLU << 24,
+ FlowHasPseudoFirstLine = 1LLU << 25,
+ FlowHasPseudoFirstLetter = 1LLU << 26,
+ FlowHasTextCombine = 1LLU << 27,
+ FlowHasTextFillBox = 1LLU << 28,
+ FlowHasBorderFitLines = 1LLU << 29,
+ FlowHasNonAutoLineBreak = 1LLU << 30,
+ FlowHasNonAutoTrailingWord = 1LLU << 31,
+ FlowHasSVGFont = 1LLU << 32,
+ FlowTextIsEmpty = 1LLU << 33,
+ FlowTextHasSoftHyphen = 1LLU << 34,
+ FlowTextHasDirectionCharacter = 1LLU << 35,
+ FlowIsMissingPrimaryFont = 1LLU << 36,
+ FlowPrimaryFontIsInsufficient = 1LLU << 37,
+ FlowTextIsCombineText = 1LLU << 38,
+ FlowTextIsRenderCounter = 1LLU << 39,
+ FlowTextIsRenderQuote = 1LLU << 40,
+ FlowTextIsTextFragment = 1LLU << 41,
+ FlowTextIsSVGInlineText = 1LLU << 42,
+ FlowHasComplexFontCodePath = 1LLU << 43,
+ FeatureIsDisabled = 1LLU << 44,
+ FlowHasNoParent = 1LLU << 45,
+ FlowHasNoChild = 1LLU << 46,
+ FlowChildIsSelected = 1LLU << 47,
+ FlowHasHangingPunctuation = 1LLU << 48,
+ FlowFontHasOverflowGlyph = 1LLU << 49,
+ FlowTextHasSurrogatePair = 1LLU << 50,
+ EndOfReasons = 1LLU << 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>