зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1415346 - Use arrow function in file_event-dispatch.html. r=birtles
MozReview-Commit-ID: 7bYYDIOLqv6 --HG-- extra : rebase_source : 93c38da7146f8e26e17f1abd06c437106472817a
This commit is contained in:
Родитель
a3d7fa09ea
Коммит
abd6474c95
|
@ -34,7 +34,7 @@ function AnimationEventHandler(target) {
|
||||||
this.animationcancel = evt.elapsedTime;
|
this.animationcancel = evt.elapsedTime;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
AnimationEventHandler.prototype.clear = function() {
|
AnimationEventHandler.prototype.clear = () => {
|
||||||
this.animationstart = undefined;
|
this.animationstart = undefined;
|
||||||
this.animationiteration = undefined;
|
this.animationiteration = undefined;
|
||||||
this.animationend = undefined;
|
this.animationend = undefined;
|
||||||
|
@ -52,122 +52,122 @@ function setupAnimation(t, animationStyle) {
|
||||||
return [animation, watcher, div];
|
return [animation, watcher, div];
|
||||||
}
|
}
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
// Add 1ms delay to ensure that the delay is not included in the elapsedTime.
|
// Add 1ms delay to ensure that the delay is not included in the elapsedTime.
|
||||||
const [animation, watcher] = setupAnimation(t, 'anim 100s 1ms');
|
const [animation, watcher] = setupAnimation(t, 'anim 100s 1ms');
|
||||||
|
|
||||||
return watcher.wait_for('animationstart').then(function(evt) {
|
return watcher.wait_for('animationstart').then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0.0);
|
assert_equals(evt.elapsedTime, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Idle -> Active');
|
}, 'Idle -> Active');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher, div] = setupAnimation(t, 'anim 100s');
|
const [animation, watcher, div] = setupAnimation(t, 'anim 100s');
|
||||||
const handler = new AnimationEventHandler(div);
|
const handler = new AnimationEventHandler(div);
|
||||||
|
|
||||||
// Seek to After phase.
|
// Seek to After phase.
|
||||||
animation.finish();
|
animation.finish();
|
||||||
return watcher.wait_for([ 'animationstart',
|
return watcher.wait_for([ 'animationstart',
|
||||||
'animationend' ]).then(function() {
|
'animationend' ]).then(() => {
|
||||||
assert_equals(handler.animationstart, 0.0);
|
assert_equals(handler.animationstart, 0.0);
|
||||||
assert_equals(handler.animationend, 100);
|
assert_equals(handler.animationend, 100);
|
||||||
});
|
});
|
||||||
}, 'Idle -> After');
|
}, 'Idle -> After');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher] =
|
const [animation, watcher] =
|
||||||
setupAnimation(t, 'anim 100s 100s paused');
|
setupAnimation(t, 'anim 100s 100s paused');
|
||||||
|
|
||||||
return animation.ready.then(function() {
|
return animation.ready.then(() => {
|
||||||
// Seek to Active phase.
|
// Seek to Active phase.
|
||||||
animation.currentTime = 100 * MS_PER_SEC;
|
animation.currentTime = 100 * MS_PER_SEC;
|
||||||
return watcher.wait_for('animationstart');
|
return watcher.wait_for('animationstart');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0.0);
|
assert_equals(evt.elapsedTime, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Before -> Active');
|
}, 'Before -> Active');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher, div] =
|
const [animation, watcher, div] =
|
||||||
setupAnimation(t, 'anim 100s 100s paused');
|
setupAnimation(t, 'anim 100s 100s paused');
|
||||||
const handler = new AnimationEventHandler(div);
|
const handler = new AnimationEventHandler(div);
|
||||||
|
|
||||||
return animation.ready.then(function() {
|
return animation.ready.then(() => {
|
||||||
// Seek to After phase.
|
// Seek to After phase.
|
||||||
animation.finish();
|
animation.finish();
|
||||||
return watcher.wait_for([ 'animationstart', 'animationend' ]);
|
return watcher.wait_for([ 'animationstart', 'animationend' ]);
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(handler.animationstart, 0.0);
|
assert_equals(handler.animationstart, 0.0);
|
||||||
assert_equals(handler.animationend, 100.0);
|
assert_equals(handler.animationend, 100.0);
|
||||||
});
|
});
|
||||||
}, 'Before -> After');
|
}, 'Before -> After');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher, div] = setupAnimation(t, 'anim 100s paused');
|
const [animation, watcher, div] = setupAnimation(t, 'anim 100s paused');
|
||||||
|
|
||||||
return watcher.wait_for('animationstart').then(function(evt) {
|
return watcher.wait_for('animationstart').then(evt => {
|
||||||
// Make idle
|
// Make idle
|
||||||
div.style.display = 'none';
|
div.style.display = 'none';
|
||||||
return watcher.wait_for('animationcancel');
|
return watcher.wait_for('animationcancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0.0);
|
assert_equals(evt.elapsedTime, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Active -> Idle, display: none');
|
}, 'Active -> Idle, display: none');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher, div] = setupAnimation(t, 'anim 100s');
|
const [animation, watcher, div] = setupAnimation(t, 'anim 100s');
|
||||||
|
|
||||||
return watcher.wait_for('animationstart').then(function(evt) {
|
return watcher.wait_for('animationstart').then(evt => {
|
||||||
animation.currentTime = 100.0;
|
animation.currentTime = 100.0;
|
||||||
// Make idle
|
// Make idle
|
||||||
animation.timeline = null;
|
animation.timeline = null;
|
||||||
return watcher.wait_for('animationcancel');
|
return watcher.wait_for('animationcancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_times_equal(evt.elapsedTime, 0.1);
|
assert_times_equal(evt.elapsedTime, 0.1);
|
||||||
});
|
});
|
||||||
}, 'Active -> Idle, setting Animation.timeline = null');
|
}, 'Active -> Idle, setting Animation.timeline = null');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
// we should NOT pause animation since calling cancel synchronously.
|
// we should NOT pause animation since calling cancel synchronously.
|
||||||
const [animation, watcher, div] = setupAnimation(t, 'anim 100s');
|
const [animation, watcher, div] = setupAnimation(t, 'anim 100s');
|
||||||
|
|
||||||
return watcher.wait_for('animationstart').then(function(evt) {
|
return watcher.wait_for('animationstart').then(evt => {
|
||||||
animation.currentTime = 50.0;
|
animation.currentTime = 50.0;
|
||||||
animation.cancel();
|
animation.cancel();
|
||||||
return watcher.wait_for('animationcancel');
|
return watcher.wait_for('animationcancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_times_equal(evt.elapsedTime, 0.05);
|
assert_times_equal(evt.elapsedTime, 0.05);
|
||||||
});
|
});
|
||||||
}, 'Active -> Idle, calling Animation.cancel()');
|
}, 'Active -> Idle, calling Animation.cancel()');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher] =
|
const [animation, watcher] =
|
||||||
setupAnimation(t, 'anim 100s 100s paused');
|
setupAnimation(t, 'anim 100s 100s paused');
|
||||||
|
|
||||||
// Seek to Active phase.
|
// Seek to Active phase.
|
||||||
animation.currentTime = 100 * MS_PER_SEC;
|
animation.currentTime = 100 * MS_PER_SEC;
|
||||||
return watcher.wait_for('animationstart').then(function() {
|
return watcher.wait_for('animationstart').then(() => {
|
||||||
// Seek to Before phase.
|
// Seek to Before phase.
|
||||||
animation.currentTime = 0;
|
animation.currentTime = 0;
|
||||||
return watcher.wait_for('animationend');
|
return watcher.wait_for('animationend');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0.0);
|
assert_equals(evt.elapsedTime, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Active -> Before');
|
}, 'Active -> Before');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher] = setupAnimation(t, 'anim 100s paused');
|
const [animation, watcher] = setupAnimation(t, 'anim 100s paused');
|
||||||
|
|
||||||
return watcher.wait_for('animationstart').then(function(evt) {
|
return watcher.wait_for('animationstart').then(evt => {
|
||||||
// Seek to After phase.
|
// Seek to After phase.
|
||||||
animation.finish();
|
animation.finish();
|
||||||
return watcher.wait_for('animationend');
|
return watcher.wait_for('animationend');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 100.0);
|
assert_equals(evt.elapsedTime, 100.0);
|
||||||
});
|
});
|
||||||
}, 'Active -> After');
|
}, 'Active -> After');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher, div] =
|
const [animation, watcher, div] =
|
||||||
setupAnimation(t, 'anim 100s 100s paused');
|
setupAnimation(t, 'anim 100s 100s paused');
|
||||||
const handler = new AnimationEventHandler(div);
|
const handler = new AnimationEventHandler(div);
|
||||||
|
@ -175,18 +175,18 @@ promise_test(function(t) {
|
||||||
// Seek to After phase.
|
// Seek to After phase.
|
||||||
animation.finish();
|
animation.finish();
|
||||||
return watcher.wait_for([ 'animationstart',
|
return watcher.wait_for([ 'animationstart',
|
||||||
'animationend' ]).then(function() {
|
'animationend' ]).then(() => {
|
||||||
// Seek to Before phase.
|
// Seek to Before phase.
|
||||||
animation.currentTime = 0;
|
animation.currentTime = 0;
|
||||||
handler.clear();
|
handler.clear();
|
||||||
return watcher.wait_for([ 'animationstart', 'animationend' ]);
|
return watcher.wait_for([ 'animationstart', 'animationend' ]);
|
||||||
}).then(function() {
|
}).then(() => {
|
||||||
assert_equals(handler.animationstart, 100.0);
|
assert_equals(handler.animationstart, 100.0);
|
||||||
assert_equals(handler.animationend, 0.0);
|
assert_equals(handler.animationend, 0.0);
|
||||||
});
|
});
|
||||||
}, 'After -> Before');
|
}, 'After -> Before');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher, div] =
|
const [animation, watcher, div] =
|
||||||
setupAnimation(t, 'anim 100s 100s paused');
|
setupAnimation(t, 'anim 100s 100s paused');
|
||||||
const handler = new AnimationEventHandler(div);
|
const handler = new AnimationEventHandler(div);
|
||||||
|
@ -194,56 +194,56 @@ promise_test(function(t) {
|
||||||
// Seek to After phase.
|
// Seek to After phase.
|
||||||
animation.finish();
|
animation.finish();
|
||||||
return watcher.wait_for([ 'animationstart',
|
return watcher.wait_for([ 'animationstart',
|
||||||
'animationend' ]).then(function() {
|
'animationend' ]).then(() => {
|
||||||
// Seek to Active phase.
|
// Seek to Active phase.
|
||||||
animation.currentTime = 100 * MS_PER_SEC;
|
animation.currentTime = 100 * MS_PER_SEC;
|
||||||
handler.clear();
|
handler.clear();
|
||||||
return watcher.wait_for('animationstart');
|
return watcher.wait_for('animationstart');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 100.0);
|
assert_equals(evt.elapsedTime, 100.0);
|
||||||
});
|
});
|
||||||
}, 'After -> Active');
|
}, 'After -> Active');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher, div]
|
const [animation, watcher, div]
|
||||||
= setupAnimation(t, 'anim 100s 100s 3 paused');
|
= setupAnimation(t, 'anim 100s 100s 3 paused');
|
||||||
const handler = new AnimationEventHandler(div);
|
const handler = new AnimationEventHandler(div);
|
||||||
|
|
||||||
return animation.ready.then(function() {
|
return animation.ready.then(() => {
|
||||||
// Seek to iteration 0 (no animationiteration event should be dispatched)
|
// Seek to iteration 0 (no animationiteration event should be dispatched)
|
||||||
animation.currentTime = 100 * MS_PER_SEC;
|
animation.currentTime = 100 * MS_PER_SEC;
|
||||||
return watcher.wait_for('animationstart');
|
return watcher.wait_for('animationstart');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
// Seek to iteration 2
|
// Seek to iteration 2
|
||||||
animation.currentTime = 300 * MS_PER_SEC;
|
animation.currentTime = 300 * MS_PER_SEC;
|
||||||
handler.clear();
|
handler.clear();
|
||||||
return watcher.wait_for('animationiteration');
|
return watcher.wait_for('animationiteration');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 200);
|
assert_equals(evt.elapsedTime, 200);
|
||||||
// Seek to After phase (no animationiteration event should be dispatched)
|
// Seek to After phase (no animationiteration event should be dispatched)
|
||||||
animation.currentTime = 400 * MS_PER_SEC;
|
animation.currentTime = 400 * MS_PER_SEC;
|
||||||
return watcher.wait_for('animationend');
|
return watcher.wait_for('animationend');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 300);
|
assert_equals(evt.elapsedTime, 300);
|
||||||
});
|
});
|
||||||
}, 'Active -> Active (forwards)');
|
}, 'Active -> Active (forwards)');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher] = setupAnimation(t, 'anim 100s 100s 3');
|
const [animation, watcher] = setupAnimation(t, 'anim 100s 100s 3');
|
||||||
|
|
||||||
// Seek to After phase.
|
// Seek to After phase.
|
||||||
animation.finish();
|
animation.finish();
|
||||||
return watcher.wait_for([ 'animationstart',
|
return watcher.wait_for([ 'animationstart',
|
||||||
'animationend' ]).then(function() {
|
'animationend' ]).then(() => {
|
||||||
// Seek to iteration 2 (no animationiteration event should be dispatched)
|
// Seek to iteration 2 (no animationiteration event should be dispatched)
|
||||||
animation.pause();
|
animation.pause();
|
||||||
animation.currentTime = 300 * MS_PER_SEC;
|
animation.currentTime = 300 * MS_PER_SEC;
|
||||||
return watcher.wait_for('animationstart');
|
return watcher.wait_for('animationstart');
|
||||||
}).then(function() {
|
}).then(() => {
|
||||||
// Seek to mid of iteration 0 phase.
|
// Seek to mid of iteration 0 phase.
|
||||||
animation.currentTime = 200 * MS_PER_SEC;
|
animation.currentTime = 200 * MS_PER_SEC;
|
||||||
return watcher.wait_for('animationiteration');
|
return watcher.wait_for('animationiteration');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 200.0);
|
assert_equals(evt.elapsedTime, 200.0);
|
||||||
// Seek to before phase (no animationiteration event should be dispatched)
|
// Seek to before phase (no animationiteration event should be dispatched)
|
||||||
animation.currentTime = 0;
|
animation.currentTime = 0;
|
||||||
|
@ -251,66 +251,66 @@ promise_test(function(t) {
|
||||||
});
|
});
|
||||||
}, 'Active -> Active (backwards)');
|
}, 'Active -> Active (backwards)');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher, div] =
|
const [animation, watcher, div] =
|
||||||
setupAnimation(t, 'anim 100s paused');
|
setupAnimation(t, 'anim 100s paused');
|
||||||
return watcher.wait_for('animationstart').then(function(evt) {
|
return watcher.wait_for('animationstart').then(evt => {
|
||||||
// Seek to Idle phase.
|
// Seek to Idle phase.
|
||||||
div.style.display = 'none';
|
div.style.display = 'none';
|
||||||
flushComputedStyle(div);
|
flushComputedStyle(div);
|
||||||
|
|
||||||
return watcher.wait_for('animationcancel');
|
return watcher.wait_for('animationcancel');
|
||||||
}).then(function() {
|
}).then(() => {
|
||||||
// Restart this animation.
|
// Restart this animation.
|
||||||
div.style.display = '';
|
div.style.display = '';
|
||||||
return watcher.wait_for('animationstart');
|
return watcher.wait_for('animationstart');
|
||||||
});
|
});
|
||||||
}, 'Active -> Idle -> Active: animationstart is fired by restarting animation');
|
}, 'Active -> Idle -> Active: animationstart is fired by restarting animation');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher] =
|
const [animation, watcher] =
|
||||||
setupAnimation(t, 'anim 100s 100s 2 paused');
|
setupAnimation(t, 'anim 100s 100s 2 paused');
|
||||||
|
|
||||||
// Make After.
|
// Make After.
|
||||||
animation.finish();
|
animation.finish();
|
||||||
return watcher.wait_for([ 'animationstart',
|
return watcher.wait_for([ 'animationstart',
|
||||||
'animationend' ]).then(function(evt) {
|
'animationend' ]).then(evt => {
|
||||||
animation.playbackRate = -1;
|
animation.playbackRate = -1;
|
||||||
return watcher.wait_for('animationstart');
|
return watcher.wait_for('animationstart');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 200);
|
assert_equals(evt.elapsedTime, 200);
|
||||||
// Seek to 1st iteration
|
// Seek to 1st iteration
|
||||||
animation.currentTime = 200 * MS_PER_SEC - 1;
|
animation.currentTime = 200 * MS_PER_SEC - 1;
|
||||||
return watcher.wait_for('animationiteration');
|
return watcher.wait_for('animationiteration');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 100);
|
assert_equals(evt.elapsedTime, 100);
|
||||||
// Seek to before
|
// Seek to before
|
||||||
animation.currentTime = 100 * MS_PER_SEC - 1;
|
animation.currentTime = 100 * MS_PER_SEC - 1;
|
||||||
return watcher.wait_for('animationend');
|
return watcher.wait_for('animationend');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0);
|
assert_equals(evt.elapsedTime, 0);
|
||||||
assert_equals(animation.playState, 'running'); // delay
|
assert_equals(animation.playState, 'running'); // delay
|
||||||
});
|
});
|
||||||
}, 'Negative playbackRate sanity test(Before -> Active -> Before)');
|
}, 'Negative playbackRate sanity test(Before -> Active -> Before)');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher] = setupAnimation(t, 'anim 100s');
|
const [animation, watcher] = setupAnimation(t, 'anim 100s');
|
||||||
|
|
||||||
return watcher.wait_for('animationstart').then(function(evt) {
|
return watcher.wait_for('animationstart').then(evt => {
|
||||||
// Make idle
|
// Make idle
|
||||||
animation.cancel();
|
animation.cancel();
|
||||||
return watcher.wait_for('animationcancel');
|
return watcher.wait_for('animationcancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
animation.cancel();
|
animation.cancel();
|
||||||
// Then wait a couple of frames and check that no event was dispatched.
|
// Then wait a couple of frames and check that no event was dispatched.
|
||||||
return waitForAnimationFrames(2);
|
return waitForAnimationFrames(2);
|
||||||
});
|
});
|
||||||
}, 'Call Animation.cancel after cancelling animation.');
|
}, 'Call Animation.cancel after cancelling animation.');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher] = setupAnimation(t, 'anim 100s');
|
const [animation, watcher] = setupAnimation(t, 'anim 100s');
|
||||||
|
|
||||||
return watcher.wait_for('animationstart').then(function(evt) {
|
return watcher.wait_for('animationstart').then(evt => {
|
||||||
// Make idle
|
// Make idle
|
||||||
animation.cancel();
|
animation.cancel();
|
||||||
animation.play();
|
animation.play();
|
||||||
|
@ -319,56 +319,56 @@ promise_test(function(t) {
|
||||||
});
|
});
|
||||||
}, 'Restart animation after cancelling animation immediately.');
|
}, 'Restart animation after cancelling animation immediately.');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher] = setupAnimation(t, 'anim 100s');
|
const [animation, watcher] = setupAnimation(t, 'anim 100s');
|
||||||
|
|
||||||
return watcher.wait_for('animationstart').then(function(evt) {
|
return watcher.wait_for('animationstart').then(evt => {
|
||||||
// Make idle
|
// Make idle
|
||||||
animation.cancel();
|
animation.cancel();
|
||||||
animation.play();
|
animation.play();
|
||||||
animation.cancel();
|
animation.cancel();
|
||||||
return watcher.wait_for('animationcancel');
|
return watcher.wait_for('animationcancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
// Then wait a couple of frames and check that no event was dispatched.
|
// Then wait a couple of frames and check that no event was dispatched.
|
||||||
return waitForAnimationFrames(2);
|
return waitForAnimationFrames(2);
|
||||||
});
|
});
|
||||||
}, 'Call Animation.cancel after restarting animation immediately.');
|
}, 'Call Animation.cancel after restarting animation immediately.');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher] = setupAnimation(t, 'anim 100s');
|
const [animation, watcher] = setupAnimation(t, 'anim 100s');
|
||||||
|
|
||||||
return watcher.wait_for('animationstart').then(function(evt) {
|
return watcher.wait_for('animationstart').then(evt => {
|
||||||
// Make idle
|
// Make idle
|
||||||
animation.timeline = null;
|
animation.timeline = null;
|
||||||
return watcher.wait_for('animationcancel');
|
return watcher.wait_for('animationcancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
animation.timeline = document.timeline;
|
animation.timeline = document.timeline;
|
||||||
animation.play();
|
animation.play();
|
||||||
return watcher.wait_for('animationstart');
|
return watcher.wait_for('animationstart');
|
||||||
});
|
});
|
||||||
}, 'Set timeline and play transition after clearing the timeline.');
|
}, 'Set timeline and play transition after clearing the timeline.');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher] = setupAnimation(t, 'anim 100s');
|
const [animation, watcher] = setupAnimation(t, 'anim 100s');
|
||||||
|
|
||||||
return watcher.wait_for('animationstart').then(function(evt) {
|
return watcher.wait_for('animationstart').then(evt => {
|
||||||
// Make idle
|
// Make idle
|
||||||
animation.cancel();
|
animation.cancel();
|
||||||
return watcher.wait_for('animationcancel');
|
return watcher.wait_for('animationcancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
animation.effect = null;
|
animation.effect = null;
|
||||||
// Then wait a couple of frames and check that no event was dispatched.
|
// Then wait a couple of frames and check that no event was dispatched.
|
||||||
return waitForAnimationFrames(2);
|
return waitForAnimationFrames(2);
|
||||||
});
|
});
|
||||||
}, 'Set null target effect after cancelling the animation.');
|
}, 'Set null target effect after cancelling the animation.');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
const [animation, watcher] = setupAnimation(t, 'anim 100s');
|
const [animation, watcher] = setupAnimation(t, 'anim 100s');
|
||||||
|
|
||||||
return watcher.wait_for('animationstart').then(function(evt) {
|
return watcher.wait_for('animationstart').then(evt => {
|
||||||
animation.effect = null;
|
animation.effect = null;
|
||||||
return watcher.wait_for('animationend');
|
return watcher.wait_for('animationend');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
animation.cancel();
|
animation.cancel();
|
||||||
// Then wait a couple of frames and check that no event was dispatched.
|
// Then wait a couple of frames and check that no event was dispatched.
|
||||||
return waitForAnimationFrames(2);
|
return waitForAnimationFrames(2);
|
||||||
|
|
|
@ -29,7 +29,7 @@ function TransitionEventHandler(target) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
TransitionEventHandler.prototype.clear = function() {
|
TransitionEventHandler.prototype.clear = () => {
|
||||||
this.transitionrun = undefined;
|
this.transitionrun = undefined;
|
||||||
this.transitionstart = undefined;
|
this.transitionstart = undefined;
|
||||||
this.transitionend = undefined;
|
this.transitionend = undefined;
|
||||||
|
@ -52,25 +52,25 @@ function setupTransition(t, transitionStyle) {
|
||||||
|
|
||||||
// On the next frame (i.e. when events are queued), whether or not the
|
// On the next frame (i.e. when events are queued), whether or not the
|
||||||
// transition is still pending depends on the implementation.
|
// transition is still pending depends on the implementation.
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher] =
|
var [transition, watcher] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
return watcher.wait_for('transitionrun').then(function(evt) {
|
return watcher.wait_for('transitionrun').then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0.0);
|
assert_equals(evt.elapsedTime, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Idle -> Pending or Before');
|
}, 'Idle -> Pending or Before');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher] =
|
var [transition, watcher] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
// Force the transition to leave the idle phase
|
// Force the transition to leave the idle phase
|
||||||
transition.startTime = document.timeline.currentTime;
|
transition.startTime = document.timeline.currentTime;
|
||||||
return watcher.wait_for('transitionrun').then(function(evt) {
|
return watcher.wait_for('transitionrun').then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0.0);
|
assert_equals(evt.elapsedTime, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Idle -> Before');
|
}, 'Idle -> Before');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher, div] =
|
var [transition, watcher, div] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
var handler = new TransitionEventHandler(div);
|
var handler = new TransitionEventHandler(div);
|
||||||
|
@ -79,13 +79,13 @@ promise_test(function(t) {
|
||||||
transition.currentTime = 100 * MS_PER_SEC;
|
transition.currentTime = 100 * MS_PER_SEC;
|
||||||
transition.pause();
|
transition.pause();
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart' ]).then(function(evt) {
|
'transitionstart' ]).then(evt => {
|
||||||
assert_equals(handler.transitionrun, 0.0);
|
assert_equals(handler.transitionrun, 0.0);
|
||||||
assert_equals(handler.transitionstart, 0.0);
|
assert_equals(handler.transitionstart, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Idle or Pending -> Active');
|
}, 'Idle or Pending -> Active');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher, div] =
|
var [transition, watcher, div] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
var handler = new TransitionEventHandler(div);
|
var handler = new TransitionEventHandler(div);
|
||||||
|
@ -94,104 +94,104 @@ promise_test(function(t) {
|
||||||
transition.finish();
|
transition.finish();
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart',
|
'transitionstart',
|
||||||
'transitionend' ]).then(function(evt) {
|
'transitionend' ]).then(evt => {
|
||||||
assert_equals(handler.transitionrun, 0.0);
|
assert_equals(handler.transitionrun, 0.0);
|
||||||
assert_equals(handler.transitionstart, 0.0);
|
assert_equals(handler.transitionstart, 0.0);
|
||||||
assert_equals(handler.transitionend, 100.0);
|
assert_equals(handler.transitionend, 100.0);
|
||||||
});
|
});
|
||||||
}, 'Idle or Pending -> After');
|
}, 'Idle or Pending -> After');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher, div] =
|
var [transition, watcher, div] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
|
|
||||||
return Promise.all([ watcher.wait_for('transitionrun'),
|
return Promise.all([ watcher.wait_for('transitionrun'),
|
||||||
transition.ready ]).then(function() {
|
transition.ready ]).then(() => {
|
||||||
// Make idle
|
// Make idle
|
||||||
div.style.display = 'none';
|
div.style.display = 'none';
|
||||||
flushComputedStyle(div);
|
flushComputedStyle(div);
|
||||||
return watcher.wait_for('transitioncancel');
|
return watcher.wait_for('transitioncancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0.0);
|
assert_equals(evt.elapsedTime, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Before -> Idle (display: none)');
|
}, 'Before -> Idle (display: none)');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher] =
|
var [transition, watcher] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
|
|
||||||
return Promise.all([ watcher.wait_for('transitionrun'),
|
return Promise.all([ watcher.wait_for('transitionrun'),
|
||||||
transition.ready ]).then(function() {
|
transition.ready ]).then(() => {
|
||||||
// Make idle
|
// Make idle
|
||||||
transition.timeline = null;
|
transition.timeline = null;
|
||||||
return watcher.wait_for('transitioncancel');
|
return watcher.wait_for('transitioncancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0.0);
|
assert_equals(evt.elapsedTime, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Before -> Idle (Animation.timeline = null)');
|
}, 'Before -> Idle (Animation.timeline = null)');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher] =
|
var [transition, watcher] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
|
|
||||||
return Promise.all([ watcher.wait_for('transitionrun'),
|
return Promise.all([ watcher.wait_for('transitionrun'),
|
||||||
transition.ready ]).then(function() {
|
transition.ready ]).then(() => {
|
||||||
transition.currentTime = 100 * MS_PER_SEC;
|
transition.currentTime = 100 * MS_PER_SEC;
|
||||||
return watcher.wait_for('transitionstart');
|
return watcher.wait_for('transitionstart');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0.0);
|
assert_equals(evt.elapsedTime, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Before -> Active');
|
}, 'Before -> Active');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher, div] =
|
var [transition, watcher, div] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
var handler = new TransitionEventHandler(div);
|
var handler = new TransitionEventHandler(div);
|
||||||
|
|
||||||
return Promise.all([ watcher.wait_for('transitionrun'),
|
return Promise.all([ watcher.wait_for('transitionrun'),
|
||||||
transition.ready ]).then(function() {
|
transition.ready ]).then(() => {
|
||||||
// Seek to After phase.
|
// Seek to After phase.
|
||||||
transition.currentTime = 200 * MS_PER_SEC;
|
transition.currentTime = 200 * MS_PER_SEC;
|
||||||
return watcher.wait_for([ 'transitionstart', 'transitionend' ]);
|
return watcher.wait_for([ 'transitionstart', 'transitionend' ]);
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(handler.transitionstart, 0.0);
|
assert_equals(handler.transitionstart, 0.0);
|
||||||
assert_equals(handler.transitionend, 100.0);
|
assert_equals(handler.transitionend, 100.0);
|
||||||
});
|
});
|
||||||
}, 'Before -> After');
|
}, 'Before -> After');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher, div] =
|
var [transition, watcher, div] =
|
||||||
setupTransition(t, 'margin-left 100s');
|
setupTransition(t, 'margin-left 100s');
|
||||||
|
|
||||||
// Seek to Active start position.
|
// Seek to Active start position.
|
||||||
transition.pause();
|
transition.pause();
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart' ]).then(function(evt) {
|
'transitionstart' ]).then(evt => {
|
||||||
// Make idle
|
// Make idle
|
||||||
div.style.display = 'none';
|
div.style.display = 'none';
|
||||||
flushComputedStyle(div);
|
flushComputedStyle(div);
|
||||||
return watcher.wait_for('transitioncancel');
|
return watcher.wait_for('transitioncancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0.0);
|
assert_equals(evt.elapsedTime, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Active -> Idle, no delay (display: none)');
|
}, 'Active -> Idle, no delay (display: none)');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher] =
|
var [transition, watcher] =
|
||||||
setupTransition(t, 'margin-left 100s');
|
setupTransition(t, 'margin-left 100s');
|
||||||
|
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart' ]).then(function(evt) {
|
'transitionstart' ]).then(evt => {
|
||||||
// Make idle
|
// Make idle
|
||||||
transition.currentTime = 0;
|
transition.currentTime = 0;
|
||||||
transition.timeline = null;
|
transition.timeline = null;
|
||||||
return watcher.wait_for('transitioncancel');
|
return watcher.wait_for('transitioncancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0.0);
|
assert_equals(evt.elapsedTime, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Active -> Idle, no delay (Animation.timeline = null)');
|
}, 'Active -> Idle, no delay (Animation.timeline = null)');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher, div] =
|
var [transition, watcher, div] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
// Pause so the currentTime is fixed and we can accurately compare the event
|
// Pause so the currentTime is fixed and we can accurately compare the event
|
||||||
|
@ -201,34 +201,34 @@ promise_test(function(t) {
|
||||||
// Seek to Active phase.
|
// Seek to Active phase.
|
||||||
transition.currentTime = 100 * MS_PER_SEC;
|
transition.currentTime = 100 * MS_PER_SEC;
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart' ]).then(function(evt) {
|
'transitionstart' ]).then(evt => {
|
||||||
// Make idle
|
// Make idle
|
||||||
div.style.display = 'none';
|
div.style.display = 'none';
|
||||||
flushComputedStyle(div);
|
flushComputedStyle(div);
|
||||||
return watcher.wait_for('transitioncancel');
|
return watcher.wait_for('transitioncancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0.0);
|
assert_equals(evt.elapsedTime, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Active -> Idle, with positive delay (display: none)');
|
}, 'Active -> Idle, with positive delay (display: none)');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher] =
|
var [transition, watcher] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
|
|
||||||
// Seek to Active phase.
|
// Seek to Active phase.
|
||||||
transition.currentTime = 100 * MS_PER_SEC;
|
transition.currentTime = 100 * MS_PER_SEC;
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart' ]).then(function(evt) {
|
'transitionstart' ]).then(evt => {
|
||||||
// Make idle
|
// Make idle
|
||||||
transition.currentTime = 100 * MS_PER_SEC;
|
transition.currentTime = 100 * MS_PER_SEC;
|
||||||
transition.timeline = null;
|
transition.timeline = null;
|
||||||
return watcher.wait_for('transitioncancel');
|
return watcher.wait_for('transitioncancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0.0);
|
assert_equals(evt.elapsedTime, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Active -> Idle, with positive delay (Animation.timeline = null)');
|
}, 'Active -> Idle, with positive delay (Animation.timeline = null)');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher, div] =
|
var [transition, watcher, div] =
|
||||||
setupTransition(t, 'margin-left 100s -50s');
|
setupTransition(t, 'margin-left 100s -50s');
|
||||||
|
|
||||||
|
@ -237,62 +237,62 @@ promise_test(function(t) {
|
||||||
transition.pause();
|
transition.pause();
|
||||||
|
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart' ]).then(function(evt) {
|
'transitionstart' ]).then(evt => {
|
||||||
// Make idle
|
// Make idle
|
||||||
div.style.display = 'none';
|
div.style.display = 'none';
|
||||||
flushComputedStyle(div);
|
flushComputedStyle(div);
|
||||||
return watcher.wait_for('transitioncancel');
|
return watcher.wait_for('transitioncancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 50.0);
|
assert_equals(evt.elapsedTime, 50.0);
|
||||||
});
|
});
|
||||||
}, 'Active -> Idle, with negative delay (display: none)');
|
}, 'Active -> Idle, with negative delay (display: none)');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher] =
|
var [transition, watcher] =
|
||||||
setupTransition(t, 'margin-left 100s -50s');
|
setupTransition(t, 'margin-left 100s -50s');
|
||||||
|
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart' ]).then(function(evt) {
|
'transitionstart' ]).then(evt => {
|
||||||
// Make idle
|
// Make idle
|
||||||
transition.currentTime = 50 * MS_PER_SEC;
|
transition.currentTime = 50 * MS_PER_SEC;
|
||||||
transition.timeline = null;
|
transition.timeline = null;
|
||||||
return watcher.wait_for('transitioncancel');
|
return watcher.wait_for('transitioncancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0.0);
|
assert_equals(evt.elapsedTime, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Active -> Idle, with negative delay (Animation.timeline = null)');
|
}, 'Active -> Idle, with negative delay (Animation.timeline = null)');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher] =
|
var [transition, watcher] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
// Seek to Active phase.
|
// Seek to Active phase.
|
||||||
transition.currentTime = 100 * MS_PER_SEC;
|
transition.currentTime = 100 * MS_PER_SEC;
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart' ]).then(function(evt) {
|
'transitionstart' ]).then(evt => {
|
||||||
// Seek to Before phase.
|
// Seek to Before phase.
|
||||||
transition.currentTime = 0;
|
transition.currentTime = 0;
|
||||||
return watcher.wait_for('transitionend');
|
return watcher.wait_for('transitionend');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 0.0);
|
assert_equals(evt.elapsedTime, 0.0);
|
||||||
});
|
});
|
||||||
}, 'Active -> Before');
|
}, 'Active -> Before');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher] =
|
var [transition, watcher] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
// Seek to Active phase.
|
// Seek to Active phase.
|
||||||
transition.currentTime = 100 * MS_PER_SEC;
|
transition.currentTime = 100 * MS_PER_SEC;
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart' ]).then(function(evt) {
|
'transitionstart' ]).then(evt => {
|
||||||
// Seek to After phase.
|
// Seek to After phase.
|
||||||
transition.currentTime = 200 * MS_PER_SEC;
|
transition.currentTime = 200 * MS_PER_SEC;
|
||||||
return watcher.wait_for('transitionend');
|
return watcher.wait_for('transitionend');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 100.0);
|
assert_equals(evt.elapsedTime, 100.0);
|
||||||
});
|
});
|
||||||
}, 'Active -> After');
|
}, 'Active -> After');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher, div] =
|
var [transition, watcher, div] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
var handler = new TransitionEventHandler(div);
|
var handler = new TransitionEventHandler(div);
|
||||||
|
@ -301,54 +301,54 @@ promise_test(function(t) {
|
||||||
transition.finish();
|
transition.finish();
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart',
|
'transitionstart',
|
||||||
'transitionend' ]).then(function(evt) {
|
'transitionend' ]).then(evt => {
|
||||||
// Seek to Before phase.
|
// Seek to Before phase.
|
||||||
transition.currentTime = 0;
|
transition.currentTime = 0;
|
||||||
return watcher.wait_for([ 'transitionstart', 'transitionend' ]);
|
return watcher.wait_for([ 'transitionstart', 'transitionend' ]);
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(handler.transitionstart, 100.0);
|
assert_equals(handler.transitionstart, 100.0);
|
||||||
assert_equals(handler.transitionend, 0.0);
|
assert_equals(handler.transitionend, 0.0);
|
||||||
});
|
});
|
||||||
}, 'After -> Before');
|
}, 'After -> Before');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher] =
|
var [transition, watcher] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
// Seek to After phase.
|
// Seek to After phase.
|
||||||
transition.finish();
|
transition.finish();
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart',
|
'transitionstart',
|
||||||
'transitionend' ]).then(function(evt) {
|
'transitionend' ]).then(evt => {
|
||||||
// Seek to Active phase.
|
// Seek to Active phase.
|
||||||
transition.currentTime = 100 * MS_PER_SEC;
|
transition.currentTime = 100 * MS_PER_SEC;
|
||||||
return watcher.wait_for('transitionstart');
|
return watcher.wait_for('transitionstart');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 100.0);
|
assert_equals(evt.elapsedTime, 100.0);
|
||||||
});
|
});
|
||||||
}, 'After -> Active');
|
}, 'After -> Active');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher, div] =
|
var [transition, watcher, div] =
|
||||||
setupTransition(t, 'margin-left 100s -50s');
|
setupTransition(t, 'margin-left 100s -50s');
|
||||||
var handler = new TransitionEventHandler(div);
|
var handler = new TransitionEventHandler(div);
|
||||||
|
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart' ]).then(function() {
|
'transitionstart' ]).then(() => {
|
||||||
assert_equals(handler.transitionrun, 50.0);
|
assert_equals(handler.transitionrun, 50.0);
|
||||||
assert_equals(handler.transitionstart, 50.0);
|
assert_equals(handler.transitionstart, 50.0);
|
||||||
transition.finish();
|
transition.finish();
|
||||||
return watcher.wait_for('transitionend');
|
return watcher.wait_for('transitionend');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 100.0);
|
assert_equals(evt.elapsedTime, 100.0);
|
||||||
});
|
});
|
||||||
}, 'Calculating the interval start and end time with negative start delay.');
|
}, 'Calculating the interval start and end time with negative start delay.');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher, div] =
|
var [transition, watcher, div] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
var handler = new TransitionEventHandler(div);
|
var handler = new TransitionEventHandler(div);
|
||||||
|
|
||||||
return watcher.wait_for('transitionrun').then(function(evt) {
|
return watcher.wait_for('transitionrun').then(evt => {
|
||||||
// We can't set the end delay via generated effect timing.
|
// We can't set the end delay via generated effect timing.
|
||||||
// Because CSS-Transition use the AnimationEffectTimingReadOnly.
|
// Because CSS-Transition use the AnimationEffectTimingReadOnly.
|
||||||
transition.effect = new KeyframeEffect(div,
|
transition.effect = new KeyframeEffect(div,
|
||||||
|
@ -361,38 +361,38 @@ promise_test(function(t) {
|
||||||
return watcher.wait_for([ 'transitioncancel',
|
return watcher.wait_for([ 'transitioncancel',
|
||||||
'transitionrun',
|
'transitionrun',
|
||||||
'transitionstart' ]);
|
'transitionstart' ]);
|
||||||
}).then(function() {
|
}).then(() => {
|
||||||
assert_equals(handler.transitionstart, 0.0);
|
assert_equals(handler.transitionstart, 0.0);
|
||||||
|
|
||||||
// Seek to After phase.
|
// Seek to After phase.
|
||||||
transition.finish();
|
transition.finish();
|
||||||
return watcher.wait_for('transitionend');
|
return watcher.wait_for('transitionend');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
assert_equals(evt.elapsedTime, 50.0);
|
assert_equals(evt.elapsedTime, 50.0);
|
||||||
});
|
});
|
||||||
}, 'Calculating the interval start and end time with negative end delay.');
|
}, 'Calculating the interval start and end time with negative end delay.');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher, div] =
|
var [transition, watcher, div] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
|
|
||||||
return watcher.wait_for('transitionrun').then(function() {
|
return watcher.wait_for('transitionrun').then(() => {
|
||||||
// Make idle
|
// Make idle
|
||||||
div.style.display = 'none';
|
div.style.display = 'none';
|
||||||
flushComputedStyle(div);
|
flushComputedStyle(div);
|
||||||
return watcher.wait_for('transitioncancel');
|
return watcher.wait_for('transitioncancel');
|
||||||
}).then(function() {
|
}).then(() => {
|
||||||
transition.cancel();
|
transition.cancel();
|
||||||
// Then wait a couple of frames and check that no event was dispatched
|
// Then wait a couple of frames and check that no event was dispatched
|
||||||
return waitForAnimationFrames(2);
|
return waitForAnimationFrames(2);
|
||||||
});
|
});
|
||||||
}, 'Call Animation.cancel after cancelling transition.');
|
}, 'Call Animation.cancel after cancelling transition.');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher, div] =
|
var [transition, watcher, div] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
|
|
||||||
return watcher.wait_for('transitionrun').then(function(evt) {
|
return watcher.wait_for('transitionrun').then(evt => {
|
||||||
// Make idle
|
// Make idle
|
||||||
div.style.display = 'none';
|
div.style.display = 'none';
|
||||||
flushComputedStyle(div);
|
flushComputedStyle(div);
|
||||||
|
@ -403,33 +403,33 @@ promise_test(function(t) {
|
||||||
});
|
});
|
||||||
}, 'Restart transition after cancelling transition immediately');
|
}, 'Restart transition after cancelling transition immediately');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher, div] =
|
var [transition, watcher, div] =
|
||||||
setupTransition(t, 'margin-left 100s 100s');
|
setupTransition(t, 'margin-left 100s 100s');
|
||||||
|
|
||||||
return watcher.wait_for('transitionrun').then(function(evt) {
|
return watcher.wait_for('transitionrun').then(evt => {
|
||||||
// Make idle
|
// Make idle
|
||||||
div.style.display = 'none';
|
div.style.display = 'none';
|
||||||
flushComputedStyle(div);
|
flushComputedStyle(div);
|
||||||
transition.play();
|
transition.play();
|
||||||
transition.cancel();
|
transition.cancel();
|
||||||
return watcher.wait_for('transitioncancel');
|
return watcher.wait_for('transitioncancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
// Then wait a couple of frames and check that no event was dispatched
|
// Then wait a couple of frames and check that no event was dispatched
|
||||||
return waitForAnimationFrames(2);
|
return waitForAnimationFrames(2);
|
||||||
});
|
});
|
||||||
}, 'Call Animation.cancel after restarting transition immediately');
|
}, 'Call Animation.cancel after restarting transition immediately');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher] =
|
var [transition, watcher] =
|
||||||
setupTransition(t, 'margin-left 100s');
|
setupTransition(t, 'margin-left 100s');
|
||||||
|
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart' ]).then(function(evt) {
|
'transitionstart' ]).then(evt => {
|
||||||
// Make idle
|
// Make idle
|
||||||
transition.timeline = null;
|
transition.timeline = null;
|
||||||
return watcher.wait_for('transitioncancel');
|
return watcher.wait_for('transitioncancel');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
transition.timeline = document.timeline;
|
transition.timeline = document.timeline;
|
||||||
transition.play();
|
transition.play();
|
||||||
|
|
||||||
|
@ -437,15 +437,15 @@ promise_test(function(t) {
|
||||||
});
|
});
|
||||||
}, 'Set timeline and play transition after clear the timeline');
|
}, 'Set timeline and play transition after clear the timeline');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher, div] =
|
var [transition, watcher, div] =
|
||||||
setupTransition(t, 'margin-left 100s');
|
setupTransition(t, 'margin-left 100s');
|
||||||
|
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart' ]).then(function() {
|
'transitionstart' ]).then(() => {
|
||||||
transition.cancel();
|
transition.cancel();
|
||||||
return watcher.wait_for('transitioncancel');
|
return watcher.wait_for('transitioncancel');
|
||||||
}).then(function() {
|
}).then(() => {
|
||||||
// Make After phase
|
// Make After phase
|
||||||
transition.effect = null;
|
transition.effect = null;
|
||||||
|
|
||||||
|
@ -454,15 +454,15 @@ promise_test(function(t) {
|
||||||
});
|
});
|
||||||
}, 'Set null target effect after cancel the transition');
|
}, 'Set null target effect after cancel the transition');
|
||||||
|
|
||||||
promise_test(function(t) {
|
promise_test(t => {
|
||||||
var [transition, watcher, div] =
|
var [transition, watcher, div] =
|
||||||
setupTransition(t, 'margin-left 100s');
|
setupTransition(t, 'margin-left 100s');
|
||||||
|
|
||||||
return watcher.wait_for([ 'transitionrun',
|
return watcher.wait_for([ 'transitionrun',
|
||||||
'transitionstart' ]).then(function(evt) {
|
'transitionstart' ]).then(evt => {
|
||||||
transition.effect = null;
|
transition.effect = null;
|
||||||
return watcher.wait_for('transitionend');
|
return watcher.wait_for('transitionend');
|
||||||
}).then(function(evt) {
|
}).then(evt => {
|
||||||
transition.cancel();
|
transition.cancel();
|
||||||
|
|
||||||
// Then wait a couple of frames and check that no event was dispatched
|
// Then wait a couple of frames and check that no event was dispatched
|
||||||
|
|
Загрузка…
Ссылка в новой задаче