2006-02-18 Alexander Kellett <lypanov@kde.org>
authorlypanov <lypanov@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 19 Feb 2006 00:21:41 +0000 (00:21 +0000)
committerlypanov <lypanov@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 19 Feb 2006 00:21:41 +0000 (00:21 +0000)
        Reviewed by Maciej.

        - Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7199.

        Testcase:
          svg/custom/text-gradient-no-content.svg

        * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
        (WebCore::KRenderingPaintServerGradientQuartz::teardown):

2006-02-18  Alexander Kellett  <lypanov@kde.org>

        Reviewed by Maciej.

        - new test for
          http://bugzilla.opendarwin.org/show_bug.cgi?id=7199
          Text gradient fills entire screen if text empty

        * svg/custom/text-gradient-no-content.svg: Added.

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

LayoutTests/ChangeLog
LayoutTests/svg/custom/text-gradient-no-content-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/text-gradient-no-content-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/text-gradient-no-content-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/text-gradient-no-content.svg [new file with mode: 0644]
WebCore/ChangeLog
WebCore/kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm

index 6efd21a789c2096c61919046159d379cfa3cb88e..0d6e398db91b40c0bca7ffff9bea53ec023fe18a 100644 (file)
@@ -1,3 +1,13 @@
+2006-02-18  Alexander Kellett  <lypanov@kde.org>
+
+        Reviewed by Maciej.
+
+        - new test for
+          http://bugzilla.opendarwin.org/show_bug.cgi?id=7199
+          Text gradient fills entire screen if text empty
+
+        * svg/custom/text-gradient-no-content.svg: Added.
+
 2006-02-17  Mitz Pettel  <opendarwin.org@mitzpettel.com>
 
         Reviewed by Darin.
diff --git a/LayoutTests/svg/custom/text-gradient-no-content-expected.checksum b/LayoutTests/svg/custom/text-gradient-no-content-expected.checksum
new file mode 100644 (file)
index 0000000..d65dd0c
--- /dev/null
@@ -0,0 +1 @@
+21c448faf8e499dafc0629f75f05ee1b
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/text-gradient-no-content-expected.png b/LayoutTests/svg/custom/text-gradient-no-content-expected.png
new file mode 100644 (file)
index 0000000..46b204c
Binary files /dev/null and b/LayoutTests/svg/custom/text-gradient-no-content-expected.png differ
diff --git a/LayoutTests/svg/custom/text-gradient-no-content-expected.txt b/LayoutTests/svg/custom/text-gradient-no-content-expected.txt
new file mode 100644 (file)
index 0000000..565e620
--- /dev/null
@@ -0,0 +1,7 @@
+KRenderingPaintServer {id="Gradient" [type=LINEAR-GRADIENT] [stops=[(0.00,#FF0000), (1.00,#FF0000)]] [bounding box mode=0] [start=(0,0)] [end=(800,0)]}
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+    KCanvasContainer {svg} at (0,0) size 785x600
+      KCanvasItem {rect} at (0,0) size 785x600 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L785.00,0.00L785.00,600.00L0.00,600.00"]
+      RenderSVGText {text} at (0,0) size 785x0
+      RenderSVGText {text} at (0,0) size 785x0
diff --git a/LayoutTests/svg/custom/text-gradient-no-content.svg b/LayoutTests/svg/custom/text-gradient-no-content.svg
new file mode 100644 (file)
index 0000000..99ff18d
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">  
+<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root"
+   width="100%" height="100%">
+   <linearGradient id="Gradient" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="100%" y2="0">
+      <stop stop-color="red" offset="0"/>
+      <stop stop-color="red" offset="1"/>
+   </linearGradient>
+   <rect fill="green" x="0" y="0" width="100%" height="100%"></rect>
+   <text fill="url(#Gradient)" x="20" y="70"></text>
+   <text stroke="url(#Gradient)" x="20" y="70"></text>
+</svg>
index a09b20f825ccdc7a9fdbd4a057c9005d7d01045e..4121580cb5bd66272f2ce4dd144ffc4542b89ef7 100644 (file)
@@ -1,3 +1,15 @@
+2006-02-18  Alexander Kellett  <lypanov@kde.org>
+
+        Reviewed by Maciej.
+
+        - Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7199.
+
+        Testcase: 
+          svg/custom/text-gradient-no-content.svg
+
+        * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
+        (WebCore::KRenderingPaintServerGradientQuartz::teardown):
+
 2006-02-18  David Harrison  <harrison@apple.com>
 
         Reviewed by John.
index aae13e2e4bb2b42d23f70e462f89077978a34a91..c6aee81c423bafc76ff41fc598f75e5455493d7e 100644 (file)
@@ -313,7 +313,9 @@ void KRenderingPaintServerGradientQuartz::teardown(const KRenderingPaintServerGr
     ASSERT(context != NULL);
     
     if ((type & APPLY_TO_FILL) && KSVGPainterFactory::isFilled(renderStyle)) {
-        CGContextDrawShading(context, shading);
+        // workaround for filling the entire screen with the shading in the case that no text was intersected with the clip
+        if (!server->isPaintingText() || (renderObject->width() > 0 && renderObject->height() > 0))
+            CGContextDrawShading(context, shading);
         CGContextRestoreGState(context);
     }