Bug #: 5969
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jan 2006 09:16:38 +0000 (09:16 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jan 2006 09:16:38 +0000 (09:16 +0000)
Submitted by: Alexander Kellett  <lypanov@kde.org>
Reviewed by: eseidel
        Basic support for <mask> tag.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=5969

        * svg/W3C-SVG-1.1/masking-mask-01-b-expected.txt: updated.
        * svg/custom/grayscale-gradient-mask-expected.checksum: Added.
        * svg/custom/grayscale-gradient-mask-expected.png: Added.
        * svg/custom/grayscale-gradient-mask-expected.txt: Added.
        * svg/custom/grayscale-gradient-mask.svg: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@11905 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/svg/W3C-SVG-1.1/masking-mask-01-b-expected.txt
LayoutTests/svg/custom/grayscale-gradient-mask-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/grayscale-gradient-mask-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/grayscale-gradient-mask-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/grayscale-gradient-mask.svg [new file with mode: 0644]

index ca276610fe3d0b893cb781e1f1e99e35fac4f4f3..d0112873d00c3d23314877266473af5c1a0ac988 100644 (file)
@@ -1,3 +1,16 @@
+2006-01-06  Alexander Kellett  <lypanov@kde.org>
+
+        Reviewed by eseidel.
+
+        Basic support for <mask> tag.
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=5969
+
+        * svg/W3C-SVG-1.1/masking-mask-01-b-expected.txt: updated.
+        * svg/custom/grayscale-gradient-mask-expected.checksum: Added.
+        * svg/custom/grayscale-gradient-mask-expected.png: Added.
+        * svg/custom/grayscale-gradient-mask-expected.txt: Added.
+        * svg/custom/grayscale-gradient-mask.svg: Added.
+
 2006-01-05  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Eric.
index 11dd0ceda5f1aa3910c0287fb314649dad2a7a8b..1a42d053ba5bb596817527f70d4a996521c3b6ac 100644 (file)
@@ -1,10 +1,22 @@
-KRenderingPaintServer {id="Grad1" [type=LINEAR-GRADIENT] [stops=[(0.00,#FFFFFF), (1.00,#FFFFFF7F)]] [bounding box mode=0] [start=(60,50)] [end=(60,120)]}
+KCanvasResource {id="mask1" [type=MASKER]}
+KRenderingPaintServer {id="Grad1" [type=LINEAR-GRADIENT] [stops=[]] [bounding box mode=0] [start=(60,50)] [end=(60,120)]}
+KCanvasResource {id="mask2" [type=MASKER]}
+KCanvasResource {id="mask3" [type=MASKER]}
 layer at (0,0) size 480x360
   RenderCanvas at (0,0) size 480x360
     KCanvasContainer {svg} at (0.50,0.50) size 479x359
-      KCanvasContainer {g} at (10,30) size 150x260
+      KCanvasContainer {g} at (10,30) size 250x270
         KCanvasItem {rect} at (10,30) size 100x260 [fill={[type=SOLID] [color=#FF0000]}] [data="M10.00,30.00L110.00,30.00L110.00,290.00L10.00,290.00"]
+        KCanvasContainer {mask} at (60,50) size 100x60
+          KCanvasItem {rect} at (60,50) size 100x60 [fill={[type=LINEAR-GRADIENT] [stops=[]] [bounding box mode=0] [start=(60,50)] [end=(60,120)]}] [data="M60.00,50.00L160.00,50.00L160.00,110.00L60.00,110.00"]
         KCanvasItem {rect} at (60,50) size 100x60 [fill={[type=SOLID] [color=#00FF00]}] [data="M60.00,50.00L160.00,50.00L160.00,110.00L60.00,110.00"]
+        KCanvasContainer {mask} at (60,120) size 100x30
+          KCanvasItem {rect} at (60,120) size 100x30 [fill={[type=SOLID] [color=#FFFFFF] [opacity=0.50]}] [data="M60.00,120.00L160.00,120.00L160.00,150.00L60.00,150.00"]
         KCanvasItem {rect} at (60,120) size 100x30 [fill={[type=SOLID] [color=#00FF00]}] [data="M60.00,120.00L160.00,120.00L160.00,150.00L60.00,150.00"]
         KCanvasItem {rect} at (60,160) size 100x30 [fill={[type=SOLID] [color=#00FF00] [opacity=0.50]}] [data="M60.00,160.00L160.00,160.00L160.00,190.00L60.00,190.00"]
+        KCanvasContainer {mask} at (60,200) size 200x100
+          KCanvasItem {rect} at (60,200) size 200x25 [fill={[type=SOLID] [color=#FFFFFF] [opacity=0.50]}] [data="M60.00,200.00L260.00,200.00L260.00,225.00L60.00,225.00"]
+          KCanvasItem {rect} at (60,225) size 200x25 [fill={[type=SOLID] [color=#FFFFFF] [opacity=0.20]}] [data="M60.00,225.00L260.00,225.00L260.00,250.00L60.00,250.00"]
+          KCanvasItem {rect} at (60,250) size 200x25 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M60.00,250.00L260.00,250.00L260.00,275.00L60.00,275.00"]
+          KCanvasItem {rect} at (60,275) size 200x25 [fill={[type=SOLID] [color=#FFFFFF] [opacity=0.70]}] [data="M60.00,275.00L260.00,275.00L260.00,300.00L60.00,300.00"]
       KCanvasItem {rect} at (0.50,0.50) size 479x359 [stroke={[type=SOLID] [color=#000000]}] [data="M1.00,1.00L479.00,1.00L479.00,359.00L1.00,359.00"]
diff --git a/LayoutTests/svg/custom/grayscale-gradient-mask-expected.checksum b/LayoutTests/svg/custom/grayscale-gradient-mask-expected.checksum
new file mode 100644 (file)
index 0000000..74b18a8
--- /dev/null
@@ -0,0 +1 @@
+61c7b4b2a6201be323d0464e593823db
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/grayscale-gradient-mask-expected.png b/LayoutTests/svg/custom/grayscale-gradient-mask-expected.png
new file mode 100644 (file)
index 0000000..5edea8d
Binary files /dev/null and b/LayoutTests/svg/custom/grayscale-gradient-mask-expected.png differ
diff --git a/LayoutTests/svg/custom/grayscale-gradient-mask-expected.txt b/LayoutTests/svg/custom/grayscale-gradient-mask-expected.txt
new file mode 100644 (file)
index 0000000..5f5fcb6
--- /dev/null
@@ -0,0 +1,9 @@
+KRenderingPaintServer {id="Gradient" [type=LINEAR-GRADIENT] [stops=[]] [bounding box mode=0] [start=(0,0)] [end=(800,0)]}
+KCanvasResource {id="Mask" [type=MASKER]}
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+    KCanvasContainer {svg} at (0.33,0) size 301.33x113
+      KCanvasContainer {mask} at (0.33,0) size 301.33x113
+        KCanvasItem {rect} at (0.33,0) size 301.33x113 [fill={[type=LINEAR-GRADIENT] [stops=[]] [bounding box mode=0] [start=(0,0)] [end=(800,0)]}] [data="M0.00,0.00L800.00,0.00L800.00,300.00L0.00,300.00"]
+      KCanvasItem {rect} at (0.33,0) size 301.33x113 [fill={[type=SOLID] [color=#FF8080]}] [data="M0.00,0.00L800.00,0.00L800.00,300.00L0.00,300.00"]
+      KCanvasItem {rect} at (0.33,37.67) size 301.33x37.67 [fill={[type=SOLID] [color=#0000FF]}] [data="M0.00,100.00L800.00,100.00L800.00,200.00L0.00,200.00"]
diff --git a/LayoutTests/svg/custom/grayscale-gradient-mask.svg b/LayoutTests/svg/custom/grayscale-gradient-mask.svg
new file mode 100644 (file)
index 0000000..b8dcd92
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
+  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="8cm" height="3cm" viewBox="0 0 800 300" version="1.1"
+     xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+  <desc>Example mask01 - blue text masked with gradient against red background
+  </desc>
+  <defs>
+    <linearGradient id="Gradient" gradientUnits="userSpaceOnUse"
+                    x1="0" y1="0" x2="800" y2="0">
+      <stop offset="0" stop-color="white" stop-opacity="1" /> <!-- this end is filled -->
+      <stop offset="1" stop-color="black" stop-opacity="1" />
+    </linearGradient>
+  </defs>
+  <mask id="Mask" maskUnits="userSpaceOnUse"
+     x="0" y="0" width="800" height="300">
+     <rect x="0" y="0" width="800" height="300" fill="url(#Gradient)"  />
+  </mask>
+  <rect x="0" y="0" width="800" height="300" fill="#FF8080" />
+  <rect x="0" y="100" width="800" height="100" fill="blue" mask="url(#Mask)"  />
+</svg>