Add test for r169820.
[WebKit-https.git] / LayoutTests / plugins / reentrant-update-widget-positions.html
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5     <style type="text/css" media="screen">
6         #plugin {
7             position: absolute;
8             width: 100px;
9             height: 100px;
10         }
11     </style>
12     <script type="text/javascript" charset="utf-8">
13     if (window.testRunner) {
14         testRunner.dumpAsText();
15         testRunner.waitUntilDone();
16     }
17     // This gets called automatically from the test plugin.
18     var doingTest = false;
19     function setWindowCalled()
20     {
21         if (!doingTest)
22             return;
23
24         var victim = document.getElementById('victim');
25         victim.parentNode.removeChild(victim);
26         document.body.offsetTop;
27
28         if (window.testRunner)
29             testRunner.notifyDone();
30     }
31     
32     function doTest()
33     {
34         doingTest = true;
35         document.getElementById('plugin').style.top = "120px";
36         document.body.offsetTop;
37         doingTest = false;
38     }
39     
40     window.addEventListener('load', function() {
41         window.setTimeout(doTest, 0);
42     }, false);
43     </script>
44 </head>
45 <body>
46
47     <p>This test should not crash.</p>
48     <embed type="application/x-webkit-test-netscape"
49         onSetWindow="setWindowCalled()"
50         id="plugin">
51     <embed name="victim" type="application/x-webkit-test-netscape" id="victim">
52   
53 </body>
54 </html>