[librsvg/rustification] Start adding SVG tests for gradients



commit 4a37888a5d2a10eab2ce179a073ba9b7c23b6562
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Nov 11 09:57:34 2016 -0600

    Start adding SVG tests for gradients
    
    Also, note in tests/README.md some peculiarities of the official SVG test suite.

 tests/README.md                                    |   49 +++++++++
 .../reftests/svg1.1/pservers-grad-01-b-ref.png     |  Bin 0 -> 9700 bytes
 .../reftests/svg1.1/pservers-grad-01-b.svg         |   69 ++++++++++++
 .../reftests/svg1.1/pservers-grad-02-b-ref.png     |  Bin 0 -> 22580 bytes
 .../reftests/svg1.1/pservers-grad-02-b.svg         |   79 ++++++++++++++
 .../reftests/svg1.1/pservers-grad-03-b-ref.png     |  Bin 0 -> 9846 bytes
 .../reftests/svg1.1/pservers-grad-03-b.svg         |   77 ++++++++++++++
 .../reftests/svg1.1/pservers-grad-04-b-ref.png     |  Bin 0 -> 23971 bytes
 .../reftests/svg1.1/pservers-grad-04-b.svg         |   88 ++++++++++++++++
 .../reftests/svg1.1/pservers-grad-05-b-ref.png     |  Bin 0 -> 65245 bytes
 .../reftests/svg1.1/pservers-grad-05-b.svg         |   94 +++++++++++++++++
 .../reftests/svg1.1/pservers-grad-06-b-ref.png     |  Bin 0 -> 21269 bytes
 .../reftests/svg1.1/pservers-grad-06-b.svg         |  109 ++++++++++++++++++++
 .../reftests/svg1.1/pservers-grad-07-b-ref.png     |  Bin 0 -> 11103 bytes
 .../reftests/svg1.1/pservers-grad-07-b.svg         |   88 ++++++++++++++++
 .../reftests/svg1.1/pservers-grad-08-b-ref.png     |  Bin 0 -> 40248 bytes
 .../reftests/svg1.1/pservers-grad-08-b.svg         |  100 ++++++++++++++++++
 .../svg1.1/pservers-grad-stops-01-f-ref.png        |  Bin 0 -> 6740 bytes
 .../reftests/svg1.1/pservers-grad-stops-01-f.svg   |   70 +++++++++++++
 19 files changed, 823 insertions(+), 0 deletions(-)
---
diff --git a/tests/README.md b/tests/README.md
index 090a48c..25b38b0 100644
--- a/tests/README.md
+++ b/tests/README.md
@@ -152,6 +152,55 @@ just render the SVG image and output it to the specified PNG file.
 You can then run `make check` again and ensure that the tests pass.
 
 
+### Issues with the official SVG test suite
+
+Our SVG files in tests/fixtures/reftests/svg1.1 come from the "SVG 1.1
+Second Edition test suite" archive linked here:
+
+https://www.w3.org/Graphics/SVG/WG/wiki/Test_Suite_Overview
+
+We don't know how the reference PNG files in that archive are
+generated.  However, they are done in such a way that objects tend not
+to be pixel-aligned.  For example, many tests have a rectangular frame
+around the whole viewport, defined like this:
+
+  <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+
+This specifies no stroke with, so it uses 1 by default.  The desired
+effect is "stroke this rectangle with a 1-pixel wide line".
+
+However, notice that the (x, y) coordinates of the rect are (1, 1).
+This means that the actual bounds of the stroked outline are from
+(0.5, 0.5) to (479.5, 359.5).  The result is a fuzzy outline: it
+occupies two pixels of width, with each pixel having half-black
+coverage.
+
+Some elements in the reference PNG images from the official SVG test
+suite are pixel-aligned, and some are not, like the example test-frame
+above.  It looks like their renderer uses a (0.5, 0.5) offset just for
+strokes, but not for fills, which sounds hackish.
+
+Our test suite doesn't use special offsets so that SVG images not from
+the official test suite are rendered "normally".  This means that the
+reference images from the official test suite will always fail
+initially, since stroke outlines will be fuzzy in librsvg, but not in
+the test suite (and conversely, SVGs *not* from the test suite would
+be crips in librsvg but probably not in the test suite's renderer
+renderer).
+
+Also, the original reference PNGs either use fonts that are different
+from those usually on free software systems, or they use SVG fonts
+which librsvg currently doesn't support (with glyph shapes referenced
+from a secondary SVG).
+
+In any case, look at the results by hand, and compare them by eye to
+the official reference image.  If the thing being tested looks
+correct, and just the outlines are fuzzy --- and also it is just the
+actual font shapes that are different --- then the test is probably
+correct.  Follow the procedure as in "Regenerating reference images"
+listed above in order to have a reference image suitable for librsvg.
+
+
 ## Crash tests for crash.c
 
 These load and parse an SVG, and ensure that there are no errors in
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-01-b-ref.png 
b/tests/fixtures/reftests/svg1.1/pservers-grad-01-b-ref.png
new file mode 100644
index 0000000..218f4cf
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/pservers-grad-01-b-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-01-b.svg 
b/tests/fixtures/reftests/svg1.1/pservers-grad-01-b.svg
new file mode 100644
index 0000000..77b7565
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/pservers-grad-01-b.svg
@@ -0,0 +1,69 @@
+<svg version="1.1" baseProfile="basic" id="svg-root"
+  width="100%" height="100%" viewBox="0 0 480 360"
+  xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink";>
+  <!--======================================================================-->
+  <!--=  SVG 1.1 2nd Edition Test Case                                     =-->
+  <!--======================================================================-->
+  <!--=  Copyright 2009 World Wide Web Consortium, (Massachusetts          =-->
+  <!--=  Institute of Technology, European Research Consortium for         =-->
+  <!--=  Informatics and Mathematics (ERCIM), Keio University).            =-->
+  <!--=  All Rights Reserved.                                              =-->
+  <!--=  See http://www.w3.org/Consortium/Legal/.                          =-->
+  <!--======================================================================-->
+  <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/";
+    template-version="1.4" reviewer="SVGWG" author="Haroon Sheikh" status="accepted"
+    version="$Revision: 1.7 $" testname="$RCSfile: pservers-grad-01-b.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://www.w3.org/TR/SVG11/pservers.html#Gradients";>
+        <p>
+          Test that the viewer can handle the xlink:href attribute on
+          linear gradients. The top rectangle has a simple
+        blue (left) to lime (right) linear gradient. The lower one
+        has a different gradient definition, but
+        should look the same as the one above, because the gradient makes a
+        reference to the first gradient, without modifying any attribute.
+        </p>
+    </d:testDescription>
+    <d:operatorScript xmlns="http://www.w3.org/1999/xhtml";>            
+      <p>
+Run the test. No interaction required.
+      </p>
+    </d:operatorScript>
+    <d:passCriteria xmlns="http://www.w3.org/1999/xhtml";>
+      <p>
+        The test is passed if there are two rectangles, both with a blue to lime gradient. 
+      </p>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: pservers-grad-01-b.svg,v $</title>
+  <defs>
+    <font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F">
+      <font-face-src>
+        <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
+      </font-face-src>
+    </font-face>
+  </defs>
+  <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
+    <!-- ====================================================================== -->
+    <!-- Linear Gradient using a xlink:href to another linear gradient          -->
+    <!-- ====================================================================== -->
+    <linearGradient id="Grad1a" gradientUnits="objectBoundingBox" x1="0" y1="0" x2="1" y2="0">
+      <stop stop-color="blue" offset="0"/>
+      <stop stop-color="lime" offset="1"/>
+    </linearGradient>
+    <linearGradient id="Grad1b" xlink:href="#Grad1a"/>
+    <rect x="20" y="20" width="440" height="80" fill="url(#Grad1a)"/>
+    <text font-size="30" x="20" y="130">Linear gradient.</text>
+    <rect x="20" y="150" width="440" height="80" fill="url(#Grad1b)"/>
+    <text font-size="30" x="20" y="260">Referencing gradient below.</text>
+  </g>
+  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
+    <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.7 $</text>
+  </g>
+  <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+  <!-- comment out this watermark once the test is approved -->
+  <!--<g id="draft-watermark">
+    <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
+    <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
+      text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
+  </g>-->
+</svg>
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-02-b-ref.png 
b/tests/fixtures/reftests/svg1.1/pservers-grad-02-b-ref.png
new file mode 100644
index 0000000..0cb6a2a
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/pservers-grad-02-b-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-02-b.svg 
b/tests/fixtures/reftests/svg1.1/pservers-grad-02-b.svg
new file mode 100644
index 0000000..bbdfb9b
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/pservers-grad-02-b.svg
@@ -0,0 +1,79 @@
+<svg version="1.1" baseProfile="basic" id="svg-root"
+  width="100%" height="100%" viewBox="0 0 480 360"
+  xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink";>
+  <!--======================================================================-->
+  <!--=  SVG 1.1 2nd Edition Test Case                                     =-->
+  <!--======================================================================-->
+  <!--=  Copyright 2009 World Wide Web Consortium, (Massachusetts          =-->
+  <!--=  Institute of Technology, European Research Consortium for         =-->
+  <!--=  Informatics and Mathematics (ERCIM), Keio University).            =-->
+  <!--=  All Rights Reserved.                                              =-->
+  <!--=  See http://www.w3.org/Consortium/Legal/.                          =-->
+  <!--======================================================================-->
+  <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/";
+    template-version="1.4" reviewer="SVGWG" author="Haroon Sheikh" status="accepted"
+    version="$Revision: 1.8 $" testname="$RCSfile: pservers-grad-02-b.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://www.w3.org/TR/SVG11/pservers.html#Gradients";>
+      <p>
+        Test that the viewer can handle the xlink:href attribute on
+        radial gradients.
+      </p>
+      <p>
+        There are two rectangles. The top one has
+        a radial gradient (black to orange) that should appear elliptical
+        to fit the aspect ratio of the rectangle. The units are
+        specified in objectBoundingBox space. The gradient
+        on the lower one
+        references the gradient of the top rectangle, but modifies
+        the units to use userSpace instead. So it is only using the
+        stops from the gradient to the left, with a different geometry. The radial gradient appears circular.
+      </p>
+    </d:testDescription>
+    <d:operatorScript xmlns="http://www.w3.org/1999/xhtml";>            
+      <p>Run the test. No interaction required.</p>
+    </d:operatorScript>
+    <d:passCriteria xmlns="http://www.w3.org/1999/xhtml";>
+      <p>The test passes if the rendering matches the reference image, except
+      for any differences in text due to CSS2 rules.  Specifically:</p>
+      <ul>
+        <li>The top rectangle is filled with an elliptical radial gradient,
+        with black in the center and orange at the outside edges of the rectangle.</li>
+        <li>The bottom rectangle is filled with a circular radial gradient,
+        with black in the center and orange at the top and bottom edges of the rectangle.
+        Outside the circular area, the rectangle is filled with plain orange.</li>
+      </ul>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: pservers-grad-02-b.svg,v $</title>
+  <defs>
+    <font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F">
+      <font-face-src>
+        <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
+      </font-face-src>
+    </font-face>
+  </defs>
+  <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
+    <!-- ====================================================================== -->
+    <!-- Radial Gradient using a xlink:href to another radial gradient          -->
+    <!-- ====================================================================== -->
+    <radialGradient id="Grad2a" gradientUnits="objectBoundingBox" cx=".5" cy=".5" fx=".5" fy=".5" r=".5">
+      <stop stop-color="black" offset="0"/>
+      <stop stop-color="rgb(255,165,0)" offset="1"/>
+    </radialGradient>
+    <radialGradient id="Grad2b" xlink:href="#Grad2a" gradientUnits="userSpaceOnUse" cx="240" cy="190" 
fx="240" fy="190" r="40"/>
+    <rect x="20" y="20" width="440" height="80" fill="url(#Grad2a)"/>
+    <text font-size="30" x="20" y="130">Radial gradient.</text>
+    <rect x="20" y="150" width="440" height="80" fill="url(#Grad2b)"/>
+    <text font-size="30" x="20" y="260">Referencing gradient below.</text>
+  </g>
+  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
+    <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.8 $</text>
+  </g>
+  <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+  <!-- comment out this watermark once the test is approved -->
+  <!--<g id="draft-watermark">
+    <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
+    <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
+      text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
+  </g>-->
+</svg>
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-03-b-ref.png 
b/tests/fixtures/reftests/svg1.1/pservers-grad-03-b-ref.png
new file mode 100644
index 0000000..a153860
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/pservers-grad-03-b-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-03-b.svg 
b/tests/fixtures/reftests/svg1.1/pservers-grad-03-b.svg
new file mode 100644
index 0000000..f3dfc25
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/pservers-grad-03-b.svg
@@ -0,0 +1,77 @@
+<svg version="1.1" baseProfile="basic" id="svg-root"
+  width="100%" height="100%" viewBox="0 0 480 360"
+  xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink";>
+  <!--======================================================================-->
+  <!--=  SVG 1.1 2nd Edition Test Case                                     =-->
+  <!--======================================================================-->
+  <!--=  Copyright 2009 World Wide Web Consortium, (Massachusetts          =-->
+  <!--=  Institute of Technology, European Research Consortium for         =-->
+  <!--=  Informatics and Mathematics (ERCIM), Keio University).            =-->
+  <!--=  All Rights Reserved.                                              =-->
+  <!--=  See http://www.w3.org/Consortium/Legal/.                          =-->
+  <!--======================================================================-->
+  <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/";
+    template-version="1.4" reviewer="SVGWG" author="Haroon Sheikh" status="accepted"
+    version="$Revision: 1.8 $" testname="$RCSfile: pservers-grad-03-b.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://www.w3.org/TR/SVG11/pservers.html#Gradients";>
+      <p>
+        Test that the viewer can handle the xlink:href attribute on
+        patterns.
+      </p>
+      <p>
+        There are two rectangles with a pattern fill made
+        up of 4 rectangles. The pattern definition of the lower one references the pattern definition
+        of the upper one, using the xlink:href attribute. Because
+        the particular way that the patterns and rectangles are
+        defined in this test case, the two fills will appear the
+        same - the rectangles are positioned on pattern-size
+        boundaries, so that the offsets into the pattern at the left
+        edges of the respective rectangles is identical.
+      </p>
+    </d:testDescription>
+    <d:operatorScript xmlns="http://www.w3.org/1999/xhtml";>            
+      <p>
+        Run the test. No interaction required.
+      </p>
+    </d:operatorScript>
+    <d:passCriteria xmlns="http://www.w3.org/1999/xhtml";>
+      <p>The test passes if the rendering matches the reference image, except
+      for any differences in text due to CSS2 rules.  Note that the top rectangle must
+      look identical to the bottom rectangle.</p>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: pservers-grad-03-b.svg,v $</title>
+  <defs>
+    <font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F">
+      <font-face-src>
+        <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
+      </font-face-src>
+    </font-face>
+  </defs>
+  <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
+    <!-- ====================================================================== -->
+    <!-- Pattern filled rectangles using a xlink:href to another pattern fill   -->
+    <!-- ====================================================================== -->
+    <pattern id="Pat3a" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse">
+      <rect x="0" y="0" width="10" height="10" fill="#93D"/>
+      <rect x="10" y="0" width="10" height="10" fill="green"/>
+      <rect x="0" y="10" width="10" height="10" fill="blue"/>
+      <rect x="10" y="10" width="10" height="10" fill="yellow"/>
+    </pattern>
+    <pattern id="Pat3b" xlink:href="#Pat3a" width="20" height="20"/>
+    <rect x="20" y="20" width="440" height="80" fill="url(#Pat3a)"/>
+    <text font-size="30" x="20" y="130">Pattern fill.</text>
+    <rect x="20" y="160" width="440" height="80" fill="url(#Pat3b)"/>
+    <text font-size="30" x="20" y="270">Referencing pattern fill below.</text>
+  </g>
+  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
+    <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.8 $</text>
+  </g>
+  <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+  <!-- comment out this watermark once the test is approved -->
+  <!--<g id="draft-watermark">
+    <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
+    <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
+      text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
+  </g>-->
+</svg>
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-04-b-ref.png 
b/tests/fixtures/reftests/svg1.1/pservers-grad-04-b-ref.png
new file mode 100644
index 0000000..586ee66
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/pservers-grad-04-b-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-04-b.svg 
b/tests/fixtures/reftests/svg1.1/pservers-grad-04-b.svg
new file mode 100644
index 0000000..876a07a
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/pservers-grad-04-b.svg
@@ -0,0 +1,88 @@
+<svg version="1.1" baseProfile="basic" id="svg-root"
+  width="100%" height="100%" viewBox="0 0 480 360"
+  xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink";>
+  <!--======================================================================-->
+  <!--=  SVG 1.1 2nd Edition Test Case                                     =-->
+  <!--======================================================================-->
+  <!--=  Copyright 2009 World Wide Web Consortium, (Massachusetts          =-->
+  <!--=  Institute of Technology, European Research Consortium for         =-->
+  <!--=  Informatics and Mathematics (ERCIM), Keio University).            =-->
+  <!--=  All Rights Reserved.                                              =-->
+  <!--=  See http://www.w3.org/Consortium/Legal/.                          =-->
+  <!--======================================================================-->
+  <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/";
+    template-version="1.4" reviewer="SVGWG" author="Haroon Sheikh" status="accepted"
+    version="$Revision: 1.8 $" testname="$RCSfile: pservers-grad-04-b.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://www.w3.org/TR/SVG11/pservers.html#Gradients";>
+      <p>
+        Test that checks the capability of the stop element in linear and radial
+        gradients.
+      </p>
+      <p>
+        The first rectangle has a linear gradient fill with a vector starting at top left
+        and going to bottom right. The stop colors are at 20% spacing apart and are in the
+        following order : violet, blue, lime, yellow, orange, green.
+        Because the gradient vector vector goes from (0,0) to (1,1) in object bounding box space
+        and because the object bounding box has a larger width than height, the gradient vector
+        is skewed off of a pure 45 degree angle. The gradient stripes are also skewed
+        so that they are no longer perpendicular to the gradient vector.
+      </p>
+      <p>
+        The next rectangle has a radial gradient fill with a multi-color stops from innermost
+        to outermost in the following order: black, yellow, orange, blue, white, green.
+      </p>
+    </d:testDescription>
+    <d:operatorScript xmlns="http://www.w3.org/1999/xhtml";>           
+      <p>
+                               Run the test. No interaction required.
+      </p>
+    </d:operatorScript>
+    <d:passCriteria xmlns="http://www.w3.org/1999/xhtml";>
+      <p>The test passes if the rendering matches the reference image, except for
+      any differences in text due to CSS2 rules.</p>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: pservers-grad-04-b.svg,v $</title>
+  <defs>
+    <font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F">
+      <font-face-src>
+        <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
+      </font-face-src>
+    </font-face>
+  </defs>
+  <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
+    <linearGradient id="Grad1" gradientUnits="objectBoundingBox" x1="0" y1="0" x2="1" y2="1">
+      <stop stop-color="rgb(238,130,238)" offset="0"/>
+      <stop stop-color="blue" offset="0.2"/>
+      <stop stop-color="lime" offset="0.4"/>
+      <stop stop-color="yellow" offset="0.6"/>
+      <stop stop-color="rgb(255,165,0)" offset="0.8"/>
+      <stop stop-color="green" offset="1"/>
+    </linearGradient>
+    <rect x="20" y="20" width="440" height="80" fill="url(#Grad1)"/>
+    <text font-size="30" x="20" y="130">Multi-color linear gradient.</text>
+    <!-- ====================================================================== -->
+    <!-- Radial gradient on the stroke of a rectangle                  ======== -->
+    <!-- ====================================================================== -->
+    <radialGradient id="Grad2" gradientUnits="userSpaceOnUse" cx="240" cy="210" r="220" fx="240" fy="210">
+      <stop stop-color="black" offset="0"/>
+      <stop stop-color="yellow" offset="0.2"/>
+      <stop stop-color="orange" offset="0.4"/>
+      <stop stop-color="blue" offset="0.6"/>
+      <stop stop-color="white" offset="0.8"/>
+      <stop stop-color="green" offset="1"/>
+    </radialGradient>
+    <rect x="20" y="150" width="440" height="80" fill="url(#Grad2)" stroke-width="40"/>
+    <text font-size="30" x="20" y="260">Multi-color radial gradient.</text>
+  </g>
+  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
+    <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.8 $</text>
+  </g>
+  <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+  <!-- comment out this watermark once the test is approved -->
+  <!--<g id="draft-watermark">
+    <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
+    <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
+      text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
+  </g>-->
+</svg>
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-05-b-ref.png 
b/tests/fixtures/reftests/svg1.1/pservers-grad-05-b-ref.png
new file mode 100644
index 0000000..31315f7
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/pservers-grad-05-b-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-05-b.svg 
b/tests/fixtures/reftests/svg1.1/pservers-grad-05-b.svg
new file mode 100644
index 0000000..d08e1f7
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/pservers-grad-05-b.svg
@@ -0,0 +1,94 @@
+<svg version="1.1" baseProfile="basic" id="svg-root"
+  width="100%" height="100%" viewBox="0 0 480 360"
+  xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink";>
+  <!--======================================================================-->
+  <!--=  SVG 1.1 2nd Edition Test Case                                     =-->
+  <!--======================================================================-->
+  <!--=  Copyright 2009 World Wide Web Consortium, (Massachusetts          =-->
+  <!--=  Institute of Technology, European Research Consortium for         =-->
+  <!--=  Informatics and Mathematics (ERCIM), Keio University).            =-->
+  <!--=  All Rights Reserved.                                              =-->
+  <!--=  See http://www.w3.org/Consortium/Legal/.                          =-->
+  <!--======================================================================-->
+  <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/";
+    template-version="1.4" reviewer="SVGWG" author="Haroon Sheikh" status="accepted"
+    version="$Revision: 1.9 $" testname="$RCSfile: pservers-grad-05-b.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://www.w3.org/TR/SVG11/pservers.html#Gradients";>
+      <p>
+        Test that checks the capability of the stop opacity in linear and radial
+        gradients.
+      </p>
+      <p>
+        There are two tests which contain rectangles with gradients using stop-opacity properties.
+        A cyan color text string "Background" is put behind both of the rectangles to help
+        demonstrate the opacity concept.
+      </p>
+      <p>
+        From top-down the appearance of objects is as follows.
+      </p>
+      <p>
+        The first rectangle has a linear gradient fill with a vector starting at top left
+        and going to bottom right. The stop colors are at 20% spacing apart and are in the
+        following order : violet, blue, lime, yellow, orange, black.
+        Also a stop opacity is given to the colors in the following order: 1, 0.2, 0.5, 0, 0.8, 1
+        Because the gradient vector vector goes from (0,0) to (1,1) in object bounding box space
+        and because the object bounding box has a larger width than height, the gradient vector
+        is skewed off of a pure 45 degree angle. The gradient stripes are also skewed
+        so that they are no longer perpendicular to the gradient vector.
+      </p>
+      <p>
+        The next rectangle has a radial gradient fill with a multi-color stops from innermost
+        to outermost in the following order: black, yellow, red, blue, white, green.
+        Also a stop opacity is given to the colors in the following order: 1, 0.2, 0.5, 0, 0.8, 1
+      </p>
+    </d:testDescription>
+    <d:operatorScript xmlns="http://www.w3.org/1999/xhtml";>            
+      <p>Run the test. No interaction required.</p>
+    </d:operatorScript>
+    <d:passCriteria xmlns="http://www.w3.org/1999/xhtml";>
+      <p>The test passes if the rendering matches the reference image, except for
+      any differences in text due to CSS2 rules.</p>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: pservers-grad-05-b.svg,v $</title>
+  <defs>
+    <font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F">
+      <font-face-src>
+        <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
+      </font-face-src>
+    </font-face>
+  </defs>
+  <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
+    <text font-size="60" fill="aqua" x="70" y="80">Background</text>
+    <linearGradient id="Grad1" gradientUnits="objectBoundingBox" x1="0" y1="0" x2="1" y2="1">
+      <stop stop-color="rgb(238,130,238)" stop-opacity="1" offset="0"/>
+      <stop stop-color="blue" stop-opacity="0" offset="0.2"/>
+      <stop stop-color="lime" stop-opacity="0.5" offset="0.4"/>
+      <stop stop-color="yellow" stop-opacity="0.2" offset="0.6"/>
+      <stop stop-color="rgb(255,165,0)" stop-opacity="0.8" offset="0.8"/>
+      <stop stop-color="black" stop-opacity="1" offset="1"/>
+    </linearGradient>
+    <rect x="20" y="20" width="440" height="80" fill="url(#Grad1)"/>
+
+    <text font-size="60" fill="aqua" x="70" y="210">Background</text>
+    <radialGradient id="Grad2" gradientUnits="userSpaceOnUse" cx="240" cy="210" r="220" fx="240" fy="210">
+      <stop stop-color="black" stop-opacity="1" offset="0"/>
+      <stop stop-color="yellow" stop-opacity="0" offset="0.2"/>
+      <stop stop-color="red" stop-opacity="0.5" offset="0.4"/>
+      <stop stop-color="blue" stop-opacity="0.2" offset="0.6"/>
+      <stop stop-color="white" stop-opacity="0.8" offset="0.8"/>
+      <stop stop-color="green" stop-opacity="1" offset="1"/>
+    </radialGradient>
+    <rect x="20" y="150" width="440" height="80" fill="url(#Grad2)" stroke-width="40"/>
+  </g>
+  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
+    <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.9 $</text>
+  </g>
+  <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+  <!-- comment out this watermark once the test is approved -->
+  <!--<g id="draft-watermark">
+    <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
+    <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
+      text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
+  </g>-->
+</svg>
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-06-b-ref.png 
b/tests/fixtures/reftests/svg1.1/pservers-grad-06-b-ref.png
new file mode 100644
index 0000000..795af83
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/pservers-grad-06-b-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-06-b.svg 
b/tests/fixtures/reftests/svg1.1/pservers-grad-06-b.svg
new file mode 100644
index 0000000..374b1e3
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/pservers-grad-06-b.svg
@@ -0,0 +1,109 @@
+<svg version="1.1" baseProfile="basic" id="svg-root"
+  width="100%" height="100%" viewBox="0 0 480 360"
+  xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink";>
+  <!--======================================================================-->
+  <!--=  SVG 1.1 2nd Edition Test Case                                     =-->
+  <!--======================================================================-->
+  <!--=  Copyright 2009 World Wide Web Consortium, (Massachusetts          =-->
+  <!--=  Institute of Technology, European Research Consortium for         =-->
+  <!--=  Informatics and Mathematics (ERCIM), Keio University).            =-->
+  <!--=  All Rights Reserved.                                              =-->
+  <!--=  See http://www.w3.org/Consortium/Legal/.                          =-->
+  <!--======================================================================-->
+  <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/";
+    template-version="1.4" reviewer="SVGWG" author="Haroon Sheikh" status="accepted"
+    version="$Revision: 1.9 $" testname="$RCSfile: pservers-grad-06-b.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://www.w3.org/TR/SVG11/pservers.html#Gradients";>
+      <p>
+        Test that the viewer can handle the gradientTransform and the patternTransform
+        attribute on gradients and patterns respectively.
+      </p>
+      <p>
+        From top-down the appearance of objects is as follows.
+      </p>
+      <p>
+        The top rectangle has a linear gradient whose coordinate system has been scaled down by
+        a half. So the gradient travelling from left to right (from blue to green to lime) should
+        only occuply the left half the rectangle.
+      </p>
+      <p>
+        The next rectangle has radial gradient that has been translated to the center and skewed
+        in the positive X direction by 45 degrees. Therefore the gradient should appear
+        ellipltical and rotated around the center.
+      </p>
+      <p>
+        The last row contains a rectangle with pattern on the fill. The transformation on the
+        pattern moves the coordinate system to the top left of the rectangle and then scales it
+        by a factor of 2 and then skew's it in the X direction by 45 degrees. The pattern
+        consists of a 2 by 2 array of colored rectangles.
+      </p>
+    </d:testDescription>
+    <d:operatorScript xmlns="http://www.w3.org/1999/xhtml";>            
+      <p>Run the test. No interaction required.</p>
+    </d:operatorScript>
+    <d:passCriteria xmlns="http://www.w3.org/1999/xhtml";>
+      <p>The test passes if the rendering matches the reference image, apart
+      from any differences in font choice due to CSS2 rules.  Specifically:</p>
+      <ul>
+        <li>The top rectangle is filled with a linear gradient from blue on the left,
+        to lime in the middle.  The right half of the rectangle is filled with plain lime.</li>
+        <li>The middle rectangle is filled with an elliptical radial gradient with
+        black on the inside and orange on the outside.  The center point of the gradient
+        is near the center-bottom of the rectangle.  The gradient is skewed, so that it appears
+        as a rotated elliptical gradient.</li>
+        <li>The bottom rectangle is filled with a repeating pattern of tiled
+        red, green, yellow and blue parallelograms.</li>
+      </ul>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: pservers-grad-06-b.svg,v $</title>
+  <defs>
+    <font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F">
+      <font-face-src>
+        <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
+      </font-face-src>
+    </font-face>
+  </defs>
+  <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
+    <!-- ====================================================================== -->
+    <!-- Linear Gradient with gradientTransforms                                -->
+    <!-- ====================================================================== -->
+    <linearGradient id="Grad1" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="430" y2="0" 
gradientTransform="translate(25 35) scale(0.5)">
+      <stop stop-color="blue" offset="0"/>
+      <stop stop-color="green" offset="0.5"/>
+      <stop stop-color="lime" offset="1"/>
+    </linearGradient>
+    <rect x="20" y="20" width="440" height="50" fill="url(#Grad1)"/>
+    <text font-size="30" x="20" y="100">scale(0.5) on gradient</text>
+    <!-- ====================================================================== -->
+    <!-- Radial Gradiant with a gradientTransform                               -->
+    <!-- ====================================================================== -->
+    <radialGradient id="Grad2" gradientUnits="userSpaceOnUse" cx="0" cy="0" fx="0" fy="0" r="60" 
gradientTransform="translate(240,155) skewX(45)">
+      <stop stop-color="black" offset="0"/>
+      <stop stop-color="rgb(255,165,0)" offset="1"/>
+    </radialGradient>
+    <rect x="20" y="110" width="440" height="50" fill="url(#Grad2)"/>
+    <text font-size="30" x="20" y="190">skewX(45) on gradient</text>
+    <!-- ====================================================================== -->
+    <!-- Pattern filled rectangles with a patternTransform.                     -->
+    <!-- ====================================================================== -->
+    <pattern patternUnits="userSpaceOnUse" id="Pat3" x="0" y="0" width="20" height="20" 
patternTransform="translate(25 215) scale(2) skewX(45)">
+      <rect x="0" y="0" width="10" height="10" fill="maroon"/>
+      <rect x="10" y="0" width="10" height="10" fill="green"/>
+      <rect x="0" y="10" width="10" height="10" fill="blue"/>
+      <rect x="10" y="10" width="10" height="10" fill="yellow"/>
+    </pattern>
+    <rect x="20" y="210" width="440" height="50" fill="url(#Pat3)"/>
+    <text font-size="30" x="20" y="290">scale(2), skewX(45) on pattern</text>
+  </g>
+  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
+    <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.9 $</text>
+  </g>
+  <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+  <!-- comment out this watermark once the test is approved -->
+  <!--<g id="draft-watermark">
+    <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
+    <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
+      text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
+  </g>-->
+</svg>
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-07-b-ref.png 
b/tests/fixtures/reftests/svg1.1/pservers-grad-07-b-ref.png
new file mode 100644
index 0000000..96c6dc1
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/pservers-grad-07-b-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-07-b.svg 
b/tests/fixtures/reftests/svg1.1/pservers-grad-07-b.svg
new file mode 100644
index 0000000..9e9b32d
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/pservers-grad-07-b.svg
@@ -0,0 +1,88 @@
+<svg version="1.1" baseProfile="basic" id="svg-root"
+  width="100%" height="100%" viewBox="0 0 480 360"
+  xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink";>
+  <!--======================================================================-->
+  <!--=  SVG 1.1 2nd Edition Test Case                                     =-->
+  <!--======================================================================-->
+  <!--=  Copyright 2009 World Wide Web Consortium, (Massachusetts          =-->
+  <!--=  Institute of Technology, European Research Consortium for         =-->
+  <!--=  Informatics and Mathematics (ERCIM), Keio University).            =-->
+  <!--=  All Rights Reserved.                                              =-->
+  <!--=  See http://www.w3.org/Consortium/Legal/.                          =-->
+  <!--======================================================================-->
+  <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/";
+    template-version="1.4" reviewer="SVGWG" author="Haroon Sheikh" status="accepted"
+    version="$Revision: 1.8 $" testname="$RCSfile: pservers-grad-07-b.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://www.w3.org/TR/SVG11/pservers.html#Gradients";>
+      <p>
+        Test that the viewer has basic capability to handle linear gradients
+        on fills and stroke of objects and text.
+      </p>
+      <p>
+        This test uses the following elements : &lt;linearGradient&gt;, &lt;stop&gt;
+        and the following properties : stop-color, fill:url(#  ), stroke(url# )
+      </p>
+      <p>
+        Both elements in this test use the same simple gradient. It is a linear gradient from
+        blue (left) to lime (right). From top-down the appearance of objects is as follows.
+      </p>
+      <p>
+        The top rectangle should be filled with the gradient.
+      </p>
+      <p>
+        The next rectangle has no fill, but has a thick stroke on which the gradient is
+        applied.
+      </p>
+    </d:testDescription>
+    <d:operatorScript xmlns="http://www.w3.org/1999/xhtml";>            
+      <p>Run the test. No interaction required.</p>
+    </d:operatorScript>
+    <d:passCriteria xmlns="http://www.w3.org/1999/xhtml";>
+      <p>The test passes if the rendering matches the reference image, apart
+      from any differences in font choice due to CSS2 rules.  Specifically:</p>
+      <ul>
+        <li>The top rectangle is filled with a gradient from blue on the left to lime on the right.</li>
+        <li>The bottom rectangle is unfilled and stroked with a thick stroke using a gradient from blue on 
the left to lime on the right.</li>
+      </ul>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: pservers-grad-07-b.svg,v $</title>
+  <defs>
+    <font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F">
+      <font-face-src>
+        <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
+      </font-face-src>
+    </font-face>
+  </defs>
+  <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
+    <g transform="scale(1, 1.5)">
+      <!-- ====================================================================== -->
+      <!-- Very simple blue to red linear gradient from left to right  ========== -->
+      <!-- ====================================================================== -->
+      <linearGradient id="Gradient" gradientUnits="userSpaceOnUse" x1="10" y1="10" x2="440" y2="10">
+        <stop stop-color="blue" offset="0"/>
+        <stop stop-color="lime" offset="1"/>
+      </linearGradient>
+      <!-- ====================================================================== -->
+      <!-- Linear gradient on the fill of a rectangle                    ======== -->
+      <!-- ====================================================================== -->
+      <rect x="10" y="10" width="430" height="60" fill="url(#Gradient)"/>
+      <text font-size="24" x="10" y="90">Linear gradient filled rectangle</text>
+      <!-- ====================================================================== -->
+      <!-- Linear gradient on the stroke of a rectangle                  ======== -->
+      <!-- ====================================================================== -->
+      <rect x="25" y="110" width="400" height="30" fill="none" stroke="url(#Gradient)" stroke-width="20"/>
+      <text font-size="24" x="10" y="170">Linear gradient on stroke of rectangle</text>
+    </g>
+  </g>
+  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
+    <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.8 $</text>
+  </g>
+  <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+  <!-- comment out this watermark once the test is approved -->
+  <!--<g id="draft-watermark">
+    <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
+    <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
+      text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
+  </g>-->
+</svg>
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-08-b-ref.png 
b/tests/fixtures/reftests/svg1.1/pservers-grad-08-b-ref.png
new file mode 100644
index 0000000..173e9e7
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/pservers-grad-08-b-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-08-b.svg 
b/tests/fixtures/reftests/svg1.1/pservers-grad-08-b.svg
new file mode 100644
index 0000000..654ec8d
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/pservers-grad-08-b.svg
@@ -0,0 +1,100 @@
+<svg version="1.1" baseProfile="basic" id="svg-root"
+  width="100%" height="100%" viewBox="0 0 480 360"
+  xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink";>
+  <!--======================================================================-->
+  <!--=  SVG 1.1 2nd Edition Test Case                                     =-->
+  <!--======================================================================-->
+  <!--=  Copyright 2009 World Wide Web Consortium, (Massachusetts          =-->
+  <!--=  Institute of Technology, European Research Consortium for         =-->
+  <!--=  Informatics and Mathematics (ERCIM), Keio University).            =-->
+  <!--=  All Rights Reserved.                                              =-->
+  <!--=  See http://www.w3.org/Consortium/Legal/.                          =-->
+  <!--======================================================================-->
+  <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/";
+    template-version="1.4" reviewer="SVGWG" author="Haroon Sheikh" status="accepted"
+    version="$Revision: 1.13 $" testname="$RCSfile: pservers-grad-08-b.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://www.w3.org/TR/SVG11/pservers.html#Gradients";>
+      <p>
+        Test that the viewer has basic capability to handle linear gradients
+        on fills and stroke of text.
+      </p>
+      <p>
+        Both elements in this test use the same simple gradient. It is a linear gradient from blue (left) to 
lime (right). From top-down the appearance of objects is as follows.
+      </p>
+      <p>
+        The first item is a text string "Gradient on fill" with the gradient on the fill of the text.
+      </p>
+      <p>
+        The second item is a text string that is not filled. It has a 2 user unit stroke on which the 
gradient is applied.
+      </p>
+    </d:testDescription>
+    <d:operatorScript xmlns="http://www.w3.org/1999/xhtml";>
+      <p>Run the test. No interaction required.</p>
+    </d:operatorScript>
+    <d:passCriteria xmlns="http://www.w3.org/1999/xhtml";>
+      <p>The test passes if the rendering matches the reference image, apart
+      from any differences in font choice due to CSS2 rules.  Specifically:</p>
+      <ul>
+        <li>The text string "Gradient on fill" must be filled with a gradient
+        from blue on the left to lime on the right.</li>
+        <li>The text string "Gradient on stroke" must be unfilled and stroked with
+        a gradient from blue on the left to lime on the right.</li>
+      </ul>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: pservers-grad-08-b.svg,v $</title>
+  <defs>
+    <font-face font-family="SVGFreeSansASCII" unicode-range="U+0-7F">
+      <font-face-src>
+        <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
+      </font-face-src>
+    </font-face>
+  </defs>
+
+  <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
+  <style type="text/css">
+    @font-face {
+      font-family: Blocky;
+      src: url(woffs/Blocky.woff) format("woff");
+  </style>
+  <defs>
+      <font-face font-family="Blocky" unicode-range="U+0-7F">
+      <font-face-src>
+        <font-face-uri xlink:href="../resources/Blocky.svg#Blocky"/>
+      </font-face-src>
+    </font-face>
+  </defs>
+    <g transform="scale(1, 1.5)">
+      <!-- ====================================================================== -->
+      <!-- Very simple blue to red linear gradient from left to right  ========== -->
+      <!-- ====================================================================== -->
+      <linearGradient id="Gradient" gradientUnits="userSpaceOnUse" x1="10" y1="10" x2="440" y2="10">
+        <stop stop-color="blue" offset="0"/>
+        <stop stop-color="lime" offset="1"/>
+      </linearGradient>
+      <!-- ====================================================================== -->
+      <!-- Gradient on fill of text                                      ======== -->
+      <!-- ====================================================================== -->
+      <text font-family="Blocky" font-size="68" fill="url(#Gradient)" x="20" y="70">Gradient on fill</text>
+      <!-- ====================================================================== -->
+      <!-- Gradient on stroke of text                                    ======== -->
+      <!-- ====================================================================== -->
+      <text font-family="Blocky" x="20" y="160" font-size="55" fill="none" stroke="url(#Gradient)" 
stroke-width="3">Gradient on stroke</text>
+
+    </g>
+      <g font-family="SVGFreeSansASCII,sans-serif" font-size="28">
+        <text  x="40" y="145">Linear gradient on filled text</text>
+        <text  x="30" y="280">Linear gradient on stroke of text</text>
+      </g>
+  </g>
+  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
+    <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.13 $</text>
+  </g>
+  <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
+  <!-- comment out this watermark once the test is approved -->
+  <!--<g id="draft-watermark">
+    <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
+    <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
+      text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
+  </g>-->
+</svg>
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-stops-01-f-ref.png 
b/tests/fixtures/reftests/svg1.1/pservers-grad-stops-01-f-ref.png
new file mode 100644
index 0000000..22d9ef9
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/pservers-grad-stops-01-f-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/pservers-grad-stops-01-f.svg 
b/tests/fixtures/reftests/svg1.1/pservers-grad-stops-01-f.svg
new file mode 100644
index 0000000..d7d1581
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/pservers-grad-stops-01-f.svg
@@ -0,0 +1,70 @@
+<svg id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink";>
+  <!--======================================================================-->
+  <!--=  Copyright 2008 World Wide Web Consortium, (Massachusetts          =-->
+  <!--=  Institute of Technology, European Research Consortium for         =-->
+  <!--=  Informatics and Mathematics (ERCIM), Keio University).            =-->
+  <!--=  All Rights Reserved.                                              =-->
+  <!--=  See http://www.w3.org/Consortium/Legal/.                          =-->
+  <!--======================================================================-->
+  <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/"; template-version="1.4" 
reviewer="CM" author="Microsoft" status="reviewed" version="$Revision: 1.3 $" testname="$RCSfile: 
pservers-grad-stops-01-f.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://www.w3.org/TR/SVG/pservers.html#GradientStops";>
+      <p>
+        Test that gradient offset values less than zero are rounded up to zero and values more than one are 
rounded down to one.
+      </p>
+      <p>
+        The test defines four gradients, each with a single stop where the 'stop-color' is set to 'blue'.
+        The four gradients have 'offset' set to '-1', '-1%', '101%' and '2'.  Four rectangles reference
+        the gradients.  All of these should render as if they have plain blue fills.
+      </p>
+    </d:testDescription>
+    <d:operatorScript xmlns="http://www.w3.org/1999/xhtml";>
+      <p>Run the test. No interaction required.</p>
+    </d:operatorScript>
+    <d:passCriteria xmlns="http://www.w3.org/1999/xhtml";>
+      <p>
+        The test passed if there are four blue boxes on the page.
+      </p>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: pservers-grad-stops-01-f.svg,v $</title>
+  <defs>
+    <font-face
+      font-family="SVGFreeSansASCII"
+      unicode-range="U+0-7F">
+      <font-face-src>
+        <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
+      </font-face-src>
+    </font-face>
+  </defs>
+  <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
+    <defs>
+        <linearGradient id="gradient1">
+            <stop offset="-1" stop-color="blue" />
+        </linearGradient>
+        <linearGradient id="gradient2">
+            <stop offset="-1%" stop-color="blue" />
+        </linearGradient>
+        <linearGradient id="gradient3">
+            <stop offset="2" stop-color="blue" />
+        </linearGradient>
+        <linearGradient id="gradient4">
+            <stop offset="101%" stop-color="blue" />
+        </linearGradient>
+    </defs>
+    <rect fill="url(#gradient1)" stroke="black" stroke-width="5" x="10" y="10" width="100" height="100" />
+    <rect fill="url(#gradient2)" stroke="black" stroke-width="5" x="120" y="10" width="100" height="100" />
+    <rect fill="url(#gradient3)" stroke="black" stroke-width="5" x="10" y="120" width="100" height="100" />
+    <rect fill="url(#gradient4)" stroke="black" stroke-width="5" x="120" y="120" width="100" height="100" />
+  </g>
+  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
+    <text id="revision" x="10" y="340" stroke="none"
+      fill="black">$Revision: 1.3 $</text>
+  </g>
+  <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>
+  <!-- comment out this watermark once the test is approved -->
+  <g id="draft-watermark">
+    <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
+    <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
+      text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
+  </g>
+</svg>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]