1
0
Fork 0
firefox/testing/web-platform/tests/scroll-animations/animation-trigger/animation-trigger-getanimations.tentative.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

68 lines
1.8 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<link rel="help" href="https://drafts.csswg.org/web-animations-2#animation-trigger">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<style>
.scroller {
overflow-y: scroll;
border: solid 1px;
place-self: center;
height: 300px;
width: 200px;
}
@keyframes slide-in {
from {
transform: translateX(-50px);
}
}
.target {
height: 100px;
width: 100%;
background-color: blue;
animation: slide-in 3s;
animation-trigger: view() alternate contain 0% contain 100%;
}
.target {
height: 100px;
width: 100%;
background-color: blue;
}
.space {
height: 250px;
width: 50%;
}
.active {
animation-fill-mode: both;
}
.idle {
animation-fill-mode: none;
}
</style>
<div id="scroller" class="scroller">
<div class="space"></div>
<div id="subject"></div>
<div class="space"></div>
<div id="active_target" class="active target"></div>
<div id="idle_target" class="idle target"></div>
</div>
<script>
promise_test(async () => {
assert_equals(idle_target.getAnimations().length, 1,
"idle target has an animation");
}, "getAnimations includes an untriggered " +
"'fill-mode: none' animation.");
promise_test(async () => {
assert_equals(active_target.getAnimations().length, 1,
"active target has an animation");
}, "getAnimations does include an untriggered " +
"'fill-mode: both' animation.");
</script>
</body>
</html>