summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/scroll-animations/css/animation-inactive-outside-range-test.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/scroll-animations/css/animation-inactive-outside-range-test.html
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/scroll-animations/css/animation-inactive-outside-range-test.html')
-rw-r--r--testing/web-platform/tests/scroll-animations/css/animation-inactive-outside-range-test.html124
1 files changed, 124 insertions, 0 deletions
diff --git a/testing/web-platform/tests/scroll-animations/css/animation-inactive-outside-range-test.html b/testing/web-platform/tests/scroll-animations/css/animation-inactive-outside-range-test.html
new file mode 100644
index 0000000000..8034e451be
--- /dev/null
+++ b/testing/web-platform/tests/scroll-animations/css/animation-inactive-outside-range-test.html
@@ -0,0 +1,124 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<link rel="help" src="https://drafts.csswg.org/scroll-animations-1/">
+<link rel="match" href="animation-inactive-outside-range-ref.html">
+<script src="/common/reftest-wait.js"></script>
+<script src="/web-animations/testcommon.js"></script>
+<style>
+ .scroller {
+ height: 200px;
+ width: 500px;
+ overflow: auto;
+ position: absolute;
+ top: 100px;
+ }
+
+ .anim {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: darkred;
+ view-timeline: --view;
+ }
+ .anim.contain {
+ background: green;
+ }
+ .spacer {
+ height: 1000px;
+ }
+
+ .before {
+ top: 450px;
+ }
+ .after {
+ top: 50px;
+ }
+ .contain {
+ top: 250px;
+ }
+ @keyframes active-opacity {
+ 0% { opacity: 1; }
+ 100% { opacity: 1; }
+ }
+ .indicator {
+ position: fixed;
+ top: 50px;
+ }
+ .contain .indicator {
+ top: 100px;
+ }
+ .contain .indicator:nth-child(2) {
+ left: 200px;
+ }
+
+ .after .indicator {
+ left: 200px;
+ }
+
+ .indicator > div {
+ display: inline-block;
+ width: 25px;
+ height: 25px;
+ position: relative;
+ border-radius: 100%;
+ box-sizing: border-box;
+ border: 2px solid black;
+ padding: 3px;
+ background: lightgray;
+ background-clip: content-box;
+ }
+
+ .indicator > div > div {
+ width: 100%;
+ height: 100%;
+ border-radius: 100%;
+ background: green;
+ opacity: 0;
+ animation: active-opacity;
+ animation-timeline: --view;
+ }
+
+ .contain .indicator > div > div {
+ animation-range: entry;
+ }
+
+ .contain .indicator:nth-child(2) > div > div {
+ animation-range: exit;
+ }
+
+</style>
+</head>
+<body onload="run()">
+ <p>None of the activity indicators should be active all of the animations are outside of their active range.</p>
+ <div class="scroller">
+ <div class="anim after"><div class="indicator">After cover phase: <div><div></div></div></div></div>
+ <div class="anim before"><div class="indicator">Before cover phase: <div><div></div></div></div></div>
+ <div class="anim contain">
+ <div class="indicator entry">After entry phase: <div><div></div></div></div>
+ <div class="indicator exit">Before exit phase: <div><div></div></div></div>
+ </div>
+ <div class="spacer"></div>
+ </div>
+</body>
+<script>
+ async function run() {
+ await waitForCompositorReady();
+ await waitForNextFrame();
+
+ let scroller = document.querySelector('.scroller');
+ // Scroll such that each animation becomes active.
+ scroller.scrollTo({top: 0});
+ await waitForNextFrame();
+ scroller.scrollTo({top: 400});
+ await waitForNextFrame();
+
+ // Then scroll between them so that we are before one and after the other.
+ scroller.scrollTo({top: 200});
+ await waitForNextFrame();
+ takeScreenshot();
+ }
+</script>
+</html>