summaryrefslogtreecommitdiffstats
path: root/layout/reftests/css-animations/scroll-timeline-in-delay-omta.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /layout/reftests/css-animations/scroll-timeline-in-delay-omta.html
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/css-animations/scroll-timeline-in-delay-omta.html')
-rw-r--r--layout/reftests/css-animations/scroll-timeline-in-delay-omta.html71
1 files changed, 71 insertions, 0 deletions
diff --git a/layout/reftests/css-animations/scroll-timeline-in-delay-omta.html b/layout/reftests/css-animations/scroll-timeline-in-delay-omta.html
new file mode 100644
index 0000000000..4dea5b7854
--- /dev/null
+++ b/layout/reftests/css-animations/scroll-timeline-in-delay-omta.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<html class="reftest-wait reftest-no-flush">
+<head>
+<title>Scroll the scroll-driven animation from the active phase to delay</title>
+<style>
+ @keyframes anim {
+ from { translate: 100px; }
+ to { translate: 200px; }
+ }
+ #scroller {
+ width: 100px;
+ height: 100px;
+ overflow: scroll;
+ scrollbar-width: none;
+ scroll-timeline: scroll_timeline;
+ }
+ #target {
+ width: 100px;
+ height: 100px;
+ background: green;
+ rotate: 45deg;
+ translate: 50px;
+ animation-name: anim;
+ animation-duration: 5s;
+ animation-timing-function: linear;
+ animation-delay: 5s;
+ animation-timeline: scroll_timeline;
+ }
+</style>
+<script>
+window.addEventListener("MozReftestInvalidate", async () => {
+ const scroller = document.getElementById("scroller");
+ scroller.scrollTop = 75;
+
+ // Wait for the MozAfterPaint to make the view id of |scroller| gets ready.
+ window.addEventListener('MozAfterPaint', async () => {
+ let utils = SpecialPowers.wrap(window).windowUtils;
+ utils.setAsyncScrollOffset(scroller, 0, -50);
+
+ await new Promise(function(resolve, reject) {
+ let repaintDone = function() {
+ SpecialPowers.Services.obs.removeObserver(
+ repaintDone,
+ "apz-repaints-flushed"
+ );
+ resolve();
+ };
+ SpecialPowers.Services.obs.addObserver(repaintDone,
+ "apz-repaints-flushed");
+ if (!utils.flushApzRepaints()) {
+ repaintDone();
+ }
+ });
+
+ // Wait for composition and then take the snapshot.
+ await new Promise(resolve => { requestAnimationFrame(resolve); });
+ await new Promise(resolve => { requestAnimationFrame(resolve); });
+
+ document.documentElement.classList.remove('reftest-wait');
+ }, {once: true});
+});
+
+</script>
+</head>
+<body>
+ <div id="scroller">
+ <div style="height: 100px; padding-bottom: 100px;"></div>
+ </div>
+ <div id="target"></div>
+</body>
+</html>