1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/crashtests/561981-1-iframe.xhtml Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,56 @@ 1.4 +<html xmlns="http://www.w3.org/1999/xhtml"> 1.5 +<head> 1.6 +<script> 1.7 +<![CDATA[ 1.8 + 1.9 +var i = 0; 1.10 + 1.11 +function init() 1.12 +{ 1.13 + targetWindow = window.frames[0]; 1.14 + targetDocument = targetWindow.document; 1.15 + targetDocument.body.appendChild(targetDocument.importNode(document.getElementById('rootish'), true)); 1.16 + targetDocument.designMode = 'on'; 1.17 + setTimeout(boom, 30); 1.18 +} 1.19 + 1.20 +function boom() 1.21 +{ 1.22 + var r = targetDocument.createRange(); 1.23 + r.setStart(targetDocument.getElementById("bar"), 0); 1.24 + r.setEnd(targetDocument.getElementById("baz").firstChild, 0); 1.25 + targetWindow.getSelection().addRange(r); 1.26 + targetDocument.execCommand("indent", false, null); 1.27 + setTimeout(whack, 300); 1.28 +} 1.29 + 1.30 +function whack() 1.31 +{ 1.32 + if (++i > 100) return; 1.33 + document.documentElement.style.MozBinding = 'url("data:text/xml,' + encodeURIComponent("<bindings xmlns=\"http://www.mozilla.org/xbl\"><binding id=\"foo\" g=\""+Math.random()+"\"><content>\n<\/content><\/binding><\/bindings>\n") + '")'; 1.34 + setTimeout(bonk, 10); 1.35 +} 1.36 + 1.37 +function bonk() 1.38 +{ 1.39 + document.getElementById("i").style.MozBinding = 'url("data:text/xml,' + encodeURIComponent("<bindings xmlns=\"http://www.mozilla.org/xbl\"><binding id=\"foo\" g=\""+Math.random()+"\"><content>\n\n<\/content><\/binding><\/bindings>\n") + '")'; 1.40 + document.documentElement.style.MozBinding = 'url("data:text/xml,' + encodeURIComponent("<bindings xmlns=\"http://www.mozilla.org/xbl\"><binding id=\"foo\" g=\""+Math.random()+"\"><content><iframe xmlns=\"http://www.w3.org/1999/xhtml\" src=\"data:text/html,\" style=\"width: 95%; height: 500px;\"><\/iframe><\/content><\/binding><\/bindings>\n") + '")'; 1.41 + setTimeout(whack, 10); 1.42 +} 1.43 + 1.44 +]]> 1.45 +</script> 1.46 +</head> 1.47 + 1.48 +<body onload="init()"> 1.49 + 1.50 +<iframe id="i" src="data:text/html," style="width: 95%; height: 500px;"/> 1.51 + 1.52 +<div id="rootish"> 1.53 + <div>Foo</div> 1.54 + <div id="bar">Bar</div> 1.55 + <div><select><option id="baz">baz</option></select></div> 1.56 +</div> 1.57 + 1.58 +</body> 1.59 +</html>