wpt / css / selectors / invalidation / nth-child-of-in-ancestor.html

Status: FAIL | Duration: 12ms | Subtests: 0/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/selectors/invalidation/nth-child-of-in-ancestor.html

<!DOCTYPE html>
<meta charset="utf-8" />
<title>CSS Selectors Invalidation: :nth-child(... of class) as ancestor</title>
<link rel="author" title="Steinar H. Gunderson" href="sesse@chromium.org">
<link rel="match" href="nth-child-of-in-ancestor-ref.html">
<link rel="help" href="https://drafts.csswg.org/selectors-4/#child-index">
<style>
  p:nth-child(odd of .c) span {
    color: green;
  }
</style>
<div>
  <p class="c">Not <span>ignored</span></p>
  <p class="c" id="toggler">Selectively <span>ignored<span></p>
  <p class="c">Not <span>ignored</span></p>
  <p class="c">Not <span>ignored</span></p>
  <p class="c">Not <span>ignored</span></p>
  <p>Ignored</p>
</div>
<script>
  document.documentElement.offsetTop;
  toggler.classList.toggle("c");
</script>

/css/selectors/invalidation/nth-child-of-in-ancestor-ref.html

<!DOCTYPE html>
<meta charset="utf-8" />
<title>CSS Selectors Invalidation: :nth-child(... of class) as ancestor</title>
<link rel="author" title="Steinar H. Gunderson" href="sesse@chromium.org">
<link rel="help" href="https://drafts.csswg.org/selectors-4/#child-index">
<div>
  <p>Not <span style="color: green">ignored</span></p>
  <p>Selectively <span>ignored<span></p>
  <p>Not <span>ignored</span></p>
  <p>Not <span style="color: green">ignored</span></p>
  <p>Not <span>ignored</span></p>
  <p>Ignored</p>
</div>