blob: 289c4e478416e07fac920c936a300d4105ea5024 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
<!--======================================================================-->
<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
<!--= Institute of Technology, Institut National de Recherche en =-->
<!--= Informatique et en Automatique, Keio University). All Rights =-->
<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
<!--======================================================================-->
<!--======================================================================-->
<!-- script-eventDom-BE-01.svg -->
<!-- renamed for 1.1 suite to script-handle-01-b -->
<!-- Author : Vincent Hardy, March 27, 2000 -->
<!--======================================================================-->
<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">
<SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
<OperatorScript version="$Revision: 1.1 $" testname="script-handle-01-b.svg">
<Paragraph>
Tests basic mouse event handler and DOM manipulation through
ECMA script binding.
</Paragraph>
<Paragraph>
The test uses ECMA Script and initially displays a target with
a message asking the user to click on the target. Once the user
has done so, and if both event handling and DOM manipulation are
supported, then the target and initial text are hidden and a text
message indicating that the test was successful is displayed.
</Paragraph>
</OperatorScript>
</SVGTestCase>
<title id="test-title">script-handle-01-b</title>
<desc id="test-desc">
This test validates scripting support by using a simple mouse event
handler and manipulating the DOM with the ECMA binding DOM API.
</desc>
<!--======================================================================-->
<!--Content of Test Case follows... =====================-->
<!--======================================================================-->
<g id="test-body-content">
<!-- Displayed Title -->
<text x="140" y="20" fill="black" >
Event and DOM Access Test
</text>
<!-- When the user clicks on the "target" group, the onMouseClick should -->
<!-- be invoked. That handler will hide the target and show a message -->
<!-- indicating that the test passed. -->
<g id="targetGroup">
<g id="target" onclick="onMouseClick( evt )">
<text x="70" y="150">Click on target</text>
<rect x="60" y="160" width="20" height="20" fill="white" stroke="none" />
<line x1="60" y1="170" x2="80" y2="170" stroke-width=".5" stroke="black" />
<line x1="70" y1="160" x2="70" y2="180" stroke-width=".5" stroke="black" />
</g>
<g id="testPassed" visibility="hidden" >
<text x="70" y="170" fill="green" font-size="30" font-weight="bold" >Scripting Test Passed!</text>
</g>
</g>
<script type="text/ecmascript"><![CDATA[
function onMouseClick(evt) {
// Get Document
var target = evt.target;
var doc = target.ownerDocument;
// Make test result visible
var testPassed = doc.getElementById('testPassed');
testPassed.setAttribute('visibility', 'visible');
// Make target invisible
var target = doc.getElementById('target');
target.setAttribute('visibility', 'hidden');
}
]]></script>
</g>
<text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.1 $</text>
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
</svg>