summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-view-transitions/fractional-translation-from-position.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 /testing/web-platform/tests/css/css-view-transitions/fractional-translation-from-position.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 'testing/web-platform/tests/css/css-view-transitions/fractional-translation-from-position.html')
-rw-r--r--testing/web-platform/tests/css/css-view-transitions/fractional-translation-from-position.html55
1 files changed, 55 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-view-transitions/fractional-translation-from-position.html b/testing/web-platform/tests/css/css-view-transitions/fractional-translation-from-position.html
new file mode 100644
index 0000000000..a09b08cf00
--- /dev/null
+++ b/testing/web-platform/tests/css/css-view-transitions/fractional-translation-from-position.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html class=reftest-wait>
+<title>View transitions: fractional translation from position</title>
+<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/">
+<link rel="author" href="mailto:khushalsagar@chromium.org">
+<link rel="match" href="fractional-translation-from-position-ref.html">
+<script src="/common/reftest-wait.js"></script>
+<style>
+body {
+ width: 100vw;
+ height: 100vh;
+ background: grey;
+}
+
+#target {
+ width: 100px;
+ height: 100px;
+ position: fixed;
+ top: 100.52px;
+ left: 100.37px;
+
+ view-transition-name: target;
+ contain: layout;
+}
+
+/* Keep the animation running for 30s to screenshot pseudo DOM */
+::view-transition-new(root), ::view-transition-old(root) {
+ animation-duration: 30s;
+}
+
+::view-transition-new(target) {
+ opacity: 1;
+ animation: unset;
+}
+::view-transition-old(target) {
+ opacity: 0;
+ animation: unset;
+}
+</style>
+
+<div id=target>
+ Here is some text which should not be blurry.
+</div>
+
+<script>
+failIfNot(document.startViewTransition, "Missing document.startViewTransition");
+
+function runTest() {
+ document.startViewTransition(() => {
+ requestAnimationFrame(() => requestAnimationFrame(takeScreenshot));
+ });
+}
+
+onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
+</script>