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

eric at webkit.org eric at webkit.org
Thu Apr 8 00:01:27 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 5b0c5989623d7a00484d1a1ba250efed7a94ea4e
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 30 17:25:00 2009 +0000

    2009-11-30  Dirk Schulze  <krit at webkit.org>
    
            Reviewed by Nikolas Zimmermann.
    
            Complex test of mask with every combination of maskUnits and maskContentUnits
            as well as different values for size and position of the mask and it's content.
    
            * platform/mac/svg/custom/mask-with-all-units-expected.checksum: Added.
            * platform/mac/svg/custom/mask-with-all-units-expected.png: Added.
            * platform/mac/svg/custom/mask-with-all-units-expected.txt: Added.
            * svg/custom/mask-with-all-units.svg: Added.
    2009-11-30  Dirk Schulze  <krit at webkit.org>
    
            Reviewed by Nikolas Zimmermann.
    
            REGRESSION (r49757): masking-mask-01-b.svg rendered incorrectly
            [https://bugs.webkit.org/show_bug.cgi?id=31980]
    
            It turns out, that we did not handle maskUnits="userSpaceOnUse"
            correctly. We just need to move the context of the maskImage
            if maskContentUnits="objectBoundingBox". The context gets scaled
            on this unit combination, so we have to substract the position of
            the targetRect. On userSpaceOnUse the position just depends on the
            position of the mask element.
            I added a test with some senseless and reasonable values for size
            and postion of the mask and it's contents. I also used every
            combination of maskUnits and maskContentUnits to be sure, that it
            is fixed this time.
    
            Test: svg/custom/mask-with-all-units.svg
    
            * svg/SVGMaskElement.cpp:
            (WebCore::SVGMaskElement::drawMaskerContent):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51496 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b17cf57..6021fe5 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2009-11-30  Dirk Schulze  <krit at webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Complex test of mask with every combination of maskUnits and maskContentUnits
+        as well as different values for size and position of the mask and it's content.
+
+        * platform/mac/svg/custom/mask-with-all-units-expected.checksum: Added.
+        * platform/mac/svg/custom/mask-with-all-units-expected.png: Added.
+        * platform/mac/svg/custom/mask-with-all-units-expected.txt: Added.
+        * svg/custom/mask-with-all-units.svg: Added.
+
 2009-11-30  Csaba Osztrogonác  <ossy at webkit.org>
 
         [Qt] Put tests into skiplist because of missing features.
diff --git a/LayoutTests/platform/mac/svg/custom/mask-with-all-units-expected.checksum b/LayoutTests/platform/mac/svg/custom/mask-with-all-units-expected.checksum
new file mode 100644
index 0000000..f353087
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/mask-with-all-units-expected.checksum
@@ -0,0 +1 @@
+e6daa98bd6d12385f6de6d058112c256
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/mask-with-all-units-expected.png b/LayoutTests/platform/mac/svg/custom/mask-with-all-units-expected.png
new file mode 100644
index 0000000..0b608af
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/mask-with-all-units-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/mask-with-all-units-expected.txt b/LayoutTests/platform/mac/svg/custom/mask-with-all-units-expected.txt
new file mode 100644
index 0000000..5e52b9b
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/mask-with-all-units-expected.txt
@@ -0,0 +1,21 @@
+KCanvasResource {id="mask1" [type=MASKER]}
+KCanvasResource {id="mask2" [type=MASKER]}
+KCanvasResource {id="mask3" [type=MASKER]}
+KCanvasResource {id="mask4" [type=MASKER]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 250x250
+  RenderSVGRoot {svg} at (10,10) size 210x210
+    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+      RenderSVGContainer {mask} at (60,60) size 50x50
+        RenderPath {rect} at (60,60) size 50x50 [fill={[type=SOLID] [color=#FFFFFF] [opacity=0.50]}] [data="M60.00,60.00 L110.00,60.00 L110.00,110.00 L60.00,110.00 Z"]
+      RenderSVGContainer {mask} at (0.50,0.50) size 125x0.50
+        RenderPath {rect} at (0.50,0.50) size 125x0.50 [fill={[type=SOLID] [color=#FFFFFF] [opacity=0.50]}] [data="M0.50,0.50 L125.50,0.50 L125.50,1.00 L0.50,1.00 Z"]
+      RenderSVGContainer {mask} at (60,170) size 50x50
+        RenderPath {rect} at (60,170) size 50x50 [fill={[type=SOLID] [color=#FFFFFF] [opacity=0.50]}] [data="M60.00,170.00 L110.00,170.00 L110.00,220.00 L60.00,220.00 Z"]
+      RenderSVGContainer {mask} at (0.50,0.50) size 0.50x0.50
+        RenderPath {rect} at (0.50,0.50) size 0.50x0.50 [fill={[type=SOLID] [color=#FFFFFF] [opacity=0.50]}] [data="M0.50,0.50 L1.00,0.50 L1.00,1.00 L0.50,1.00 Z"]
+    RenderPath {rect} at (10,10) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M10.00,10.00 L110.00,10.00 L110.00,110.00 L10.00,110.00 Z"]
+    RenderPath {rect} at (120,10) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M120.00,10.00 L220.00,10.00 L220.00,110.00 L120.00,110.00 Z"]
+    RenderPath {rect} at (10,120) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M10.00,120.00 L110.00,120.00 L110.00,220.00 L10.00,220.00 Z"]
+    RenderPath {rect} at (120,120) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M120.00,120.00 L220.00,120.00 L220.00,220.00 L120.00,220.00 Z"]
diff --git a/LayoutTests/svg/custom/mask-with-all-units.svg b/LayoutTests/svg/custom/mask-with-all-units.svg
new file mode 100644
index 0000000..0d7028a
--- /dev/null
+++ b/LayoutTests/svg/custom/mask-with-all-units.svg
@@ -0,0 +1,22 @@
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="250" height="250">
+<!-- You should see 4 rects with the same size, filled with green and a fill opacity of 0.5 -->
+<defs>
+<mask id="mask1" maskUnits="userSpaceOnUse" maskContentUnits="userSpaceOnUse" x="10" y="10" width="100" height="100">
+  <rect x="60" y="60" width="20%" height="50" fill-opacity="0.5" fill="white"/>
+</mask>
+<mask id="mask2" maskUnits="objectBoundingBox" maskContentUnits="objectBoundingBox">
+  <rect x="0.5" y="0.2%" width="50%" height="0.5" fill-opacity="0.5" fill="white"/>
+</mask>
+<mask id="mask3" maskUnits="objectBoundingBox" maskContentUnits="userSpaceOnUse" y="50%">
+  <rect x="24%" y="170" width="20%" height="50" fill-opacity="0.5" fill="white"/>
+</mask>
+<mask id="mask4" maskUnits="userSpaceOnUse" maskContentUnits="objectBoundingBox" x="120" y="120" width="100" height="100">
+  <rect x="0.5" y="0.2%" width="0.5" height="0.2%" fill-opacity="0.5" fill="white"/>
+</mask>
+</defs>
+<rect x="10" y="10" width="100" height="100" fill="green" mask="url(#mask1)"/>
+<rect x="120" y="10" width="100" height="100" fill="green" mask="url(#mask2)"/>
+<rect x="10" y="120" width="100" height="100" fill="green" mask="url(#mask3)"/>
+<rect x="120" y="120" width="100" height="100" fill="green" mask="url(#mask4)"/>
+</svg>
+
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b5efbbd..de9effb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,26 @@
+2009-11-30  Dirk Schulze  <krit at webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        REGRESSION (r49757): masking-mask-01-b.svg rendered incorrectly
+        [https://bugs.webkit.org/show_bug.cgi?id=31980]
+
+        It turns out, that we did not handle maskUnits="userSpaceOnUse"
+        correctly. We just need to move the context of the maskImage
+        if maskContentUnits="objectBoundingBox". The context gets scaled
+        on this unit combination, so we have to substract the position of
+        the targetRect. On userSpaceOnUse the position just depends on the
+        position of the mask element.
+        I added a test with some senseless and reasonable values for size
+        and postion of the mask and it's contents. I also used every
+        combination of maskUnits and maskContentUnits to be sure, that it
+        is fixed this time.
+
+        Test: svg/custom/mask-with-all-units.svg
+
+        * svg/SVGMaskElement.cpp:
+        (WebCore::SVGMaskElement::drawMaskerContent):
+
 2009-11-30  Steve Block  <steveblock at google.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/svg/SVGMaskElement.cpp b/WebCore/svg/SVGMaskElement.cpp
index 60109a4..e131d34 100644
--- a/WebCore/svg/SVGMaskElement.cpp
+++ b/WebCore/svg/SVGMaskElement.cpp
@@ -2,6 +2,7 @@
     Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann at kde.org>
                   2004, 2005, 2006, 2007 Rob Buis <buis at kde.org>
                   2005 Alexander Kellett <lypanov at kde.org>
+                  2009 Dirk Schulze <krit at webkit.org>
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -156,11 +157,14 @@ PassOwnPtr<ImageBuffer> SVGMaskElement::drawMaskerContent(const FloatRect& targe
         return 0;
 
     FloatPoint maskContextLocation = maskDestRect.location();
-    if (maskUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
+    if (maskUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
         maskDestRect.move(targetRect.x(), targetRect.y());
-
-    if (maskContentUnits() != SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
-        maskContextLocation.move(targetRect.x(), targetRect.y());
+        if (maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE)
+            maskContextLocation.move(targetRect.x(), targetRect.y());
+    } else {
+        if (maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
+            maskContextLocation.move(-targetRect.x(), -targetRect.y());
+    }
 
     GraphicsContext* maskImageContext = maskImage->context();
     ASSERT(maskImageContext);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list