| 1 |
<svg version="1.1" baseProfile="basic" id="svg-root" |
| 2 |
width="100%" height="100%" viewBox="0 0 480 360" |
| 3 |
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| 4 |
<!--======================================================================--> |
| 5 |
<!--= SVG 1.1 2nd Edition Test Case =--> |
| 6 |
<!--======================================================================--> |
| 7 |
<!--= Copyright 2009 World Wide Web Consortium, (Massachusetts =--> |
| 8 |
<!--= Institute of Technology, European Research Consortium for =--> |
| 9 |
<!--= Informatics and Mathematics (ERCIM), Keio University). =--> |
| 10 |
<!--= All Rights Reserved. =--> |
| 11 |
<!--= See http://www.w3.org/Consortium/Legal/. =--> |
| 12 |
<!--======================================================================--> |
| 13 |
<d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/" |
| 14 |
template-version="1.4" reviewer="SVGWG" author="Jon Ferraiolo" status="accepted" |
| 15 |
version="$Revision: 1.7 $" testname="$RCSfile: interact-order-01-b.svg,v $"> |
| 16 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/interact.html#UIEventProcessing"> |
| 17 |
<p> |
| 18 |
Test event bubbling of event attributes, part a. |
| 19 |
</p> |
| 20 |
<p> |
| 21 |
The two circles test whether event bubbling is occurring |
| 22 |
to parents of the target object, and whether the target object |
| 23 |
is able to prevent bubbling. The supplemental text next to |
| 24 |
the circles describes what should occur. |
| 25 |
</p> |
| 26 |
</d:testDescription> |
| 27 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 28 |
<p>This test requires user interaction. Firstly, move the pointer |
| 29 |
over the top circle. Then, move it over the bottom circle.</p> |
| 30 |
</d:operatorScript> |
| 31 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 32 |
<p> |
| 33 |
The test is passed if two black circles are displayed. The top circle |
| 34 |
must turn pink when the pointer is over the circle, and go back to black once |
| 35 |
the pointer leaves. The second circle must turn blue when the pointer is over |
| 36 |
the circle, and go back to black once the pointer leaves. |
| 37 |
</p> |
| 38 |
</d:passCriteria> |
| 39 |
</d:SVGTestCase> |
| 40 |
<title id="test-title">$RCSfile: interact-order-01-b.svg,v $</title> |
| 41 |
<defs> |
| 42 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 43 |
<font-face-src> |
| 44 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 45 |
</font-face-src> |
| 46 |
</font-face> |
| 47 |
</defs> |
| 48 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 49 |
<defs> |
| 50 |
<script type="text/ecmascript"> |
| 51 |
|
| 52 |
function bubbleYes(evt, color){ |
| 53 |
// Get Document |
| 54 |
var target = evt.target; |
| 55 |
target.setAttribute('fill', '' +color); |
| 56 |
} |
| 57 |
function bubbleNo(evt, color){ |
| 58 |
// Get Document |
| 59 |
var target = evt.target; |
| 60 |
target.setAttribute('fill', '' +color); |
| 61 |
evt.stopPropagation(); |
| 62 |
evt.preventDefault(); |
| 63 |
} |
| 64 |
|
| 65 |
</script> |
| 66 |
</defs> |
| 67 |
<text font-family="Arial" font-size="40" x="60" y="45">Event bubbling - a</text> |
| 68 |
<g id="background"> |
| 69 |
<rect fill="#EEE" stroke="#000" x="10" y="60" width="460" height="120"/> |
| 70 |
<rect fill="#FFF" stroke="#000" x="10" y="180" width="460" height="120"/> |
| 71 |
</g> |
| 72 |
<g fill="#000" font-family="Arial" font-size="40"> |
| 73 |
<!-- Event bubbling (i.e., propagation) is not turned off, so |
| 74 |
event if first processed by 'circle', but then processed by 'g', |
| 75 |
with result that circle turns blue, but then instantaneously |
| 76 |
turns pink. --> |
| 77 |
<g onmouseover="bubbleYes(evt, '#F08')" onmouseout="bubbleYes(evt, 'inherit')"> |
| 78 |
<circle onmouseover="bubbleYes(evt, '#00F')" onmouseout="bubbleYes(evt, 'inherit')" cx="70" cy="120" r="50"/> |
| 79 |
<circle onmouseover="bubbleNo(evt, '#00F')" onmouseout="bubbleNo(evt, 'inherit')" cx="70" cy="240" r="50"/> |
| 80 |
</g> |
| 81 |
<text x="150" y="110"> |
| 82 |
Pointer in circle, |
| 83 |
</text> |
| 84 |
<text x="150" y="150"> |
| 85 |
circle turns pink |
| 86 |
</text> |
| 87 |
<text x="150" y="230"> |
| 88 |
Pointer in circle, |
| 89 |
</text> |
| 90 |
<text x="150" y="270"> |
| 91 |
circle turns blue |
| 92 |
</text> |
| 93 |
</g> |
| 94 |
</g> |
| 95 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 96 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.7 $</text> |
| 97 |
</g> |
| 98 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
| 99 |
<!-- comment out this watermark once the test is approved --> |
| 100 |
<!--<g id="draft-watermark"> |
| 101 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 102 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 103 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 104 |
</g>--> |
| 105 |
</svg> |