Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /scroll-animations/css/scroll-timeline-on-pseudo-002.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Tests that scroll timeline defined by a pseudo-element can be found</title>
<link rel="match" href="../../css/reference/ref-filled-green-100px-square.xht">
<link rel="author" name="David Shin" href="mailto:dshin@mozilla.com">
<style>
.container {
timeline-scope: --foo;
}
.red {
width: 100px;
height: 100px;
background: red;
}
@keyframes anim {
from { width: 100px; }
to { width: 200px; }
}
#target {
width: 0px;
height: 100px;
background: green;
animation: anim auto linear;
animation-timeline: --foo;
}
.st {
opacity: 0;
width: fit-content;
border: 1px solid;
}
.st::after {
display: block;
width: 100px;
height: 100px;
overflow: hidden;
content: "a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a";
scroll-timeline: --foo;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div class=container>
<div class=red>
<div id=target></div>
</div>
<div class=st><div class=content></div></div>
</div>