| 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 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 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-09-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 gradientUnits attribute on linear gradients. |
| 19 |
It tests the following values of gradientUnits: default (userSpace), objectBoundingBox, |
| 20 |
and userSpaceOnUse. |
| 21 |
</p> |
| 22 |
<p> |
| 23 |
From top-down the appearance of objects is as follows. |
| 24 |
</p> |
| 25 |
<p> |
| 26 |
The first rectangle uses the default attributes on the linearGradient element. |
| 27 |
Therefore the linear gradient should default to objectBoundingBox. It should appear |
| 28 |
from the left edge of the rectangle (blue) to the right edge of the rectangle (lime). |
| 29 |
The rectangle is smaller than the viewport, because a previous version of the SVG spec had the default value be 'viewport'. |
| 30 |
The test fails if only a portion of the gradient is shown. |
| 31 |
</p> |
| 32 |
<p> |
| 33 |
The next rectangle uses gradientUnits=objectBoundingBox. The linear gradient should |
| 34 |
travel from blue (top) to lime (bottom). |
| 35 |
</p> |
| 36 |
<p> |
| 37 |
The last rectangle uses gradientUnits=userSpaceOnUse. The rectangle element is given it's |
| 38 |
own transformation and the gradient is assumed to be in this user space. |
| 39 |
The gradient should appear as a linear gradient from lime (left) to blue (right). |
| 40 |
</p> |
| 41 |
</d:testDescription> |
| 42 |
<d:operatorScript xmlns="http://www.w3.org/1999/xhtml"> |
| 43 |
<p>Run the test. No interaction required.</p> |
| 44 |
</d:operatorScript> |
| 45 |
<d:passCriteria xmlns="http://www.w3.org/1999/xhtml"> |
| 46 |
<p>The test passes if the rendering matches the reference image, apart |
| 47 |
from any differences in font choice due to CSS2 rules. Specifically:</p> |
| 48 |
<ul> |
| 49 |
<li>The top rectangle is filled with a linear gradient from lime on the left to blue on the right.</li> |
| 50 |
<li>The middle rectangle is filled with a linear gradient from blue on the top to lime on the bottom.</li> |
| 51 |
<li>The bottom rectangle is filled with a linear gradient from lime on the left to blue on the right.</li> |
| 52 |
</ul> |
| 53 |
</d:passCriteria> |
| 54 |
</d:SVGTestCase> |
| 55 |
<title id="test-title">$RCSfile: pservers-grad-09-b.svg,v $</title> |
| 56 |
<defs> |
| 57 |
<font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F"> |
| 58 |
<font-face-src> |
| 59 |
<font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/> |
| 60 |
</font-face-src> |
| 61 |
</font-face> |
| 62 |
</defs> |
| 63 |
<g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18"> |
| 64 |
<text font-size="15" x="10" y="25">Testing gradientUnits attribute</text> |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
<linearGradient id="Grad1"> |
| 69 |
<stop stop-color="lime" offset="0"/> |
| 70 |
<stop stop-color="blue" offset="1"/> |
| 71 |
</linearGradient> |
| 72 |
<rect x="125" y="35" width="200" height="50" fill="url(#Grad1)"/> |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
<linearGradient id="Grad2" gradientUnits="objectBoundingBox" x1="0" y1="0" x2="0" y2="1"> |
| 80 |
<stop stop-color="blue" offset="0"/> |
| 81 |
<stop stop-color="lime" offset="1"/> |
| 82 |
</linearGradient> |
| 83 |
<rect x="10" y="125" width="430" height="50" fill="url(#Grad2)"/> |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
<linearGradient id="Grad3" x1="0" y1="0" x2="0" y2="430" gradientUnits="userSpaceOnUse"> |
| 90 |
<stop stop-color="lime" offset="0"/> |
| 91 |
<stop stop-color="blue" offset="1"/> |
| 92 |
</linearGradient> |
| 93 |
<rect transform="translate(10, 260) rotate(-90)" x="0" y="0" width="50" height="430" fill="url(#Grad3)"/> |
| 94 |
|
| 95 |
|
| 96 |
</g> |
| 97 |
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32"> |
| 98 |
<text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.9 $</text> |
| 99 |
</g> |
| 100 |
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/> |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
</svg> |