1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/xul/tree/crashtests/399227-1.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 1.4 +<?xml version="1.0"?> 1.5 + 1.6 +<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> 1.7 + 1.8 +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" class="reftest-wait" onload="setTimeout(boom, 30)"> 1.9 + 1.10 + 1.11 + <script> 1.12 + function boom() 1.13 + { 1.14 + var tree = document.getElementById("thetree"); 1.15 + var selection = tree.view.selection; 1.16 + 1.17 + selection.select(0); 1.18 + tree.parentNode.removeChild(tree); 1.19 + 1.20 + // This is expected to throw an error (it used to crash). 1.21 + try { 1.22 + selection.rangedSelect(1, 1, false); 1.23 + } 1.24 + catch (ex) {} 1.25 + 1.26 + document.documentElement.removeAttribute("class"); 1.27 + } 1.28 + </script> 1.29 + 1.30 +<tree flex="1" id="thetree"> 1.31 + <treecols> 1.32 + <treecol label="Name"/> 1.33 + </treecols> 1.34 + <treechildren id="TC"> 1.35 + <treeitem id="TI1"> 1.36 + <treerow> 1.37 + <treecell label="First treecell"/> 1.38 + </treerow> 1.39 + </treeitem> 1.40 + <treeitem id="TI2"> 1.41 + <treerow> 1.42 + <treecell label="Second treecell"/> 1.43 + </treerow> 1.44 + </treeitem> 1.45 + </treechildren> 1.46 + </tree> 1.47 +</window>