fast/fixed-layout/fixed-layout.html is flaky
[WebKit-https.git] / LayoutTests / fast / fixed-layout / fixed-layout.html
index 37a0414af396f0f6460fe2723b09c5ddd4f1d3ca..d0f3eb5c6cf84565aeb1170cda2fd4dfc406ee5f 100644 (file)
@@ -6,16 +6,19 @@ window.onload = function () {
         return;
     }
 
-    testRunner.waitUntilDone();
+    // Ensure layout is up to date here so that we get a resize event instead of just using
+    // 200x200 as the initial size, in WebKit1 (causing the test to hang).
+    document.body.offsetTop;
 
+    testRunner.waitUntilDone();
     window.resizeTo(200, 200);
+}
 
+window.onresize = function () {
     internals.setUseFixedLayout(true);
     internals.setFixedLayoutSize(400, 400);
 
-    setTimeout(function () {
-        testRunner.notifyDone();
-    }, 0);
+    testRunner.notifyDone();
 }
 </script>
 </head>