1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE svg PUBLIC
"-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
3 <!--======================================================================-->
4 <!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
5 <!--= Institute of Technology, Institut National de Recherche en =-->
6 <!--= Informatique et en Automatique, Keio University). All Rights =-->
7 <!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
8 <!--======================================================================-->
9 <!--======================================================================-->
10 <!-- script-uiEvents-BE-02.svg -->
11 <!-- renamed for 1.1 suite to script-handle-02-b -->
12 <!-- Author : Vincent Hardy, March 27, 2000 -->
13 <!--======================================================================-->
15 <svg version=
"1.1" baseProfile=
"basic" xmlns=
"http://www.w3.org/2000/svg" xmlns:
xlink=
"http://www.w3.org/1999/xlink" id=
"svg-root" width=
"100%" height=
"100%" viewBox=
"0 0 480 360">
16 <SVGTestCase xmlns=
"http://www.w3.org/2000/02/svg/testsuite/description/">
17 <OperatorScript version=
"$Revision: 1.1 $" testname=
"script-handle-02-b.svg">
19 Tests basic mouse event handlers.
22 The test shows a target that can be used to generate the various
23 kinds of mouse and keyboard events supported in SVG. Below the
24 target, the list of events is shown with red markers next to each.
27 If the test passes, all the markers should have turned to green
28 after the events have been triggered on the target. If any event
29 has not triggered, its marker will remain red.
33 <title id=
"test-title">script-handle-
02-b
</title>
35 This test validates basic support for the mouse events defined in SVG.
37 <!--======================================================================-->
38 <!--Content of Test Case follows... =====================-->
39 <!--======================================================================-->
40 <g id=
"test-body-content">
42 <!-- Displayed Title -->
43 <text x=
"100" y=
"40" fill=
"black" font-size=
"24" >
44 Mouse event handlers test.
47 <!-- The test defines a target and defines all the handlers for the target -->
48 <!-- There are legends for each handler that are modified after the handler-->
49 <!-- has been invoked -->
51 <g id=
"targetGroup" transform=
"translate(60, 140)">
52 <text x=
"-40" y=
"-50" font-size=
"32">Target
</text>
53 <text x=
"60" y=
"7" font-size=
"24">Use the target to trigger events
</text>
54 <!-- The target has all the event handlers defined -->
55 <!-- Use this <g> instead -->
57 onfocusin=
"onEvent(evt, 'onfocusin')"
58 onfocusout=
"onEvent(evt, 'onfocusout')"
59 onactivate=
"onEvent(evt, 'onactivate')" >
61 <circle cx=
"0" cy=
"0" r=
"30" fill=
"#cccccc" stroke=
"black" />
62 <line x1=
"-30" y1=
"0" x2=
"30" y2=
"0"/>
63 <line x1=
"0" y1=
"-30" x2=
"0" y2=
"30"/>
65 </g> <!-- targetGroup -->
68 <g id=
"mouseEvents" transform=
"translate(65, 190)">
69 <g id=
"mouseEventsLabels">
70 <text x=
"10" y=
"20" font-size=
"32">onfocusin
</text>
71 <text x=
"10" y=
"50" font-size=
"32">onfocusout
</text>
72 <text x=
"10" y=
"80" font-size=
"32">onactivate
</text>
74 <g id=
"mouseEventsTestIndicators">
76 <rect x=
"-15" y=
"2" width=
"20" height=
"20" fill=
"green" />
77 <rect id=
"onfocusin" x=
"-15" y=
"2" width=
"20" height=
"20" fill=
"red" />
80 <rect x=
"-15" y=
"32" width=
"20" height=
"20" fill=
"green" />
81 <rect id=
"onfocusout" x=
"-15" y=
"32" width=
"20" height=
"20" fill=
"red" />
84 <rect x=
"-15" y=
"62" width=
"20" height=
"20" fill=
"green" />
85 <rect id=
"onactivate" x=
"-15" y=
"62" width=
"20" height=
"20" fill=
"red" />
88 </g> <!-- Mouse Events -->
91 <script type=
"text/ecmascript"><![CDATA[
93 function onEvent(evt, indicatorId){
95 var target = evt.target;
96 var doc = target.ownerDocument;
98 // Mark test as passed
99 var testPassed = doc.getElementById(indicatorId);
100 testPassed.setAttribute('visibility', 'hidden');
105 <text id=
"revision" x=
"10" y=
"340" font-size=
"40" stroke=
"none" fill=
"black">$Revision:
1.1 $
</text>
106 <rect id=
"test-frame" x=
"1" y=
"1" width=
"478" height=
"358" fill=
"none" stroke=
"#000000"/>