Title: [257915] trunk/LayoutTests
Revision
257915
Author
an...@apple.com
Date
2020-03-05 07:51:17 -0800 (Thu, 05 Mar 2020)

Log Message

REGRESSION (r257839): two fast/forms/textarea are failing after commit r257839 (208576)
https://bugs.webkit.org/show_bug.cgi?id=208627
<rdar://problem/60042801>

Reviewed by Zalan Bujtas.

* fast/forms/textarea-no-scroll-on-blur.html:
* fast/forms/textarea-scrolled-type.html:

Update the tests to use rAF instead of zero duration timers.
There must be a rendering update between focus() and blur() for actual scrolling to happen and
zero duration timer doesn't guarantee that.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (257914 => 257915)


--- trunk/LayoutTests/ChangeLog	2020-03-05 15:46:20 UTC (rev 257914)
+++ trunk/LayoutTests/ChangeLog	2020-03-05 15:51:17 UTC (rev 257915)
@@ -1,3 +1,18 @@
+2020-03-05  Antti Koivisto  <an...@apple.com>
+
+        REGRESSION (r257839): two fast/forms/textarea are failing after commit r257839 (208576)
+        https://bugs.webkit.org/show_bug.cgi?id=208627
+        <rdar://problem/60042801>
+
+        Reviewed by Zalan Bujtas.
+
+        * fast/forms/textarea-no-scroll-on-blur.html:
+        * fast/forms/textarea-scrolled-type.html:
+
+        Update the tests to use rAF instead of zero duration timers.
+        There must be a rendering update between focus() and blur() for actual scrolling to happen and
+        zero duration timer doesn't guarantee that.
+
 2020-03-05  Carlos Garcia Campos  <cgar...@igalia.com>
 
         Unreviewed GTK gardening. Rebaseline media controls tests after r257775

Modified: trunk/LayoutTests/fast/forms/textarea-no-scroll-on-blur.html (257914 => 257915)


--- trunk/LayoutTests/fast/forms/textarea-no-scroll-on-blur.html	2020-03-05 15:46:20 UTC (rev 257914)
+++ trunk/LayoutTests/fast/forms/textarea-no-scroll-on-blur.html	2020-03-05 15:51:17 UTC (rev 257915)
@@ -1,8 +1,8 @@
 <html>
 <head>
 <script>
-    function wait(seconds) {
-        return new Promise((resolve) => setTimeout(resolve, 0), seconds);
+    function rAF() {
+        return new Promise(resolve => requestAnimationFrame(resolve));
     }
 
     async function test() {
@@ -16,14 +16,14 @@
         // Send caret to bottom of textarea
         ta.focus();
         ta.setSelectionRange(ta.value.length, ta.value.length);
-        await wait(0);
+        await rAF();
         ta.blur();
 
-        await wait(0);
+        await rAF();
         ta.focus();
-        await wait(0);
+        await rAF();
         ta.blur();
-        await wait(0);
+        await rAF();
 
         document.getElementById('res').innerHTML = ta.scrollTop != 0 ? "Test Passed" : "Test Failed";
 

Modified: trunk/LayoutTests/fast/forms/textarea-scrolled-type.html (257914 => 257915)


--- trunk/LayoutTests/fast/forms/textarea-scrolled-type.html	2020-03-05 15:46:20 UTC (rev 257914)
+++ trunk/LayoutTests/fast/forms/textarea-scrolled-type.html	2020-03-05 15:51:17 UTC (rev 257915)
@@ -2,9 +2,8 @@
 <head>
 <script src="" language="_javascript_" type="text/_javascript_" ></script>
 <script>
-function wait(seconds)
-{
-    return new Promise((resolve) => setTimeout(resolve, 0), seconds);
+function rAF() {
+    return new Promise(resolve => requestAnimationFrame(resolve));
 }
 
 async function test()
@@ -17,14 +16,14 @@
 
     // Send caret to bottom of textarea
     ta.focus();
-    await wait(0);
+    await rAF();
     ta.setSelectionRange(ta.value.length, ta.value.length);
-    await wait(0);
+    await rAF();
     ta.blur();
-    await wait(0);
+    await rAF();
 
     ta.focus();
-    await wait(0);
+    await rAF();
     ta.setSelectionRange(44, 44);
     typeCharacterCommand(' ');
     typeCharacterCommand('P');
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to