commit 3e1336dbd46514c4f1ff76bbadddfd9c64038a22
parent 5ec4d374ac5120105f2e327b1bff14d49c4b0485
Author: Steve Kobes <skobes@chromium.org>
Date: Wed, 3 Dec 2025 14:41:06 +0000
Bug 2003283 [wpt PR 56367] - ScopedVT: Make PaintLayer::HitTest treat ::v-t as an overlay., a=testonly
Automatic update from web-platform-tests
ScopedVT: Make PaintLayer::HitTest treat ::v-t as an overlay.
Follow-up to crrev.com/c/7178180 which changed the paint order of the
::view-transition pseudo element relative to other children of the
scope's PaintLayer.
This change aligns hit testing logic with the new paint order.
Bug: 421927605
Change-Id: Ib5f092fd42e176f450e77a1fe885dc4a2a6d9b55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7208494
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1552154}
--
wpt-commits: a81c0440ce4180a2e49acbdb2f26b688dac9ac5f
wpt-pr: 56367
Diffstat:
1 file changed, 62 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/css/css-view-transitions/scoped/hit-test-vt-overlay.html b/testing/web-platform/tests/css/css-view-transitions/scoped/hit-test-vt-overlay.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="help" href="https://drafts.csswg.org/css-view-transitions-2/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+
+body { margin: 0; }
+#scope {
+ position: relative; width: 100px; height: 110px;
+ background: white; contain: strict; view-transition-name: none;
+}
+#part {
+ position: absolute; top: 10px; left: 10px;
+ width: 50px; height: 50px; background: #8cf;
+ z-index: 1; view-transition-name: foo;
+}
+#higher-nonpart {
+ position: absolute; top: 20px; left: 40px;
+ z-index: 2; width: 50px; height: 50px; background: #f88;
+}
+#inflow-nonpart {
+ background: #4f8; width: 50px; height: 50px;
+ margin-left: 20px; margin-top: 50px;
+}
+::view-transition { background: rgba(0, 0, 0, 0.1); height: 40px; }
+::view-transition-group(*) { animation-play-state: paused; }
+::view-transition-new(*) { animation: unset; opacity: 1; }
+::view-transition-old(*) { animation: unset; opacity: 0; }
+
+</style>
+</head>
+<body>
+<div id=scope>
+ <div id=part></div>
+ <div id=higher-nonpart></div>
+ <div id=inflow-nonpart></div>
+</div>
+<script>
+
+promise_test(async t => {
+ await scope.startViewTransition(() => {}).ready;
+ const cases = [
+ [25, 30, "scope"],
+ [50, 30, "scope"],
+ [75, 30, "scope"],
+ [25, 50, "scope"],
+ [50, 50, "scope"],
+ [75, 50, "higher-nonpart"],
+ [50, 80, "inflow-nonpart"]
+ ];
+ for (const c of cases) {
+ const [x, y, expected] = c;
+ assert_equals(document.elementFromPoint(x, y).id,
+ expected, `at (${x}, ${y})`);
+ }
+});
+
+</script>
+</body>
+</html>