| 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 a tspan attributes --> |
| 25 |
<!-- --> |
| 26 |
<!-- @author [email protected] --> |
| 27 |
<!-- @version $Id$ --> |
| 28 |
<!-- ====================================================================== --> |
| 29 |
|
| 30 |
<?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?> |
| 31 |
|
| 32 |
<svg id="body" width="450" height="500" viewBox="0 0 450 500" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| 33 |
<title><tspan> attributes 'onload'</title> |
| 34 |
|
| 35 |
<text x="50%" y="45" class="title"><tspan> attributes in 'onload'</text> |
| 36 |
|
| 37 |
<script type="text/ecmascript"><![CDATA[ |
| 38 |
|
| 39 |
function initXY(evt, x, y) { |
| 40 |
var elt = evt.target; |
| 41 |
elt.setAttribute("x", x) |
| 42 |
elt.setAttribute("y", y) |
| 43 |
} |
| 44 |
function initDXDY(evt, dx, dy) { |
| 45 |
var elt = evt.target; |
| 46 |
elt.setAttribute("dx", dx) |
| 47 |
elt.setAttribute("dy", dy) |
| 48 |
} |
| 49 |
function initRotate(evt, rotate) { |
| 50 |
var elt = evt.target; |
| 51 |
elt.setAttribute("rotate", rotate) |
| 52 |
} |
| 53 |
|
| 54 |
]]></script> |
| 55 |
|
| 56 |
<g id="test-content"> |
| 57 |
|
| 58 |
<g id="dynamic" style="fill:orange;stroke:none;font-size:32;text-anchor:middle" > |
| 59 |
|
| 60 |
<text x="35" y="180" >E<tspan onload="initXY(evt,120,180)" |
| 61 |
>XAMPLE</tspan>1</text> |
| 62 |
<text ><tspan onload="initDXDY(evt,200,300)" |
| 63 |
>EXAMPLE2</tspan></text> |
| 64 |
<text><tspan x="100" y="430" onload="initRotate(evt,-10)" |
| 65 |
>EXAMPLE3</tspan></text> |
| 66 |
<text><tspan onload="initXY(evt,'250 280 300 330 350 380 400 430','180 170 180 190 170 180 190 180')" |
| 67 |
>EXAMPLE4</tspan></text> |
| 68 |
<text><tspan onload="initDXDY(evt,'650 -20 20 -20 20 -20 20 -20','300 30 -30 30 -30 30 -30 30')" |
| 69 |
>EXAMPLE5</tspan></text> |
| 70 |
<text><tspan x="350" y="430" onload="initRotate(evt,'-10 10 -10 10 -10 10 -10 10')" |
| 71 |
>EXAMPLE6</tspan></text> |
| 72 |
|
| 73 |
</g> |
| 74 |
|
| 75 |
<g id="expected" style="fill:none;stroke:black;stroke-width:1;font-size:32;text-anchor:middle"> |
| 76 |
|
| 77 |
<text x="35" y="180" >E<tspan x="120" y="180" |
| 78 |
>XAMPLE</tspan>1</text> |
| 79 |
<text onclick="showBBox(evt)"><tspan dx="200" dy="300" |
| 80 |
>EXAMPLE2</tspan></text> |
| 81 |
<text><tspan x="100" y="430" rotate="-10" onclick="showBBox(evt)" |
| 82 |
>EXAMPLE3</tspan></text> |
| 83 |
<text><tspan x="250 280 300 330 350 380 400 430" y="180 170 180 190 170 180 190 180" onclick="showBBox(evt)" |
| 84 |
>EXAMPLE4</tspan></text> |
| 85 |
<text onclick="showBBox(evt)" ><tspan dx="650 -20 20 -20 20 -20 20 -20" dy="300 30 -30 30 -30 30 -30 30" |
| 86 |
>EXAMPLE5</tspan></text> |
| 87 |
<text><tspan x="350" y="430" rotate="-10 10 -10 10 -10 10 -10 10" onclick="showBBox(evt)" |
| 88 |
>EXAMPLE6</tspan></text> |
| 89 |
|
| 90 |
</g> |
| 91 |
</g> |
| 92 |
|
| 93 |
<g id="legend" > |
| 94 |
<g style="fill:black; stroke:none; text-anchor:middle"> |
| 95 |
<text x="100" y="230" >x, y</text> |
| 96 |
<text x="100" y="350" >dx, dy</text> |
| 97 |
<text x="100" y="470" >rotate</text> |
| 98 |
|
| 99 |
<text x="350" y="230" >x, y ( list )</text> |
| 100 |
<text x="350" y="350" >dx, dy ( list )</text> |
| 101 |
<text x="350" y="470" >rotate ( list )</text> |
| 102 |
</g> |
| 103 |
</g> |
| 104 |
</svg> |