struct-dom-18-f-isvalid.html (5325B)
1 <!DOCTYPE html> 2 <html lang='en'> 3 <head> 4 <title>struct-dom-18-f-manual.svg</title> 5 <meta charset='utf-8'> 6 </head> 7 <body> 8 <h1>Source SVG: struct-dom-18-f-manual.svg</h1> 9 <svg id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 10 <!--======================================================================--> 11 <!--= Copyright 2008 World Wide Web Consortium, (Massachusetts =--> 12 <!--= Institute of Technology, European Research Consortium for =--> 13 <!--= Informatics and Mathematics (ERCIM), Keio University). =--> 14 <!--= All Rights Reserved. =--> 15 <!--= See http://www.w3.org/Consortium/Legal/. =--> 16 <!--======================================================================--> 17 18 <title id="test-title">$RCSfile: struct-dom-18-f.svg,v $</title> 19 <defs> 20 <font-face 21 font-family="SVGFreeSansASCII" 22 unicode-range="U+0-7F"> 23 <font-face-src> 24 <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> 25 </font-face-src> 26 </font-face> 27 </defs> 28 <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> 29 <svg id="testSVG"> 30 <circle cx="96" cy="96" r="48" id="testCircle" /> 31 <ellipse cx="96" cy="96" rx="48" ry="48" id="testEllipse" /> 32 <line x1="10" y1="10" x2="10" y2="100" stroke="black" id="testLine" /> 33 <path d="M0 10 H 100" stroke-width="5" stroke="black" fill="none" id="testPath" /> 34 <polyline points="0,0 120,100 120,120" stroke="black" fill="black" id="testPolyline" /> 35 <polygon points="0,0 100,100" stroke="black" fill="black" id="testPolygon" /> 36 <rect width="96" height="96" id="testRect" /> 37 <use xlink:href="#testRect" id="testUse" /> 38 <image xlink:href="../images/black10x10.png" width="100" height="100" id="testImage" /> 39 <text x="100" y="100" fill="black" id="testText">Filler text</text> 40 </svg> 41 <text id="failText" x="350" y="350" font-size="50" fill="red">FAIL</text> 42 <script><![CDATA[ 43 try 44 { 45 var passedCount = 0; 46 var expectedIDList = ["testCircle", "testEllipse", "testLine", "testPath", "testPolyline", "testPolygon", "testRect", "testUse", "testImage", "testText"]; 47 var testSVG = document.getElementById("testSVG"); 48 var rectElem = testSVG.createSVGRect(); 49 50 rectElem.x = 10; 51 rectElem.y = 0; 52 rectElem.width = 130; 53 rectElem.height = 98; 54 55 var intersectionList = testSVG.getIntersectionList(rectElem, null); 56 57 if (null != intersectionList && expectedIDList.length == intersectionList.length) 58 { 59 passedCount++; 60 } 61 62 for (var i = 0; i < intersectionList.length; i++) 63 { 64 var curIntersection = intersectionList[i]; 65 var curExpectedId = expectedIDList[i]; 66 67 if (curExpectedId == curIntersection.id) 68 { 69 passedCount++; 70 } 71 // Special case for "use" and SVGElementInstance 72 else if (null != curIntersection.correspondingUseElement && curExpectedId == curIntersection.correspondingUseElement.id) 73 { 74 passedCount++; 75 } 76 } 77 78 rectElem.x = 0; 79 rectElem.y = 0; 80 rectElem.width = 200; 81 rectElem.height = 200; 82 83 var enclosureList = testSVG.getEnclosureList(rectElem, null); 84 85 if (null != enclosureList && expectedIDList.length == enclosureList.length) 86 { 87 passedCount++; 88 } 89 90 for (var i = 0; i < enclosureList.length; i++) 91 { 92 var curEnclosure = enclosureList[i]; 93 var curExpectedId = expectedIDList[i]; 94 95 if (curExpectedId == curEnclosure.id) 96 { 97 passedCount++; 98 } 99 // Special case for "use" and SVGElementInstance 100 else if (null != curEnclosure.correspondingUseElement && curExpectedId == curEnclosure.correspondingUseElement.id) 101 { 102 passedCount++; 103 } 104 } 105 106 if (22 == passedCount) 107 { 108 document.getElementById("failText").setAttribute("display", "none"); 109 } 110 } 111 catch(ex) 112 { 113 // alert('ERROR: ' + ex.message); 114 }]]> 115 </script> 116 </g> 117 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> 118 <text id="revision" x="10" y="340" stroke="none" 119 fill="black">$Revision: 1.4 $</text> 120 </g> 121 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> 122 <!-- comment out this watermark once the test is approved --> 123 <g id="draft-watermark"> 124 <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> 125 <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" 126 text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> 127 </g> 128 </svg> 129 </body> 130 </html>