| 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 |
<!-- Dynamic update for use --> |
| 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" xmlns:xlink="http://www.w3.org/1999/xlink" id="body" width="450" height="500" viewBox="0 0 450 500"> |
| 32 |
<title>Update on <use></title> |
| 33 |
|
| 34 |
<text x="50%" y="45" class="title">x/y/transform update on <use></text> |
| 35 |
|
| 36 |
<script type="text/ecmascript"> <![CDATA[ |
| 37 |
var xlinkNS = 'http://www.w3.org/1999/xlink'; |
| 38 |
var svgNS = 'http://www.w3.org/2000/svg'; |
| 39 |
|
| 40 |
function runTest(){ |
| 41 |
document.getElementById('x').setAttributeNS(null, 'x', '20'); |
| 42 |
document.getElementById('y').setAttributeNS(null, 'y', '15'); |
| 43 |
document.getElementById('transform').setAttributeNS(null, 'transform', 'rotate(20)'); |
| 44 |
document.getElementById('xlink').setAttributeNS(xlinkNS, 'xlink:href', '#symbol2'); |
| 45 |
|
| 46 |
var mutated = document.getElementById('mutatedSymbol'); |
| 47 |
while(mutated.firstChild != null) { |
| 48 |
mutated.removeChild(mutated.firstChild); |
| 49 |
} |
| 50 |
var r = document.createElementNS(svgNS, 'rect'); |
| 51 |
r.setAttributeNS(null, "x", "-10"); |
| 52 |
r.setAttributeNS(null, "y", "-10"); |
| 53 |
r.setAttributeNS(null, "width", "20"); |
| 54 |
r.setAttributeNS(null, "height", "20"); |
| 55 |
r.setAttributeNS(null, "stroke-width", "4"); |
| 56 |
r.setAttributeNS(null, "stroke", "gold"); |
| 57 |
r.setAttributeNS(null, "fill", "crimson"); |
| 58 |
mutated.appendChild(r); |
| 59 |
|
| 60 |
var t = document.createElementNS(svgNS, "text"); |
| 61 |
mutated.appendChild(t); |
| 62 |
t.setAttributeNS(null, "text-anchor", "middle"); |
| 63 |
t.setAttributeNS(null, "fill", "gold"); |
| 64 |
t.setAttributeNS(null, "stroke", "none"); |
| 65 |
t.setAttributeNS(null, "y", "5"); |
| 66 |
var msg = document.createTextNode("Hello"); |
| 67 |
t.appendChild(msg); |
| 68 |
|
| 69 |
msg.data = "Hi"; |
| 70 |
} |
| 71 |
|
| 72 |
]]> </script> <rect id="symbol" x="-10" y="-10" width="20" height="20" /> |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
<defs> |
| 77 |
<rect id="symbol" x="-10" y="-10" width="20" height="20" /> |
| 78 |
<rect id="symbol2" x="-10" y="-10" width="20" height="20" stroke-width="4" stroke="gold" fill="crimson" /> |
| 79 |
|
| 80 |
<g id="mutatedSymbolReference"> |
| 81 |
<rect x="-10" y="-10" width="20" height="20" stroke-width="4" stroke="gold" fill="crimson" /> |
| 82 |
<text text-anchor="middle" y="5" fill="gold" stroke="none">Hi</text> |
| 83 |
</g> |
| 84 |
|
| 85 |
<g id="mutatedSymbol"> |
| 86 |
<rect x="-12" y="-12" width="24" height="24" class="reference" /> |
| 87 |
</g> |
| 88 |
|
| 89 |
<rect id="titleCell" x="-60" y="-15" width="120" height="20" /> |
| 90 |
<rect id="tableCell" x="-60" y="-20" width="120" height="40" /> |
| 91 |
<rect id="button" x="-30" y="-15" width="60" height="20" /> |
| 92 |
|
| 93 |
</defs> |
| 94 |
|
| 95 |
<style type="text/css"><![CDATA[ |
| 96 |
use.tableHeader { |
| 97 |
fill: #eeeeee; |
| 98 |
stroke: black; |
| 99 |
} |
| 100 |
|
| 101 |
text.tableHeader { |
| 102 |
text-anchor: middle; |
| 103 |
stroke: none; |
| 104 |
fill: black; |
| 105 |
} |
| 106 |
|
| 107 |
use.tableCell { |
| 108 |
fill: white; |
| 109 |
stroke: black; |
| 110 |
} |
| 111 |
|
| 112 |
text.tableCell { |
| 113 |
text-anchor: middle; |
| 114 |
stroke: none; |
| 115 |
fill: black; |
| 116 |
} |
| 117 |
|
| 118 |
use.button { |
| 119 |
fill: #eeeeee; |
| 120 |
stroke: black; |
| 121 |
} |
| 122 |
|
| 123 |
text.button { |
| 124 |
fill: black; |
| 125 |
stroke: none; |
| 126 |
text-anchor: middle; |
| 127 |
} |
| 128 |
|
| 129 |
.reference { |
| 130 |
fill: none; |
| 131 |
stroke: black; |
| 132 |
} |
| 133 |
|
| 134 |
.symbol { |
| 135 |
fill: gold; |
| 136 |
stroke: crimson; |
| 137 |
stroke-width: 4; |
| 138 |
} |
| 139 |
|
| 140 |
]]></style> |
| 141 |
|
| 142 |
<g transform="translate(165, 120)"> |
| 143 |
<g id="tableHeader" class="tableHeader"> |
| 144 |
<g> |
| 145 |
<use class="tableHeader" xlink:href="#titleCell" /> |
| 146 |
<text class="tableHeader">Attribute</text> |
| 147 |
</g> |
| 148 |
|
| 149 |
<g transform="translate(120,0)"> |
| 150 |
<use class="tableHeader" xlink:href="#titleCell" /> |
| 151 |
<text class="tableHeader"><use> and ref</text> |
| 152 |
</g> |
| 153 |
|
| 154 |
</g> |
| 155 |
|
| 156 |
<g id="xRow" transform="translate(0,25)"> |
| 157 |
<g> |
| 158 |
<use class="tableCell" xlink:href="#tableCell" /> |
| 159 |
<text class="tableCell">x</text> |
| 160 |
</g> |
| 161 |
|
| 162 |
<g transform="translate(120,0)" > |
| 163 |
<use class="tableCell" xlink:href="#tableCell" /> |
| 164 |
<use id="x" x="10" y="5" class="symbol" xlink:href="#symbol"/> |
| 165 |
<use x="20" y="5" class="reference" xlink:href="#symbol"/> |
| 166 |
</g> |
| 167 |
|
| 168 |
</g> |
| 169 |
|
| 170 |
<g id="yRow" transform="translate(0,65)"> |
| 171 |
<g> |
| 172 |
<use class="tableCell" xlink:href="#tableCell" /> |
| 173 |
<text class="tableCell">y</text> |
| 174 |
</g> |
| 175 |
|
| 176 |
<g transform="translate(120,0)" > |
| 177 |
<use class="tableCell" xlink:href="#tableCell" /> |
| 178 |
<use id="y" x="10" y="0" class="symbol" xlink:href="#symbol"/> |
| 179 |
<use x="10" y="15" class="reference" xlink:href="#symbol"/> |
| 180 |
</g> |
| 181 |
|
| 182 |
</g> |
| 183 |
|
| 184 |
<g id="transformRow" transform="translate(0,105)"> |
| 185 |
<g> |
| 186 |
<use class="tableCell" xlink:href="#tableCell" /> |
| 187 |
<text class="tableCell">transform</text> |
| 188 |
</g> |
| 189 |
|
| 190 |
<g transform="translate(120,0)" > |
| 191 |
<use class="tableCell" xlink:href="#tableCell" /> |
| 192 |
<use id="transform" |
| 193 |
x="10" y="5" class="symbol" xlink:href="#symbol"/> |
| 194 |
<use x="10" y="5" transform="rotate(20)" class="reference" xlink:href="#symbol"/> |
| 195 |
</g> |
| 196 |
|
| 197 |
</g> |
| 198 |
|
| 199 |
<g id="xlinkRow" transform="translate(0,145)"> |
| 200 |
<g> |
| 201 |
<use class="tableCell" xlink:href="#tableCell" /> |
| 202 |
<text class="tableCell">xlink:href</text> |
| 203 |
</g> |
| 204 |
|
| 205 |
<g transform="translate(120,0)" > |
| 206 |
<use class="tableCell" xlink:href="#tableCell" /> |
| 207 |
<use id="xlink" |
| 208 |
x="5" y="0" class="symbol" xlink:href="#symbol"/> |
| 209 |
<use x="5" y="0" class="reference" xlink:href="#symbol"/> |
| 210 |
</g> |
| 211 |
|
| 212 |
</g> |
| 213 |
|
| 214 |
<g id="mutation" transform="translate(0,185)"> |
| 215 |
<g> |
| 216 |
<use class="tableCell" xlink:href="#tableCell" /> |
| 217 |
<text class="tableCell">mutation</text> |
| 218 |
</g> |
| 219 |
|
| 220 |
<g transform="translate(120,0)" > |
| 221 |
<use class="tableCell" xlink:href="#tableCell" /> |
| 222 |
<use id="xlink" |
| 223 |
x="-25" y="0" class="symbol" xlink:href="#mutatedSymbolReference"/> |
| 224 |
<use x="25" y="0" class="reference" xlink:href="#mutatedSymbol"/> |
| 225 |
</g> |
| 226 |
|
| 227 |
</g> |
| 228 |
|
| 229 |
<g onclick="runTest()" transform="translate(0, 80)"> |
| 230 |
<use class="button" xlink:href="#button" x="60" y="200" /> |
| 231 |
<text class="button" x="60" y="200">Run Test</text> |
| 232 |
</g> |
| 233 |
</g> |
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
<script type="text/ecmascript"><![CDATA[ |
| 238 |
function onDone() { |
| 239 |
if (!(regardTestInstance == null)) { |
| 240 |
regardTestInstance.scriptDone(); |
| 241 |
} else { |
| 242 |
alert("This button only works when run in the regard framework"); |
| 243 |
} |
| 244 |
} |
| 245 |
]]></script> |
| 246 |
<g id="done" transform="translate(195, 468)" cursor="pointer" onclick="onDone()"> |
| 247 |
<rect rx="5" ry="5" width="60" height="25" fill="#eeeeee" stroke="black" /> |
| 248 |
<text x="30" y="18" font-size="14" font-weight="bold" text-anchor="middle">Done</text> |
| 249 |
</g> |
| 250 |
|
| 251 |
|
| 252 |
</svg> |
| 253 |
|