Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / custom / getsvgdocument.html
blob3a04f39f9e44df1d813cc876a9f2d8f8f69e9e06
1 <script>
2 function changeToSuccess(svgDocument) {
3 var text = svgDocument.getElementById("text");
4 var rect = svgDocument.getElementById("rect");
6 // Due to limitations in the current SVG JS Bindings, we're changing the text in this roundabout way:
7 text.removeChild(text.firstChild);
8 text.appendChild(document.createTextNode("SUCCESS"));
10 rect.style.fill = "green";
13 function didLoad() {
14 var object = document.getElementById("object");
15 var embed = document.getElementById("embed");
17 changeToSuccess(object.getSVGDocument());
18 changeToSuccess(embed.getSVGDocument());
20 </script>
22 <body onload="didLoad()">
23 <p>This tests to see if HTMLEmbedElement.getSVGDocument() and HTMLObjectElement.getSVGDocument() work. You should see SUCCESS printed twice below this:</p>
25 <EMBED id="embed" SRC="resources/getsvgdocument.svg" WIDTH="85" HEIGHT="20" /><br><br>
27 <OBJECT id="object" DATA="resources/getsvgdocument.svg" WIDTH="85" HEIGHT="20">FAILURE (no SVG support!)</OBJECT>
28 </body>