[ Mac ] REGRESSION (r237587) Layout Test compositing/visible-rect/animated-from-none...
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2019 17:50:11 +0000 (17:50 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2019 17:50:11 +0000 (17:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194798
<rdar://problem/48181898>

Reviewed by Dean Jackson.

When using the Web Animations engine, the best way to run code as an animation start is to use the "ready" promise, whereas
DOM events are dispatched asynchronously and, in the case of this test, might have an animation progress that is greater
than 0 and yield an animated transform that isn't quite the identity matrix.

* compositing/visible-rect/animated-from-none.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244082 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/compositing/visible-rect/animated-from-none.html

index 73e7764..2e08d80 100644 (file)
@@ -1,3 +1,17 @@
+2019-04-09  Antoine Quint  <graouts@apple.com>
+
+        [ Mac ] REGRESSION (r237587) Layout Test compositing/visible-rect/animated-from-none.html is flaky text diff failure
+        https://bugs.webkit.org/show_bug.cgi?id=194798
+        <rdar://problem/48181898>
+
+        Reviewed by Dean Jackson.
+
+        When using the Web Animations engine, the best way to run code as an animation start is to use the "ready" promise, whereas
+        DOM events are dispatched asynchronously and, in the case of this test, might have an animation progress that is greater
+        than 0 and yield an animated transform that isn't quite the identity matrix.
+
+        * compositing/visible-rect/animated-from-none.html:
+
 2019-04-09  Jer Noble  <jer.noble@apple.com>
 
         Add test for fix of #196095
index 464ec0c..f61e19c 100644 (file)
 
         function doTest()
         {
-            let animated = document.getElementById('animated');
-            animated.addEventListener('webkitAnimationStart', function() {
+            const animated = document.getElementById('animated');
+            animated.classList.add('animating');
+            animated.getAnimations()[0].ready.then(() => {
                 if (window.internals)
                     document.getElementById('layers').innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS)
 
                 if (window.testRunner)
                     testRunner.notifyDone();
-            }, false);
-            
-            animated.classList.add('animating');
+            });
         }
         window.addEventListener('load', doTest, false);
     </script>