Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / block / float / float-mark-descendants-for-layout-crash.html
blob98d31a9511b96a4bc8355b882e2f6dd85c822cf2
1 <!doctype HTML>
2 <script>
3 if (window.testRunner) {
4 testRunner.waitUntilDone();
5 testRunner.dumpAsText();
7 </script>
8 <style>
9 .c7 { float: right; }
10 .c8:nth-last-of-type(2n+1) { float: right;}
11 </style>
12 <script>
13 // This test will crash if we leave stale floats in a child's descendants.
14 var nodes = Array();
15 function reference(domNode) {
16 this.domNode = domNode;
18 function walk(a, currentPrefix, index, domNode) {
19 if(domNode == null)
20 return;
21 newPrefix = currentPrefix + "_" + index;
22 a[newPrefix] = new reference(domNode);
24 function clear() {
25 var a = new Array();
26 walk(a, "", 0, document.documentElement);
27 for(key in a) {
28 a[key].domNode.parentNode.removeChild(a[key].domNode);
30 if (window.testRunner)
31 testRunner.notifyDone();
33 function boom() {
34 nodes[0] = document.createElement('meter');
35 nodes[0].setAttribute('class', 'c7');
36 document.documentElement.appendChild(nodes[0]);
37 nodes[58] = document.createElement('br');
38 document.documentElement.appendChild(nodes[58]);
39 nodes[63] = document.createElement('h1');
40 nodes[63].setAttribute('class', 'c8');
41 document.documentElement.appendChild(nodes[63]);
42 nodes[66] = document.createElement('iframe');
43 nodes[66].setAttribute('srcdoc', '');
44 document.documentElement.appendChild(nodes[66]);
45 nodes[72] = document.createElement('sup');
46 nodes[72].setAttribute('class', 'c7');
47 document.documentElement.appendChild(nodes[72]);
48 setTimeout('clear();', 700);
50 window.onload = boom;
51 </script>