[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 00:53:04 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit a1c9073a27b12d9aa5e2cf8832a48f2c446b7a22
Author: krit at webkit.org <krit at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 4 08:21:52 2010 +0000

    2010-01-03  Dirk Schulze  <krit at webkit.org>
    
            Reviewed by Nikolas Zimmermann.
    
            SVGResources don't invalidate if target object changes attributes
            https://bugs.webkit.org/show_bug.cgi?id=33091
    
            It's neccessary to invalidate all resources of an object, if the attributes of this
            target change. Otherwise the saved resource data (like ImageBuffers) don't match
            to the new object properties.
    
            Test: svg/custom/resource-invalidate-on-target-update.svg
    
            * svg/SVGStyledElement.cpp:
            (WebCore::SVGStyledElement::svgAttributeChanged):
            (WebCore::SVGStyledElement::invalidateResources):
            * svg/SVGStyledElement.h:
    
    2010-01-03  Dirk Schulze  <krit at webkit.org>
    
            Reviewed by Nikolas Zimmermann.
    
            SVGResources don't invalidate if target object changes attributes
            https://bugs.webkit.org/show_bug.cgi?id=33091
    
            Check if SVG resources are invalidated, if target object changes
            attributes.
    
            * platform/mac/svg/custom/resource-invalidate-on-target-update-expected.checksum: Added.
            * platform/mac/svg/custom/resource-invalidate-on-target-update-expected.png: Added.
            * platform/mac/svg/custom/resource-invalidate-on-target-update-expected.txt: Added.
            * svg/custom/resource-invalidate-on-target-update.svg: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52709 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a7248c1..1baa07d 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-01-04  Dirk Schulze  <krit at webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVGResources don't invalidate if target object changes attributes
+        https://bugs.webkit.org/show_bug.cgi?id=33091
+
+        Check if SVG resources are invalidated, if target object changes
+        attributes.
+
+        * platform/mac/svg/custom/resource-invalidate-on-target-update-expected.checksum: Added.
+        * platform/mac/svg/custom/resource-invalidate-on-target-update-expected.png: Added.
+        * platform/mac/svg/custom/resource-invalidate-on-target-update-expected.txt: Added.
+        * svg/custom/resource-invalidate-on-target-update.svg: Added.
+
 2010-01-03  Kenneth Russell  <kbr at google.com>
 
         Reviewed by Maciej Stachowiak.
diff --git a/LayoutTests/platform/mac/svg/custom/resource-invalidate-on-target-update-expected.checksum b/LayoutTests/platform/mac/svg/custom/resource-invalidate-on-target-update-expected.checksum
new file mode 100644
index 0000000..36c6826
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/resource-invalidate-on-target-update-expected.checksum
@@ -0,0 +1 @@
+def3237c2a760761dec917e57f640cf2
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/resource-invalidate-on-target-update-expected.png b/LayoutTests/platform/mac/svg/custom/resource-invalidate-on-target-update-expected.png
new file mode 100644
index 0000000..dc63fb0
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/resource-invalidate-on-target-update-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/resource-invalidate-on-target-update-expected.txt b/LayoutTests/platform/mac/svg/custom/resource-invalidate-on-target-update-expected.txt
new file mode 100644
index 0000000..8421bd6
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/resource-invalidate-on-target-update-expected.txt
@@ -0,0 +1,14 @@
+KCanvasResource {id="filter" [type=FILTER]  [bounding box=at (-10.00%,-10.00%) size 120.00%x120.00%]}
+KCanvasResource {id="clip" [type=CLIPPER] [clip data=[[winding=NON-ZERO] [bounding box mode=1] [path=M1.00,0.50 L1.00,0.53 L1.00,0.56 L0.99,0.59 L0.98,0.62 L0.98,0.65 L0.96,0.68 L0.95,0.71 L0.94,0.74 L0.92,0.77 L0.90,0.79 L0.89,0.82 L0.86,0.84 L0.84,0.86 L0.82,0.89 L0.79,0.90 L0.77,0.92 L0.74,0.94 L0.71,0.95 L0.68,0.96 L0.65,0.98 L0.62,0.98 L0.59,0.99 L0.56,1.00 L0.53,1.00 L0.50,1.00 L0.47,1.00 L0.44,1.00 L0.41,0.99 L0.38,0.98 L0.35,0.98 L0.32,0.96 L0.29,0.95 L0.26,0.94 L0.23,0.92 L0.21,0.90 L0.18,0.89 L0.16,0.86 L0.14,0.84 L0.11,0.82 L0.10,0.79 L0.08,0.77 L0.06,0.74 L0.05,0.71 L0.04,0.68 L0.02,0.65 L0.02,0.62 L0.01,0.59 L0.00,0.56 L0.00,0.53 L0.00,0.50 L0.00,0.47 L0.00,0.44 L0.01,0.41 L0.02,0.38 L0.02,0.35 L0.04,0.32 L0.05,0.29 L0.06,0.26 L0.08,0.23 L0.10,0.21 L0.11,0.18 L0.14,0.16 L0.16,0.14 L0.18,0.11 L0.21,0.10 L0.23,0.08 L0.26,0.06 L0.29,0.05 L0.32,0.04 L0.35,0.02 L0.38,0.02 L0.41,0.01 L0.44,0.00 L0.47,0.00 L0.50,0.00 L0.53,0.00 L0.56,0.00 L0.59,0.01 L0.62,0.02 L0.65,0.02 L0.68,0.04 L0.71,0.05 L0.74,0.06 L0.77,0.08 L0.79,0.10 L0.82,0.11 L0.84,0.14 L0.86,0.16 L0.89,0.18 L0.90,0.21 L0.92,0.23 L0.94,0.26 L0.95,0.29 L0.96,0.32 L0.98,0.35 L0.98,0.38 L0.99,0.41 L1.00,0.44 L1.00,0.47 Z]]]}
+KCanvasResource {id="mask" [type=MASKER]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (0,10) size 120x350
+    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+      RenderSVGContainer {mask} at (0,0) size 1x1
+        RenderPath {circle} at (0,0) size 1x1 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M1.00,0.50 L1.00,0.53 L1.00,0.56 L0.99,0.59 L0.98,0.62 L0.98,0.65 L0.96,0.68 L0.95,0.71 L0.94,0.74 L0.92,0.77 L0.90,0.79 L0.89,0.82 L0.86,0.84 L0.84,0.86 L0.82,0.89 L0.79,0.90 L0.77,0.92 L0.74,0.94 L0.71,0.95 L0.68,0.96 L0.65,0.98 L0.62,0.98 L0.59,0.99 L0.56,1.00 L0.53,1.00 L0.50,1.00 L0.47,1.00 L0.44,1.00 L0.41,0.99 L0.38,0.98 L0.35,0.98 L0.32,0.96 L0.29,0.95 L0.26,0.94 L0.23,0.92 L0.21,0.90 L0.18,0.89 L0.16,0.86 L0.14,0.84 L0.11,0.82 L0.10,0.79 L0.08,0.77 L0.06,0.74 L0.05,0.71 L0.04,0.68 L0.02,0.65 L0.02,0.62 L0.01,0.59 L0.00,0.56 L0.00,0.53 L0.00,0.50 L0.00,0.47 L0.00,0.44 L0.01,0.41 L0.02,0.38 L0.02,0.35 L0.04,0.32 L0.05,0.29 L0.06,0.26 L0.08,0.23 L0.10,0.21 L0.11,0.18 L0.14,0.16 L0.16,0.14 L0.18,0.11 L0.21,0.10 L0.23,0.08 L0.26,0.06 L0.29,0.05 L0.32,0.04 L0.35,0.02 L0.38,0.02 L0.41,0.01 L0.44,0.00 L0.47,0.00 L0.50,0.00 L0.53,0.00 L0.56,0.00 L0.59,0.01 L0.62,0.02 L0.65,0.02 L0.68,0.04 L0.71,0.05 L0.74,0.06 L0.77,0.08 L0.79,0.10 L0.82,0.11 L0.84,0.14 L0.86,0.16 L0.89,0.18 L0.90,0.21 L0.92,0.23 L0.94,0.26 L0.95,0.29 L0.96,0.32 L0.98,0.35 L0.98,0.38 L0.99,0.41 L1.00,0.44 L1.00,0.47 Z"]
+    RenderSVGContainer {g} at (0,10) size 120x350
+      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 (10,130) size 100x100 [fill={[type=SOLID] [color=#008000]}] [clip path="clip"] [data="M10.00,130.00 L110.00,130.00 L110.00,230.00 L10.00,230.00 Z"]
+      RenderPath {rect} at (0,240) size 120x120 [fill={[type=SOLID] [color=#008000]}] [filter=filter] [data="M10.00,250.00 L110.00,250.00 L110.00,350.00 L10.00,350.00 Z"]
diff --git a/LayoutTests/svg/custom/resource-invalidate-on-target-update.svg b/LayoutTests/svg/custom/resource-invalidate-on-target-update.svg
new file mode 100644
index 0000000..7fb3e66
--- /dev/null
+++ b/LayoutTests/svg/custom/resource-invalidate-on-target-update.svg
@@ -0,0 +1,45 @@
+<svg width="800" height="600" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+<filter id="filter">
+    <feGaussianBlur in="SourceAlpha" stdDeviation="4" result="blur"/>
+    <feComposite in2="blur" in="SourceGraphic"/>
+</filter>
+<clipPath id="clip" clipPathUnits="objectBoundingBox">
+    <circle cx="0.5" cy="0.5" r="0.5"/>
+</clipPath>
+<mask id="mask"  maskContentUnits="objectBoundingBox">
+    <circle cx="0.5" cy="0.5" r="0.5" fill="white"/>
+</mask>
+</defs>
+
+<script>
+if (window.layoutTestController)
+    layoutTestController.waitUntilDone();
+
+window.setTimeout("clickNow()", 0);
+
+function clickNow() {
+    if (window.eventSender) {
+        eventSender.mouseMoveTo(100, 100);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+    }
+
+    if (window.layoutTestController) {
+        layoutTestController.notifyDone();
+    }
+}
+
+function mouseHandler(evt)
+{
+    document.getElementById("rect1").setAttribute("width", "100");
+    document.getElementById("rect2").setAttribute("width", "100");
+    document.getElementById("rect3").setAttribute("width", "100");
+}
+</script>
+<g onclick="mouseHandler()" id="box">
+<rect id="rect1" x="10" y="10" width="200" height="100" style="fill:green;mask:url(#mask)"/>
+<rect id="rect2" x="10" y="130" width="200" height="100" style="fill:green;clip-path:url(#clip)"/>
+<rect id="rect3" x="10" y="250" width="200" height="100" style="fill:green;filter:url(#filter)"/>
+</g>
+</svg>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c4c175e..d9c6255 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-01-04  Dirk Schulze  <krit at webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        SVGResources don't invalidate if target object changes attributes
+        https://bugs.webkit.org/show_bug.cgi?id=33091
+
+        It's neccessary to invalidate all resources of an object, if the attributes of this
+        target change. Otherwise the saved resource data (like ImageBuffers) don't match
+        to the new object properties. 
+
+        Test: svg/custom/resource-invalidate-on-target-update.svg
+
+        * svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::svgAttributeChanged):
+        (WebCore::SVGStyledElement::invalidateResources):
+        * svg/SVGStyledElement.h:
+
 2010-01-03  Kenneth Russell  <kbr at google.com>
 
         Reviewed by Maciej Stachowiak.
diff --git a/WebCore/svg/SVGStyledElement.cpp b/WebCore/svg/SVGStyledElement.cpp
index 46d7cbe..aee0e35 100644
--- a/WebCore/svg/SVGStyledElement.cpp
+++ b/WebCore/svg/SVGStyledElement.cpp
@@ -36,7 +36,9 @@
 #include "SVGElementInstance.h"
 #include "SVGNames.h"
 #include "SVGRenderStyle.h"
-#include "SVGResource.h"
+#include "SVGResourceClipper.h"
+#include "SVGResourceFilter.h"
+#include "SVGResourceMasker.h"
 #include "SVGSVGElement.h"
 #include <wtf/Assertions.h>
 
@@ -202,10 +204,40 @@ void SVGStyledElement::svgAttributeChanged(const QualifiedName& attrName)
     // If we're the child of a resource element, be sure to invalidate it.
     invalidateResourcesInAncestorChain();
 
+    // If the element is using resources, invalidate them.
+    invalidateResources();
+
     // Invalidate all SVGElementInstances associated with us
     SVGElementInstance::invalidateAllInstancesOfElement(this);
 }
 
+void SVGStyledElement::invalidateResources()
+{
+    RenderObject* object = renderer();
+    if (!object)
+        return;
+
+    const SVGRenderStyle* svgStyle = object->style()->svgStyle();
+    Document* document = this->document();
+
+    if (document->parsing())
+        return; 
+
+#if ENABLE(FILTERS)
+    SVGResourceFilter* filter = getFilterById(document, svgStyle->filter(), object);
+    if (filter)
+        filter->invalidate();
+#endif
+
+    SVGResourceMasker* masker = getMaskerById(document, svgStyle->maskElement(), object);
+    if (masker)
+        masker->invalidate();
+
+    SVGResourceClipper* clipper = getClipperById(document, svgStyle->clipPath(), object);
+    if (clipper)
+        clipper->invalidate();
+}
+
 void SVGStyledElement::invalidateResourcesInAncestorChain() const
 {
     Node* node = parentNode();
diff --git a/WebCore/svg/SVGStyledElement.h b/WebCore/svg/SVGStyledElement.h
index a17128c..7542d61 100644
--- a/WebCore/svg/SVGStyledElement.h
+++ b/WebCore/svg/SVGStyledElement.h
@@ -60,7 +60,9 @@ namespace WebCore {
         // Centralized place to force a manual style resolution. Hacky but needed for now.
         PassRefPtr<RenderStyle> resolveStyle(RenderStyle* parentStyle);
 
-        void invalidateResourcesInAncestorChain() const;        
+        void invalidateResourcesInAncestorChain() const;
+        void invalidateResources();
+
         virtual void detach();
                                  
         void setInstanceUpdatesBlocked(bool);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list