Debian Codegraph @

test_non_regression/svg/struct-use-07-b.svg

raw
1 <svg version="1.1" baseProfile="full" 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="CM" author="ED" status="reviewed"
15 version="$Revision: 1.7 $" testname="$RCSfile: struct-use-07-b.svg,v $">
16 <d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/struct.html#UseElement">
17 <p>
18 This tests interactivity and event handlers on use elements. It also tests
19 that the <code>SVGElementInstance.correspondingElement</code> property and the
20 <code>CSSStyleDeclaration.setProperty()</code> method defined in
21 DOM Level 2 Style. By testing different ways of setting the fill on a rectangle
22 it verifies that the result is consistent, and that CSS properly overrides
23 the specified values.
24 </p>
25 </d:testDescription>
26 <d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
27 <p>
28 You should at first see a pyramid of four pink rects.
29 Click each of the pink rects once.
30 </p>
31 </d:operatorScript>
32 <d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
33 <p>
34 If the useragent doesn't support CSS, this test does not apply.
35 </p>
36 <p>
37 The test has passed if when clicking each of the rects the clicked rect turns blue -
38 note that only the clicked rect must turn blue, if any other rect turns blue too then the test has failed.
39 </p>
40 <p>
41 The reference image shows the final state, what the result should be after all rects have been clicked.
42 </p>
43 </d:passCriteria>
44 </d:SVGTestCase>
45 <title id="test-title">$RCSfile: struct-use-07-b.svg,v $</title>
46 <defs>
47 <font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F">
48 <font-face-src>
49 <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
50 </font-face-src>
51 </font-face>
52 </defs>
53 <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
54 <defs>
55 <svg xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-sub-root" viewBox="0 0 450 450" width="450" height="450">
56 <g id="drawRects">
57 <rect x="225" y="0" width="220" height="220" style="fill:magenta" onclick="evt.currentTarget.correspondingElement.style.fill='blue';"/>
58 <rect x="0" y="225" width="220" height="220" style="fill:#f0f" onclick="evt.currentTarget.correspondingElement.style.setProperty('fill','blue',null);"/>
59 <rect x="225" y="225" width="220" height="220" fill="#f0f" onclick="evt.currentTarget.correspondingElement.style.setProperty('fill','blue',null);"/>
60 </g>
61 </svg>
62 </defs>
63
64 <use id="use-elm" x="60" y="50" width="240" height="240" xlink:href="#svg-sub-root"/>
65 <rect x="300" y="170" width="118" height="118" fill="magenta" onclick="evt.target.setAttribute('fill','blue')"/>
66 </g>
67 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
68 <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.7 $</text>
69 </g>
70 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
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>