Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!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="opacity-with-delayed-important-ref.html">
<title>Opacity animation with delayed important</title>
</head>
<script src="/common/reftest-wait.js"></script>
<style>
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
#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 2000s -1000s cubic-bezier(0, 1, 1, 0);
}
.updated {
opacity: 1 !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>