| 1 |
<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"> |
| 2 |
<!--======================================================================--> |
| 3 |
<!--= SVG 1.1 2nd Edition Test Case =--> |
| 4 |
<!--======================================================================--> |
| 5 |
<!--= Copyright 2008 World Wide Web Consortium, (Massachusetts =--> |
| 6 |
<!--= Institute of Technology, European Research Consortium for =--> |
| 7 |
<!--= Informatics and Mathematics (ERCIM), Keio University). =--> |
| 8 |
<!--= All Rights Reserved. =--> |
| 9 |
<!--= See http://www.w3.org/Consortium/Legal/. =--> |
| 10 |
<!--======================================================================--> |
| 11 |
<d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/" template-version="1.4" reviewer="[reviewer]" author="Microsoft" status="created" version="$Revision: 1.5 $" testname="$RCSfile: struct-dom-16-f.svg,v $"> |
| 12 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://dev.w3.org/SVG/profiles/1.1F2/publish/struct.html#InterfaceSVGSVGElement"> |
| 13 |
<p> |
| 14 |
The 'SVGSVGElement' interface allows for creation of references to various primitive SVG interface types with explicitly defined default values. |
| 15 |
</p> |
| 16 |
<p> |
| 17 |
A reference to an 'SVGSVGElement' is obtained through an 'svg' element in the page's markup. Each of the 'CreateSVG*' methods is called from this |
| 18 |
reference and initial values are verified. A counter is used to determine whether all conditions are satisfied. The word 'fail' in red via an SVG |
| 19 |
'text' element is used to indicate failure and the word 'pass' in black is used to indicate passing. |
| 20 |
</p> |
| 21 |
</d:testDescription> |
| 22 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 23 |
<p> |
| 24 |
Run the test. No interaction required. |
| 25 |
</p> |
| 26 |
</d:operatorScript> |
| 27 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 28 |
<p> |
| 29 |
Test passes if there is no red visible on the page. |
| 30 |
</p> |
| 31 |
</d:passCriteria> |
| 32 |
</d:SVGTestCase> |
| 33 |
<title id="test-title">$RCSfile: struct-dom-16-f.svg,v $</title> |
| 34 |
<defs> |
| 35 |
<font-face |
| 36 |
font-family="SVGFreeSansASCII" |
| 37 |
unicode-range="U+0-7F"> |
| 38 |
<font-face-src> |
| 39 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 40 |
</font-face-src> |
| 41 |
</font-face> |
| 42 |
</defs> |
| 43 |
<g id="test-body-content" font-size="18"> |
| 44 |
<svg id="testSVG" /> |
| 45 |
<text id="failText" x="350" y="350" font-size="50" fill="red">FAIL</text> |
| 46 |
<text id="passText" x="350" y="300" font-size="50" display="none">PASS</text> |
| 47 |
<script type="text/javascript"> |
| 48 |
<![CDATA[ |
| 49 |
try |
| 50 |
{ |
| 51 |
var passCount = 0; |
| 52 |
var testSVG = document.getElementById("testSVG"); |
| 53 |
|
| 54 |
var testSVGNumber = testSVG.createSVGNumber(); |
| 55 |
if (0 == testSVGNumber.value) |
| 56 |
{ |
| 57 |
passCount++; |
| 58 |
} |
| 59 |
|
| 60 |
var testSVGLength = testSVG.createSVGLength(); |
| 61 |
if (0 == testSVGLength.value) |
| 62 |
{ |
| 63 |
passCount++; |
| 64 |
} |
| 65 |
|
| 66 |
var testSVGAngle = testSVG.createSVGAngle(); |
| 67 |
if (0 == testSVGAngle.value) |
| 68 |
{ |
| 69 |
passCount++; |
| 70 |
} |
| 71 |
|
| 72 |
var testSVGPoint = testSVG.createSVGPoint(); |
| 73 |
if (0 == testSVGPoint.x && 0 == testSVGPoint.y) |
| 74 |
{ |
| 75 |
passCount++; |
| 76 |
} |
| 77 |
|
| 78 |
var testSVGMatrix = testSVG.createSVGMatrix(); |
| 79 |
if (1 == testSVGMatrix.a && 0 == testSVGMatrix.b && 0 == testSVGMatrix.c && 1 == testSVGMatrix.d && 0 == testSVGMatrix.e && 0 == testSVGMatrix.f) |
| 80 |
{ |
| 81 |
passCount++; |
| 82 |
} |
| 83 |
|
| 84 |
var testSVGRect = testSVG.createSVGRect(); |
| 85 |
if (0 == testSVGRect.x && 0 == testSVGRect.y && 0 == testSVGRect.width && 0 == testSVGRect.height) |
| 86 |
{ |
| 87 |
passCount++; |
| 88 |
} |
| 89 |
|
| 90 |
var testSVGTransform = testSVG.createSVGTransform(); |
| 91 |
if (1 == testSVGTransform.type && 0 == testSVGTransform.angle && 1 == testSVGTransform.matrix.a && 0 == testSVGTransform.matrix.b && 0 == testSVGTransform.matrix.c && 1 == testSVGTransform.matrix.d && 0 == testSVGTransform.matrix.e && 0 == testSVGTransform.matrix.f) |
| 92 |
{ |
| 93 |
passCount++; |
| 94 |
} |
| 95 |
|
| 96 |
var testSVGTransformFromMatrix = testSVG.createSVGTransformFromMatrix(testSVGMatrix); |
| 97 |
if (1 == testSVGTransformFromMatrix.type && 0 == testSVGTransformFromMatrix.angle && 1 == testSVGTransformFromMatrix.matrix.a && 0 == testSVGTransformFromMatrix.matrix.b && 0 == testSVGTransformFromMatrix.matrix.c && 1 == testSVGTransformFromMatrix.matrix.d && 0 == testSVGTransformFromMatrix.matrix.e && 0 == testSVGTransformFromMatrix.matrix.f) |
| 98 |
{ |
| 99 |
passCount++; |
| 100 |
} |
| 101 |
|
| 102 |
if (8 == passCount) |
| 103 |
{ |
| 104 |
document.getElementById("failText").setAttribute("display", "none"); |
| 105 |
document.getElementById("passText").setAttribute("display", "inline"); |
| 106 |
} |
| 107 |
} |
| 108 |
catch(ex) |
| 109 |
{ |
| 110 |
alert("ERROR: " + ex.message); |
| 111 |
|
| 112 |
} |
| 113 |
]]> |
| 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.5 $</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> |