diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /testing/web-platform/tests/css/css-view-transitions/iframe-and-main-frame-transition-with-name-on-iframe.html | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-view-transitions/iframe-and-main-frame-transition-with-name-on-iframe.html')
-rw-r--r-- | testing/web-platform/tests/css/css-view-transitions/iframe-and-main-frame-transition-with-name-on-iframe.html | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-view-transitions/iframe-and-main-frame-transition-with-name-on-iframe.html b/testing/web-platform/tests/css/css-view-transitions/iframe-and-main-frame-transition-with-name-on-iframe.html new file mode 100644 index 0000000000..f948e89dc7 --- /dev/null +++ b/testing/web-platform/tests/css/css-view-transitions/iframe-and-main-frame-transition-with-name-on-iframe.html @@ -0,0 +1,93 @@ +<!DOCTYPE html> +<html class=reftest-wait> +<title>View transitions: iframe and main frame transition at the same time with name on iframe</title> +<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> +<link rel="author" href="mailto:khushalsagar@chromium.org"> +<link rel="match" href="iframe-and-main-frame-transition-with-name-on-iframe-ref.html"> +<script src="/common/reftest-wait.js"></script> +<style> +iframe { + position: fixed; + top: 0; + left: 0; + width: 50vw; + height: 50vh; + view-transition-name: inner; +} + +.old { + border: 1px solid black; +} + +.new { + border: 1px solid orange; +} + +/* The main frame is showing the old screenshot for the root */ +::view-transition-group(root) { + animation-duration: 300s; +} +::view-transition-new(root) { + animation: unset; + opacity: 0; +} +::view-transition-old(root) { + animation: unset; + opacity: 1; +} + +/* The iframe is showing the live screenshot */ +::view-transition-new(inner) { + animation: unset; + opacity: 1; +} +::view-transition-old(inner) { + animation: unset; + opacity: 0; +} + +</style> + +<iframe id="inner" srcdoc=" +<style> + /* The iframe document itself is showing an old screenshot */ + ::view-transition-group(root) { + animation-duration: 300s; + } + ::view-transition-new(root) { + animation: unset; + opacity: 0; + } + ::view-transition-old(root) { + animation: unset; + opacity: 1; + } +</style> +<body></body>"></iframe> +<script> + onload = runTest; + + async function startTransition(document, oldColor, newColor, nestedFrame) { + document.documentElement.style.background = oldColor; + if (nestedFrame != null) + nestedFrame.classList.add("old"); + + await document.startViewTransition(() => { + document.documentElement.style.background = newColor; + if (nestedFrame != null) { + nestedFrame.classList.remove("old"); + nestedFrame.classList.add("new"); + } + }).ready; + } + + async function runTest() { + await startTransition(document, "green", "lightgreen", document.getElementById("inner")); + + const iframeDocument = document.querySelector("iframe").contentDocument; + await startTransition(iframeDocument, "blue", "lightblue", null); + + takeScreenshot(); + } +</script> + |