| 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="Haroon Sheikh" status="accepted" |
| 15 |
version="$Revision: 1.9 $" testname="$RCSfile: pservers-grad-06-b.svg,v $"> |
| 16 |
<d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/pservers.html#Gradients"> |
| 17 |
<p> |
| 18 |
Test that the viewer can handle the gradientTransform and the patternTransform |
| 19 |
attribute on gradients and patterns respectively. |
| 20 |
</p> |
| 21 |
<p> |
| 22 |
From top-down the appearance of objects is as follows. |
| 23 |
</p> |
| 24 |
<p> |
| 25 |
The top rectangle has a linear gradient whose coordinate system has been scaled down by |
| 26 |
a half. So the gradient travelling from left to right (from blue to green to lime) should |
| 27 |
only occuply the left half the rectangle. |
| 28 |
</p> |
| 29 |
<p> |
| 30 |
The next rectangle has radial gradient that has been translated to the center and skewed |
| 31 |
in the positive X direction by 45 degrees. Therefore the gradient should appear |
| 32 |
ellipltical and rotated around the center. |
| 33 |
</p> |
| 34 |
<p> |
| 35 |
The last row contains a rectangle with pattern on the fill. The transformation on the |
| 36 |
pattern moves the coordinate system to the top left of the rectangle and then scales it |
| 37 |
by a factor of 2 and then skew's it in the X direction by 45 degrees. The pattern |
| 38 |
consists of a 2 by 2 array of colored rectangles. |
| 39 |
</p> |
| 40 |
</d:testDescription> |
| 41 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 42 |
<p>Run the test. No interaction required.</p> |
| 43 |
</d:operatorScript> |
| 44 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 45 |
<p>The test passes if the rendering matches the reference image, apart |
| 46 |
from any differences in font choice due to CSS2 rules. Specifically:</p> |
| 47 |
<ul> |
| 48 |
<li>The top rectangle is filled with a linear gradient from blue on the left, |
| 49 |
to lime in the middle. The right half of the rectangle is filled with plain lime.</li> |
| 50 |
<li>The middle rectangle is filled with an elliptical radial gradient with |
| 51 |
black on the inside and orange on the outside. The center point of the gradient |
| 52 |
is near the center-bottom of the rectangle. The gradient is skewed, so that it appears |
| 53 |
as a rotated elliptical gradient.</li> |
| 54 |
<li>The bottom rectangle is filled with a repeating pattern of tiled |
| 55 |
red, green, yellow and blue parallelograms.</li> |
| 56 |
</ul> |
| 57 |
</d:passCriteria> |
| 58 |
</d:SVGTestCase> |
| 59 |
<title id="test-title">$RCSfile: pservers-grad-06-b.svg,v $</title> |
| 60 |
<defs> |
| 61 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 62 |
<font-face-src> |
| 63 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 64 |
</font-face-src> |
| 65 |
</font-face> |
| 66 |
</defs> |
| 67 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 68 |
<!-- ====================================================================== --> |
| 69 |
<!-- Linear Gradient with gradientTransforms --> |
| 70 |
<!-- ====================================================================== --> |
| 71 |
<linearGradient id="Grad1" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="430" y2="0" gradientTransform="translate(25 35) scale(0.5)"> |
| 72 |
<stop stop-color="blue" offset="0"/> |
| 73 |
<stop stop-color="green" offset="0.5"/> |
| 74 |
<stop stop-color="lime" offset="1"/> |
| 75 |
</linearGradient> |
| 76 |
<rect x="20" y="20" width="440" height="50" fill="url(#Grad1)"/> |
| 77 |
<text font-size="30" x="20" y="100">scale(0.5) on gradient</text> |
| 78 |
<!-- ====================================================================== --> |
| 79 |
<!-- Radial Gradiant with a gradientTransform --> |
| 80 |
<!-- ====================================================================== --> |
| 81 |
<radialGradient id="Grad2" gradientUnits="userSpaceOnUse" cx="0" cy="0" fx="0" fy="0" r="60" gradientTransform="translate(240,155) skewX(45)"> |
| 82 |
<stop stop-color="black" offset="0"/> |
| 83 |
<stop stop-color="rgb(255,165,0)" offset="1"/> |
| 84 |
</radialGradient> |
| 85 |
<rect x="20" y="110" width="440" height="50" fill="url(#Grad2)"/> |
| 86 |
<text font-size="30" x="20" y="190">skewX(45) on gradient</text> |
| 87 |
<!-- ====================================================================== --> |
| 88 |
<!-- Pattern filled rectangles with a patternTransform. --> |
| 89 |
<!-- ====================================================================== --> |
| 90 |
<pattern patternUnits="userSpaceOnUse" id="Pat3" x="0" y="0" width="20" height="20" patternTransform="translate(25 215) scale(2) skewX(45)"> |
| 91 |
<rect x="0" y="0" width="10" height="10" fill="maroon"/> |
| 92 |
<rect x="10" y="0" width="10" height="10" fill="green"/> |
| 93 |
<rect x="0" y="10" width="10" height="10" fill="blue"/> |
| 94 |
<rect x="10" y="10" width="10" height="10" fill="yellow"/> |
| 95 |
</pattern> |
| 96 |
<rect x="20" y="210" width="440" height="50" fill="url(#Pat3)"/> |
| 97 |
<text font-size="30" x="20" y="290">scale(2), skewX(45) on pattern</text> |
| 98 |
</g> |
| 99 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 100 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.9 $</text> |
| 101 |
</g> |
| 102 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
| 103 |
<!-- comment out this watermark once the test is approved --> |
| 104 |
<!--<g id="draft-watermark"> |
| 105 |
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/> |
| 106 |
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240" |
| 107 |
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text> |
| 108 |
</g>--> |
| 109 |
</svg> |