summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-view-transitions/content-smaller-than-box-size.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/css/css-view-transitions/content-smaller-than-box-size.html')
-rw-r--r--testing/web-platform/tests/css/css-view-transitions/content-smaller-than-box-size.html55
1 files changed, 55 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-view-transitions/content-smaller-than-box-size.html b/testing/web-platform/tests/css/css-view-transitions/content-smaller-than-box-size.html
new file mode 100644
index 0000000000..d2b8f63ca0
--- /dev/null
+++ b/testing/web-platform/tests/css/css-view-transitions/content-smaller-than-box-size.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html class=reftest-wait>
+<title>View transitions: element with content less than box size</title>
+<link rel="help" href="https://github.com/WICG/view-transitions">
+<link rel="author" href="mailto:khushalsagar@chromium.org">
+<link rel="match" href="content-smaller-than-box-size-ref.html">
+
+<script src="/common/reftest-wait.js"></script>
+<style>
+div { contain: paint; }
+#target {
+ width: 100px;
+ height: 100px;
+ view-transition-name: target;
+}
+#inner {
+ width: 10px;
+ height: 10px;
+ background: blue;
+ position: relative;
+ top: 10px;
+ left: 10px;
+}
+
+.hidden {
+ background: pink;
+ width: 10px;
+ height: 10px;
+ view-transition-name: hidden;
+}
+
+html::view-transition-group(hidden) { animation-duration: 300s; }
+html::view-transition-image-pair(hidden) { animation: unset; opacity: 0; }
+
+html::view-transition-new(target) { animation: unset; opacity: 0; }
+html::view-transition-old(target) { animation: unset; opacity: 1; }
+
+</style>
+
+<div id=target>
+ <div id=inner></div>
+</div>
+<div id=hidden class=hidden></div>
+
+<script>
+failIfNot(document.startViewTransition, "Missing document.startViewTransition");
+
+async function runTest() {
+ document.startViewTransition(() => {
+ requestAnimationFrame(takeScreenshot);
+ });
+}
+onload = () => requestAnimationFrame(runTest);
+</script>
+