Title: [261321] trunk/LayoutTests
Revision
261321
Author
timothy_hor...@apple.com
Date
2020-05-07 11:38:52 -0700 (Thu, 07 May 2020)

Log Message

Add a test for `REGRESSION (r260753): Frequent crashes under TextIndicator's estimatedTextColorsForRange`
https://bugs.webkit.org/show_bug.cgi?id=211532

Reviewed by Wenson Hsieh.

* fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt: Added.
* fast/text-indicator/text-indicator-estimated-color-with-implicit-newline.html: Added.
* platform/ios/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt: Added.
This test would trigger the null deref fixed in r261245.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (261320 => 261321)


--- trunk/LayoutTests/ChangeLog	2020-05-07 18:37:33 UTC (rev 261320)
+++ trunk/LayoutTests/ChangeLog	2020-05-07 18:38:52 UTC (rev 261321)
@@ -1,3 +1,15 @@
+2020-05-07  Timothy Horton  <timothy_hor...@apple.com>
+
+        Add a test for `REGRESSION (r260753): Frequent crashes under TextIndicator's estimatedTextColorsForRange`
+        https://bugs.webkit.org/show_bug.cgi?id=211532
+
+        Reviewed by Wenson Hsieh.
+
+        * fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt: Added.
+        * fast/text-indicator/text-indicator-estimated-color-with-implicit-newline.html: Added.
+        * platform/ios/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt: Added.
+        This test would trigger the null deref fixed in r261245.
+
 2020-05-07  Jason Lawrence  <lawrenc...@apple.com>
 
         [ Mac wk1 ] http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html is flaky failing.

Added: trunk/LayoutTests/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt (0 => 261321)


--- trunk/LayoutTests/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt	2020-05-07 18:38:52 UTC (rev 261321)
@@ -0,0 +1,3 @@
+indicator: 
+    0 0 84 22
+

Added: trunk/LayoutTests/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline.html (0 => 261321)


--- trunk/LayoutTests/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline.html	2020-05-07 18:38:52 UTC (rev 261321)
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+* { box-sizing: border-box; font-family: ahem; }
+body { margin: 0; }
+div { position: absolute; top: 0; left: 0; }
+</style>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+
+function output(s)
+{
+    window.log.innerText += s + "\n";
+}
+
+function runTest()
+{
+    if (!window.internals) {
+        output("This test cannot be run outside of WebKitTestRunner.");
+        return;
+    }
+
+    function dumpIndicatorBoundsForElement(el)
+    {
+        var indicatorOptions = {
+            "computeEstimatedBackgroundColor": true,
+        };
+        var range = internals.rangeFromLocationAndLength(el, 0, 9);
+        var indicator = window.internals.textIndicatorForRange(range, indicatorOptions);
+        var rects = indicator.textRectsInBoundingRectCoordinates;
+
+        output(`${el.id}: `);
+        for (var rect of rects)
+            output(`    ${rect.x} ${rect.y} ${rect.width} ${rect.height}`);
+    }
+
+    dumpIndicatorBoundsForElement(document.getElementById("indicator"));
+
+    // Remove the test cases so they don't show up in the dump.
+    document.getElementById("testCases").innerText = "";
+}
+</script>
+</head>
+<body _onload_="runTest()">
+<div id="testCases">
+    <div id="indicator"><img src=""
+</div>
+<pre id="log"></pre>
+</body>
+</html>
\ No newline at end of file

Added: trunk/LayoutTests/platform/ios/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt (0 => 261321)


--- trunk/LayoutTests/platform/ios/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt	2020-05-07 18:38:52 UTC (rev 261321)
@@ -0,0 +1,3 @@
+indicator: 
+    0 0 84 23
+
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to