Title: [289574] trunk/LayoutTests
Revision
289574
Author
[email protected]
Date
2022-02-10 14:09:14 -0800 (Thu, 10 Feb 2022)

Log Message

Make accessibility/mac/line-index-for-textmarker.html run faster.
https://bugs.webkit.org/show_bug.cgi?id=236451
<rdar://problem/88763847>

Reviewed by Chris Fleizach.

The main cause of slowness seems to be the high number of calls to
debug(). So now it builds the output string and call debug() just once.

* accessibility/mac/line-index-for-textmarker-expected.txt:
* accessibility/mac/line-index-for-textmarker.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (289573 => 289574)


--- trunk/LayoutTests/ChangeLog	2022-02-10 22:06:48 UTC (rev 289573)
+++ trunk/LayoutTests/ChangeLog	2022-02-10 22:09:14 UTC (rev 289574)
@@ -1,3 +1,17 @@
+2022-02-10  Andres Gonzalez  <[email protected]>
+
+        Make accessibility/mac/line-index-for-textmarker.html run faster.
+        https://bugs.webkit.org/show_bug.cgi?id=236451
+        <rdar://problem/88763847>
+
+        Reviewed by Chris Fleizach.
+
+        The main cause of slowness seems to be the high number of calls to
+        debug(). So now it builds the output string and call debug() just once.
+
+        * accessibility/mac/line-index-for-textmarker-expected.txt:
+        * accessibility/mac/line-index-for-textmarker.html:
+
 2022-02-10  Jon Lee  <[email protected]>
 
         Unreviewed gardening.

Modified: trunk/LayoutTests/accessibility/mac/line-index-for-textmarker-expected.txt (289573 => 289574)


--- trunk/LayoutTests/accessibility/mac/line-index-for-textmarker-expected.txt	2022-02-10 22:06:48 UTC (rev 289573)
+++ trunk/LayoutTests/accessibility/mac/line-index-for-textmarker-expected.txt	2022-02-10 22:09:14 UTC (rev 289574)
@@ -188,6 +188,7 @@
 181 7 9
 182 8 9
 183 9 9
+
 contenteditable:
 0 a 0
 1 b 0
@@ -373,6 +374,7 @@
 181 7 2
 182 8 2
 183 9 2
+
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/accessibility/mac/line-index-for-textmarker.html (289573 => 289574)


--- trunk/LayoutTests/accessibility/mac/line-index-for-textmarker.html	2022-02-10 22:06:48 UTC (rev 289573)
+++ trunk/LayoutTests/accessibility/mac/line-index-for-textmarker.html	2022-02-10 22:09:14 UTC (rev 289574)
@@ -19,11 +19,13 @@
         var range = p.textMarkerRangeForElement(p);
         var length = p.textMarkerRangeLength(range);
         var current = p.startTextMarkerForTextMarkerRange(range);
+        let output = "";
         for (let i = 0; i < length; ++i) {
             let character = p.stringForTextMarkerRange(p.textMarkerRangeForMarkers(current, p.nextTextMarker(current)));
-            debug(`${i} ${character} ${p.lineIndexForTextMarker(current)}`);
+            output += `${i} ${character} ${p.lineIndexForTextMarker(current)}\n`;
             current = p.nextTextMarker(current);
         }
+        debug(output);
     }
 
     if (window.accessibilityController) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to