<script>
function changeToSuccess(svgDocument) {
  var text = svgDocument.getElementById("text");
  var rect = svgDocument.getElementById("rect");
  
  // Due to limitations in the current SVG JS Bindings, we're changing the text in this roundabout way:
  text.removeChild(text.firstChild);
  text.appendChild(document.createTextNode("SUCCESS"));
  
  rect.style.fill = "green";
}

function didLoad() {
  var object = document.getElementById("object");
  var embed = document.getElementById("embed");

  changeToSuccess(object.getSVGDocument());
  changeToSuccess(embed.getSVGDocument());
}
</script>

<body onload="didLoad()">
<p>This tests to see if HTMLEmbedElement.getSVGDocument() and HTMLObjectElement.getSVGDocument() work. You should see SUCCESS printed twice below this:</p>

<EMBED id="embed" SRC="resources/getsvgdocument.svg" WIDTH="85" HEIGHT="20" /><br><br>
  
<OBJECT id="object" DATA="resources/getsvgdocument.svg" WIDTH="85" HEIGHT="20">FAILURE (no SVG support!)</OBJECT>
</body>
