summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/scroll-animations/css/animation-update-ref.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /testing/web-platform/tests/scroll-animations/css/animation-update-ref.html
parentInitial commit. (diff)
downloadthunderbird-upstream.tar.xz
thunderbird-upstream.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/scroll-animations/css/animation-update-ref.html')
-rw-r--r--testing/web-platform/tests/scroll-animations/css/animation-update-ref.html55
1 files changed, 55 insertions, 0 deletions
diff --git a/testing/web-platform/tests/scroll-animations/css/animation-update-ref.html b/testing/web-platform/tests/scroll-animations/css/animation-update-ref.html
new file mode 100644
index 0000000000..7e375a1df7
--- /dev/null
+++ b/testing/web-platform/tests/scroll-animations/css/animation-update-ref.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<title>Reference file for various tests that update an animation with a scroll timeline</title>
+<script src="/web-animations/testcommon.js"></script>
+</head>
+<style type="text/css">
+ #scroller {
+ border: 1px solid black;
+ overflow: hidden;
+ width: 300px;
+ height: 200px;
+ }
+ #target {
+ margin-bottom: 800px;
+ margin-top: 800px;
+ margin-left: 10px;
+ margin-right: 10px;
+ width: 100px;
+ height: 100px;
+ z-index: -1;
+ background-color: green;
+ }
+</style>
+<body>
+ <div id="scroller">
+ <div id="target"></div>
+ </div>
+</body>
+<script type="text/javascript">
+ document.documentElement.addEventListener('TestRendered', async () => {
+ runTest();
+ }, { once: true });
+
+ async function runTest() {
+ // Defaults to exit 60% if using a view timeline with subject = target.
+ const DEFAULT_SCROLL_POS = 860;
+ await waitForCompositorReady();
+
+ const urlParams = new URLSearchParams(window.location.search);
+ target.style.transform =
+ `translateX(${urlParams.get('translate') || "0px"}`;
+
+ scroller.scrollTop = urlParams.get('scroll') || DEFAULT_SCROLL_POS;
+ await waitForNextFrame();
+ await waitForNextFrame();
+
+ // Make sure change to animation range was properly picked up.
+ document.documentElement.classList.remove("reftest-wait");
+ }
+</script>
+</body>
+</html>