OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 | 4 |
5 <script language="JavaScript"> | 5 <script language="JavaScript"> |
6 | 6 |
7 function buildFrameset() | 7 function buildFrameset() |
8 { | 8 { |
9 if (window.testRunner) { | 9 if (window.testRunner) { |
10 testRunner.waitUntilDone(); | 10 testRunner.waitUntilDone(); |
(...skipping 10 matching lines...) Expand all Loading... |
21 document.open("text/html","replace"); | 21 document.open("text/html","replace"); |
22 document.write(outHTML); | 22 document.write(outHTML); |
23 document.close(); | 23 document.close(); |
24 | 24 |
25 outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/
frame-loading-via-document-write.js\">"+ | 25 outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/
frame-loading-via-document-write.js\">"+ |
26 "</scr" + "ipt></head><body onLoad=\"clickAnchor(); top.frameLoade
d();\"><table><tr><td>"+ | 26 "</scr" + "ipt></head><body onLoad=\"clickAnchor(); top.frameLoade
d();\"><table><tr><td>"+ |
27 "<a href=\"resources/success.html\" target=\"topRow\" id=\"anchorL
ink\">Click me. If nothing loads above we have a problem.</a>"+ | 27 "<a href=\"resources/success.html\" target=\"topRow\" id=\"anchorL
ink\">Click me. If nothing loads above we have a problem.</a>"+ |
28 "</td></tr></table></body></html>"; | 28 "</td></tr></table></body></html>"; |
29 | 29 |
30 frames['topRow'].document.open("text/html","replace"); | 30 frames['topRow'].document.open("text/html","replace"); |
31 frames['topRow'].document.charset=document.charset; | |
32 frames['topRow'].document.write(outHTML); | 31 frames['topRow'].document.write(outHTML); |
33 frames['topRow'].document.close(); | 32 frames['topRow'].document.close(); |
34 | 33 |
35 var localImageLocation = "file:///tmp/LayoutTests/fast/dom/resources/abe.png
"; | 34 var localImageLocation = "file:///tmp/LayoutTests/fast/dom/resources/abe.png
"; |
36 if (window.testRunner) | 35 if (window.testRunner) |
37 localImageLocation = testRunner.pathToLocalResource(localImageLocation); | 36 localImageLocation = testRunner.pathToLocalResource(localImageLocation); |
38 | 37 |
39 // We check image loading via an onload handler on the <img> instead of the
<body> because due to https://webkit.org/b/29615 | 38 // We check image loading via an onload handler on the <img> instead of the
<body> because due to https://webkit.org/b/29615 |
40 // the document onload may fire before the image has loaded. | 39 // the document onload may fire before the image has loaded. |
41 outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/
frame-loading-via-document-write.js\">"+ | 40 outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/
frame-loading-via-document-write.js\">"+ |
42 "</scr" + "ipt></head><body><table><tr><td>"+ | 41 "</scr" + "ipt></head><body><table><tr><td>"+ |
43 "<div id=\"result\"></div>"+ | 42 "<div id=\"result\"></div>"+ |
44 "<img src=\"" + localImageLocation + "\" id=\"myImg\" onLoad=\"did
ImageLoad(); top.frameLoaded();\">"+ | 43 "<img src=\"" + localImageLocation + "\" id=\"myImg\" onLoad=\"did
ImageLoad(); top.frameLoaded();\">"+ |
45 "</td></tr></table></body></html>"; | 44 "</td></tr></table></body></html>"; |
46 | 45 |
47 frames['middleRow'].document.open("text/html","replace"); | 46 frames['middleRow'].document.open("text/html","replace"); |
48 frames['middleRow'].document.charset=document.charset; | |
49 frames['middleRow'].document.write(outHTML); | 47 frames['middleRow'].document.write(outHTML); |
50 frames['middleRow'].document.close(); | 48 frames['middleRow'].document.close(); |
51 | 49 |
52 outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/
frame-loading-via-document-write.js\">"+ | 50 outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/
frame-loading-via-document-write.js\">"+ |
53 "</scr" + "ipt></head><body><table><tr><td>"+ | 51 "</scr" + "ipt></head><body><table><tr><td>"+ |
54 "<div id=\"result\"></div>"+ | 52 "<div id=\"result\"></div>"+ |
55 "<img src=\"resources/abe.png\" id=\"myImg\" onLoad=\"didImageLoad
(); top.frameLoaded();\">"+ | 53 "<img src=\"resources/abe.png\" id=\"myImg\" onLoad=\"didImageLoad
(); top.frameLoaded();\">"+ |
56 "</td></tr></table></body></html>"; | 54 "</td></tr></table></body></html>"; |
57 | 55 |
58 frames['bottomRow'].document.open("text/html","replace"); | 56 frames['bottomRow'].document.open("text/html","replace"); |
59 frames['bottomRow'].document.charset=document.charset; | |
60 frames['bottomRow'].document.write(outHTML); | 57 frames['bottomRow'].document.write(outHTML); |
61 frames['bottomRow'].document.close(); | 58 frames['bottomRow'].document.close(); |
62 } | 59 } |
63 | 60 |
64 var frameLoadCounter = 3; | 61 var frameLoadCounter = 3; |
65 | 62 |
66 function frameLoaded() | 63 function frameLoaded() |
67 { | 64 { |
68 frameLoadCounter--; | 65 frameLoadCounter--; |
69 if (frameLoadCounter == 0 && window.testRunner) | 66 if (frameLoadCounter == 0 && window.testRunner) |
70 testRunner.notifyDone(); | 67 testRunner.notifyDone(); |
71 } | 68 } |
72 | 69 |
73 buildFrameset(); | 70 buildFrameset(); |
74 | 71 |
75 </script> | 72 </script> |
76 </head> | 73 </head> |
77 | 74 |
78 <body> | 75 <body> |
79 <p>JavaScript FAILED! you should not see this.</p> | 76 <p>JavaScript FAILED! you should not see this.</p> |
80 </body> | 77 </body> |
81 | 78 |
82 </html> | 79 </html> |
83 | 80 |
OLD | NEW |