Bug 1351409 - Remove animationiteration from legacy event listener test, make the transition tests more robust, and re-enable that test. r?jmaher draft
authorXidorn Quan <me@upsuper.org>
Thu, 21 Dec 2017 16:10:38 +1100
changeset 715185 ad7e5c3307703be08a46218e6bdb3ca53047dfb7
parent 715183 f6598acd0ae36c1c8b0d1f961e41e329a2bfb0fa
child 744725 071299aa080100d2b653519b7a44f6dd38db177a
push id94085
push userxquan@mozilla.com
push dateWed, 03 Jan 2018 01:53:27 +0000
reviewersjmaher
bugs1351409, 701445
milestone59.0a1
Bug 1351409 - Remove animationiteration from legacy event listener test, make the transition tests more robust, and re-enable that test. r?jmaher According to :birtles, it is not guaranteed that animationiteration event will be fired. This event is sample-based rather than event-based, and such behavior has been clarified in CSS Animations Level 2: https://drafts.csswg.org/css-animations-2/#event-dispatch Also, Chromium has the same issue with this test: https://bugs.chromium.org/p/chromium/issues/detail?id=701445 MozReview-Commit-ID: KBCzkGHxbfc
testing/web-platform/meta/dom/events/EventListener-invoke-legacy.html.ini
testing/web-platform/tests/dom/events/EventListener-invoke-legacy.html
deleted file mode 100644
--- a/testing/web-platform/meta/dom/events/EventListener-invoke-legacy.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[EventListener-invoke-legacy.html]
-  type: testharness
-  disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1351409
--- a/testing/web-platform/tests/dom/events/EventListener-invoke-legacy.html
+++ b/testing/web-platform/tests/dom/events/EventListener-invoke-legacy.html
@@ -46,27 +46,21 @@ function runLegacyEventTest(type, legacy
       elem.dispatchEvent(new window[ctor](type));
       t.done();
     }));
     setup(elem);
   }, "Legacy listener of " + type);
 }
 
 function setupTransition(elem) {
-  elem.style.transition = '';
-  requestAnimationFrame(function() {
-    elem.style.color = 'red';
-    elem.style.transition = 'color 30ms';
-    requestAnimationFrame(function() {
-      elem.style.color = 'green';
-    });
-  });
+  getComputedStyle(elem).color;
+  elem.style.color = 'green';
+  elem.style.transition = 'color 30ms';
 }
 
 function setupAnimation(elem) {
-  elem.style.animation = 'test 30ms 2';
+  elem.style.animation = 'test 30ms';
 }
 
 runLegacyEventTest('transitionend', 'webkitTransitionEnd', "TransitionEvent", setupTransition);
 runLegacyEventTest('animationend', 'webkitAnimationEnd', "AnimationEvent", setupAnimation);
-runLegacyEventTest('animationiteration', 'webkitAnimationIteration', "AnimationEvent", setupAnimation);
 runLegacyEventTest('animationstart', 'webkitAnimationStart', "AnimationEvent", setupAnimation);
 </script>