summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/selectors/invalidation/nth-child-of-in-ancestor.html
blob: 7311c3e301155620b05cde7ffecd9d829d20618a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!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://w3c.github.io/csswg-drafts/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>