blob: 63a76ba84a62736bb7edb05d9cfa79d6dc73c1cf [file] [log] [blame]
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="UTF-8">
<title>Update playback rate zero</title>
<link rel="match" href="update-playback-rate-fast-ref.html">
<script src="/common/reftest-wait.js"></script>
<style>
#box-1, #box-2 {
border: 1px solid white;
height: 40px;
left: 40px;
position: absolute;
top: 40px;
width: 40px;
}
#box-1 {
background: blue;
z-index: 1;
}
#box-2 {
background: white;
transform: translateX(0px);
z-index: 2;
}
#notes {
position: absolute;
left: 0px;
top: 100px;
}
body {
background: white;
}
</style>
<body>
<div id="box-1"></div>
<div id="box-2"></div>
<p id="notes">
This test creates a running animation and changes its playback rate
part way through. The animation finishes ahead of the screenshot.
If any blue pixels appear in the screenshot, the test fails.
</p>
</body>
<script>
onload = function() {
const elem = document.getElementById('box-1');
const anim = elem.animate([
{ transform: 'translateX(100px)' },
{ transform: 'translateX(100px)' },
{ transform: 'translateX(200px)' },
{ transform: 'translateX(200px)' }
], {
duration: 1000
});
anim.ready.then(() => {
anim.updatePlaybackRate(2);
takeScreenshotDelayed(750);
});
};
</script>