1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE svg PUBLIC
"-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
4 <!--======================================================================-->
5 <!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
6 <!--= Institute of Technology, Institut National de Recherche en =-->
7 <!--= Informatique et en Automatique, Keio University). All Rights =-->
8 <!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
9 <!--======================================================================-->
10 <!-- ===================================================================== -->
12 <!-- gradPatt-linearGr-BE-02.svg -->
13 <!-- renamed for 1.1 suite to pservers-grad-09-b.svg -->
15 <!-- Test that the viewer can handle the gradientUnits attribute on -->
16 <!-- linear gradients. -->
18 <!-- Author : Haroon Sheikh 09-Feb-2000 -->
19 <!-- 1.1 revision by Rick Graham -->
22 <!-- 09-Feb-2000, HSS: Serial#1 created. -->
23 <!-- 28-Feb-2000, LRH: fix name ("02"), Ser#2 created. -->
24 <!-- 6-Mar-2000, HSS: Changed name to gradientPattern-linearGradient-BE -->
25 <!-- Increased size of legend box by 100. -->
26 <!-- Reorganized tests to focus on sections in spec. -->
27 <!-- Changed description. -->
28 <!-- Changed DOCTYPE and width & height on bounding rect-->
29 <!-- Serial#3 created. -->
30 <!-- 26-Apr-2000, DJ: changed be to BE -->
31 <!-- removed "should"s -->
32 <!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
33 <!-- 16-Aug-2000, LH="rename" ser#6. -->
35 <!-- ===================================================================== -->
36 <!--======================================================================-->
37 <!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
38 <!--= log messages, and therefore is no longer in the preceding preamble.=-->
39 <!--======================================================================-->
40 <svg version=
"1.1" baseProfile=
"basic" xmlns=
"http://www.w3.org/2000/svg" xmlns:
xlink=
"http://www.w3.org/1999/xlink" id=
"svg-root" width=
"100%" height=
"100%" viewBox=
"0 0 480 360">
41 <SVGTestCase xmlns=
"http://www.w3.org/2000/02/svg/testsuite/description/">
42 <OperatorScript version=
"$Revision: 1.7 $" testname=
"pservers-grad-09-b.svg">
44 Test that the viewer can handle the gradientUnits attribute on linear gradients.
45 It tests the following values of gradientUnits : default (userSpace), objectBoundingBox,
49 From top-down the appearance of objects is as follows.
52 The first rectangle uses the default attributes on the linearGradient element.
53 Therefore the linear gradient should default to objectBoundingBox. It should appear
54 from the left edge of therectangle (blue) to the right edge of the rectangle (red).
55 The rectangle is smaller than the viewport, because a previous version of the SVG spec had the default value be 'viewport'.
56 The test fails if only a portion of the gradient is shown.
59 The next rectangle uses gradientUnits=objectBoundingBox. The linear gradient should
60 travel from blue (top) to red (bottom).
63 The last rectangle uses gradientUnits=userSpaceOnUse. The rectangle element is given it's
64 own transformation and the gradient is assumed to be in this user space.
65 The gradient should appear as a linear gradient from red (left) to blue (right).
68 The rendered picture should match the reference image exactly, except for possible
69 variations in the labelling text (per CSS2 rules).
73 <title id=
"test-title">pservers-grad-
09-b.svg
</title>
74 <desc id=
"test-desc">Test that the viewer can handle the gradientUnits attribute on linear gradients.
</desc>
75 <!--======================================================================-->
76 <!--Content of Test Case follows... =====================-->
77 <!--======================================================================-->
78 <g id=
"test-body-content">
79 <text font-family=
"Arial" font-size=
"15" x=
"10" y=
"25">Testing gradientUnits attribute
</text>
80 <!-- ====================================================================== -->
81 <!-- Linear gradient with default attributes on <linear gradient> element. -->
82 <!-- ====================================================================== -->
83 <linearGradient id=
"Grad1">
84 <stop stop-color=
"red" offset=
"0"/>
85 <stop stop-color=
"blue" offset=
"1"/>
87 <rect x=
"125" y=
"35" width=
"200" height=
"50" fill=
"url(#Grad1)" />
88 <text font-family=
"Arial" font-size=
"12" x=
"10" y=
"100">Linear gradient with default attributes (thus, same as objectBoundingBox)
</text>
89 <!--text font-family="Arial" font-size="12" x="10" y="125">Gradient is from the viewport left edge (red) to viewport right edge (blue)</text-->
90 <text font-family="Arial" font-size="12" x="10" y="115">Gradient is from the object left edge (red) to object right edge (blue)</text>
91 <!-- ====================================================================== -->
92 <!-- Linear gradient with gradientUnits=objectBoundingBox ======== -->
93 <!-- ====================================================================== -->
94 <linearGradient id=
"Grad2" gradientUnits=
"objectBoundingBox" x1=
"0" y1=
"0" x2=
"0" y2=
"1">
95 <stop stop-color=
"blue" offset=
"0"/>
96 <stop stop-color=
"red" offset=
"1"/>
98 <rect x=
"10" y=
"125" width=
"430" height=
"50" fill=
"url(#Grad2)" />
99 <text font-family=
"Arial" font-size=
"12" x=
"10" y=
"190">gradientUnits=objectBoundingBox
</text>
100 <text font-family=
"Arial" font-size=
"12" x=
"10" y=
"205">Gradient is from the object top edge (blue) to object bottom edge (red)
</text>
101 <!-- ====================================================================== -->
102 <!-- Gradient using gradientUnits="userSpaceOnUse" -->
103 <!-- ====================================================================== -->
104 <linearGradient id=
"Grad3" x1=
"0" y1=
"0" x2=
"0" y2=
"430" gradientUnits=
"userSpaceOnUse">
105 <stop stop-color=
"red" offset=
"0"/>
106 <stop stop-color=
"blue" offset=
"1"/>
108 <rect transform=
"translate(10, 260) rotate(-90)" x=
"0" y=
"0" width=
"50" height=
"430" fill=
"url(#Grad3)" />
109 <text font-family=
"Arial" font-size=
"12" x=
"10" y=
"275">gradientUnits=userSpaceOnUse
</text>
110 <text font-family=
"Arial" font-size=
"12" x=
"10" y=
"290">Gradient is from the object left edge (red) to object right edge (blue)
</text>
114 <text id=
"revision" x=
"10" y=
"340" font-size=
"40" stroke=
"none" fill=
"black">$Revision:
1.7 $
</text>
115 <rect id=
"test-frame" x=
"1" y=
"1" width=
"478" height=
"358" fill=
"none" stroke=
"#000000"/>