<!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>
