struct-dom-07-f-isvalid.html (3718B)
1 <!DOCTYPE html> 2 <html lang='en'> 3 <head> 4 <title>struct-dom-07-f-manual.svg</title> 5 <meta charset='utf-8'> 6 </head> 7 <body> 8 <h1>Source SVG: struct-dom-07-f-manual.svg</h1> 9 <svg version="1.1" baseProfile="full" onload="init();" id="svg-root" 10 width="100%" height="100%" viewBox="0 0 480 360" 11 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 12 <!--======================================================================--> 13 <!--= SVG 1.1 2nd Edition Test Case =--> 14 <!--======================================================================--> 15 <!--= Copyright 2009 World Wide Web Consortium, (Massachusetts =--> 16 <!--= Institute of Technology, European Research Consortium for =--> 17 <!--= Informatics and Mathematics (ERCIM), Keio University). =--> 18 <!--= All Rights Reserved. =--> 19 <!--= See http://www.w3.org/Consortium/Legal/. =--> 20 <!--======================================================================--> 21 22 <title id="test-title">$RCSfile: struct-dom-07-f.svg,v $</title> 23 <defs> 24 <font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> 25 <font-face-src> 26 <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> 27 </font-face-src> 28 </font-face> 29 </defs> 30 <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> 31 <script><![CDATA[ 32 function init() 33 { 34 var use = document.getElementById("use-elm"); 35 var firstElementChild = use.instanceRoot.firstChild; 36 37 // Get the <g> elements SVGElementInstance 38 while(firstElementChild.correspondingElement.nodeType != Node.ELEMENT_NODE) 39 firstElementChild = firstElementChild.nextSibling; 40 41 // the childnodes of the g element shadowtree 42 var childNodes = firstElementChild.childNodes; 43 for(var i = 0; i < childNodes.length; i++) 44 { 45 var item = childNodes.item(i); 46 if(item.correspondingElement.nodeType == Node.ELEMENT_NODE) 47 { 48 item.correspondingElement.setAttribute("fill", "green"); 49 } 50 } 51 } 52 ]]></script> 53 <defs> 54 <svg xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-sub-root" viewBox="0 0 450 450"> 55 <g id="drawRects" fill="red" stroke="black" stroke-width="5"> 56 <rect x="225" y="0" width="225" height="225"/> 57 <rect x="0" y="225" width="225" height="225"/> 58 <rect x="225" y="225" width="225" height="225"/> 59 </g> 60 </svg> 61 </defs> 62 63 <g transform="translate(100,30)"> 64 <use id="use-elm" x="60" y="50" width="240" height="240" transform="translate(50,50) scale(0.4)" xlink:href="#svg-sub-root"/> 65 <use id="use-elm-2" x="60" y="50" width="240" height="240" transform="scale(0.4)" xlink:href="#svg-sub-root"/> 66 <use id="use-elm-3" width="450" height="450" transform="translate(124,120) scale(0.213333)" xlink:href="#drawRects"/> 67 </g> 68 </g> 69 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> 70 <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.8 $</text> 71 </g> 72 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="black"/> 73 <!-- comment out this watermark once the test is approved --> 74 <!--<g id="draft-watermark"> 75 <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> 76 <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" 77 text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> 78 </g>--> 79 </svg> 80 </body> 81 </html>