Debian Codegraph @

samples/tests/spec/scripting/bug12933.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 <!-- test for bug in updateTracker -->
25 <!-- -->
26 <!-- @author [email protected] -->
27 <!-- @version $Id$ -->
28 <!-- ========================================================================= -->
29 <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>
30
31 <svg xmlns="http://www.w3.org/2000/svg"
32 xmlns:xlink="http://www.w3.org/1999/xlink"
33 id="body" width="450" height="500"
34 viewBox="0 0 450 500">
35
36 <title>UpdateTracker bug#12933</title>
37
38 <style type="text/css"><![CDATA[
39
40 ]]></style>
41 <script type="text/ecmascript" >
42 var xlinkNS = "http://www.w3.org/1999/xlink";
43 var SVGNS ="http://www.w3.org/2000/svg";
44
45 function showBBox(name){
46 var e = document.getElementById(name);
47 var rect = document.createElementNS(SVGNS,"rect");
48
49 var bbox = e.getBBox();
50 rect.setAttribute("x",bbox.getX());
51 rect.setAttribute("y",bbox.getY());
52 rect.setAttribute("width",bbox.getWidth());
53 rect.setAttribute("height",bbox.getHeight());
54 rect.setAttribute("style","stroke:red;fill:none");
55 document.getDocumentElement().appendChild(rect);
56 }
57
58 function move(before,first,second){
59 var e1 = document.getElementById(before);
60 var e2 = document.getElementById(first);
61 var e3 = document.getElementById(second);
62
63 e1.getParentNode().insertBefore(e3,e1);
64 e1.getParentNode().insertBefore(e2,e3);
65 }
66 </script>
67
68 <g id="content">
69
70 <text class="title" x="50%" y="40">UpdateTracker bug#12933</text>
71
72
73 <circle id="circle" cx="75" cy="125" r="30" fill="coral" stroke="black"/>
74 <rect id="rect" x="100" y="100" width="100" height="50" fill="darkorange" stroke="black"/>
75 <polygon id="polygon"
76 points="75,125 120,180 140,140 150,190 140,210 120,180 100,210 90,180"
77 fill="cornsilk" stroke="black"/>
78
79
80 <rect x="70" y="300" width="50" height="50" stroke="black" fill="crimson"
81 onclick="move('circle','rect','polygon')"/>
82
83 <rect x="150" y="300" width="50" height="50" stroke="black" fill="crimson"
84 onclick="showBBox('rect')"/>
85
86 <text x="80" y="340" fill="black" font-weight="bold">1</text>
87 <text x="160" y="340" fill="black" font-weight="bold">2</text>
88
89 <text x="50%" y="400" text-anchor="middle" >Click 1 and 2, the bounding box of &lt;rect&gt; should appear in red</text>
90
91 </g>
92
93 <script type="text/ecmascript"><![CDATA[
94 function onDone() {
95 if (!(regardTestInstance == null)) {
96 regardTestInstance.scriptDone();
97 } else {
98 alert("This button only works when run in the regard framework");
99 }
100 }
101 ]]></script>
102 <g id="done" transform="translate(195, 458)" cursor="pointer" onclick="onDone()">
103 <rect rx="5" ry="5" width="60" height="25" fill="#eeeeee" stroke="black" />
104 <text x="30" y="18" font-size="14" font-weight="bold" text-anchor="middle">Done</text>
105 </g>
106
107 <!-- ============================================================= -->
108 <!-- Batik sample mark -->
109 <!-- ============================================================= -->
110 <use xlink:href="../../../batikLogo.svg#Batik_Tag_Box" />
111
112 </svg>
113