mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
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 --HG-- extra : rebase_source : 470b63b35c3a52f48ddd08d4b529c6b1eb957cb2
This commit is contained in:
parent
fdf597eae9
commit
d96dadbd8a
@ -38,9 +38,6 @@ events (${expectedEvents.map(event => event.type).join(', ')})`);
|
||||
|
||||
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 => {
|
||||
@ -50,6 +47,10 @@ function setupAnimation(t, animationStyle, receiveEvents) {
|
||||
};
|
||||
});
|
||||
|
||||
const watcher = new EventWatcher(t, div, [ 'animationstart',
|
||||
'animationiteration',
|
||||
'animationend' ]);
|
||||
|
||||
const animation = div.getAnimations()[0];
|
||||
|
||||
return [animation, watcher, div];
|
||||
|
Loading…
Reference in New Issue
Block a user