tenfourfox/dom/animation/test/css-animations/file_animation-oncancel.html
Cameron Kaiser c9b2922b70 hello FPR
2017-04-19 00:56:45 -07:00

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>