diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/css/css-view-transitions/old-content-has-scrollbars.html | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-view-transitions/old-content-has-scrollbars.html')
-rw-r--r-- | testing/web-platform/tests/css/css-view-transitions/old-content-has-scrollbars.html | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-view-transitions/old-content-has-scrollbars.html b/testing/web-platform/tests/css/css-view-transitions/old-content-has-scrollbars.html new file mode 100644 index 0000000000..f87a4498c1 --- /dev/null +++ b/testing/web-platform/tests/css/css-view-transitions/old-content-has-scrollbars.html @@ -0,0 +1,60 @@ +<!DOCTYPE html> +<meta name="timeout" content="long"> +<html class=reftest-wait> +<title>Shared transitions: outgoing viewport has scrollbars</title> +<link rel="help" href="https://github.com/WICG/view-transitions"> +<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/7859"> +<link rel="author" href="mailto:bokan@chromium.org"> +<link rel="match" href="old-content-has-scrollbars-ref.html"> +<meta name=fuzzy content="old-content-has-scrollbars-ref.html:0-40;0-30000"> +<script src="/common/reftest-wait.js"></script> +<style> + html, body { + width: 100%; + height: 100%; + background-color: lightpink; + } + body { + /* Margin to make sure background color is correctly drawn into the snapshot. */ + margin: 50px; + } + div { + /* Draw a checkerboard pattern to make sure the snapshot is captured at the + * full size, rather than scaled. */ + background-image: + linear-gradient(45deg, #000 25%, transparent 25%), + linear-gradient(45deg, transparent 75%, #000 75%), + linear-gradient(45deg, transparent 75%, #000 75%), + linear-gradient(45deg, #000 25%, lightgreen 25%); + background-size: 200px 200px; + background-position: 0 0, 0 0, -100px -100px, 100px 100px; + width: 200%; + height: 200%; + } + + /* We're verifying what we capture, so just display the old contents for 5 minutes. */ + html::view-transition-new(root) { animation: unset; opacity: 0; } + html::view-transition-old(root) { + animation-duration: 300s; + animation-timing-function: steps(1, end); + opacity: 1; + } +</style> + +<div></div> +<script> +failIfNot(document.startViewTransition, "Missing document.startViewTransition"); + +// Ensure a root snapshot captured on a page with scrollbars uses the full +// viewport size (including scrollbars). Areas obscured by scrollbars should be +// filled with background and content; the snapshot should not be scaled-to-fit. +async function runTest() { + document.startViewTransition(() => { + document.querySelector('div').remove(); + document.documentElement.style.overflow = "hidden"; + requestAnimationFrame(() => requestAnimationFrame(takeScreenshot)); + }); +} +onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest)); +</script> + |