summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/selectors/invalidation/nth-last-child-of-attr.html
blob: 9381796bf1636d33ece681581db693985c151757 (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 attribute)</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-attr-ref.html">
<link rel="help" href="https://drafts.csswg.org/selectors-4/#child-index">
<style>
  p:nth-last-child(even of [attr="yes"]) {
    color: green;
  }
</style>
<div>
  <p>Ignored</p>
  <p attr="yes">Not ignored</p>
  <p attr="yes">Not ignored</p>
  <p attr="yes">Not ignored</p>
  <p attr="yes" id="toggler">Selectively ignored</p>
  <p attr="yes">Not ignored</p>
  <p attr="no">Ignored</p>
  <p>Ignored</p>
</div>
<script>
  document.documentElement.offsetTop;
  toggler.setAttribute("attr", "no");
</script>