| 1 |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd" [ |
| 2 |
<!ENTITY Viewport1 "<rect x='.5' y='.5' width='49' height='29' fill='none' stroke='blue'/>"> |
| 3 |
<!ENTITY Viewport2 "<rect x='.5' y='.5' width='29' height='59' fill='none' stroke='blue'/>"> |
| 4 |
]> |
| 5 |
<svg version="1.1" baseProfile="basic" id="svg-root" |
| 6 |
width="100%" height="100%" viewBox="0 0 480 360" |
| 7 |
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| 8 |
<!--======================================================================--> |
| 9 |
<!--= SVG 1.1 2nd Edition Test Case =--> |
| 10 |
<!--======================================================================--> |
| 11 |
<!--= Copyright 2009 World Wide Web Consortium, (Massachusetts =--> |
| 12 |
<!--= Institute of Technology, European Research Consortium for =--> |
| 13 |
<!--= Informatics and Mathematics (ERCIM), Keio University). =--> |
| 14 |
<!--= All Rights Reserved. =--> |
| 15 |
<!--= See http://www.w3.org/Consortium/Legal/. =--> |
| 16 |
<!--======================================================================--> |
| 17 |
<d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/" |
| 18 |
template-version="1.4" reviewer="[reviewer]" author="ED" status="created" |
| 19 |
version="$Revision: 1.2 $" testname="$RCSfile: coords-viewattr-04-f.svg,v $"> |
| 20 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute"> |
| 21 |
<p> |
| 22 |
This test verifies the implementation of the preserveAspectRatio attribute on <image> |
| 23 |
referencing svg content. |
| 24 |
</p> |
| 25 |
</d:testDescription> |
| 26 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 27 |
<p> |
| 28 |
Run the test. No interaction required. |
| 29 |
</p> |
| 30 |
</d:operatorScript> |
| 31 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 32 |
<p> |
| 33 |
The rendered picture should match the reference image exactly except for variations in the labeling text. |
| 34 |
</p> |
| 35 |
</d:passCriteria> |
| 36 |
</d:SVGTestCase> |
| 37 |
<title id="test-title">$RCSfile: coords-viewattr-04-f.svg,v $</title> |
| 38 |
<defs> |
| 39 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 40 |
<font-face-src> |
| 41 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 42 |
</font-face-src> |
| 43 |
</font-face> |
| 44 |
</defs> |
| 45 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 46 |
<g font-size="9" transform="translate(0, 30)"> |
| 47 |
<desc>Example PreserveAspectRatio - demonstrate available options</desc> |
| 48 |
<text text-anchor="middle" x="240" font-size="16">Test options of preserveAspectRatio on an image element</text> |
| 49 |
<text x="40" y="30" text-anchor="middle">SVG to fit</text> |
| 50 |
<g transform="translate(20,40)"> |
| 51 |
<image xlink:href="../images/happysmiley.svg" width="40" height="40" preserveAspectRatio="none" /> |
| 52 |
</g> |
| 53 |
<text x="35.5" y="110" text-anchor="middle">Viewport 1</text> |
| 54 |
<g transform="translate(10,120)">&Viewport1;</g> |
| 55 |
<text x="35.5" y="180" text-anchor="middle">Viewport 2</text> |
| 56 |
<g transform="translate(20,190)">&Viewport2;</g> |
| 57 |
<g id="meet-group-1" transform="translate(120, 50)"> |
| 58 |
<text x="0" y="-20">---------- meet --------------------</text> |
| 59 |
<g> |
| 60 |
<text y="-5">xMin*</text>&Viewport1; |
| 61 |
<image xlink:href="../images/happysmiley.svg" preserveAspectRatio="xMinYMin meet" width="50" height="30" /> |
| 62 |
</g> |
| 63 |
<g transform="translate(70,0)"> |
| 64 |
<text y="-5">xMid*</text>&Viewport1; |
| 65 |
<image xlink:href="../images/happysmiley.svg" preserveAspectRatio="xMidYMid meet" width="50" height="30" /> |
| 66 |
</g> |
| 67 |
<g transform="translate(0,50)"> |
| 68 |
<text y="-5">xMax*</text>&Viewport1; |
| 69 |
<image xlink:href="../images/happysmiley.svg" preserveAspectRatio="xMaxYMax meet" width="50" height="30" /> |
| 70 |
</g> |
| 71 |
</g> |
| 72 |
<g id="meet-group-2" transform="translate(300, 50)"> |
| 73 |
<text x="0" y="-20">---------- meet ------------------------</text> |
| 74 |
<g> |
| 75 |
<text y="-5">*YMin</text>&Viewport2; |
| 76 |
<image xlink:href="../images/happysmiley.svg" preserveAspectRatio="xMinYMin meet" width="30" height="60" /> |
| 77 |
</g> |
| 78 |
<g transform="translate(50, 0)"> |
| 79 |
<text y="-5">*YMid</text>&Viewport2; |
| 80 |
<image xlink:href="../images/happysmiley.svg" preserveAspectRatio="xMidYMid meet" width="30" height="60" /> |
| 81 |
</g> |
| 82 |
<g transform="translate(100, 0)"> |
| 83 |
<text y="-5">*YMax</text>&Viewport2; |
| 84 |
<image xlink:href="../images/happysmiley.svg" preserveAspectRatio="xMaxYMax meet" width="30" height="60" /> |
| 85 |
</g> |
| 86 |
</g> |
| 87 |
<g id="slice-group-1" transform="translate(120, 185)"> |
| 88 |
<text x="0" y="-20">---------- slice -------------------------</text> |
| 89 |
<g> |
| 90 |
<text y="-5">xMin*</text>&Viewport2; |
| 91 |
<image xlink:href="../images/happysmiley.svg" preserveAspectRatio="xMinYMin slice" width="30" height="60" /> |
| 92 |
</g> |
| 93 |
<g transform="translate(50,0)"> |
| 94 |
<text y="-5">xMid*</text>&Viewport2; |
| 95 |
<image xlink:href="../images/happysmiley.svg" preserveAspectRatio="xMidYMid slice" width="30" height="60" /> |
| 96 |
</g> |
| 97 |
<g transform="translate(100,0)"> |
| 98 |
<text y="-5">xMax*</text>&Viewport2; |
| 99 |
<image xlink:href="../images/happysmiley.svg" preserveAspectRatio="xMaxYMax slice" width="30" height="60" /> |
| 100 |
</g> |
| 101 |
</g> |
| 102 |
<g id="slide-group-2" transform="translate(300, 155) translate(0, 30)"> |
| 103 |
<text x="0" y="-20">---------- slice ---------------------</text> |
| 104 |
<g> |
| 105 |
<text y="-5">*YMin</text>&Viewport1; |
| 106 |
<image xlink:href="../images/happysmiley.svg" preserveAspectRatio="xMinYMin slice" width="50" height="30" /> |
| 107 |
</g> |
| 108 |
<g transform="translate(70,0)"> |
| 109 |
<text y="-5">*YMid</text>&Viewport1; |
| 110 |
<image xlink:href="../images/happysmiley.svg" preserveAspectRatio="xMidYMid slice" width="50" height="30" /> |
| 111 |
</g> |
| 112 |
<g transform="translate(0,50)"> |
| 113 |
<text y="-5">*YMax</text>&Viewport1; |
| 114 |
<image xlink:href="../images/happysmiley.svg" preserveAspectRatio="xMaxYMax slice" width="50" height="30" /> |
| 115 |
</g> |
| 116 |
</g> |
| 117 |
</g> |
| 118 |
</g> |
| 119 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 120 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.2 $</text> |
| 121 |
</g> |
| 122 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
| 123 |
<!-- comment out this watermark once the test is approved --> |
| 124 |
<g id="draft-watermark"> |
| 125 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 126 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 127 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 128 |
</g> |
| 129 |
</svg> |