blob: 5e055cf25a902d2b6fa6def7fc9292519f1ea0f5 [file] [edit]
<!doctype html>
<html class="reftest-wait">
<head>
<meta charset="utf-8">
<title>CSS Animations Test: Appending a stylesheet link to head with animation-fill-mode: both</title>
<link rel="help" href="https://drafts.csswg.org/css-animations-1/#animation-fill-mode">
<link rel="help" href="https://github.com/servo/servo/issues/47958">
<link rel="match" href="animation-append-stylesheet-reverse-ref.html">
<script src="/common/reftest-wait.js"></script>
<style>
body {
margin: 0;
}
.target {
width: 100px;
height: 100px;
background-color: red;
}
.animate {
animation-duration: 0.1s;
animation-fill-mode: both;
animation-name: anim;
}
@keyframes anim {
from {
background-color: red;
}
to {
background-color: green;
}
}
</style>
</head>
<body>
<div id="target" class="target"></div>
<script>
const target = document.getElementById('target');
target.addEventListener('animationend', () => {
takeScreenshot();
});
target.classList.add('animate');
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = 'data:text/css,';
document.head.appendChild(link);
</script>
</body>
</html>