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/has-with-nth-child-sibling-remove.html - WPT Dashboard Interop Dashboard
 
 
<!doctype html>
<meta charset="utf-8">
<link rel="author" title="David Shin" href="mailto:dshin@mozilla.com">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
<style>
.square {
  width: 100px;
  height: 100px;
  background: red;
}
.item:not(:has(~ .item > :nth-child(2))) {
  background: green;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id=container>
  <div class="item square">
    <div></div>
    <div></div>
  </div>
  <div id=td class=item>
    <div></div>
    <div></div>
  </div>
</div>
<script>
window.onload = () => {
  td.remove();
};
</script>