Files
firefox/testing/web-platform/tests/css/css-nesting/has-nesting.html
T
Emilio Cobos Álvarez 369d1f7a56 Bug 1864647 - Don't crash when finding nested relative selectors. r=dshin
For now, do the same as pseudo-elements, which is effectively to keep
them in the replaced selector but don't match them. Avoid crashing in
this case.

I filed https://github.com/w3c/csswg-drafts/issues/9600 since this issue
isn't specific about :has(), and depending on the result of that
discussion, the "proper" solution might be different.

Differential Revision: https://phabricator.services.mozilla.com/D193663
2023-11-15 17:21:24 +00:00

22 lines
505 B
HTML

<!doctype html>
<title>Nested has shouldn't match</title>
<link rel="help" href="https://drafts.csswg.org/selectors/#relational">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1864647">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/9600">
<link rel="match" href="has-nesting-ref.html">
<style>
ul { background: green }
li:has(strong) {
display: none;
:has(> &) {
background: red;
}
}
</style>
<ul>
<li><strong>Foo</strong></li>
<li>Bar</li>
</ul>