46d2cad7413d72e920450fa1e8c59e3684657438
[WebKit-https.git] / LayoutTests / fast / dom / frame-loading-via-document-write.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4
5 <script language="JavaScript">
6
7 function buildFrameset()
8 {
9     if (window.layoutTestController)
10         layoutTestController.waitUntilDone();
11
12     var outHTML="<frameset rows=\"33%, 33%, 33%\">"+
13                 "<frame src=\"\" name=\"topRow\">"+
14                 "<frame src=\"\" name=\"middleRow\">"+
15                 "<frame src=\"\" name=\"bottomRow\">"+
16                 "</frameset>";
17
18     document.open("text/html","replace");
19     document.write(outHTML);
20     document.close();
21
22     outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+
23               "</scr" + "ipt></head><body onLoad=\"clickAnchor()\"><table><tr><td>"+
24               "<a href=\"resources/success.html\" target=\"topRow\" id=\"anchorLink\">Click me. If nothing loads above we have a problem.</a>"+
25               "</td></tr></table></body></html>";
26
27     frames['topRow'].document.open("text/html","replace");
28     frames['topRow'].document.charset=document.charset;
29     frames['topRow'].document. write(outHTML);
30     frames['topRow'].document.close();
31
32     outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+
33               "</scr" + "ipt></head><body onLoad=\"didImageLoad()\"><table><tr><td>"+
34               "<div id=\"result\"></div>"+
35               "<img src=\"file:////tmp/LayoutTests/fast/dom/resources/abe.png\" id=\"myImg\">"+
36               "</td></tr></table></body></html>";
37
38     frames['middleRow'].document.open("text/html","replace");
39     frames['middleRow'].document.charset=document.charset;
40     frames['middleRow'].document. write(outHTML);
41     frames['middleRow'].document.close();
42
43     outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+
44               "</scr" + "ipt></head><body onLoad=\"lastTest()\"><table><tr><td>"+
45               "<div id=\"result\"></div>"+
46               "<img src=\"resources/abe.png\" id=\"myImg\">"+
47               "</td></tr></table></body></html>";
48
49     frames['bottomRow'].document.open("text/html","replace");
50     frames['bottomRow'].document.charset=document.charset;
51     frames['bottomRow'].document. write(outHTML);
52     frames['bottomRow'].document.close();
53 }
54
55 buildFrameset();
56
57 </script>
58 </head>
59
60 <body>
61 <p>JavaScript FAILED! you should not see this.</p>
62 </body>
63
64 </html>
65