commit b9008310c29753c7f029f12eb85737910752e4e4
parent 150b5ab5962b9310e3ac8ea353b22046b826b1ab
Author: Vladimir Levin <vmpstr@chromium.org>
Date: Thu, 9 Oct 2025 20:33:49 +0000
Bug 1992169 [wpt PR 55172] - CV: Avoid c-v applying to inline pseudo elements, a=testonly
Automatic update from web-platform-tests
CV: Avoid c-v applying to inline pseudo elements
When we style elements, we call DidStyleSelf which may unlock
the element due to missing constraints (containment, inlines).
However, when we initially create a pseudo element, it goes
through a different path which misses this call. This means
we can end up with c-v locked inline elements which causes problems
down the line.
This patch fixes this by calling DidStyleSelf on newly created
and styled pseudo elements.
R=futhark@chromium.org
Bug: 445470755
Change-Id: I4c500d17f116d9f785757563f897f0337172b912
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6995738
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Vladimir Levin <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1523552}
--
wpt-commits: be770da33b38785234137269f885b2c6dc29ae70
wpt-pr: 55172
Diffstat:
1 file changed, 20 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/css/css-contain/content-visibility/content-visibility-in-relpos-before-crash.html b/testing/web-platform/tests/css/css-contain/content-visibility/content-visibility-in-relpos-before-crash.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+
+<meta charset="utf8">
+<title>CSS Content Visibility: crash on relatively positioned ::before content-visibility</title>
+<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
+<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
+<meta name="assert" content="content-visibility hit testing in ::before should not crash">
+
+<style>
+ #problem::before {
+ position: relative;
+ content-visibility: auto;
+ content: "content";
+ }
+</style>
+<div style="height:30000px;"></div>
+<div id="problem"></div>
+<script>
+ document.elementFromPoint(300, 300);
+</script>