Use testRunner instead of layoutTestController in fast/doctypes, dom, dynamic, encodi...
[WebKit-https.git] / LayoutTests / fast / dom / StyleSheet / detached-style-2.html
1 <html>
2 <head>
3 <link rel="stylesheet" href="resources/detached-style.css" type="text/css" media="screen">
4 </head>
5 <body onload="finishTest()">
6 <p><a href="https://bugs.webkit.org/show_bug.cgi?id=45205">Bug 45205</a>:
7 Test that &lt;link> elements only have stylesheets when in document.</p>
8 <pre id=result></pre>
9 <script>
10 if (window.testRunner)
11     testRunner.dumpAsText();
12
13 head = document.getElementsByTagName("head")[0];
14 link = document.getElementsByTagName("link")[0];
15 result = document.getElementById("result");
16
17 head.removeChild(link);
18
19 function finishTest()
20 {
21     result.innerHTML += "Not in document: " + ((link.sheet === null) ? "PASS" : ("FAIL: " + link.sheet)) + "\n";
22
23     head.appendChild(link);
24
25     result.innerHTML += "After adding to document: " + ((link.sheet === null) ? ("FAIL: " + link.sheet) : "PASS") + "\n";
26
27     result.innerHTML += "DONE";
28 }
29 </script>
30 </body>
31 </html>