Bug 1415010 - Bind onanimationxx handlers before creating EventWatcher. r=birtles
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 07 Nov 2017 10:30:07 +0900
changeset 443718 242c0719c3bfc9dce6186d4048e7ea37ecbc6034
parent 443717 e75110474d54f79ed4053ec9beff2c16ec7a714e
child 443719 e06545e41fdfcab3f580592d42a8806f5b4b86ce
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1415010
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1415010 - Bind onanimationxx handlers before creating EventWatcher. r=birtles So that we can surely receive these animation events in the handler before the EventWatcher receives the events. MozReview-Commit-ID: 9jVJ3TgwYeq
dom/animation/test/css-animations/file_event-order.html
--- a/dom/animation/test/css-animations/file_event-order.html
+++ b/dom/animation/test/css-animations/file_event-order.html
@@ -33,28 +33,29 @@ events (${expectedEvents.map(event => ev
                   'Event target should match');
     assert_equals(expectedEvents[i][2], actualEvent.elapsedTime,
                   'Event\'s elapsed time should match');
   });
 }
 
 function setupAnimation(t, animationStyle, receiveEvents) {
   const div = addDiv(t, { style: "animation: " + animationStyle });
-  const watcher = new EventWatcher(t, div, [ 'animationstart',
-                                             'animationiteration',
-                                             'animationend' ]);
 
   ['start', 'iteration', 'end'].forEach(name => {
     div['onanimation' + name] = evt => {
     receiveEvents.push({ type:        evt.type,
                          target:      evt.target,
                          elapsedTime: evt.elapsedTime });
     };
   });
 
+  const watcher = new EventWatcher(t, div, [ 'animationstart',
+                                             'animationiteration',
+                                             'animationend' ]);
+
   const animation = div.getAnimations()[0];
 
   return [animation, watcher, div];
 }
 
 promise_test(t => {
   let events = [];
   const [animation1, watcher1, div1] =