Debian Codegraph @

samples/tests/spec/scripting/text.svg

raw
1 <?xml version="1.0" standalone="no"?>
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000802//EN"
3 "http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd">
4
5 <!--
6
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
13
14 http://www.apache.org/licenses/LICENSE-2.0
15
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
21
22 -->
23 <!-- ====================================================================== -->
24 <!-- Modification of a attributes -->
25 <!-- -->
26 <!-- @author [email protected] -->
27 <!-- @version $Id$ -->
28 <!-- ====================================================================== -->
29
30 <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>
31
32 <svg id="body" width="450" height="500" viewBox="0 0 450 500">
33 <title>&lt;text&gt; attributes 'onload'</title>
34
35 <text x="50%" y="45" class="title">&lt;text&gt; attributes in 'onload'</text>
36
37 <script type="text/ecmascript">
38
39 function initXY(evt, x, y) {
40 var elt = evt.target;
41 elt.setAttribute("x", x)
42 elt.setAttribute("y", y)
43 }
44 function initDXDY(evt, dx, dy) {
45 var elt = evt.target;
46 elt.setAttribute("dx", dx)
47 elt.setAttribute("dy", dy)
48 }
49 function initRotate(evt, rotate) {
50 var elt = evt.target;
51 elt.setAttribute("rotate", rotate)
52 }
53
54 </script>
55
56 <g id="test-content">
57 <g id="dynamic" style="fill:orange;stroke:none;font-size:32;text-anchor:middle" >
58
59 <text onload="initXY(evt,100,180)"
60 >EXAMPLE1</text>
61 <text onload="initDXDY(evt,200,300)"
62 >EXAMPLE2</text>
63 <text x="100" y="430" onload="initRotate(evt,-10)"
64 >EXAMPLE3</text>
65 <text onload="initXY(evt,'250 280 300 330 350 380 400 430','180 170 180 190 170 180 190 180')"
66 >EXAMPLE4</text>
67 <text onload="initDXDY(evt,'650 -20 20 -20 20 -20 20 -20','300 30 -30 30 -30 30 -30 30')"
68 >EXAMPLE5</text>
69 <text x="350" y="430" onload="initRotate(evt,'-10 10 -10 10 -10 10 -10 10')"
70 >EXAMPLE6</text>
71
72 </g>
73
74 <g id="expected" style="fill:none;stroke:black;stroke-width:1;font-size:32;text-anchor:middle">
75
76 <text x="100" y="180"
77 >EXAMPLE1</text>
78 <text dx="200" dy="300"
79 >EXAMPLE2</text>
80 <text x="100" y="430" rotate="-10"
81 >EXAMPLE3</text>
82 <text x="250 280 300 330 350 380 400 430" y="180 170 180 190 170 180 190 180"
83 >EXAMPLE4</text>
84 <text dx="650 -20 20 -20 20 -20 20 -20" dy="300 30 -30 30 -30 30 -30 30"
85 >EXAMPLE5</text>
86 <text x="350" y="430" rotate="-10 10 -10 10 -10 10 -10 10"
87 >EXAMPLE6</text>
88
89 </g>
90 </g>
91
92 <g id="legend" >
93 <g style="fill:black; stroke:none; text-anchor:middle">
94 <text x="100" y="230" >x, y</text>
95 <text x="100" y="350" >dx, dy</text>
96 <text x="100" y="470" >rotate</text>
97
98 <text x="350" y="230" >x, y ( list )</text>
99 <text x="350" y="350" >dx, dy ( list )</text>
100 <text x="350" y="470" >rotate ( list )</text>
101 </g>
102 </g>
103 </svg>