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-eventDom-BE-01.svg -->
11 <!-- renamed for 1.1 suite to script-handle-01-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-01-b.svg">
19 Tests basic mouse event handler and DOM manipulation through
23 The test uses ECMA Script and initially displays a target with
24 a message asking the user to click on the target. Once the user
25 has done so, and if both event handling and DOM manipulation are
26 supported, then the target and initial text are hidden and a text
27 message indicating that the test was successful is displayed.
31 <title id=
"test-title">script-handle-
01-b
</title>
33 This test validates scripting support by using a simple mouse event
34 handler and manipulating the DOM with the ECMA binding DOM API.
36 <!--======================================================================-->
37 <!--Content of Test Case follows... =====================-->
38 <!--======================================================================-->
39 <g id=
"test-body-content">
40 <!-- Displayed Title -->
41 <text x=
"140" y=
"20" fill=
"black" >
42 Event and DOM Access Test
45 <!-- When the user clicks on the "target" group, the onMouseClick should -->
46 <!-- be invoked. That handler will hide the target and show a message -->
47 <!-- indicating that the test passed. -->
49 <g id=
"target" onclick=
"onMouseClick( evt )">
50 <text x=
"70" y=
"150">Click on target
</text>
51 <rect x=
"60" y=
"160" width=
"20" height=
"20" fill=
"white" stroke=
"none" />
52 <line x1=
"60" y1=
"170" x2=
"80" y2=
"170" stroke-width=
".5" stroke=
"black" />
53 <line x1=
"70" y1=
"160" x2=
"70" y2=
"180" stroke-width=
".5" stroke=
"black" />
55 <g id=
"testPassed" visibility=
"hidden" >
56 <text x=
"70" y=
"170" fill=
"green" font-size=
"30" font-weight=
"bold" >Scripting Test Passed!
</text>
60 <script type=
"text/ecmascript"><![CDATA[
62 function onMouseClick(evt) {
65 var target = evt.target;
66 var doc = target.ownerDocument;
68 // Make test result visible
69 var testPassed = doc.getElementById('testPassed');
70 testPassed.setAttribute('visibility', 'visible');
72 // Make target invisible
73 var target = doc.getElementById('target');
74 target.setAttribute('visibility', 'hidden');
80 <text id=
"revision" x=
"10" y=
"340" font-size=
"40" stroke=
"none" fill=
"black">$Revision:
1.1 $
</text>
81 <rect id=
"test-frame" x=
"1" y=
"1" width=
"478" height=
"358" fill=
"none" stroke=
"#000000"/>