blob: ca036d751ce9c584f0bb021b8effaef107cabfb6 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("Tests that HTMLFrameElement and HTMLIFrameElement expose a getSVGDocument accessor");
if (window.layoutTestController)
layoutTestController.waitUntilDone();
var frame;
var iframe;
var embed;
var object;
function startTest() {
frame = document.createElement("frame");
frame.onload = continueTest1;
frame.src = "resources/getsvgdocument.svg";
document.documentElement.appendChild(frame);
shouldBeTrue("!!frame.getSVGDocument");
}
var continueTest1 = function() {
shouldBeEqualToString("frame.getSVGDocument().toString()", "[object SVGDocument]");
frame.parentNode.removeChild(frame);
iframe = document.createElement("iframe");
iframe.onload = continueTest2;
iframe.src = "resources/getsvgdocument.svg";
document.documentElement.appendChild(iframe);
shouldBeTrue("!!iframe.getSVGDocument");
}
var continueTest2 = function() {
shouldBeEqualToString("iframe.getSVGDocument().toString()", "[object SVGDocument]");
iframe.parentNode.removeChild(iframe);
embed = document.createElement("embed");
embed.onload = continueTest3;
embed.src = "resources/getsvgdocument.svg";
document.documentElement.appendChild(embed);
shouldBeTrue("!!embed.getSVGDocument");
}
var continueTest3 = function(event) {
shouldBeEqualToString("embed.getSVGDocument().toString()", "[object SVGDocument]");
embed.parentNode.removeChild(embed);
object = document.createElement("object");
object.onload = completeTest;
object.data = "resources/getsvgdocument.svg";
document.documentElement.appendChild(object);
shouldBeTrue("!!object.getSVGDocument");
}
function completeTest() {
shouldBeEqualToString("object.getSVGDocument().toString()", "[object SVGDocument]");
object.parentNode.removeChild(object);
var script = document.createElement('script');
script.src = "../../fast/js/resources/js-test-post.js";
successfullyParsed = true;
document.body.appendChild(script);
if (window.layoutTestController)
layoutTestController.notifyDone();
}
startTest();
</script>
</body>
</html>