mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-09-09 04:54:33 +00:00
36 lines
875 B
HTML
36 lines
875 B
HTML
<!doctype html>
|
|
<meta charset=utf-8>
|
|
<script src="../testcommon.js"></script>
|
|
<style>
|
|
@keyframes abc {
|
|
to { transform: translate(10px) }
|
|
}
|
|
</style>
|
|
<body>
|
|
<script>
|
|
'use strict';
|
|
|
|
async_test(function(t) {
|
|
var div = addDiv(t, {'style': 'animation: abc 100s'});
|
|
var animation = div.getAnimations()[0];
|
|
|
|
var finishedTimelineTime;
|
|
animation.finished.then().catch(function() {
|
|
finishedTimelineTime = animation.timeline.currentTime;
|
|
});
|
|
|
|
animation.oncancel = t.step_func_done(function(event) {
|
|
assert_equals(event.currentTime, null,
|
|
'event.currentTime should be null');
|
|
assert_equals(event.timelineTime, finishedTimelineTime,
|
|
'event.timelineTime should equal to the animation timeline ' +
|
|
'when finished promise is rejected');
|
|
});
|
|
|
|
animation.cancel();
|
|
}, 'oncancel event is fired when animation.cancel()');
|
|
|
|
done();
|
|
</script>
|
|
</body>
|