layout/base/crashtests/288790-1-inner.xhtml

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:1c19f89432c3
1 <?xml version="1.0"?>
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <title>Testcase bug 288790 - Crash [@ GetNearestContainingBlock] with this xbl testcase</title>
4 <head>
5 <style>
6 #z {position: relative;}
7 #z span{position: absolute;}
8 </style>
9
10 <bindings xmlns="http://www.mozilla.org/xbl" xmlns:html="http://www.w3.org/1999/xhtml">
11 <binding id="m"></binding>
12 <binding id="ma" extends="#m">
13 <content>
14 <html:div><children/></html:div>
15 </content>
16 </binding>
17 </bindings>
18
19 </head>
20 <body>
21 <div id="z"><span></span></div>
22
23
24 <script>
25 function doe(){
26 document.getElementById('z').setAttribute('style','-moz-binding:url(#ma)');
27 setTimeout(doe2,0);
28 }
29
30 function doe2(){
31 document.getElementsByTagName('span')[0].setAttribute('style','-moz-binding:url(#m)');
32 }
33 </script>
34 <button id="button" onclick="doe()">Click me</button><br/>
35 Clicking on the above button two times, should not crash Mozilla.
36 <script>
37 function clickbutton()
38 {
39 var ev = document.createEvent('MouseEvents');
40 ev.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
41 var button = document.getElementById('button');
42 button.dispatchEvent(ev);
43 button.dispatchEvent(ev);
44 }
45 clickbutton();
46 </script>
47 </body></html>

mercurial