2007-01-15 Eric Seidel <eric@eseidel.com>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Jan 2007 09:19:28 +0000 (09:19 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Jan 2007 09:19:28 +0000 (09:19 +0000)
        Reviewed by mjs.

        SVG gradients do not notice stop additions
        http://bugs.webkit.org/show_bug.cgi?id=12192

        Test: svg/custom/gradient-add-stops.svg

        * ksvg2/svg/SVGGradientElement.cpp:
        (WebCore::SVGGradientElement::childrenChanged):
        * ksvg2/svg/SVGGradientElement.h:

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

LayoutTests/ChangeLog
LayoutTests/svg/custom/gradient-add-stops-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/gradient-add-stops-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/gradient-add-stops-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/gradient-add-stops.svg [new file with mode: 0644]
WebCore/ChangeLog
WebCore/ksvg2/svg/SVGGradientElement.cpp
WebCore/ksvg2/svg/SVGGradientElement.h

index 978995f62e85b56ea3cb53dac20bcab8b994af43..75265f68540b938abf37258229a9479311f58285 100644 (file)
@@ -1,3 +1,15 @@
+2007-01-15  Eric Seidel  <eric@eseidel.com>
+
+        Reviewed by mjs.
+        
+        SVG gradients do not notice stop additions
+        http://bugs.webkit.org/show_bug.cgi?id=12192
+
+        * svg/custom/gradient-add-stops-expected.checksum: Added.
+        * svg/custom/gradient-add-stops-expected.png: Added.
+        * svg/custom/gradient-add-stops-expected.txt: Added.
+        * svg/custom/gradient-add-stops.svg: Added.
+
 2007-01-14  Eric Seidel  <eric@webkit.org>
 
         Reviewed by hyatt.
diff --git a/LayoutTests/svg/custom/gradient-add-stops-expected.checksum b/LayoutTests/svg/custom/gradient-add-stops-expected.checksum
new file mode 100644 (file)
index 0000000..3a4f1f7
--- /dev/null
@@ -0,0 +1 @@
+16310588467cfc20d551635abc59b784
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/gradient-add-stops-expected.png b/LayoutTests/svg/custom/gradient-add-stops-expected.png
new file mode 100644 (file)
index 0000000..3db2634
Binary files /dev/null and b/LayoutTests/svg/custom/gradient-add-stops-expected.png differ
diff --git a/LayoutTests/svg/custom/gradient-add-stops-expected.txt b/LayoutTests/svg/custom/gradient-add-stops-expected.txt
new file mode 100644 (file)
index 0000000..b4ca0aa
--- /dev/null
@@ -0,0 +1,6 @@
+KRenderingPaintServer {id="test" [type=LINEAR-GRADIENT] [stops=[(0.00,#FF0000), (0.00,#008000)]] [start=(0,0)] [end=(1,0)]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    RenderSVGContainer {svg} at (0,0) size 100x100
+      RenderSVGContainer {defs} at (0,0) size 0x0
+      RenderPath {rect} at (0,0) size 100x100 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#FF0000), (0.00,#008000)]] [start=(0,0)] [end=(1,0)]}] [data="M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00"]
diff --git a/LayoutTests/svg/custom/gradient-add-stops.svg b/LayoutTests/svg/custom/gradient-add-stops.svg
new file mode 100644 (file)
index 0000000..be02eb5
--- /dev/null
@@ -0,0 +1,24 @@
+<svg xmlns='http://www.w3.org/2000/svg'>
+  <defs>
+    <linearGradient id='test'>
+      <stop id='stop' offset='0' stop-color='red' />
+    </linearGradient>
+  </defs>
+  <rect fill="url(#test)" width='100' height='100' />
+  <script>
+  <![CDATA[
+    if (window.layoutTestController)
+      layoutTestController.waitUntilDone();
+      var loaded = function() {
+        var gradient = document.getElementById("test");
+        var stop = document.createElementNS('http://www.w3.org/2000/svg', 'stop');
+        stop.setAttribute("offset", "0");
+        stop.style.stopColor = 'green';
+        gradient.appendChild(stop);
+        if (window.layoutTestController)
+          layoutTestController.notifyDone();
+      }
+      window.setTimeout(loaded, 0);
+  ]]>
+  </script>
+</svg>
index 88ecff323c8c8b4ddfd9d78e1d23daee6ec2ff62..97dead99b50623d96d1228557935f1121abfa0d3 100644 (file)
@@ -1,3 +1,16 @@
+2007-01-15  Eric Seidel  <eric@eseidel.com>
+
+        Reviewed by mjs.
+        
+        SVG gradients do not notice stop additions
+        http://bugs.webkit.org/show_bug.cgi?id=12192
+
+        Test: svg/custom/gradient-add-stops.svg
+
+        * ksvg2/svg/SVGGradientElement.cpp:
+        (WebCore::SVGGradientElement::childrenChanged):
+        * ksvg2/svg/SVGGradientElement.h:
+
 2007-01-14  David Hyatt  <hyatt@apple.com>
 
         Fix for bug 10356, positioning doesn't work with <svg> elements in XHTML.  Change the requiresLayer
index 5d934b506abe16d193bee89d21e7c9fbe413b598..c8267dc898fdf9a7e10f4142efdf4a294fa8e702 100644 (file)
@@ -143,6 +143,12 @@ void SVGGradientElement::insertedIntoDocument()
         SVGResource::repaintClients(extensions->removePendingResource(resourceId));
 }
 
+void SVGGradientElement::childrenChanged()
+{
+    notifyAttributeChange();
+    SVGStyledElement::childrenChanged();
+}
+
 }
 
 #endif // SVG_SUPPORT
index 9af705e5e984bbeb7039ed833929daf9c2265e82..bd433e0b7c32c26bb79fdf60f78bbe5611173f81 100644 (file)
@@ -55,6 +55,7 @@ namespace WebCore {
         virtual SVGResource* canvasResource();
 
         virtual void insertedIntoDocument();
+        virtual void childrenChanged();
 
     protected:
         friend class SVGPaintServerGradient;