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/pseudo-get-computed-style.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/pseudo-get-computed-style.html')
-rw-r--r-- | testing/web-platform/tests/css/css-view-transitions/pseudo-get-computed-style.html | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-view-transitions/pseudo-get-computed-style.html b/testing/web-platform/tests/css/css-view-transitions/pseudo-get-computed-style.html new file mode 100644 index 0000000000..45d2559b3e --- /dev/null +++ b/testing/web-platform/tests/css/css-view-transitions/pseudo-get-computed-style.html @@ -0,0 +1,94 @@ +<!DOCTYPE html> +<html> +<title>Shared transitions: check pseudo element's display property</title> +<link rel="help" href="https://github.com/WICG/view-transitions"> +<link rel="author" href="mailto:vmpstr@chromium.org"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> +div { + width: 100px; + height: 100px; + background: blue; + contain: paint; + view-transition-name: target; +} +::view-transition-image-pair(target) { + position: fixed; +} +</style> + +<div id=target></div> + +<script> +promise_test(() => { + assert_implements(document.startViewTransition, "Missing document.startViewTransition"); + return new Promise(async (resolve, reject) => { + let transition = document.startViewTransition(() => { + assert_equals(getComputedStyle(document.documentElement, ":view-transition").position, "fixed", ":view-transition"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").position, "absolute", "container(target)"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(target)").position, "absolute", "wrapper(target)"); + + assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(target)").position, "absolute", "outgoing(target)"); + + assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(root)").position, "absolute", "container(root)"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(root)").position, "absolute", "wrapper(root)"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(root)").position, "absolute", "outgoing(root)"); + + requestAnimationFrame(() => { + assert_equals(getComputedStyle(document.documentElement, ":view-transition").position, "fixed", "raf :view-transition"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").position, "absolute", "raf container(target)"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(target)").position, "fixed", "raf wrapper(target)"); + + assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(target)").position, "absolute", "raf outgoing(target)"); + + assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(root)").position, "absolute", "raf container(root)"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(root)").position, "absolute", "raf wrapper(root)"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(root)").position, "absolute", "raf outgoing(root)"); + }); + }); + await transition.finished; + resolve(); + }); +}, "position property of pseudo elements"); + +promise_test(() => { + assert_implements(document.startViewTransition, "Missing document.startViewTransition"); + return new Promise(async (resolve, reject) => { + let transition = document.startViewTransition(() => { + assert_equals(getComputedStyle(document.documentElement, ":view-transition").position, "fixed"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").position, "absolute"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(target)").position, "absolute"); + + assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(target)").position, "absolute"); + + assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(root)").position, "absolute"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(root)").position, "absolute"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(root)").position, "absolute"); + }); + + assert_equals(getComputedStyle(document.documentElement, ":view-transition").position, "fixed"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").position, "absolute"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(target)").position, "fixed"); + + assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(target)").position, "absolute"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-new(target)").position, "absolute"); + + assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(root)").position, "absolute"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-image-pair(root)").position, "absolute"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-old(root)").position, "absolute"); + assert_equals(getComputedStyle(document.documentElement, ":view-transition-new(root)").position, "absolute"); + + assert_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").position, "absolute"); + + await transition.finished; + + // With custom ua sheets not applying to non-existing pseudo, the value should be the default (not absolute) + assert_not_equals(getComputedStyle(document.documentElement, ":view-transition-group(target)").position, "absolute"); + + resolve(); + }); +}, "position property of pseudo elements with prepare api"); +</script> |