summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/selectors/invalidation/nth-last-child-of-sibling.html
blob: b7b9bd70ab8e3f3a2c95613709d26e501e5671aa (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
25
26
<!doctype html>
<meta charset="utf-8">
<title>CSS Selectors Invalidation: :nth-last-child(... of sibling)</title>
<link rel="author" title="Zach Hoffman" href="mailto:zach@zrhoffman.net">
<link rel="author" title="Steinar H. Gunderson" href="mailto:sesse@chromium.org">
<link rel="match" href="nth-last-child-of-sibling-ref.html">
<link rel="help" href="https://drafts.csswg.org/selectors-4/#child-index">
<style>
  p:nth-last-child(even of .a + .b) {
    color: green;
  }
</style>
<div>
  <p class="a">Ignored</p>
  <p class="b">Not ignored</p>
  <p class="a">Ignored</p>
  <p class="b">Not ignored</p>
  <p class="a">Ignored</p>
  <p class="b" id="toggler">Selectively ignored</p>
  <p class="a">Ignored</p>
  <p>Ignored</p>
</div>
<script>
  document.documentElement.offsetTop;
  toggler.classList.toggle("b");
</script>