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 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <p id="description"></p> | 7 <p id="description"></p> |
8 <div id="console"></div> | 8 <div id="console"></div> |
9 <script> | 9 <script> |
10 description("Tests that HTMLFrameElement and HTMLIFrameElement expose a getSVG
Document accessor"); | 10 description("Tests that HTMLIFrameElement, HTMLEmbedElement and HTMLObjectElem
ent expose a getSVGDocument accessor"); |
11 | 11 |
12 window.jsTestIsAsync = true; | 12 window.jsTestIsAsync = true; |
13 if (window.testRunner) | 13 if (window.testRunner) |
14 testRunner.waitUntilDone(); | 14 testRunner.waitUntilDone(); |
15 | 15 |
16 var frame; | |
17 var iframe; | 16 var iframe; |
18 var embed; | 17 var embed; |
19 var object; | 18 var object; |
20 | 19 |
21 function startTest() { | 20 function startTest() { |
22 frame = document.createElement("frame"); | |
23 frame.onload = continueTest1; | |
24 frame.src = "resources/getsvgdocument.svg"; | |
25 document.documentElement.appendChild(frame); | |
26 shouldBeTrue("!!frame.getSVGDocument"); | |
27 } | |
28 | |
29 var continueTest1 = function() { | |
30 shouldBeEqualToString("frame.getSVGDocument().toString()", "[object XMLDocum
ent]"); | |
31 frame.parentNode.removeChild(frame); | |
32 | |
33 iframe = document.createElement("iframe"); | 21 iframe = document.createElement("iframe"); |
34 iframe.onload = continueTest2; | 22 iframe.onload = continueTest1; |
35 iframe.src = "resources/getsvgdocument.svg"; | 23 iframe.src = "resources/getsvgdocument.svg"; |
36 document.documentElement.appendChild(iframe); | 24 document.documentElement.appendChild(iframe); |
37 shouldBeTrue("!!iframe.getSVGDocument"); | 25 shouldBeTrue("!!iframe.getSVGDocument"); |
38 } | 26 } |
39 | 27 |
40 var continueTest2 = function() { | 28 var continueTest1 = function() { |
41 shouldBeEqualToString("iframe.getSVGDocument().toString()", "[object XMLDocu
ment]"); | 29 shouldBeEqualToString("iframe.getSVGDocument().toString()", "[object XMLDocu
ment]"); |
42 iframe.parentNode.removeChild(iframe); | 30 iframe.parentNode.removeChild(iframe); |
43 | 31 |
44 embed = document.createElement("embed"); | 32 embed = document.createElement("embed"); |
45 embed.onload = continueTest3; | 33 embed.onload = continueTest2; |
46 embed.src = "resources/getsvgdocument.svg"; | 34 embed.src = "resources/getsvgdocument.svg"; |
47 document.documentElement.appendChild(embed); | 35 document.documentElement.appendChild(embed); |
48 shouldBeTrue("!!embed.getSVGDocument"); | 36 shouldBeTrue("!!embed.getSVGDocument"); |
49 } | 37 } |
50 | 38 |
51 var continueTest3 = function(event) { | 39 var continueTest2 = function(event) { |
52 shouldBeEqualToString("embed.getSVGDocument().toString()", "[object XMLDocum
ent]"); | 40 shouldBeEqualToString("embed.getSVGDocument().toString()", "[object XMLDocum
ent]"); |
53 embed.parentNode.removeChild(embed); | 41 embed.parentNode.removeChild(embed); |
54 | 42 |
55 object = document.createElement("object"); | 43 object = document.createElement("object"); |
56 object.onload = continueTest4; | 44 object.onload = continueTest3; |
57 object.data = "resources/getsvgdocument.svg"; | 45 object.data = "resources/getsvgdocument.svg"; |
58 document.documentElement.appendChild(object); | 46 document.documentElement.appendChild(object); |
59 shouldBeTrue("!!object.getSVGDocument"); | 47 shouldBeTrue("!!object.getSVGDocument"); |
60 } | 48 } |
61 | 49 |
62 function continueTest4() { | 50 function continueTest3() { |
63 shouldBeEqualToString("object.getSVGDocument().toString()", "[object XMLDocu
ment]"); | 51 shouldBeEqualToString("object.getSVGDocument().toString()", "[object XMLDocu
ment]"); |
64 object.parentNode.removeChild(object); | 52 object.parentNode.removeChild(object); |
65 | 53 |
66 finishJSTest(); | 54 finishJSTest(); |
67 } | 55 } |
68 | 56 |
69 startTest(); | 57 startTest(); |
70 </script> | 58 </script> |
71 </body> | 59 </body> |
72 </html> | 60 </html> |
OLD | NEW |