| 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 rect's x,y,width and height attributes in an --> |
| 25 |
<!-- 'onclick' event handler. This is actually mostly testing a change in --> |
| 26 |
<!-- the documents size. --> |
| 27 |
<!-- --> |
| 28 |
<!-- @author [email protected] --> |
| 29 |
<!-- @version $Id$ --> |
| 30 |
<!-- ========================================================================= --> |
| 31 |
<?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?> |
| 32 |
<svg xmlns="http://www.w3.org/2000/svg" id="body" width="450" height="500" viewBox="0 0 450 500"> |
| 33 |
<title><rect> width & hieght modification in 'onclick'</title> |
| 34 |
|
| 35 |
<script type="text/ecmascript"> |
| 36 |
|
| 37 |
function setRect(target, valX, valY, valW, valH){ |
| 38 |
var t = document.getElementById(target); |
| 39 |
t.setAttribute('x', valX); |
| 40 |
t.setAttribute('y', valY); |
| 41 |
t.setAttribute('width', valW); |
| 42 |
t.setAttribute('height', valH); |
| 43 |
} |
| 44 |
|
| 45 |
// This function is only called if test is run from regard. |
| 46 |
function regardStart() { |
| 47 |
setRect('targetRect', '5', '5', '440', '490'); |
| 48 |
setTimeout('regardTestInstance.scriptDone()', 100); |
| 49 |
} |
| 50 |
</script> |
| 51 |
|
| 52 |
<text x="50%" y="45" class="title"><rect> width & height modification in 'onclick'</text> |
| 53 |
|
| 54 |
|
| 55 |
<g id="test-content" > |
| 56 |
<rect style="fill:none; stroke:black" |
| 57 |
x="182" y="97" width="86" height="46" /> |
| 58 |
<text class="legend" x="225" y="160">Position A</text> |
| 59 |
|
| 60 |
<rect style="fill:none; stroke:black" |
| 61 |
x="182" y="177" width="86" height="46" /> |
| 62 |
<text class="legend" x="225" y="240">Click Target</text> |
| 63 |
|
| 64 |
<g stroke="black" |
| 65 |
onclick="setRect('targetRect', '5', '5', '440', '490')" > |
| 66 |
<circle cx="225" cy="200" r="10" fill="crimson"/> |
| 67 |
<line x1="225" x2="225" y1="185" y2="215" fill="none" /> |
| 68 |
<line x1="210" x2="240" y1="200" y2="200" fill="none" /> |
| 69 |
</g> |
| 70 |
|
| 71 |
<rect id="targetRect" fill="crimson" |
| 72 |
x="185" y="100" width="80" height="40" /> |
| 73 |
|
| 74 |
<text class="legend"> |
| 75 |
<tspan x="225" y="270">Click on the Click Target (crimson circle)</tspan> |
| 76 |
<tspan x="225" y="285">to resize the rectangle to fill the viewport.</tspan> |
| 77 |
<tspan x="225" y="300">Hiding everything but this text.</tspan> |
| 78 |
</text> |
| 79 |
</g> |
| 80 |
</svg> |