| 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" onload='f(evt)'> |
| 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.3" reviewer="ED" author="CM" status="accepted" |
| 13 |
version="$Revision: 1.7 $" testname="$RCSfile: interact-events-02-b.svg,v $"> |
| 14 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/interact.html#SVGEvents"> |
| 15 |
<p> |
| 16 |
This tests that the SVGLoad event does not bubble. |
| 17 |
</p> |
| 18 |
<p> |
| 19 |
After loading the tests, two rectangles are displayed. |
| 20 |
The left rectangle indicates whether the SVGLoad event |
| 21 |
dispatched to the root 'svg' element did not bubble |
| 22 |
and the right rectangle indicates whether the SVGLoad |
| 23 |
event dispatched to an 'image' element did not bubble. |
| 24 |
Each rectangle is red if the sub-test failed or green |
| 25 |
if it passed. |
| 26 |
</p> |
| 27 |
</d:testDescription> |
| 28 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 29 |
<p>Run the test. No interaction required.</p> |
| 30 |
</d:operatorScript> |
| 31 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 32 |
<p> |
| 33 |
The test is passed if both rectangles are green |
| 34 |
once the document has loaded. |
| 35 |
</p> |
| 36 |
</d:passCriteria> |
| 37 |
</d:SVGTestCase> |
| 38 |
<title id="test-title">$RCSfile: interact-events-02-b.svg,v $</title> |
| 39 |
<defs> |
| 40 |
<font-face |
| 41 |
font-family="SVGFreeSansASCII" |
| 42 |
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 |
|
| 50 |
<text x='10' y='30'>Testing that SVGLoad does not bubble</text> |
| 51 |
|
| 52 |
<rect id='r1' x='10' y='50' width='50' height='50' fill='red'/> |
| 53 |
<rect id='r2' x='210' y='50' width='50' height='50' fill='red'/> |
| 54 |
<g font-size='14'> |
| 55 |
<text x='10' y='130'>On root <svg></text> |
| 56 |
<text x='210' y='130'>On an <image></text> |
| 57 |
</g> |
| 58 |
|
| 59 |
<script><![CDATA[ |
| 60 |
function f(evt) { if (!evt.bubbles && evt.target == document.getElementById("svg-root")) document.getElementById('r1').setAttribute('fill', 'green'); } |
| 61 |
function g(evt) { if (!evt.bubbles && evt.target == document.getElementById("image")) document.getElementById('r2').setAttribute('fill', 'green'); } |
| 62 |
]]></script> |
| 63 |
|
| 64 |
<image id="image" xlink:href='../images/20x20.png' width='20' height='20' visibility='hidden' onload='g(evt)'/> |
| 65 |
</g> |
| 66 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 67 |
<text id="revision" x="10" y="340" stroke="none" |
| 68 |
fill="black">$Revision: 1.7 $</text> |
| 69 |
</g> |
| 70 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/> |
| 71 |
<!-- comment out this watermark once the test is approved --><!-- |
| 72 |
<g id="draft-watermark"> |
| 73 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 74 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 75 |
text-anchor="middle" y="18" stroke-width="0.5>" stroke="black" fill="white">DRAFT</text> |
| 76 |
</g>--> |
| 77 |
</svg> |