Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/selectors/invalidation/nth-child-whole-subtree.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Selectors Invalidation: :nth-child(... of :not()) combined with whole subtree invalidation</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
div:nth-child(odd of :not(.c)) {
background-color: silver;
}
.c * {}
</style>
<div>Silver</div>
<div id="d2" class="c">White</div>
<div id="d3">Silver</div>
<script>
test(() => {
document.body.offsetTop;
d2.classList.value = '';
assert_equals(getComputedStyle(d3).backgroundColor, 'rgb(192, 192, 192)');
});
</script>