Debian Codegraph @

samples/tests/spec/scripting/gradientsUpdateRef.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 <!-- check updates on gradients, filter, mask, and clip regarding to -->
25 <!-- geometry updates -->
26 <!-- -->
27 <!-- @author [email protected] -->
28 <!-- @version $Id$ -->
29 <!-- ====================================================================== -->
30
31 <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>
32
33 <svg xmlns="http://www.w3.org/2000/svg"
34 xmlns:xlink="http://www.w3.org/1999/xlink"
35 id="body" width="450" height="500" viewBox="0 0 450 500">
36
37 <title>Gradients with geometry updates</title>
38
39 <text x="50%" y="45" class="title">Gradients with geometry updates</text>
40
41 <script type="text/ecmascript">
42
43 var svgNamespaceURI = "http://www.w3.org/2000/svg";
44
45 function move(evt) {
46 var x = parseFloat(evt.target.getAttribute("x"));
47 var y = parseFloat(evt.target.getAttribute("y"));
48 evt.target.setAttribute("x", x+80);
49 evt.target.setAttribute("y", y+80);
50 }
51
52 </script>
53
54 <defs>
55
56 <linearGradient id="linearObjectBoundingBox" x1="0" y1="0" x2="1" y2="1">
57 <stop offset="0" stop-color="crimson" />
58 <stop offset=".5" stop-color="orange" />
59 <stop offset="1" stop-color="gold" />
60 </linearGradient>
61
62 <linearGradient id="linearUserSpaceOnUse" x1="240" y1="100" x2="440" y2="290" gradientUnits="userSpaceOnUse">
63 <stop offset="0" stop-color="crimson" />
64 <stop offset=".5" stop-color="orange" />
65 <stop offset="1" stop-color="gold" />
66 </linearGradient>
67
68 <radialGradient id="radialObjectBoundingBox" cx=".5" cy=".5" r=".5" fx=".5" fy=".5">
69 <stop offset="0" stop-color="crimson" />
70 <stop offset=".5" stop-color="orange" />
71 <stop offset="1" stop-color="gold" />
72 </radialGradient>
73
74 <radialGradient id="radialUserSpaceOnUse" cx="340" cy="385" r="100" fx="340" fy="385" gradientUnits="userSpaceOnUse">
75 <stop offset="0" stop-color="crimson" />
76 <stop offset=".5" stop-color="orange" />
77 <stop offset="1" stop-color="gold" />
78 </radialGradient>
79
80 </defs>
81
82
83 <g id="test-content">
84
85 <g id="board" style="fill:none; stroke:black">
86 <rect x="40" y="80" width="200" height="20" style="fill:#eee"/>
87 <rect x="240" y="80" width="200" height="20" style="fill:#eee"/>
88
89 <rect x="40" y="100" width="200" height="380" />
90 <rect x="240" y="100" width="200" height="380" />
91
92 <line x1="20" y1="290" x2="440" y2="290" />
93 <rect x="20" y="100" width="20" height="190" style="fill:#eee"/>
94 <rect x="20" y="290" width="20" height="190" style="fill:#eee"/>
95
96 <g style="fill:black; stroke:none; text-anchor:middle">
97 <text x="134" y="94">objectBoundingBox</text>
98 <text x="314" y="94">userSpaceOnUse</text>
99 <text x="0" y="0" transform="translate(34 200)rotate(-90)">&lt;linearGradient></text>
100 <text x="0" y="0" transform="translate(34 380)rotate(-90)">&lt;radialGradient></text>
101 </g>
102 </g>
103
104 <rect onload="move(evt)" x="50" y="110" width="100" height="95" style="fill:url(#linearObjectBoundingBox)"/>
105 <rect onload="move(evt)" x="250" y="110" width="100" height="95" style="fill:url(#linearUserSpaceOnUse)"/>
106
107 <rect onload="move(evt)" x="50" y="300" width="100" height="95" style="fill:url(#radialObjectBoundingBox)"/>
108 <rect onload="move(evt)" x="250" y="300" width="100" height="95" style="fill:url(#radialUserSpaceOnUse)"/>
109
110 </g>
111
112
113
114 </svg>