Debian Codegraph @

samples/tests/spec/scripting/svg.svg

raw
1 <?xml version="1.0" standalone="no"?>
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
3 "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.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 <!-- append child test -->
25 <!-- -->
26 <!-- @author [email protected] -->
27 <!-- @version $Id$ -->
28 <!-- ====================================================================== -->
29
30 <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>
31
32 <svg xmlns="http://www.w3.org/2000/svg"
33 xmlns:xlink="http://www.w3.org/1999/xlink"
34 id="body" width="450" height="500" viewBox="0 0 450 500">
35
36 <title>svg viewport modification 'onclick'</title>
37
38 <text x="50%" y="45" class="title">svg viewport modification 'onclick'</text>
39
40 <script type="text/ecmascript">
41
42 function changeSize(evt) {
43 var e = evt.currentTarget;
44 e.setAttribute("x", "10%");
45 e.setAttribute("y", "10%");
46 e.setAttribute("width", "80%");
47 e.setAttribute("height", "80%");
48 }
49
50 </script>
51
52 <g id="test-content">
53
54 <svg onclick="changeSize(evt)"
55 x="25%" y="25%" width="50%" height="50%" >
56 <rect width="100%" height="100%" fill="crimson" />
57 </svg>
58
59 </g>
60
61
62
63 <script type="text/ecmascript"><![CDATA[
64 function onDone() {
65 if (!(regardTestInstance == null)) {
66 regardTestInstance.scriptDone();
67 } else {
68 alert("This button only works when run in the regard framework");
69 }
70 }
71 ]]></script>
72 <g id="done" transform="translate(195, 468)" cursor="pointer" onclick="onDone()">
73 <rect rx="5" ry="5" width="60" height="25" fill="#eeeeee" stroke="black" />
74 <text x="30" y="18" font-size="14" font-weight="bold" text-anchor="middle">Done</text>
75 </g>
76
77
78 </svg>