blob: 8505cfa5545c417109f8b11618c82f8c85a2cc2e [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-uiEvents-BE-02.svg -->
<!-- renamed for 1.1 suite to script-handle-04-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.2 $" testname="script-handle-04-b.svg">
<Paragraph>
Tests basic mouse event handlers.
</Paragraph>
<Paragraph>
The test shows a target that can be used to generate the various
kinds of mouse and keyboard events supported in SVG. Below the
target, the list of events is shown with red markers next to each.
</Paragraph>
<Paragraph>
If the test passes, all the markers should have turned to green
after the events have been triggered on the target. If any event
has not triggered, its marker will remain red.
</Paragraph>
</OperatorScript>
</SVGTestCase>
<title id="test-title">script-handle-04-b</title>
<desc id="test-desc">
This test validates basic support for the mouse events defined in SVG.
</desc>
<!--======================================================================-->
<!--Content of Test Case follows... =====================-->
<!--======================================================================-->
<g id="test-body-content">
<!-- Displayed Title -->
<text x="100" y="40" fill="black" font-size="24" >
Mouse event handlers test.
</text>
<!-- The test defines a target and defines all the handlers for the target -->
<!-- There are legends for each handler that are modified after the handler-->
<!-- has been invoked -->
<g id="targetGroup" transform="translate(60, 140)">
<text x="-40" y="-50" font-size="32">Target</text>
<text x="60" y="7" font-size="24">Use the target to trigger events</text>
<!-- The target has all the event handlers defined -->
<!-- Use this <g> instead -->
<g id="target"
onmouseover="onEvent(evt, 'onmouseover')"
onmousemove="onEvent(evt, 'onmousemove')"
onmouseout="onEvent(evt, 'onmouseout')" >
<circle cx="0" cy="0" r="30" fill="#cccccc" stroke="black" />
<line x1="-30" y1="0" x2="30" y2="0"/>
<line x1="0" y1="-30" x2="0" y2="30"/>
</g>
</g> <!-- targetGroup -->
<g id="labels">
<g id="mouseEvents" transform="translate(65, 190)">
<g id="mouseEventsLabels">
<text x="10" y="20" font-size="32">onmouseover</text>
<text x="10" y="50" font-size="32">onmousemove</text>
<text x="10" y="80" font-size="32">onmouseout</text>
</g>
<g id="mouseEventsTestIndicators">
<!-- onmouseover -->
<rect x="-15" y="2" width="20" height="20" fill="green" />
<rect id="onmouseover" x="-15" y="2" width="20" height="20" fill="red" />
<!-- onmousemove -->
<rect x="-15" y="32" width="20" height="20" fill="green" />
<rect id="onmousemove" x="-15" y="32" width="20" height="20" fill="red" />
<!-- onmouseout -->
<rect x="-15" y="62" width="20" height="20" fill="green" />
<rect id="onmouseout" x="-15" y="62" width="20" height="20" fill="red" />
</g>
</g> <!-- Mouse Events -->
</g>
<script type="text/ecmascript"><![CDATA[
function onEvent(evt, indicatorId){
// Get Document
var target = evt.target;
var doc = target.ownerDocument;
// Mark test as passed
var testPassed = doc.getElementById(indicatorId);
testPassed.setAttribute('visibility', 'hidden');
}
]]></script>
</g>
<text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.2 $</text>
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
</svg>