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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/base/crashtests/288790-1-inner.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,47 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<html xmlns="http://www.w3.org/1999/xhtml">
     1.6 +<title>Testcase bug 288790 - Crash [@ GetNearestContainingBlock] with this xbl testcase</title>
     1.7 +<head>
     1.8 +<style>
     1.9 +#z {position: relative;}
    1.10 +#z span{position: absolute;}
    1.11 +</style>
    1.12 +
    1.13 +<bindings xmlns="http://www.mozilla.org/xbl" xmlns:html="http://www.w3.org/1999/xhtml">
    1.14 +  <binding id="m"></binding>
    1.15 +  <binding id="ma" extends="#m">
    1.16 +    <content>
    1.17 +        <html:div><children/></html:div>
    1.18 +    </content>
    1.19 +  </binding>
    1.20 +</bindings>
    1.21 +
    1.22 +</head>
    1.23 +<body>
    1.24 +<div id="z"><span></span></div>
    1.25 +
    1.26 +
    1.27 +<script>
    1.28 +function doe(){
    1.29 +document.getElementById('z').setAttribute('style','-moz-binding:url(#ma)');
    1.30 +setTimeout(doe2,0);
    1.31 +}
    1.32 +
    1.33 +function doe2(){
    1.34 +document.getElementsByTagName('span')[0].setAttribute('style','-moz-binding:url(#m)');
    1.35 +}
    1.36 +</script>
    1.37 +<button id="button" onclick="doe()">Click me</button><br/>
    1.38 +Clicking on the above button two times, should not crash Mozilla.
    1.39 +<script>
    1.40 +function clickbutton()
    1.41 +{
    1.42 +  var ev = document.createEvent('MouseEvents');
    1.43 +  ev.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
    1.44 +  var button = document.getElementById('button');
    1.45 +  button.dispatchEvent(ev);
    1.46 +  button.dispatchEvent(ev);
    1.47 +}
    1.48 +clickbutton();
    1.49 +</script>
    1.50 +</body></html>

mercurial