fa230d6bd78ac1fd9aaaa60563d94921992e0fa0
[WebKit-https.git] / LayoutTests / platform / mac-wk2 / tiled-drawing / scrolling / non-fast-region / destroy-wheel-element-crash.html
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5     <style>
6         .popover {
7             position: absolute;
8             z-index: 1;
9             top: 100px;
10             left: 100px;
11             width: 300px;
12             height: 200px;
13             border: 1px solid black;
14         }
15         
16         .container {
17             position: absolute;
18             width: 100%;
19             height: 100%;
20         }
21         
22     </style>
23
24     <script src="../../../../../resources/js-test-pre.js" type="text/javascript" charset="utf-8"></script>
25     <script>
26         if (window.testRunner) {
27             testRunner.waitUntilDone();
28             testRunner.dumpAsText();
29         }
30         
31         var popover;
32         function createPopover()
33         {
34             popover = document.createElement('div');
35             popover.className = 'popover';
36             var container = document.createElement('div');
37             container.className = 'container';
38             popover.appendChild(container);
39         }
40         
41         function doTest()
42         {
43             createPopover();
44             document.body.appendChild(popover);
45             popover.addEventListener("mousewheel", this, true);
46             window.setTimeout(dismiss, 0);
47         }
48
49         var count = 0;
50         function dismiss()
51         {
52             document.body.removeChild(popover);
53             gc();
54             
55             document.getElementById('count').textContent = ++count;
56             if (count > 3) {
57                 if (window.testRunner)
58                     testRunner.notifyDone();
59                 return;
60             }
61             doTest();
62         }
63         
64         window.addEventListener('load', doTest, false);
65     </script>
66 </head>
67 <body>
68     <p>Test that elements with wheel event handlers are removed from the document's event handler set when the element is destroyed. Test passes if it does not crash.</p>
69 <p>Iterations: <span id="count"></span></p>
70 </body>
71 </html>