Title: [212482] trunk/Source/WebCore
Revision
212482
Author
za...@apple.com
Date
2017-02-16 15:58:34 -0800 (Thu, 16 Feb 2017)

Log Message

Simple line layout: Add forced line layout info to coverage print.
https://bugs.webkit.org/show_bug.cgi?id=168470

Reviewed by Simon Fraser.

This is about potential vs. actual coverage:

Simple line layout potential coverage: 65.05%
Simple line layout actual coverage: 46.60%
Forced line layout blocks: 4 content length: 57(18.45%)

Not testable.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (212481 => 212482)


--- trunk/Source/WebCore/ChangeLog	2017-02-16 23:52:26 UTC (rev 212481)
+++ trunk/Source/WebCore/ChangeLog	2017-02-16 23:58:34 UTC (rev 212482)
@@ -1,3 +1,21 @@
+2017-02-16  Zalan Bujtas  <za...@apple.com>
+
+        Simple line layout: Add forced line layout info to coverage print.
+        https://bugs.webkit.org/show_bug.cgi?id=168470
+
+        Reviewed by Simon Fraser.
+
+        This is about potential vs. actual coverage:
+
+        Simple line layout potential coverage: 65.05%
+        Simple line layout actual coverage: 46.60%
+        Forced line layout blocks: 4 content length: 57(18.45%)
+
+        Not testable.
+
+        * rendering/SimpleLineLayout.cpp:
+        (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
+
 2017-02-16  Anders Carlsson  <ander...@apple.com>
 
         Rename DataTransfer functions to indicate whether they are for dragging or dropping

Modified: trunk/Source/WebCore/rendering/SimpleLineLayout.cpp (212481 => 212482)


--- trunk/Source/WebCore/rendering/SimpleLineLayout.cpp	2017-02-16 23:52:26 UTC (rev 212481)
+++ trunk/Source/WebCore/rendering/SimpleLineLayout.cpp	2017-02-16 23:58:34 UTC (rev 212482)
@@ -1339,12 +1339,19 @@
     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 (reasons == NoReason) {
+            if (flow->lineLayoutPath() == RenderBlockFlow::ForceLineBoxesPath) {
+                supportedButForcedToLineLayoutTextLength += flowLength;
+                ++numberOfSupportedButForcedToLineLayoutLeafBlocks;
+            }
             continue;
+        }
         ++numberOfUnsupportedLeafBlocks;
         unsupportedTextLength += flowLength;
         for (auto reasonItem = EndOfReasons >> 1; reasonItem != NoReason; reasonItem >>= 1) {
@@ -1356,14 +1363,18 @@
         }
     }
     stream << "---------------------------------------------------\n";
-    stream << "Number of text blocks: total(" <<  leafRenderers.size() << ") non-simple(" << numberOfUnsupportedLeafBlocks << ")\nText length: total(" <<
+    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";
     }
-    stream << "simple line layout coverage: " << (float)(textLength - unsupportedTextLength) / (float)textLength * 100 << "%\n";
-    stream << "---------------------------------------------------\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
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to