Debian Codegraph @

samples/tests/spec/scripting/xyModifOnLoad.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 an element used in a BackgroundImage -->
25 <!-- -->
26 <!-- @author [email protected] -->
27 <!-- @version $Id$ -->
28 <!-- ====================================================================== -->
29 <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>
30 <svg id="body" width="450" height="500" viewBox="0 0 450 500">
31 <title>&lt;rect&gt; x modification in 'onload'</title>
32
33 <text x="50%" y="45" class="title">&lt;rect&gt; x modification in 'onload'</text>
34
35 <script type="text/ecmascript">
36
37 function setXTo(evt, val){
38 // alert('In setXTo');
39 var r = evt.getTarget();
40 r.setAttribute('x', val);
41 }
42
43 </script>
44
45 <g id="test-content" transform="translate(0,125)">
46 <g transform="translate(75,0)">
47 <rect id="originalPlaceShadow" x="35" y="80" width="80" height="40" style="fill:crimson;"/>
48 <rect id="originalPlaceShadowBorder" x="32" y="77" width="86" height="46" style="fill:none; stroke:black" />
49
50 <text class="legend" x="75" y="135">&lt;rect&gt; position</text>
51 <text class="legend" x="75" y="150">before onload</text>
52 </g>
53
54 <g transform="translate(225,0)">
55 <rect id="targetPlaceShadow" x="35" y="80" width="80" height="40" style="fill:crimson;"/>
56 <rect id="targetPlaceShadowBorder" x="32" y="77" width="86" height="46" style="fill:none; stroke:black" />
57
58 <text class="legend" x="75" y="135">&lt;rect&gt; position</text>
59 <text class="legend" x="75" y="150">after onload</text>
60 </g>
61
62 <rect id="targetRect" x="110" y="80" width="80" height="40" style="fill:orange" onload="setXTo(evt,'260')"/>
63
64 <text class="legend" x="225" y="185">The modified rectangle is orange</text>
65 <text class="legend" x="225" y="200">and should show on the right</text>
66 </g>
67 </svg>