coords-dom-01-f-novalid.html (3621B)
1 <!DOCTYPE html> 2 <html lang='en'> 3 <head> 4 <title>coords-dom-01-f-manual.svg</title> 5 <meta charset='utf-8'> 6 </head> 7 <body> 8 <h1>Source SVG: coords-dom-01-f-manual.svg</h1> 9 <svg id="svg-root" width="100%" height="100%" 10 viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg" 11 xmlns:xlink="http://www.w3.org/1999/xlink"> 12 <!--======================================================================--> 13 <!--= Copyright 2008 World Wide Web Consortium, (Massachusetts =--> 14 <!--= Institute of Technology, European Research Consortium for =--> 15 <!--= Informatics and Mathematics (ERCIM), Keio University). =--> 16 <!--= All Rights Reserved. =--> 17 <!--= See http://www.w3.org/Consortium/Legal/. =--> 18 <!--======================================================================--> 19 20 <title id="test-title">$RCSfile: coords-dom-01-f.svg,v $</title> 21 <defs> 22 <font-face 23 font-family="SVGFreeSansASCII" 24 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 32 33 <g transform="translate(240 180)"> 34 <g id="reference"> 35 <circle r="40" fill="red"/> 36 </g> 37 38 <g id="g" transform="translate(20 20)"> 39 <circle id="c" r="41" fill="blue"/> 40 </g> 41 </g> 42 43 <script type="text/ecmascript"><![CDATA[ 44 var eps = 1 / 65535; // 16.16 fixpoint epsilon 45 var passed = false; 46 47 function isequal( value, expected, epsilon ) 48 { 49 return(Math.abs(value - expected) < epsilon); 50 } 51 52 try 53 { 54 var g = document.getElementById("g"); 55 var c = document.getElementById("c"); 56 var tfm = g.transform.baseVal.getItem(0); 57 var mtx = tfm.matrix; 58 tfm.setTranslate(300,200); 59 if(tfm.type == SVGTransform.SVG_TRANSFORM_TRANSLATE && 60 isequal(mtx.e, 300, eps) && isequal(mtx.f, 200, eps)) 61 { 62 tfm.setScale(4,4); 63 if(tfm.type == SVGTransform.SVG_TRANSFORM_SCALE && 64 isequal(mtx.a, 4, eps) && isequal(mtx.d, 4, eps)) 65 { 66 tfm.setRotate(90,0,0); 67 if(tfm.type == SVGTransform.SVG_TRANSFORM_ROTATE && 68 isequal(mtx.a, Math.cos(Math.PI/2), eps) && isequal(mtx.b, Math.sin(Math.PI/2), eps) && 69 isequal(mtx.c, -Math.sin(Math.PI/2), eps) && isequal(mtx.d, Math.cos(Math.PI/2), eps) && 70 isequal(mtx.e, 0, eps) && isequal(mtx.f, 0, eps)) 71 { 72 passed = true; 73 } 74 } 75 } 76 } 77 catch(e) {} 78 79 if(passed) 80 { 81 c.setAttribute("fill", "lime"); 82 } 83 else 84 { 85 c.setAttribute("fill", "red"); 86 } 87 ]]></script> 88 89 </g> 90 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> 91 <text id="revision" x="10" y="340" stroke="none" 92 fill="black">$Revision: 1.8 $</text> 93 </g> 94 <rect xml:id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> 95 <!-- comment out this watermark once the test is approved --><!-- 96 <g id="draft-watermark"> 97 <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> 98 <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" 99 text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> 100 </g>--> 101 </svg> 102 </body> 103 </html>