| 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="Lee Klosterman" status="accepted" |
| 15 |
version="$Revision: 1.12 $" testname="$RCSfile: linking-uri-01-b.svg,v $"> |
| 16 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/linking.html#LinksIntoSVG"> |
| 17 |
<p> |
| 18 |
Verify the capability to handle links to 'view' elements, and the |
| 19 |
permissible attributes on those elements. All of the links in this |
| 20 |
test case are <em>internal</em>, i.e., to 'view' elements in the same SVG file. |
| 21 |
</p> |
| 22 |
<p> |
| 23 |
This test is identical to linking-uri-02-b except that the links there are external. |
| 24 |
</p> |
| 25 |
<p> |
| 26 |
In the four quadrants of the initial picture are four graphical objects. |
| 27 |
Clockwise from upper right, they are |
| 28 |
a purple rectangle, blue ellipse, green polygon (pentagon), and yellow |
| 29 |
circle. Each is labelled and tightly boxes with a rectangular frame. |
| 30 |
These are identical to their counterparts in linking-uri-01-b.svg, in which |
| 31 |
file each has an associated 'view' element, with attributes |
| 32 |
per the labels in the initial picture. |
| 33 |
</p> |
| 34 |
<p> |
| 35 |
In the center is a gray box with four lines of text, each of which says |
| 36 |
"Go to" followed by Rectangle, Ellipse, Polygon, and Circle, respectively. |
| 37 |
Each of these is contained within an 'a' element, whose xlink:href names |
| 38 |
the respective 'view' element of the respective graphical object. |
| 39 |
</p> |
| 40 |
<p> |
| 41 |
There are several reference images associated with this test case. The first |
| 42 |
illustrates the correct initial state of the rendered SVG file, which should |
| 43 |
also be the correct picture after the Rectangle link is executed. |
| 44 |
The second, third, and fourth illustrate the correct images as described |
| 45 |
above after respectively the Ellipse, Polygon, and Circle links are activated. |
| 46 |
(Note. This harness does not yet provide access to multiple PNGs; the PNG for the |
| 47 |
initial view is shown.) |
| 48 |
</p> |
| 49 |
<p> |
| 50 |
The test uses the 'rect', 'circle', 'ellipse', and 'polygon' elements, |
| 51 |
as well as basic fill (solid simple colors), |
| 52 |
stroke (black and colored 1-pixel lines), font-family (Arial) and font-size properties. |
| 53 |
</p> |
| 54 |
</d:testDescription> |
| 55 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 56 |
<p> |
| 57 |
In turn, activate each of the "Rectangle", "Ellipse", "Polygon" and "Circle" links |
| 58 |
in the gray box in the middle of the document, navigating back (for example with |
| 59 |
the Back button if in a browser) after activating each one. |
| 60 |
</p> |
| 61 |
</d:operatorScript> |
| 62 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 63 |
<p> |
| 64 |
The test is passed if all of the sub-tests have the correct behavior: |
| 65 |
</p> |
| 66 |
<ul> |
| 67 |
<li>After activating the "Rectangle" link, the whole of the linking-uri-01-b.svg |
| 68 |
document must be displayed; that is, there will be no visual change. (The |
| 69 |
'view' element has no attributes (other than id), so the correct view in |
| 70 |
the frame is of the parent 'svg' element, which is the whole picture.)</li> |
| 71 |
<li>After navigating back and activating the "Ellipse" link, the view must change so that it is |
| 72 |
zoomed (uniformly scaled) and centered on the ellipse. The black rectangle |
| 73 |
surrounding the ellipse must be just within the frame.</li> |
| 74 |
<li>After navigating back and activating the "Circle" link, the view must change so that it is |
| 75 |
zoomed and centered on the yellow circle. The view is scaled non-uniformly, however, |
| 76 |
so that the circle is stretched horizontally ito an ellipse. The black rectangle |
| 77 |
surrounding it must be just within the frame.</li> |
| 78 |
<li>After navigating back and activating the "Polygon" link, the view must not change.</li> |
| 79 |
</ul> |
| 80 |
</d:passCriteria> |
| 81 |
</d:SVGTestCase> |
| 82 |
<title id="test-title">$RCSfile: linking-uri-01-b.svg,v $</title> |
| 83 |
<defs> |
| 84 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 85 |
<font-face-src> |
| 86 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 87 |
</font-face-src> |
| 88 |
</font-face> |
| 89 |
</defs> |
| 90 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 91 |
<text x="65" y="16" font-size="12">Link test of the 'view' element and its attributes, 1 of 2, internal.</text> |
| 92 |
<g font-size="14"> |
| 93 |
<g transform="translate(-150,75)"> |
| 94 |
<rect x="300" y="55" width="125" height="85" fill="#aaa"/> |
| 95 |
<a xlink:href="#rect-view"> |
| 96 |
<text x="310" y="70" fill="purple">Go to Rectangle</text> |
| 97 |
</a> |
| 98 |
<a xlink:href="#ellipse-view"> |
| 99 |
<text x="310" y="90" fill="blue">Go to Ellipse</text> |
| 100 |
</a> |
| 101 |
<a xlink:href="#circle-view"> |
| 102 |
<text x="310" y="110" fill="yellow">Go to Circle</text> |
| 103 |
</a> |
| 104 |
<a xlink:href="#polygon-view"> |
| 105 |
<text x="310" y="130" fill="green">Go to Polygon</text> |
| 106 |
</a> |
| 107 |
<text x="315" y="152" font-size="12">Click element's line</text> |
| 108 |
<text x="315" y="164" font-size="12">to link to its view</text> |
| 109 |
</g> |
| 110 |
|
| 111 |
<!-- View with no attributes. Picture should not change. --> |
| 112 |
<view id="rect-view"/> |
| 113 |
<rect id="rect-object" fill="purple" x="295" y="36" width="135" height="68"/> |
| 114 |
<text id="rect-label" x="362.5" y="116" text-anchor="middle">Rectangle</text> |
| 115 |
<rect x="292" y="29" width="141" height="91" fill="none" stroke="black"/> |
| 116 |
<text x="362.5" y="132" font-size="10" text-anchor="middle">No view attributes except id.</text> |
| 117 |
<!-- Test viewBox. Should blow-up the ellipse in the frame. --> |
| 118 |
<view id="ellipse-view" viewBox="295 216 150 82"/> |
| 119 |
<ellipse id="ellipse-object" fill="blue" cx="370" cy="251" rx="72" ry="32"/> |
| 120 |
<text id="ellipse-label" x="370" y="295" text-anchor="middle">Ellipse</text> |
| 121 |
<rect x="295" y="216" width="150" height="82" fill="none" stroke="black"/> |
| 122 |
<text x="315" y="212" font-size="10">viewBox, should fill frame.</text> |
| 123 |
<!-- Test preserveAspectRatio. --> |
| 124 |
<view id="circle-view" viewBox="36 29 98 91" preserveAspectRatio="none"/> |
| 125 |
<circle id="circle-object" fill="yellow" cx="85" cy="68" r="36"/> |
| 126 |
<text id="circle-label" x="85" y="116" text-anchor="middle">Circle</text> |
| 127 |
<rect x="36" y="29" width="98" height="91" fill="none" stroke="black"/> |
| 128 |
<text x="85" y="130" font-size="10" text-anchor="middle">viewBox & non-uniform</text> |
| 129 |
<text x="85" y="139" font-size="10" text-anchor="middle">preserveAspectRatio</text> |
| 130 |
<!-- Test viewTarget attribute, no change to the viewport. --> |
| 131 |
<view id="polygon-view" viewTarget="polygon-object"/> |
| 132 |
<polygon id="polygon-object" fill="green" points="87,211 134,238 116,283 57,283 39,238 87,211"/> |
| 133 |
<text id="polygon-label" x="85" y="295" text-anchor="middle">Polygon</text> |
| 134 |
<rect x="36" y="208" width="100" height="89" fill="none" stroke="black"/> |
| 135 |
<text x="85" y="195" font-size="10" text-anchor="middle">viewTarget, no</text> |
| 136 |
<text x="85" y="204" font-size="10" text-anchor="middle">changes to viewport</text> |
| 137 |
</g> |
| 138 |
</g> |
| 139 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 140 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.12 $</text> |
| 141 |
</g> |
| 142 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
| 143 |
<!-- comment out this watermark once the test is approved --> |
| 144 |
<!--<g id="draft-watermark"> |
| 145 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 146 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 147 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 148 |
</g>--> |
| 149 |
</svg> |