[librsvg/librsvg-2.40] Add a bunch of masking/clipping tests from the SVG test suite



commit ad3daec79eddbe00641e94346c78c7e06f1611fe
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Sep 1 07:54:33 2017 -0500

    Add a bunch of masking/clipping tests from the SVG test suite

 .../reftests/svg1.1/masking-intro-01-f-ref.png     |  Bin 0 -> 14528 bytes
 .../reftests/svg1.1/masking-intro-01-f.svg         |   81 ++++++++++++
 .../reftests/svg1.1/masking-mask-01-b-ref.png      |  Bin 0 -> 17887 bytes
 .../fixtures/reftests/svg1.1/masking-mask-01-b.svg |  131 +++++++++++++++++++
 .../reftests/svg1.1/masking-mask-02-f-ref.png      |  Bin 0 -> 4512 bytes
 .../fixtures/reftests/svg1.1/masking-mask-02-f.svg |   50 ++++++++
 .../reftests/svg1.1/masking-opacity-01-b-ref.png   |  Bin 0 -> 30924 bytes
 .../reftests/svg1.1/masking-opacity-01-b.svg       |  125 ++++++++++++++++++
 .../reftests/svg1.1/masking-path-01-b-ref.png      |  Bin 0 -> 12226 bytes
 .../fixtures/reftests/svg1.1/masking-path-01-b.svg |   95 ++++++++++++++
 .../reftests/svg1.1/masking-path-02-b-ref.png      |  Bin 0 -> 13294 bytes
 .../fixtures/reftests/svg1.1/masking-path-02-b.svg |   84 ++++++++++++
 .../reftests/svg1.1/masking-path-03-b-ref.png      |  Bin 0 -> 23263 bytes
 .../fixtures/reftests/svg1.1/masking-path-03-b.svg |  134 ++++++++++++++++++++
 .../reftests/svg1.1/masking-path-04-b-ref.png      |  Bin 0 -> 88260 bytes
 15 files changed, 700 insertions(+), 0 deletions(-)
---
diff --git a/tests/fixtures/reftests/svg1.1/masking-intro-01-f-ref.png 
b/tests/fixtures/reftests/svg1.1/masking-intro-01-f-ref.png
new file mode 100644
index 0000000..ea43014
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/masking-intro-01-f-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/masking-intro-01-f.svg 
b/tests/fixtures/reftests/svg1.1/masking-intro-01-f.svg
new file mode 100644
index 0000000..4a0357b
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/masking-intro-01-f.svg
@@ -0,0 +1,81 @@
+<svg version="1.1" baseProfile="full" 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="CL" author="BB" status="accepted"
+    version="$Revision: 1.6 $" testname="$RCSfile: masking-intro-01-f.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://www.w3.org/TR/SVG11/masking.html#Introduction";>
+      <p>
+        The rules are different regarding the geometry of a shape when clipping and masking.
+        For example, a clip-path does not take into account the stroke of the shape used for clipping.
+        It is however, used when masking.
+      </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 identical darkblue circles at the top of the illustration, and
+        below those two circles, two more circles should appear. They are of lighter appearance,
+        the one on the left has a darker and thick stroke.
+      </p>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: masking-intro-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">
+    <g shape-rendering="geometricPrecision">
+      <title id="test-title">masking-mask-04-f.svg</title>
+      <desc id="test-desc">Tests the impact of strokes within clipPath and mask</desc>
+      <text font-size="18" x="240" y="35" text-anchor="middle">Testing stroke inclusion for 'clip-path' and 
'mask'</text>
+
+      <defs>
+        <clipPath id="one" clipPathUnits="objectBoundingBox">
+          <circle cx="0.3" cy="0.5" r="0.2" stroke-width="0.15" fill="none" stroke="red"/>
+          <circle cx="0.7" cy="0.5" r="0.2" stroke-width="0.15" fill="none" stroke="none"/>
+        </clipPath>
+      </defs>
+
+      <rect x="150" y="0" width="200" height="200" fill="darkblue" clip-path="url(#one)"/>
+      <text x="50" y="110">With a 'clip-path':</text>
+
+      <defs>
+        <mask id="two" maskUnits="objectBoundingBox" maskContentUnits="objectBoundingBox" 
color-interpolation="linearRGB">
+          <circle cx="0.3" cy="0.5" r="0.2" stroke-width="0.15" fill="blue" stroke="red"/>
+          <circle cx="0.7" cy="0.5" r="0.2" stroke-width="0.15" fill="blue" stroke="none"/>
+        </mask>
+      </defs>
+
+      <rect x="150" y="150" width="200" height="200" fill="darkblue" mask="url(#two)"/>
+      <text x="50" y="260">With a 'mask':</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.6 $</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/masking-mask-01-b-ref.png 
b/tests/fixtures/reftests/svg1.1/masking-mask-01-b-ref.png
new file mode 100644
index 0000000..a0065d9
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/masking-mask-01-b-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/masking-mask-01-b.svg 
b/tests/fixtures/reftests/svg1.1/masking-mask-01-b.svg
new file mode 100644
index 0000000..5928d57
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/masking-mask-01-b.svg
@@ -0,0 +1,131 @@
+<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: masking-mask-01-b.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://www.w3.org/TR/SVG11/masking.html#Masking";>
+      <p>
+        Test to see if the masking features using the mask element and mask
+        property are available.
+      </p>
+      <p>
+        A red rectangle is displayed in the background to help view the result
+        of transparency and masking.
+      </p>
+      <p>
+        From top to bottom, the tests are as follows.
+      </p>
+      <p>
+        In the top test, a linear gradient is used inside the mask to change the opacity
+        of the rectangle from 1.0 (at the top) to 0.5 (at the bottom).
+      </p>
+      <p>
+        In the second test, a simple 50% opaque rectangle is used as a mask.
+      </p>
+      <p>
+        In the third test, no mask is used, but a rectangle is shown with 50% opacity.
+        The second and third test should look the same.
+      </p>
+      <p>
+        Lastly, a string of text has a mask applied to it. The mask only covers a partial
+        area of the text, so the text should only be half visible. Also the mask consists
+        of 4 rectangles with various levels of opacity.
+      </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 rendered picture should match the reference image, except
+        variations are possible in the labelling text (per CSS2 rules).
+      </p>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: masking-mask-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">
+  <style type="text/css">
+  @font-face {
+     font-family: larabie-anglepoise;
+     src: url(woffs/anglepoi.woff) format("woff");
+     }
+  </style>
+    <defs>
+      <font horiz-adv-x="313">
+        <!-- Converted from Larabie Anglepoise by Batik ttf2svg -->
+        <font-face font-family="larabie-anglepoise" units-per-em="1000" panose-1="0 0 4 0 0 0 0 0 0 0" 
ascent="703" descent="-300" alphabetic="0"/>
+        <missing-glyph horiz-adv-x="500" d="M63 0V700H438V0H63ZM125 63H375V638H125V63Z"/>
+        <glyph unicode="S" glyph-name="S" horiz-adv-x="385" d="M371 1H29V144H264Q264 151 264 166Q265 180 265 
188Q265 212 249 212H132Q83 212 55 247Q29 279 29 329V566H335V422H136V375Q136 360 144 356Q148 355 168 
355H279Q327 355 352 309Q371 273 371 221V1Z"/>
+        <glyph unicode="V" glyph-name="V" horiz-adv-x="351" d="M365 563L183 -33L0 563H101L183 296L270 
563H365Z"/>
+        <glyph unicode="G" glyph-name="G" horiz-adv-x="367" d="M355 
1H18V564H355V420H125V144H248V211H156V355H355V1Z"/>
+        <hkern g1="V" g2="G" k="-40"/>
+      </font>
+    </defs>
+    <g font-family="SVGFreeSansASCII,sans-serif">
+    <text font-size="14" x="10" y="20">Test for mask support</text>
+    <!-- Draw a red rectangle in the background -->
+    <rect x="10" y="30" width="100" height="260" fill="red"/>
+    <!-- Apply a gradient ramp based opacity -->
+    <mask id="mask1" maskUnits="userSpaceOnUse" x="60" y="50" width="100" height="60" 
color-interpolation="linearRGB">
+      <defs>
+        <linearGradient gradientUnits="userSpaceOnUse" id="Grad1" x1="60" y1="50" x2="60" y2="120">
+          <stop stop-color="white" stop-opacity="1" offset="0"/>
+          <stop stop-color="white" stop-opacity="0.5" offset="1"/>
+        </linearGradient>
+      </defs>
+      <rect x="60" y="50" width="100" height="60" fill="url(#Grad1)"/>
+    </mask>
+    <rect x="60" y="50" width="100" height="60" fill="lime" mask="url(#mask1)"/>
+    <text font-size="12" x="200" y="65">Mask with linear gradient from</text>
+    <text font-size="12" x="200" y="80">opacity=1 to opactity=0.5</text>
+    <!-- Simulate a uniform opacity using a mask -->
+    <mask id="mask2" maskUnits="userSpaceOnUse" x="60" y="120" width="100" height="30" 
color-interpolation="linearRGB">
+      <rect x="60" y="120" width="100" height="30" fill-opacity="0.5" fill="white"/>
+    </mask>
+    <rect x="60" y="120" width="100" height="30" fill="lime" mask="url(#mask2)"/>
+    <text font-size="12" x="200" y="135">Mask with uniform opacity of 0.5</text>
+    <!-- Apply a uniform opacity -->
+    <rect x="60" y="160" width="100" height="30" fill="lime" fill-opacity="0.5"/>
+    <text font-size="12" x="200" y="175">Rectangle with uniform opacity of 0.5</text>
+    <!-- Apply a mask to text -->
+    <mask id="mask3" maskUnits="userSpaceOnUse" x="60" y="200" width="200" height="100" 
color-interpolation="linearRGB">
+      <rect x="60" y="200" width="200" height="25" fill="white" fill-opacity="0.5"/>
+      <rect x="60" y="225" width="200" height="25" fill="white" fill-opacity="0.2"/>
+      <rect x="60" y="250" width="200" height="25" fill="white" fill-opacity="1"/>
+      <rect x="60" y="275" width="200" height="25" fill="white" fill-opacity="0.7"/>
+    </mask>
+    <text x="60" y="280" font-family="larabie-anglepoise" font-size="110" fill="lime" 
mask="url(#mask3)">SVG</text>
+    <text  font-size="12" x="200" y="225">Text with mask containing rectangles</text>
+    <text  font-size="12" x="200" y="240">of various opacities</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/masking-mask-02-f-ref.png 
b/tests/fixtures/reftests/svg1.1/masking-mask-02-f-ref.png
new file mode 100644
index 0000000..58b475a
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/masking-mask-02-f-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/masking-mask-02-f.svg 
b/tests/fixtures/reftests/svg1.1/masking-mask-02-f.svg
new file mode 100644
index 0000000..38cd942
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/masking-mask-02-f.svg
@@ -0,0 +1,50 @@
+<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="CL" author="Microsoft" status="accepted" version="$Revision: 1.3 $" testname="$RCSfile: 
masking-mask-02-f.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://dev.w3.org/SVG/profiles/1.1F2/publish/masking.html#Masking";>
+      <p>
+        If the 'mask' property references a 'mask' element containing no children, the element referencing 
it is not rendered.
+      </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>
+        Test passes if there is a single green rectangle, with no red visible on the page.
+      </p>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: masking-mask-02-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">
+    <mask id="testMask" />
+    <rect x="100" y="100" width="250" height="150" fill="green" />
+    <rect x="100" y="100" width="250" height="150" fill="red" mask="url(#testMask)" />
+  </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>
\ No newline at end of file
diff --git a/tests/fixtures/reftests/svg1.1/masking-opacity-01-b-ref.png 
b/tests/fixtures/reftests/svg1.1/masking-opacity-01-b-ref.png
new file mode 100644
index 0000000..fa6bfea
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/masking-opacity-01-b-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/masking-opacity-01-b.svg 
b/tests/fixtures/reftests/svg1.1/masking-opacity-01-b.svg
new file mode 100644
index 0000000..ce34cae
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/masking-opacity-01-b.svg
@@ -0,0 +1,125 @@
+<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.6 $" testname="$RCSfile: masking-opacity-01-b.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://www.w3.org/TR/SVG11/masking.html#ObjectAndGroupOpacityProperties";>
+      <p>
+        Test to see the effect of applying an opacity property to a group.
+      </p>
+      <p>
+        A blue rectangle with a green rectangle on top are contained in a
+        group. This opacity of the group and the opacity of the rectangles are
+        changed in this test. A red rectangle is provided in the background so
+        that opacity changes are obvious visually.
+      </p>
+      <p>
+        From top to bottom, the tests are as follows.
+      </p>
+      <p>
+        In the top test, the opacities of the group and the individual rectangles are
+        all set to 1. 
+      </p>
+      <p>
+        In the second test, the group is given an opacity of 0.5. 
+      </p>
+      <p>
+        In the third test, the group maintains a group opacity of 1 whereas each individual
+        rectangle is given an opacity of 0.5 in the group. 
+      </p>
+      <p>
+        Lastly, the group and individual rectangles are all given an opacity of 0.5.
+      </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>
+        In the top test, the green rectangle should appear on top of the blue
+        rectangle.
+      </p>
+      <p>
+        In the second test, the blue
+        rectangle should not show through in the region where the green and blue overlap.
+      </p>
+      <p>
+        In the third test, the blue rectangle
+        should show through in the overlap region.
+      </p>
+      <p>
+        Lastly, the
+        result should be similar to the previous test only fainter (because the opacity) is
+        resulting in less contribution.
+      </p>
+      <p>
+        The rendered picture should match the reference image exactly, except for possible
+        variations in the labelling text (per CSS2 rules).
+      </p>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: masking-opacity-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">
+    <text font-size="24" x="50" y="27">Test for opacity property on a group.</text>
+    <rect x="10" y="30" width="100" height="260" fill="red"/>
+    <g opacity="1">
+      <rect x="60" y="50" width="80" height="40" fill="blue"/>
+      <rect x="70" y="60" width="80" height="40" fill="lime"/>
+    </g>
+    <text font-size="20" x="200" y="62">Group opacity: 1</text>
+    <text font-size="20" x="200" y="80">Blue rectangle opacity: 1</text>
+    <text font-size="20" x="200" y="98">Green rectangle opacity: 1</text>
+    <g opacity="0.5">
+      <rect x="60" y="110" width="80" height="40" fill="blue"/>
+      <rect x="70" y="120" width="80" height="40" fill="lime"/>
+    </g>
+    <text font-size="20" x="200" y="122">Group opacity: 0.5</text>
+    <text font-size="20" x="200" y="140">Blue rectangle opacity: 1</text>
+    <text font-size="20" x="200" y="158">Green rectangle opacity: 1</text>
+    <g opacity="1">
+      <rect x="60" y="170" width="80" height="40" fill="blue" opacity=".5"/>
+      <rect x="70" y="180" width="80" height="40" fill="lime" opacity=".5"/>
+    </g>
+    <text font-size="20" x="200" y="182">Group opacity: 1</text>
+    <text font-size="20" x="200" y="200">Blue rectangle opacity: 0.5</text>
+    <text font-size="20" x="200" y="218">Green rectangle opacity: 0.5</text>
+    <g opacity="0.5">
+      <rect x="60" y="230" width="80" height="40" fill="blue" opacity=".5"/>
+      <rect x="70" y="240" width="80" height="40" fill="lime" opacity=".5"/>
+    </g>
+    <text font-size="20" x="200" y="242">Group opacity: 0.5</text>
+    <text font-size="20" x="200" y="260">Blue rectangle opacity: 0.5</text>
+    <text font-size="20" x="200" y="278">Green rectangle opacity: 0.5</text>
+  </g>
+  <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
+    <text id="revision" x="10" y="340" stroke="none" fill="black">$Revision: 1.6 $</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/masking-path-01-b-ref.png 
b/tests/fixtures/reftests/svg1.1/masking-path-01-b-ref.png
new file mode 100644
index 0000000..a5de871
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/masking-path-01-b-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/masking-path-01-b.svg 
b/tests/fixtures/reftests/svg1.1/masking-path-01-b.svg
new file mode 100644
index 0000000..81dbc8d
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/masking-path-01-b.svg
@@ -0,0 +1,95 @@
+<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="CL" author="LH" status="accepted"
+    version="$Revision: 1.7 $" testname="$RCSfile: masking-path-01-b.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://www.w3.org/TR/SVG11/masking.html#ClippingPaths";>
+      <p>
+        Test to see if the basic clipping works using the clipPath element
+        and the clip-path property.
+      </p>
+      <p>
+        This test uses the following elements : &lt;clipPath&gt; and the following
+        properties : clip-path.
+      </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 at the top shows an orange rectangle (with black stroke) being clipped by another rectangle.
+        So only the middle portion of the orange rectangle should be visible. Also the black stroke should
+        only be visible along the top and bottom edge of the rectangle.
+      </p>
+      <p>
+        The example at the bottom has a group containing a text string and two rectangles. The group
+        has a clipping path defined using two  overlapping rectangles. Of concern is the overlapping area
+        shared by the two rectangles. There should not be holes in this overlapping area, the
+        clip region is the union of the two rectangles. For clarity,
+        guide rectangles in grey show the position of the clipping rectangles.
+      </p>
+      <p>
+        The rendered picture should match the reference image exactly, except for possible
+        variations in the labelling text (per CSS2 rules).
+      </p>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: masking-path-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">
+    <g shape-rendering="geometricPrecision">
+      <!--text font-size="14"  x="10" y="20">Test for clipping using clipPath element</text-->
+      <defs>
+        <clipPath id="clip1">
+          <rect x="200" y="10" width="60" height="100"/>
+        </clipPath>
+        <clipPath id="clip2">
+          <rect x="90" y="150" width="175" height="100"/>
+          <rect x="225" y="160" width="95" height="75"/>
+        </clipPath>
+      </defs>
+      <rect x="20" y="20" width="440" height="60" fill="orange" stroke="black" stroke-width="5" 
clip-path="url(#clip1)"/>
+      <text font-size="30" x="20" y="130">Rectangle being clipped</text>
+      <g clip-path="url(#clip2)">
+        <rect x="115" y="190" width="225" height="40" fill="aqua" stroke="blue" stroke-width="5"/>
+        <rect x="115" y="240" width="225" height="40" fill="lime" stroke="green" stroke-width="5"/>
+        <text font-size="30" x="115" y="180">Line of text to be clipped</text>
+      </g>
+      <text font-size="30" x="20" y="280">Group being clipped</text>
+      <!--  show the two rects and the overlap area -->
+      <g fill="none" stroke="#999" stroke-width="2">
+        <rect x="90" y="150" width="175" height="100"/>
+        <rect x="225" y="160" width="95" height="75"/>
+      </g>
+    </g>
+  </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/masking-path-02-b-ref.png 
b/tests/fixtures/reftests/svg1.1/masking-path-02-b-ref.png
new file mode 100644
index 0000000..8948b23
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/masking-path-02-b-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/masking-path-02-b.svg 
b/tests/fixtures/reftests/svg1.1/masking-path-02-b.svg
new file mode 100644
index 0000000..d952df1
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/masking-path-02-b.svg
@@ -0,0 +1,84 @@
+<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: masking-path-02-b.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://www.w3.org/TR/SVG11/masking.html#ClippingPaths";>
+      <p>
+        Test to see if clipPathUnits attribute is handled properly on a
+        clipPath element. Only tests the userSpaceOnUse and
+        objectBoundingBox items of the clipPathUnits. userSpace has been
+        tested by the previous test as it is the default.
+      </p>
+      <p>
+        The test at the top shows a pink rectangle that has been clipped by a
+        rectangular clipping path. The clipping path is defined using clipPathUnits=objectBoundingBox.
+        
+      </p>
+      <p>
+        The example at the bottom a rotated blue rectangle that has been clipped by a
+        rectangular clipping path. The clipping path is defined using clipPathUnits=userSpaceOnUse.
+        
+      </p>
+      <p>
+        The rendered picture should match the reference image exactly, except for possible
+        variations in the labelling text (per CSS2 rules).
+      </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 pink rectangle and blue diamond do not have any
+        color painted outside of their black borders.
+      </p>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: masking-path-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">
+    <g shape-rendering="geometricPrecision">
+      <clipPath id="clip1" clipPathUnits="objectBoundingBox">
+        <rect x=".25" y=".5" width=".6" height="1"/>
+      </clipPath>
+      <rect x="10" y="10" width="430" height="80" fill="#F08" clip-path="url(#clip1)"/>
+      <rect x="117" y="50" width="258" height="40" fill="none" stroke="black" stroke-width="4"/>
+      <text font-size="30" x="20" y="130">clipPathUnits=objectBoundingBox</text>
+      <clipPath id="clip2" clipPathUnits="userSpaceOnUse">
+        <rect x="60" y="60" width="80" height="80"/>
+      </clipPath>
+      <rect transform="translate(100 200) rotate(-45)" x="0" y="0" width="120" height="120" fill="blue" 
clip-path="url(#clip2)"/>
+      <rect transform="translate(100 200) rotate(-45)" x="60" y="60" width="60" height="60" fill="none" 
stroke="black" stroke-width="4"/>
+      <text font-size="30" x="20" y="280">clipPathUnits=userSpaceOnUse</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/masking-path-03-b-ref.png 
b/tests/fixtures/reftests/svg1.1/masking-path-03-b-ref.png
new file mode 100644
index 0000000..8d80406
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/masking-path-03-b-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/masking-path-03-b.svg 
b/tests/fixtures/reftests/svg1.1/masking-path-03-b.svg
new file mode 100644
index 0000000..92186a6
--- /dev/null
+++ b/tests/fixtures/reftests/svg1.1/masking-path-03-b.svg
@@ -0,0 +1,134 @@
+<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="Jon Ferraiolo" status="accepted"
+    version="$Revision: 1.7 $" testname="$RCSfile: masking-path-03-b.svg,v $">
+    <d:testDescription xmlns="http://www.w3.org/1999/xhtml"; 
href="http://www.w3.org/TR/SVG11/masking.html#ClippingPaths";>
+      <p>
+        Test 'overflow'/'clip' on outermost and inner 'svg' elements.
+      </p>
+      <p>
+        There are two parts to the test. The first part tests viewport clipping
+        on outermost 'svg' elements. The second part tests viewport clipping
+        on inner 'svg' elements.
+      </p>
+      <p>
+        The test case also tests the initial value of the 'overflow' property
+        to ensure that it is set to 'hidden' for all 'svg' elements.
+        Tester should zoom out and/or pan to check this.
+      </p>
+      <p>
+        To test clipping to the outermost 'svg' element,
+        a rectangle with a light blue interior, a light red border and a black
+        string that says "Clip to outer 'svg'" is painted four times such that
+        it will overflow each of the top, left, right and bottom
+        sides of the bounds of the outermost 'svg' element, respectively.
+      </p>
+      <p>
+        To test clipping to inner 'svg' elements, a rectangle with a light red
+        interior, a light blue border and a black string that says "Clip to
+        inner 'svg'" is painted four times such that it will overflow each of
+        the top, left, right and bottom sides of the bounds of an inner 'svg'
+        element, respectively.  
+      </p>
+      <p>
+        Note that minor text layout differences, as are permissible under CSS2
+        rules, can lead to slightly different visual results regarding where
+        the text strings get clipped.
+      </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:</p>
+      <ul>
+        <li>The four "Outer Clip" boxed strings must not render outside the
+        outermost 'svg' element (the 480x360 rectangular viewport) and
+        must continue to be clipped to this viewport if the image is zoomed in or out,
+        or panned.</li>
+        <li>The four "Inner Clip" boxed strings must not render outside the
+        bounds of the green rectangle.</li>
+      </ul>
+    </d:passCriteria>
+  </d:SVGTestCase>
+  <title id="test-title">$RCSfile: masking-path-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">
+    <g shape-rendering="geometricPrecision">
+      <!--text font-size="18" text-anchor="middle" x="240" y="70">Test 'overflow'/'clip' on outermost and 
inner 'svg' elements</text-->
+      <text font-size="18" x="10" y="70">Test 'overflow'/'clip' on outermost and inner 'svg' elements</text>
+      <!-- Test initial value for 'overflow' property (i.e., hidden)
+       on outermost 'svg' -->
+      <g font-size="48" stroke-width="2">
+        <g transform="translate(115,-20)">
+          <rect width="250" height="60" fill="#ccccff" stroke="#ff8888"/>
+          <text x="15" y="45">Outer Clip</text>
+        </g>
+        <g transform="translate(-175,150)">
+          <rect width="250" height="60" fill="#ccccff" stroke="#ff8888"/>
+          <text x="15" y="45">Outer Clip</text>
+        </g>
+        <g transform="translate(405,150)">
+          <rect width="250" height="60" fill="#ccccff" stroke="#ff8888"/>
+          <text x="15" y="45">Outer Clip</text>
+        </g>
+        <g transform="translate(115,330)">
+          <rect width="250" height="60" fill="#ccccff" stroke="#ff8888"/>
+          <text x="15" y="45">Outer Clip</text>
+        </g>
+      </g>
+      <!-- Test initial value for 'overflow' property (i.e., hidden)
+       on inner 'svg' -->
+      <rect x="115" y="100" width="250" height="160" fill="none" stroke="#006600" stroke-width="5"/>
+      <svg xmlns:xlink="http://www.w3.org/1999/xlink"; version="1.1" x="115" y="100" width="250" height="160">
+        <g font-size="32" stroke-width="2">
+          <g transform="translate(50,-15)">
+            <rect width="150" height="35" fill="#ffaaaa" stroke="#6666ff"/>
+            <text x="6" y="26">Inner Clip</text>
+          </g>
+          <g transform="translate(-50,62.5)">
+            <rect width="150" height="35" fill="#ffaaaa" stroke="#6666ff"/>
+            <text x="6" y="26">Inner Clip</text>
+          </g>
+          <g transform="translate(150,62.5)">
+            <rect width="150" height="35" fill="#ffaaaa" stroke="#6666ff"/>
+            <text x="6" y="26">Inner Clip</text>
+          </g>
+          <g transform="translate(50,140)">
+            <rect width="150" height="35" fill="#ffaaaa" stroke="#6666ff"/>
+            <text x="6" y="26">Inner Clip</text>
+          </g>
+        </g>
+      </svg>
+    </g>
+  </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/masking-path-04-b-ref.png 
b/tests/fixtures/reftests/svg1.1/masking-path-04-b-ref.png
new file mode 100644
index 0000000..7a66001
Binary files /dev/null and b/tests/fixtures/reftests/svg1.1/masking-path-04-b-ref.png differ



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