Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/selectors/has-where-computed.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>:has() pseudo-class with :where()</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style type="text/css">
div.foo:has(div:where(.bar)) div:where(.baz) {
background-color: rgb(226 232 240);
}
</style>
<div class="foo">
<div>
<div class="bar">
</div>
</div>
<div>
<div class="baz">
</div>
</div>
</div>
<script>
"use strict";
const div = document.querySelector(".baz");
test(() => {
assert_equals(window.getComputedStyle(div).backgroundColor, "rgb(226, 232, 240)", "match background-color");
}, "getComputedStyle()");
</script>