-
Notifications
You must be signed in to change notification settings - Fork 746
Closed
Labels
Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.Used when the issue is more of a question than a problem, and it's been answered.selectors-4Current WorkCurrent Work
Description
This means that :has
and nesting don't play super-well, and it's a bit unintuitive.
Test-case:
<!DOCTYPE html>
<div id="outer">
<div id="middle">
<div id="inner"></div>
</div>
</div>
<pre><script>
function w(el, selector) {
document.writeln(`#${el.id}.matches(${selector}) = ${el.matches(selector)}`);
}
w(middle, ":has(#outer #inner)");
w(middle, ":has(:is(#outer #inner))");
</script></pre>
Maybe we shouldn't allow :has()
to escape its scope?
Metadata
Metadata
Assignees
Labels
Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.Used when the issue is more of a question than a problem, and it's been answered.selectors-4Current WorkCurrent Work