dom-hover-002

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:hover { color: red; }
16       div#green { color: green; }
17     </style>
18   </head>
19   <body>
20     <div>
21       Dummy text. Dummy text.
22       <div id="target" onmouseover="setTimeout(remove, 1000)"><span>Hover this text,
23          then wait till it disappears.  At that point there should be no red.</span>
24       </div>
25     </div>
26     <div id="green">
27       Dummy text. Dummy text.
28     </div>
29   </body>
30 </html>