[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

krit at webkit.org krit at webkit.org
Thu Apr 8 02:21:16 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit ad448306ae67f5852c090b24e83b3c6668b4bf8f
Author: krit at webkit.org <krit at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Mar 12 20:43:59 2010 +0000

    2010-03-12  Dirk Schulze  <krit at webkit.org>
    
            Reviewed by Nikolas Zimmermann.
    
            SVG fallback color doesn't work for bogus gradients.
            https://bugs.webkit.org/show_bug.cgi?id=35479
    
            Use a given fallback color on ignored gradients if present. Gradients
            must be ignored, if one dimension of the objects boundingBox is zero.
    
            Test: svg/custom/gradient-with-1d-boundingbox.svg
    
            * svg/graphics/SVGPaintServer.cpp:
            (WebCore::SVGPaintServer::strokePaintServer):
            * svg/graphics/SVGPaintServerGradient.cpp:
            (WebCore::SVGPaintServerGradient::setup):
    2010-03-12  Dirk Schulze  <krit at webkit.org>
    
            Reviewed by Nikolas Zimmermann.
    
            SVG fallback color doesn't work for bogus gradients.
            https://bugs.webkit.org/show_bug.cgi?id=35479
    
            We now use a fallback color on ignored gradients for one dimensional objects,
            either a given fallback color or black as default.
            This causes a change of one LayoutTest, because it was done manually in the
            gradient PaintServer, without respecting a given fallback color.
    
            * platform/mac/svg/W3C-SVG-1.1/pservers-grad-17-b-expected.txt:
            * platform/mac/svg/custom/gradient-with-1d-boundingbox-expected.checksum: Added.
            * platform/mac/svg/custom/gradient-with-1d-boundingbox-expected.png: Added.
            * platform/mac/svg/custom/gradient-with-1d-boundingbox-expected.txt: Added.
            * svg/custom/gradient-with-1d-boundingbox.svg: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55930 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 9d015c9..7623458 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,21 @@
+2010-03-12  Dirk Schulze  <krit at webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVG fallback color doesn't work for bogus gradients.
+        https://bugs.webkit.org/show_bug.cgi?id=35479
+
+        We now use a fallback color on ignored gradients for one dimensional objects,
+        either a given fallback color or black as default.
+        This causes a change of one LayoutTest, because it was done manually in the
+        gradient PaintServer, without respecting a given fallback color.
+
+        * platform/mac/svg/W3C-SVG-1.1/pservers-grad-17-b-expected.txt:
+        * platform/mac/svg/custom/gradient-with-1d-boundingbox-expected.checksum: Added.
+        * platform/mac/svg/custom/gradient-with-1d-boundingbox-expected.png: Added.
+        * platform/mac/svg/custom/gradient-with-1d-boundingbox-expected.txt: Added.
+        * svg/custom/gradient-with-1d-boundingbox.svg: Added.
+
 2010-03-12  Dmitry Titov  <dimich at chromium.org>
 
         Not reviewed, build fix.
diff --git a/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-17-b-expected.txt b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-17-b-expected.txt
index ce8b2c0..5e81e25 100644
--- a/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-17-b-expected.txt
+++ b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-17-b-expected.txt
@@ -10,9 +10,9 @@ layer at (0,0) size 480x360
           RenderSVGGradientStop {stop} at (0,0) size 0x0
       RenderSVGContainer {g} at (49,81) size 146x146 [transform={m=((0.30,0.00)(0.00,0.30)) t=(50.00,100.00)}]
         RenderPath {rect} at (49,81) size 146x146 [stroke={[type=SOLID] [color=#000000]}] [data="M0.00,-60.00 L480.00,-60.00 L480.00,420.00 L0.00,420.00 Z"]
-        RenderPath {line} at (50,151) size 144x6 [stroke={[type=LINEAR-GRADIENT] [stops=[(0.00,#000000), (1.00,#FFFFFF)]] [start=(0,0)] [end=(1,0)] [stroke width=20.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,180.00 L480.00,180.00"]
-        RenderPath {line} at (68,100) size 108x108 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(197.57,-116.98)}] [stroke={[type=LINEAR-GRADIENT] [stops=[(0.00,#000000), (1.00,#FFFFFF)]] [start=(0,0)] [end=(1,0)] [stroke width=20.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,180.00 L480.00,180.00"]
-        RenderPath {line} at (119,82) size 6x144 [transform={m=((0.00,1.00)(-1.00,0.00)) t=(420.00,-60.00)}] [stroke={[type=LINEAR-GRADIENT] [stops=[(0.00,#000000), (1.00,#FFFFFF)]] [start=(0,0)] [end=(1,0)] [stroke width=20.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,180.00 L480.00,180.00"]
+        RenderPath {line} at (50,151) size 144x6 [stroke={[type=SOLID] [color=#000000] [stroke width=20.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,180.00 L480.00,180.00"]
+        RenderPath {line} at (68,100) size 108x108 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(197.57,-116.98)}] [stroke={[type=SOLID] [color=#000000] [stroke width=20.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,180.00 L480.00,180.00"]
+        RenderPath {line} at (119,82) size 6x144 [transform={m=((0.00,1.00)(-1.00,0.00)) t=(420.00,-60.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=20.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,180.00 L480.00,180.00"]
         RenderPath {line} at (68,100) size 108x108 [stroke={[type=LINEAR-GRADIENT] [stops=[(0.00,#000000), (1.00,#FFFFFF)]] [start=(0,0)] [end=(1,0)] [stroke width=20.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M410.00,10.00 L70.00,350.00"]
       RenderSVGText {text} at (84,250) size 72x18 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,-14) size 72x18
diff --git a/LayoutTests/platform/mac/svg/custom/gradient-with-1d-boundingbox-expected.checksum b/LayoutTests/platform/mac/svg/custom/gradient-with-1d-boundingbox-expected.checksum
new file mode 100644
index 0000000..9868c28
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/gradient-with-1d-boundingbox-expected.checksum
@@ -0,0 +1 @@
+b9f116b4a960c013825104fa2c8b2e78
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/gradient-with-1d-boundingbox-expected.png b/LayoutTests/platform/mac/svg/custom/gradient-with-1d-boundingbox-expected.png
new file mode 100644
index 0000000..1bd368d
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/gradient-with-1d-boundingbox-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/gradient-with-1d-boundingbox-expected.txt b/LayoutTests/platform/mac/svg/custom/gradient-with-1d-boundingbox-expected.txt
new file mode 100644
index 0000000..5010a4d
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/gradient-with-1d-boundingbox-expected.txt
@@ -0,0 +1,10 @@
+KRenderingPaintServer {id="gradient" [type=LINEAR-GRADIENT] [stops=[(0.00,#FF0000), (1.00,#008000)]] [start=(0,0)] [end=(1,0)]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (0,0) size 800x600
+    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+      RenderSVGHiddenContainer {linearGradient} at (0,0) size 0x0
+        RenderSVGGradientStop {stop} at (0,0) size 0x0
+        RenderSVGGradientStop {stop} at (0,0) size 0x0
+    RenderPath {line} at (0,40) size 200x20 [stroke={[type=SOLID] [color=#00FF00] [stroke width=20.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,50.00 L200.00,50.00"]
diff --git a/LayoutTests/svg/custom/gradient-with-1d-boundingbox.svg b/LayoutTests/svg/custom/gradient-with-1d-boundingbox.svg
new file mode 100644
index 0000000..d4babe4
--- /dev/null
+++ b/LayoutTests/svg/custom/gradient-with-1d-boundingbox.svg
@@ -0,0 +1,11 @@
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<!-- Gradients can't applied on objects with a boundingBox, where either width or height is zero.
+     This test checks if we use a given alternative Color. -->
+<defs>
+<linearGradient id="gradient">
+    <stop offset="0" stop-color="red"/>
+    <stop offset="1" stop-color="green"/>
+</linearGradient>
+</defs>
+<line x1="0" x2="200" y1="50" y2="50" stroke="url(#gradient) #0f0" stroke-width="20"/>
+</svg>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7334916..351bf48 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-03-12  Dirk Schulze  <krit at webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVG fallback color doesn't work for bogus gradients.
+        https://bugs.webkit.org/show_bug.cgi?id=35479
+
+        Use a given fallback color on ignored gradients if present. Gradients
+        must be ignored, if one dimension of the objects boundingBox is zero.
+
+        Test: svg/custom/gradient-with-1d-boundingbox.svg
+
+        * svg/graphics/SVGPaintServer.cpp:
+        (WebCore::SVGPaintServer::strokePaintServer):
+        * svg/graphics/SVGPaintServerGradient.cpp:
+        (WebCore::SVGPaintServerGradient::setup):
+
 2010-03-12  David Hyatt  <hyatt at apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/WebCore/svg/graphics/SVGPaintServer.cpp b/WebCore/svg/graphics/SVGPaintServer.cpp
index ed5486f..0ac3a35 100644
--- a/WebCore/svg/graphics/SVGPaintServer.cpp
+++ b/WebCore/svg/graphics/SVGPaintServer.cpp
@@ -123,8 +123,10 @@ SVGPaintServer* SVGPaintServer::strokePaintServer(const RenderStyle* style, cons
 
     SVGPaintServer* strokePaintServer = 0;
     SVGPaint::SVGPaintType paintType = stroke->paintType();
-    if (paintType == SVGPaint::SVG_PAINTTYPE_URI ||
-        paintType == SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR) {
+    if ((paintType == SVGPaint::SVG_PAINTTYPE_URI
+        || paintType == SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR)
+        && item->objectBoundingBox().width() != 0
+        && item->objectBoundingBox().height() != 0) {
         AtomicString id(SVGURIReference::getTarget(stroke->uri()));
         strokePaintServer = getPaintServerById(item->document(), id, item);
 
@@ -147,6 +149,11 @@ SVGPaintServer* SVGPaintServer::strokePaintServer(const RenderStyle* style, cons
         if (!strokePaintServerSolid->color().isValid())
             strokePaintServer = 0;
     }
+    if (!strokePaintServer) {
+        // default value (black), see bug 11017
+        strokePaintServer = sharedSolidPaintServer();
+        static_cast<SVGPaintServerSolid*>(strokePaintServer)->setColor(Color::black);
+    }
 
     return strokePaintServer;
 }
diff --git a/WebCore/svg/graphics/SVGPaintServerGradient.cpp b/WebCore/svg/graphics/SVGPaintServerGradient.cpp
index 2a582b0..6e6ebfc 100644
--- a/WebCore/svg/graphics/SVGPaintServerGradient.cpp
+++ b/WebCore/svg/graphics/SVGPaintServerGradient.cpp
@@ -223,13 +223,6 @@ bool SVGPaintServerGradient::setup(GraphicsContext*& context, const RenderObject
     if (boundingBoxMode()) {
 #endif
         FloatRect bbox = object->objectBoundingBox();
-        // Don't use gradients for 1d objects like horizontal/vertical 
-        // lines or rectangles without width or height.
-        if (bbox.width() == 0 || bbox.height() == 0) {
-            Color color(0, 0, 0);
-            context->setStrokeColor(color, style->colorSpace());
-            return true;
-        }
         matrix.translate(bbox.x(), bbox.y());
         matrix.scaleNonUniform(bbox.width(), bbox.height());
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list