Debian Codegraph @

test_non_regression/fail/na/interaction/interact-events-203-t.svg

raw
1 <svg id="svg-root" width="100%" height="100%"
2 viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg"
3 xmlns:xlink="http://www.w3.org/1999/xlink">
4 <!--======================================================================-->
5 <!--= Copyright 2008 World Wide Web Consortium, (Massachusetts =-->
6 <!--= Institute of Technology, European Research Consortium for =-->
7 <!--= Informatics and Mathematics (ERCIM), Keio University). =-->
8 <!--= All Rights Reserved. =-->
9 <!--= See http://www.w3.org/Consortium/Legal/. =-->
10 <!--======================================================================-->
11 <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/"
12 template-version="1.4" reviewer="AE" author="ASl" status="accepted"
13 version="$Revision: 1.4 $" testname="$RCSfile: interact-events-203-t.svg,v $">
14 <d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/interact.html#SVGEvents">
15 <p>Tests 'mouseover' event on SVGElementInstance</p>
16 <p>
17 What each case tests is as follows.
18 Case 1: mouseover event on SVGElementInstance. Referenceing an element that contains an event.
19 Case 2: mouseover event on referencing element. Event bubbling from SVGElementInstance to referencing element.
20 Case 3: mouseover event on parent of referencing element. Event bubbling from SVGElementInstance to referencing element ancestors.
21 Case 4: mousedown event on referencing element. SVGElementInstance is not effected by event listener on referencing element.
22 </p>
23 </d:testDescription>
24 <d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
25 <p>
26 Mouseover each of the red rectangles, and then click on the bottommost rectangle.
27 </p>
28 </d:operatorScript>
29 <d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
30 <p>
31 This test contains four cases. The cases must produce the following results for the test to pass.
32 </p>
33 <ul>
34 <li>Case 1: On a mouseover event on the top square, all four squares must turn blue.</li>
35 <li>Case 2: On a mouseover event on the top middle square, all four squares must turn blue and a black stroke
36 must appear on the referencing square (element).</li>
37 <li>Case 3: On a mouseover event on the bottom middle square, all four squares must turn blue and a black
38 stroke must appear on the referencing square (element).</li>
39 <li>Case 4: On a mouseover event on the bottom square, all four squares must turn blue, and on a mousedown event
40 a black stroke must appear on the referencing square (element).</li>
41 </ul>
42 </d:passCriteria>
43 </d:SVGTestCase>
44 <title id="test-title">$RCSfile: interact-events-203-t.svg,v $</title>
45 <defs>
46 <font-face
47 font-family="SVGFreeSansASCII"
48 unicode-range="U+0-7F">
49 <font-face-src>
50 <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
51 </font-face-src>
52 </font-face>
53 </defs>
54 <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
55
56 <defs>
57 <!-- SVGElementInstance animates fill on mouseover -->
58 <rect id="rect" width="50" height="50" fill="red" onmouseover="document.getElementById('rect').setAttribute('fill','blue')" onmouseout="document.getElementById('rect').setAttribute('fill','red')" />
59 </defs>
60
61 <text x="120" y="20" font-size="15">Shadow tree event listener chain</text>
62
63 <!--basic event dispatch - all rectangles turn blue -->
64 <use fill="red" x="30" y="30" xlink:href="#rect"/>
65 <text x="95" y="45" font-size="12">Case 1: on mouseover all squares must turn blue</text>
66
67 <!-- event bubbling from SVGElementInstance to referencing element -->
68 <!-- all rectangles turn blue and second rectangle displays black stroke -->
69 <use id="use2" fill="red" x="30" y="100" xlink:href="#rect" onmouseover="document.getElementById('rect1').setAttribute('stroke','black')" onmouseout="document.getElementById('rect1').setAttribute('stroke','none')"/>
70 <rect id="rect1" pointer-events="none" x="30" y="100" width="50" height="50" fill="none" stroke-width="5" stroke="none"/>
71
72 <g font-size="12">
73 <text x="95" y="115">Case 2: on mouseover all squares must turn blue</text>
74 <text x="95" y="130">and a black stroke must appear on reference square</text>
75 </g>
76
77 <!-- event bubbling from SVGElementInstance to referencing element ancestors-->
78 <!-- all rectangles turn blue and third rectangle displays black stroke -->
79 <g id="g1" onmouseover="document.getElementById('rect2').setAttribute('stroke','black')" onmouseout="document.getElementById('rect2').setAttribute('stroke','none')">
80 <use fill="red" x="30" y="170" xlink:href="#rect"/>
81 <rect id="rect2" pointer-events="none" x="30" y="170" width="50" height="50" fill="none" stroke-width="5" stroke="none"/>
82 </g>
83 <g font-size="12">
84 <text x="95" y="185">Case 3: on mouseover all squares must turn blue</text>
85 <text x="95" y="200">and a black stroke must appear on reference square</text>
86 </g>
87
88 <!--SVGElementInstance is not effected by event listener on referencing element -->
89 <!-- all rectangles turn blue and displays black stroke only on mouse down -->
90 <use id="use3" fill="red" x="30" y="240" xlink:href="#rect" onmousedown="document.getElementById('rect3').setAttribute('stroke','black')" onmouseup="document.getElementById('rect3').setAttribute('stroke','none')"/>
91 <rect id="rect3" pointer-events="none" x="30" y="240" width="50" height="50" fill="none" stroke-width="5" stroke="none"/>
92 <g font-size="12">
93 <text x="95" y="255">Case 4: on mouseover all squares must turn blue</text>
94 <text x="95" y="270">and on mousedown a black stroke must appear on reference square</text>
95 </g>
96
97 </g>
98 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
99 <text id="revision" x="10" y="340" stroke="none"
100 fill="black">$Revision: 1.4 $</text>
101 </g>
102 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>
103 <!-- comment out this watermark once the test is approved
104 <g id="draft-watermark">
105 <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
106 <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
107 text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
108 </g>-->
109 </svg>