| 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 |
|
| 8 |
Licensed to the Apache Software Foundation (ASF) under one or more |
| 9 |
contributor license agreements. See the NOTICE file distributed with |
| 10 |
this work for additional information regarding copyright ownership. |
| 11 |
The ASF licenses this file to You under the Apache License, Version 2.0 |
| 12 |
(the "License"); you may not use this file except in compliance with |
| 13 |
the License. You may obtain a copy of the License at |
| 14 |
|
| 15 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 16 |
|
| 17 |
Unless required by applicable law or agreed to in writing, software |
| 18 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 19 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 20 |
See the License for the specific language governing permissions and |
| 21 |
limitations under the License. |
| 22 |
|
| 23 |
--> |
| 24 |
<!-- ========================================================================= --> |
| 25 |
<!-- Tests support for the DOMFocusIn, DOMFocusOut, DOMActivate --> |
| 26 |
<!-- --> |
| 27 |
<!-- @author [email protected] --> |
| 28 |
<!-- @author [email protected] --> |
| 29 |
<!-- @version $Id$ --> |
| 30 |
<!-- ========================================================================= --> |
| 31 |
|
| 32 |
<?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?> |
| 33 |
|
| 34 |
<svg xmlns="http://www.w3.org/2000/svg" |
| 35 |
xmlns:xlink="http://www.w3.org/1999/xlink" |
| 36 |
id="body" width="450" height="500" viewBox="0 0 450 500"> |
| 37 |
|
| 38 |
<text class="title" x="50%" y="50">KeyEvents test<tspan x="50%" dy="1.3em">(type an upper case 'A' on each color)</tspan></text> |
| 39 |
|
| 40 |
<g id="body-content"> |
| 41 |
|
| 42 |
<rect onkeypress="set('orange', 'keypress')" onkeydown="set('orange', 'keydown')" onkeyup="set('orange', 'keypress')" |
| 43 |
x="100" y="100" width="100" height="100" style="fill:orange" /> |
| 44 |
|
| 45 |
<rect onkeypress="set('crimson', 'keypress')" onkeydown="set('crimson', 'keydown')" onkeyup="set('crimson', 'keypress')" |
| 46 |
x="250" y="100" width="100" height="100" style="fill:crimson" /> |
| 47 |
|
| 48 |
<rect onkeypress="set('gold', 'keypress')" onkeydown="set('gold', 'keydown')" onkeyup="set('gold', 'keypress')" |
| 49 |
x="100" y="250" width="100" height="100" style="fill:gold" /> |
| 50 |
|
| 51 |
<rect onkeypress="set('aaa', 'keypress')" onkeydown="set('aaa', 'keydown')" onkeyup="set('aaa', 'keypress')" |
| 52 |
x="250" y="250" width="100" height="100" style="fill:#aaa" /> |
| 53 |
|
| 54 |
<circle onkeypress="set('eee', 'keypress')" onkeydown="set('eee', 'keydown')" onkeyup="set('eee', 'keypress')" |
| 55 |
cx="225" cy="225" r="75" style="fill:#eee" /> |
| 56 |
|
| 57 |
</g> |
| 58 |
|
| 59 |
<script type="text/ecmascript"><![CDATA[ |
| 60 |
function set(color, state) { |
| 61 |
var elt = document.getElementById(color + "." + state); |
| 62 |
elt.setAttribute("fill", "green"); |
| 63 |
} |
| 64 |
|
| 65 |
function onDone() { |
| 66 |
if (!(regardTestInstance == null)) { |
| 67 |
regardTestInstance.scriptDone(); |
| 68 |
} else { |
| 69 |
alert("This button only works when run in the regard framework"); |
| 70 |
} |
| 71 |
} |
| 72 |
]]></script> |
| 73 |
|
| 74 |
<g fill="red" stroke="black" transform="translate(40, 420)"> |
| 75 |
<g transform="translate(0,0)"> |
| 76 |
<rect id="orange.keypress" width="20" height="20" /> |
| 77 |
<rect id="orange.keydown" x="25" width="20" height="20" /> |
| 78 |
<rect id="orange.keyup" x="50" width="20" height="20" /> |
| 79 |
</g> |
| 80 |
|
| 81 |
<g transform="translate(75,0)"> |
| 82 |
<rect id="crimson.keypress" width="20" height="20" /> |
| 83 |
<rect id="crimson.keydown" x="25" width="20" height="20" /> |
| 84 |
<rect id="crimson.keyup" x="50" width="20" height="20" /> |
| 85 |
</g> |
| 86 |
|
| 87 |
<g transform="translate(150,0)"> |
| 88 |
<rect id="gold.keypress" width="20" height="20" /> |
| 89 |
<rect id="gold.keydown" x="25" width="20" height="20" /> |
| 90 |
<rect id="gold.keyup" x="50" width="20" height="20" /> |
| 91 |
</g> |
| 92 |
|
| 93 |
<g transform="translate(225,0)"> |
| 94 |
<rect id="aaa.keypress" width="20" height="20" /> |
| 95 |
<rect id="aaa.keydown" x="25" width="20" height="20" /> |
| 96 |
<rect id="aaa.keyup" x="50" width="20" height="20" /> |
| 97 |
</g> |
| 98 |
|
| 99 |
<g transform="translate(300,0)"> |
| 100 |
<rect id="eee.keypress" width="20" height="20" /> |
| 101 |
<rect id="eee.keydown" x="25" width="20" height="20" /> |
| 102 |
<rect id="eee.keyup" x="50" width="20" height="20" /> |
| 103 |
</g> |
| 104 |
|
| 105 |
|
| 106 |
</g> |
| 107 |
|
| 108 |
<g id="done" transform="translate(195, 458)" cursor="pointer" onclick="onDone()"> |
| 109 |
<rect rx="5" ry="5" width="60" height="25" fill="#eeeeee" stroke="black" /> |
| 110 |
<text x="30" y="18" font-size="14" font-weight="bold" text-anchor="middle">Done</text> |
| 111 |
</g> |
| 112 |
|
| 113 |
|
| 114 |
</svg> |