summaryrefslogtreecommitdiffstats
path: root/layout/base/crashtests/288790-1-inner.xhtml
blob: 15351dcffd3008cd3a48e6a474b3f1d4c82c7804 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Testcase bug 288790 - Crash [@ GetNearestContainingBlock] with this xbl testcase</title>
<head>
<style>
#z {position: relative;}
#z span{position: absolute;}
</style>

<bindings xmlns="http://www.mozilla.org/xbl" xmlns:html="http://www.w3.org/1999/xhtml">
  <binding id="m"></binding>
  <binding id="ma" extends="#m">
    <content>
        <html:div><children/></html:div>
    </content>
  </binding>
</bindings>

</head>
<body>
<div id="z"><span></span></div>


<script>
function doe(){
document.getElementById('z').setAttribute('style','-moz-binding:url(#ma)');
setTimeout(doe2,0);
}

function doe2(){
document.getElementsByTagName('span')[0].setAttribute('style','-moz-binding:url(#m)');
}
</script>
<button id="button" onclick="doe()">Click me</button><br/>
Clicking on the above button two times, should not crash Mozilla.
<script>
function clickbutton()
{
  var ev = document.createEvent('MouseEvents');
  ev.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  var button = document.getElementById('button');
  button.dispatchEvent(ev);
  button.dispatchEvent(ev);
}
clickbutton();
</script>
</body></html>