diff options
Diffstat (limited to 'testing/web-platform/tests/css/css-view-transitions/support')
5 files changed, 163 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-view-transitions/support/cat.png b/testing/web-platform/tests/css/css-view-transitions/support/cat.png Binary files differnew file mode 100644 index 0000000000..85dd732481 --- /dev/null +++ b/testing/web-platform/tests/css/css-view-transitions/support/cat.png diff --git a/testing/web-platform/tests/css/css-view-transitions/support/dialog-in-rtl-iframe-child.html b/testing/web-platform/tests/css/css-view-transitions/support/dialog-in-rtl-iframe-child.html new file mode 100644 index 0000000000..7b40a8fd5b --- /dev/null +++ b/testing/web-platform/tests/css/css-view-transitions/support/dialog-in-rtl-iframe-child.html @@ -0,0 +1,49 @@ +<!DOCTYPE html> +<html dir="rtl"> + <head> + <style> + body { + /* We need a background due to https://crbug.com/1414158. */ + background-color: white; + height: 200vh; + } + + ::view-transition-new(*) { + animation: unset; + opacity: 1; + } + ::view-transition-old(*) { + animation-duration: 30s; + opacity: 0; + } + + dialog { + width: 50dvw; + height: 50dvh; + box-sizing: border-box; + background-color: limegreen; + border: 1px solid black; + } + + </style> + <script> + function show() { + document.getElementById('dialog').showModal(); + } + function startTransition() { + window.transition = document.startViewTransition(() => { + show(); + }); + } + + const params = new URLSearchParams(window.location.search); + if (params.has('show')) { + addEventListener('load', show); + } + </script> + </head> + <body> + <dialog id="dialog"> + </dialog> + </body> +</html> diff --git a/testing/web-platform/tests/css/css-view-transitions/support/frame-helper.html b/testing/web-platform/tests/css/css-view-transitions/support/frame-helper.html new file mode 100644 index 0000000000..3d2e7b52d0 --- /dev/null +++ b/testing/web-platform/tests/css/css-view-transitions/support/frame-helper.html @@ -0,0 +1,25 @@ +<!doctype html> + +<style> +div { + width: 100px; + height: 100px; + background: green; +} +html { height: 50%; } +::view-transition-group(*) { animation-duration: 500s } +</style> + +<div></div> + +<script> +function run() { + document.startViewTransition(() => { + requestAnimationFrame(() => requestAnimationFrame(() => { + window.parent.postMessage({}, "*"); + })); + }); +} +onload = () => requestAnimationFrame(() => requestAnimationFrame(run)); +</script> + diff --git a/testing/web-platform/tests/css/css-view-transitions/support/iframe-scrollbar-child.html b/testing/web-platform/tests/css/css-view-transitions/support/iframe-scrollbar-child.html new file mode 100644 index 0000000000..dfd0fb40d9 --- /dev/null +++ b/testing/web-platform/tests/css/css-view-transitions/support/iframe-scrollbar-child.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> + <head> + <style> + body.scrollable { + width: 200lvw; + height: 200lvh; + } + + div { + width: 200px; + height: 200px; + background-color: skyblue; + } + + ::view-transition-new(*) { + animation-duration: 30s; + opacity: 0; + } + ::view-transition-old(*) { + animation: unset; + opacity: 1; + } + */ + </style> + <script> + function startTransition() { + window.transition = document.startViewTransition(() => { + document.body.classList.toggle('scrollable'); + }); + } + + onload = () => { + const params = new URLSearchParams(window.location.search); + if (params.has('scrollbar')) { + document.body.classList.add('scrollable'); + } + } + </script> + </head> + <body> + <div></div> + </body> +</html> diff --git a/testing/web-platform/tests/css/css-view-transitions/support/transition-in-empty-iframe-child.html b/testing/web-platform/tests/css/css-view-transitions/support/transition-in-empty-iframe-child.html new file mode 100644 index 0000000000..4eca06a0a9 --- /dev/null +++ b/testing/web-platform/tests/css/css-view-transitions/support/transition-in-empty-iframe-child.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> + <head> + <style> + ::view-transition-new(*) { + animation: unset; + opacity: 1; + } + ::view-transition-old(*) { + animation-duration: 30s; + opacity: 0; + } + + div { + width: 50vw; + height: 50vh; + background-color: limegreen; + border: 1px solid black; + } + + .hidden { + display: none; + } + + </style> + <script> + function newState() { + document.querySelector('.hidden').classList.remove('hidden'); + } + + function startTransition() { + window.transition = document.startViewTransition(newState); + } + + const params = new URLSearchParams(window.location.search); + if (params.has('ref')) { + addEventListener('load', newState); + } + </script> + </head> + <body> + <div class="hidden"> + </div> + </body> +</html> |