diff options
Diffstat (limited to 'testing/web-platform/tests/css/css-view-transitions/3d-transform-outgoing.html')
-rw-r--r-- | testing/web-platform/tests/css/css-view-transitions/3d-transform-outgoing.html | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-view-transitions/3d-transform-outgoing.html b/testing/web-platform/tests/css/css-view-transitions/3d-transform-outgoing.html new file mode 100644 index 0000000000..3cb29527c4 --- /dev/null +++ b/testing/web-platform/tests/css/css-view-transitions/3d-transform-outgoing.html @@ -0,0 +1,66 @@ +<!DOCTYPE html> +<html class=reftest-wait> +<title>Shared transitions: 3d transform</title> +<link rel="help" href="https://github.com/WICG/view-transitions"> +<link rel="author" href="mailto:vmpstr@chromium.org"> +<link rel="match" href="3d-transform-outgoing-ref.html"> +<meta name=fuzzy content="3d-transform-outgoing-ref.html:0-255;0-1200"> +<script src="/common/reftest-wait.js"></script> + +<style> +div { box-sizing: border-box; will-change: transform } +.rotate3d { + transform: translate(20px, 100px) rotate3d(1, 1, 1, 45deg); + background: blue; +} + +.wrap_perspective { + perspective: 100px; + width: max-content; + transform: translate(200px); +} +.rotatex { + transform-style: preserve-3d; + transform: rotateX(20deg); + background: green; +} +.shared { + view-transition-name: shared; + contain: layout; + width: 100px; + height: 100px; +} +#hidden { + view-transition-name: hidden; + width: 10px; + height: 10px; + background: red; + contain: layout; +} + +::view-transition-group(hidden) { animation-duration: 300s; } +::view-transition-image-pair(hidden) { visibility: hidden; } +::view-transition-group(root) { visibility: hidden; } +::view-transition { background: pink; } +::view-transition-group(*) { animation-duration: 0s; } +::view-transition-new(*) { animation: unset; opacity: 0; } +::view-transition-old(*) { animation: unset; opacity: 1; } +</style> + +<div id=wrapper class=wrap_perspective><div id=target class="shared rotatex"></div></div> +<div id=hidden></div> + +<script> +failIfNot(document.startViewTransition, "Missing document.startViewTransition"); + +function runTest() { + document.startViewTransition(() => { + wrapper.classList.toggle("wrap_perspective"); + target.classList.toggle("rotatex"); + target.classList.toggle("rotate3d"); + requestAnimationFrame(() => requestAnimationFrame(takeScreenshot)); + }); +} + +onload = requestAnimationFrame(() => requestAnimationFrame(runTest)); +</script> |