Debian Codegraph @

test_non_regression/fail/na/script/struct-svg-01-f.svg

raw
1 <svg id="svg-root" width="100%" height="100%"
2 viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg"
3 xmlns:xlink="http://www.w3.org/1999/xlink">
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/"
12 template-version="1.4" reviewer="CL" author="Microsoft" status="accepted"
13 version="$Revision: 1.4 $" testname="$RCSfile: struct-svg-01-f.svg,v $">
14 <d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/struct.html#SVGElement">
15 <p>
16 The default values for 'width' and 'height' are '100%' and 'x' and 'y' are '0' for the 'svg' element.
17 </p>
18 </d:testDescription>
19 <d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
20 <p>
21 Empty 'svg' element is referenced via 'getElementById()'. From that reference, 'width', 'height', 'x', and 'y' are evaluated
22 via 'baseVal.valueAsString'. A failure of one or more tests is indicated by the word 'FAIL' in red text.
23 </p>
24 </d:operatorScript>
25 <d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
26 <p>
27 Test passes if there is no red visible on the page.
28 </p>
29 </d:passCriteria>
30 </d:SVGTestCase>
31 <title id="test-title">$RCSfile: struct-svg-01-f.svg,v $</title>
32 <defs>
33 <font-face
34 font-family="SVGFreeSansASCII"
35 unicode-range="U+0-7F">
36 <font-face-src>
37 <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
38 </font-face-src>
39 </font-face>
40 </defs>
41 <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
42
43 <svg id="testSVG" />
44
45 <text x="20" y="40">Initial value of the 'svg' tag's 'width' attribute: </text>
46 <text x="20" y="60" id="widthResult" />
47
48 <text x="20" y="100">Initial value of the 'svg' tag's 'height' attribute: </text>
49 <text x="20" y="120" id="heightResult" />
50
51 <text x="20" y="160">Initial value of the 'svg' tag's 'x' attribute: </text>
52 <text x="20" y="180" id="xResult" />
53
54 <text x="20" y="220">Initial value of the 'svg' tag's 'y' attribute: </text>
55 <text x="20" y="240" id="yResult" />
56
57 <text id="failText" x="350" y="350" font-size="50" fill="red">FAIL</text>
58
59 <script type="text/javascript"><![CDATA[
60 try
61 {
62 var testSVG = document.getElementById("testSVG");
63 var pass = true;
64
65 var initialWidth = testSVG.width.baseVal.valueAsString;
66 document.getElementById("widthResult").appendChild(document.createTextNode(initialWidth));
67
68 if("100%" != initialWidth)
69 {
70 pass = false;
71 }
72
73 var initialHeight = testSVG.height.baseVal.valueAsString;
74 document.getElementById("heightResult").appendChild(document.createTextNode(initialHeight));
75
76 if("100%" != initialHeight)
77 {
78 pass = false;
79 }
80
81 var initialX = testSVG.x.baseVal.valueAsString;
82 document.getElementById("xResult").appendChild(document.createTextNode(initialX ));
83
84 if("0" != initialX )
85 {
86 pass = false;
87 }
88
89 var initialY = testSVG.y.baseVal.valueAsString;
90 document.getElementById("yResult").appendChild(document.createTextNode(initialY));
91
92 if("0" != initialY )
93 {
94 pass = false;
95 }
96
97 if(pass)
98 {
99 document.getElementById("failText").setAttribute("display", "none");
100 }
101 }
102 catch(ex)
103 {
104 //alert('ERROR: ' + ex.message);
105 }]]>
106 </script>
107
108 </g>
109 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
110 <text id="revision" x="10" y="340" stroke="none"
111 fill="black">$Revision: 1.4 $</text>
112 </g>
113 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>
114 <!-- comment out this watermark once the test is approved -->
115 <!--
116 <g id="draft-watermark">
117 <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
118 <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
119 text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
120 </g>
121 -->
122 </svg>
123