| 1 |
<svg version="1.1" baseProfile="tiny" 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="CN" author="VH" status="accepted" |
| 15 |
version="$Revision: 1.6 $" testname="$RCSfile: struct-image-06-t.svg,v $"> |
| 16 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/struct.html#ImageElement"> |
| 17 |
<p> |
| 18 |
Check that all the preserveAspectRatio values are supported |
| 19 |
for the <image> element. In particular, check that |
| 20 |
values which are not supported on the svg element's |
| 21 |
preserveAspectRatio are supported for <image>. |
| 22 |
</p> |
| 23 |
</d:testDescription> |
| 24 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 25 |
<p>Run the test. No interaction required.</p> |
| 26 |
</d:operatorScript> |
| 27 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 28 |
<p>The test shows four smiley images: the leftmost one is the reference, |
| 29 |
and the three on the right are the three sub-tests. The test is passed |
| 30 |
if the following conditions are met: |
| 31 |
</p> |
| 32 |
<ul> |
| 33 |
<li>The image in the first sub-test is shown within the blue rectangle, |
| 34 |
its aspect ratio preserved and with white bars between the blue rectangle |
| 35 |
and the left and right edges of the image.</li> |
| 36 |
<li>The image in the second sub-test is shown within the blue rectangle, |
| 37 |
its aspect ratio preserved and with white bars between the blue rectangle |
| 38 |
and the top and bottom edges of the image.</li> |
| 39 |
<li>The image in the third sub-test is shown stretched, having the same |
| 40 |
size as the blue rectangle shown on the left of the test slide underneath |
| 41 |
the text "Viewport 2".</li> |
| 42 |
</ul> |
| 43 |
</d:passCriteria> |
| 44 |
</d:SVGTestCase> |
| 45 |
<title id="test-title">$RCSfile: struct-image-06-t.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 |
<g font-size="9"> |
| 55 |
<desc>Example PreserveAspectRatio - demonstrate available options</desc> |
| 56 |
<text x="10" y="30">SVG to fit</text> |
| 57 |
<g transform="translate(20,40)"> |
| 58 |
<image xlink:href="../images/smiley.png" width="50" height="50"/> |
| 59 |
</g> |
| 60 |
<text x="10" y="110">Viewport 1</text> |
| 61 |
<g transform="translate(10,120)"> |
| 62 |
<rect x=".5" y=".5" width="49" height="29" fill="none" stroke="blue"/> |
| 63 |
</g> |
| 64 |
<text x="10" y="180">Viewport 2</text> |
| 65 |
<g transform="translate(20,190)"> |
| 66 |
<rect x=".5" y=".5" width="29" height="59" fill="none" stroke="blue"/> |
| 67 |
</g> |
| 68 |
<g id="meet-group-1" transform="translate(100, 50)"> |
| 69 |
<text x="0" y="-20">---------- meet ----------</text> |
| 70 |
<g transform="translate(30,0)"> |
| 71 |
<text y="-5">xMid*</text> |
| 72 |
<rect x=".5" y=".5" width="49" height="29" fill="none" stroke="blue"/> |
| 73 |
<image xlink:href="../images/smiley.png" preserveAspectRatio="xMidYMid meet" width="50" height="30"/> |
| 74 |
</g> |
| 75 |
</g> |
| 76 |
<g id="meet-group-2" transform="translate(230, 50)"> |
| 77 |
<text x="0" y="-20">---------- meet ----------</text> |
| 78 |
<g transform="translate(30, 0)"> |
| 79 |
<text y="-5">*YMid</text> |
| 80 |
<rect x=".5" y=".5" width="29" height="59" fill="none" stroke="blue"/> |
| 81 |
<image xlink:href="../images/smiley.png" preserveAspectRatio="xMidYMid meet" width="30" height="60"/> |
| 82 |
</g> |
| 83 |
</g> |
| 84 |
<g id="meet-group-3" transform="translate(350, 50)"> |
| 85 |
<text x="0" y="-20">---------- meet ----------</text> |
| 86 |
<g transform="translate(30, 0)"> |
| 87 |
<text y="-5">*none</text> |
| 88 |
<rect x=".5" y=".5" width="29" height="59" fill="none" stroke="blue"/> |
| 89 |
<image xlink:href="../images/smiley.png" preserveAspectRatio="none" width="30" height="60"/> |
| 90 |
</g> |
| 91 |
</g> |
| 92 |
</g> |
| 93 |
</g> |
| 94 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 95 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.6 $</text> |
| 96 |
</g> |
| 97 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
| 98 |
<!-- comment out this watermark once the test is approved --> |
| 99 |
<!--<g id="draft-watermark"> |
| 100 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 101 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 102 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 103 |
</g>--> |
| 104 |
</svg> |