dom-hover-001

Effect of DOM mutations on :hover matching

WeasyPrint

This browser

Flags
dom, interact

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3   <head>
 4     <title>CSS Test: Effect of DOM mutations on :hover matching</title>
 5     <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu">
 6     <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#dynamic-pseudo-classes">
 7     <meta name="flags" content="dom interact">
 8     <script type="text/javascript">
 9       function remove() {
10         var node = document.getElementById("target");
11         node.parentNode.removeChild(node);
12       }
13     </script>
14     <style>
15       div#green { color: red; }
16       div:hover { color: green !important; }
17     </style>
18   </head>
19   <body>
20     <div id="target" onmouseover="setTimeout(remove, 1000)">Hover this text,
21        then wait till it disappears.  At that point there should be no red.
22     </div>
23     <div id="green">
24       This should end up green.
25     </div>
26   </body>
27 </html>