Title: [231690] trunk/LayoutTests
Revision
231690
Author
[email protected]
Date
2018-05-10 22:00:23 -0700 (Thu, 10 May 2018)

Log Message

REGRESSION(r227983): fast/dom/adopt-node-crash-2.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=182589

Reviewed by Wenson Hsieh.

This is a speculative fix for the test since I can't reproduce the flakiness locally. Because r227983 makes
the layout update async, I suspect the focus change which occurs to the keygen having autofocus attribute
isn't updating the layout in time for notifyDone call. Manually update the layout before/after the test.

Also wait for the load event to figure before starting the test since layout, etc... may not be updated
immediately after DOMContentLoaded.

* fast/dom/adopt-node-crash-2.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (231689 => 231690)


--- trunk/LayoutTests/ChangeLog	2018-05-11 04:41:24 UTC (rev 231689)
+++ trunk/LayoutTests/ChangeLog	2018-05-11 05:00:23 UTC (rev 231690)
@@ -1,3 +1,19 @@
+2018-05-10  Ryosuke Niwa  <[email protected]>
+
+        REGRESSION(r227983): fast/dom/adopt-node-crash-2.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=182589
+
+        Reviewed by Wenson Hsieh.
+
+        This is a speculative fix for the test since I can't reproduce the flakiness locally. Because r227983 makes
+        the layout update async, I suspect the focus change which occurs to the keygen having autofocus attribute
+        isn't updating the layout in time for notifyDone call. Manually update the layout before/after the test.
+
+        Also wait for the load event to figure before starting the test since layout, etc... may not be updated
+        immediately after DOMContentLoaded.
+
+        * fast/dom/adopt-node-crash-2.html:
+
 2018-05-10  Wenson Hsieh  <[email protected]>
 
         [Extra zoom mode] fast/visual-viewport/extrazoom/layout-viewport-after-scrolling-and-resizing.html sometimes fails

Modified: trunk/LayoutTests/fast/dom/adopt-node-crash-2.html (231689 => 231690)


--- trunk/LayoutTests/fast/dom/adopt-node-crash-2.html	2018-05-11 04:41:24 UTC (rev 231689)
+++ trunk/LayoutTests/fast/dom/adopt-node-crash-2.html	2018-05-11 05:00:23 UTC (rev 231690)
@@ -20,13 +20,23 @@
 <script>
 function doit()
 {
-    div2.addEventListener("DOMFocusOut", function () { document.implementation.createDocument("", "", null).adoptNode(div2); }, false);
+    div2.addEventListener("DOMFocusOut", function () {
+        document.implementation.createDocument("", "", null).adoptNode(div2);
+        setTimeout(() => {
+            if (window.internals)
+                internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
+            if (window.testRunner)
+                testRunner.notifyDone();
+        }, 0);
+    }, false);
     div1.outerHTML = header1.outerHTML;
-    if (window.testRunner)
-        testRunner.notifyDone();
 }
-document.addEventListener("DOMContentLoaded", function() {
+window._onload_ = function() {
+    if (window.internals)
+        internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
+    else
+        div2.getBoundingClientRect();
     setTimeout("doit()", 1);
-}, false);
+}
 </script>
 </html>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to