diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/css-view-transitions/fractional-translation-from-transform.html | |
parent | Initial commit. (diff) | |
download | firefox-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/css/css-view-transitions/fractional-translation-from-transform.html')
-rw-r--r-- | testing/web-platform/tests/css/css-view-transitions/fractional-translation-from-transform.html | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-view-transitions/fractional-translation-from-transform.html b/testing/web-platform/tests/css/css-view-transitions/fractional-translation-from-transform.html new file mode 100644 index 0000000000..7027a90086 --- /dev/null +++ b/testing/web-platform/tests/css/css-view-transitions/fractional-translation-from-transform.html @@ -0,0 +1,57 @@ +<!DOCTYPE html> +<html class=reftest-wait> +<title>View transitions: fractional translation from CSS transform</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-transform-ref.html"> +<meta name="fuzzy" content="maxDifference=0-2; totalPixels=0-100"> +<script src="/common/reftest-wait.js"></script> +<style> +body { + width: 100vw; + height: 100vh; + background: grey; +} + +#target { + width: 100px; + height: 100px; + position: fixed; + top: 0px; + left: 0px; + transform: translate(100.52px, 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> |