Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / should-not-insert-stylesheet-into-detached-document.html
blob5bd5f3bbf0db38a5bcb358fe651ef19e0d1df6fa
1 <!DOCTYPE html>
2 <script>
3 if (window.testRunner)
4 testRunner.waitUntilDone();
6 function start() {
7 document_clone = document.cloneNode(false);
8 style1 = document_clone.createProcessingInstruction('xml-stylesheet', 'href="fail.css" type="text/css"');
9 iframe1 = style1.ownerDocument.createElement('iframe');
10 style2 = document_clone.createProcessingInstruction('xml-stylesheet', 'href="fail.css" type="text/css"');
11 document_clone.insertBefore(style2, document_clone.firstChild);
12 doc = document.documentElement;
13 iframe1.appendChild(doc);
14 document_clone = null;
15 style2 = null;
16 iframe2 = doc.ownerDocument.createElement('iframe');
17 gc();
18 iframe2_clone = iframe2.cloneNode(true);
19 div = document.createElement('div');
20 div_clone = div.cloneNode(false);
21 iframe2_clone.appendChild(div_clone);
22 iframe3 = div_clone.ownerDocument.createElement('iframe');
23 style3 = iframe3.ownerDocument.createProcessingInstruction('xml-stylesheet', 'href="fail.css" type="text/css"');
24 iframe3.ownerDocument.insertBefore(style3, iframe3.ownerDocument.firstChild);
25 reload_page();
28 function reload_page() {
29 if (location.hash == '#done') {
30 document.write('PASS');
31 if (window.testRunner) {
32 testRunner.dumpAsText();
33 testRunner.notifyDone();
35 return;
38 var count = 0;
39 if (location.hash !== "")
40 count = parseInt(location.hash.substr(1));
41 if (count < 10) {
42 ++count;
43 location.hash = '#' + count;
44 } else {
45 location.hash = 'done';
47 setTimeout("gc(); location.reload();", 100);
49 </script>
50 <body onload="start()"></body>