Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / accessibility / table-modification-crash.html
1 <html>
2 <script>
3     if (window.testRunner)
4         testRunner.dumpAsText();
5 </script>
6
7 <body id="body">
8
9     <!-- This test makes sure we do not crash if javascript changes a table element -->
10  
11     <table border=1 id='table1'><tr><td>a</td><td>b</td><td>c</td></tr></table>
12
13     <div id="result"></div>
14      
15     <script>
16         if (window.accessibilityController) {
17             var result = document.getElementById("result");
18
19             var table = document.getElementById("table1");
20             table.focus();
21             tableAX = accessibilityController.focusedElement;
22
23             var string = tableAX.attributesOfChildren();
24
25              var row = document.createElement("tr")
26              var td1 = document.createElement("td")
27              td1.appendChild(document.createTextNode("column 1"))
28              row.appendChild(td1);
29
30              var td2 = document.createElement("td")
31              td2.appendChild(document.createTextNode("column 2"))
32              row.appendChild(td2);
33
34              var td3 = document.createElement("td")
35              td3.appendChild(document.createTextNode("column 3"))
36              row.appendChild(td3);
37
38              table.childNodes[0].appendChild(row);
39
40              string = tableAX.attributesOfChildren();
41  
42              table.childNodes[0].removeChild(table.childNodes[0].childNodes[0]);
43
44              string = tableAX.attributesOfChildren();
45          
46              result.innerText += "Test passed\n";
47         }
48     </script>
49 </body>
50 </html>