Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /web-animations/responsive/multiple-properties-delayed-important.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="help" href="https://crbug.com/476652058">
<link rel="match" href="multiple-properties-delayed-important-ref.html">
<!-- Accommodate pixel rounding -->
<meta name="fuzzy" content="maxDifference=0-1;totalPixels=0-10000">
<title>Multiple properties in animation with delayed important</title>
</head>
<script src="/common/reftest-wait.js"></script>
<style>
@keyframes fade-in-and-shift {
from {
opacity: 0;
transform: translateX(100px);
}
to {
opacity: 1;
transform: translateX(200px);
}
}
#target {
width: 100px;
height: 100px;
background-color: rebeccapurple;
/* Freeze running animation at midpoint. Avoiding the use of a step timing
function due to potential to optimize handling of discrete updates. */
animation: fade-in-and-shift 2000s -1000s cubic-bezier(0, 1, 1, 0);
}
.updated {
transform: none !important;
}
</style>
<body>
<div id="target"></div>
</body>
<script>
function raf() {
return new Promise (resolve => {
requestAnimationFrame(resolve);
});
}
window.onload = async () => {
await raf();
const anim = document.getAnimations()[0];
await anim.ready;
await raf();
target.classList.add('updated');
raf().then(takeScreenshot);
};
</script>
</html>