class-id-attr.html (677B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>CSS Test: [id] and [class] attribute selectors are invalidated correctly.</title> 4 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> 5 <link rel="help" href="https://drafts.csswg.org/selectors-4/#attribute-selectors"> 6 <link rel="match" href="class-id-attr-ref.html"> 7 <style> 8 [class="foo"] { 9 color: green; 10 } 11 [id="baz"] { 12 color: green; 13 } 14 </style> 15 <div id="foo">This should be green</div> 16 <div id="bar">And this too</div> 17 <script> 18 onload = function() { 19 document.documentElement.offsetTop; 20 foo.classList.add("foo"); 21 bar.setAttribute("id", "baz"); 22 document.documentElement.offsetTop; 23 } 24 </script>