Bug #: 4706
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 28 Aug 2005 11:41:51 +0000 (11:41 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 28 Aug 2005 11:41:51 +0000 (11:41 +0000)
Submitted by: Tobias Lidskog <tobiaslidskog@mac.com>
Reviewed by: eseidel
        Test cases updated:
        * svg-tests/W3C-SVG-1.1/Resources/animation-extRef-image1-expected.checks
um:
        * svg-tests/W3C-SVG-1.1/Resources/animation-extRef-image1-expected.txt:
        * svg-tests/W3C-SVG-1.1/coords-units-03-b-expected.txt:
        * svg-tests/W3C-SVG-1.1/struct-image-02-b-expected.txt:

        * kcanvas/KCanvasCreator.cpp:
        (KCanvasCreator::createRoundedRectangle): ignore 0 rects
        (KCanvasCreator::createRectangle): ignore 0 rects
        (KCanvasCreator::createEllipse): ignore empty elipses
        (KCanvasCreator::createLine): ignore 0 lines
        http://bugzilla.opendarwin.org/show_bug.cgi?id=4706

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

LayoutTests/svg/W3C-SVG-1.1/coords-units-03-b-expected.txt
LayoutTests/svg/W3C-SVG-1.1/resources/animation-extRef-image1-expected.checksum
LayoutTests/svg/W3C-SVG-1.1/resources/animation-extRef-image1-expected.png
LayoutTests/svg/W3C-SVG-1.1/resources/animation-extRef-image1-expected.txt
LayoutTests/svg/W3C-SVG-1.1/struct-image-02-b-expected.txt
WebCore/ChangeLog-2005-12-19
WebCore/kcanvas/KCanvasCreator.cpp

index 6f92e029c33489569905ff808a5a1d47ae4570a9..0cf79c21876b02bd83fba16b61c1989bb458e394 100644 (file)
@@ -6,10 +6,8 @@ KCanvasContainer at (0,0) size 2001x2001
     KCanvasContainer at (19,79) size 201x182 [transform={m=((1.000000,0.000000)(0.000000,1.000000)) t=(0.000000,60.000000)}] [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
       KCanvasItem {rect} at (19,79) size 201x2 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M20.00,20.00L220.00,20.00L220.00,21.00L20.00,21.00"]
       KCanvasItem {rect} at (19,99) size 201x2 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M20.00,40.00L220.00,40.00L220.00,41.00L20.00,41.00"]
-      KCanvasContainer at (19,120) size 1x1 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
-        KCanvasItem {rect} at (19,120) size 1x1 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M20.00,60.00L20.00,60.00L20.00,61.00L20.00,61.00"]
-      KCanvasContainer at (19,140) size 1x1 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
-        KCanvasItem {rect} at (19,140) size 1x1 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M20.00,80.00L20.00,80.00L20.00,81.00L20.00,81.00"]
+      KCanvasContainer at (0,0) size 0x0 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
+      KCanvasContainer at (0,0) size 0x0 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
       KCanvasItem {rect} at (19,159) size 201x2 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M20.00,100.00L220.02,100.00L220.02,101.00L20.00,101.00"]
       KCanvasItem {rect} at (19,179) size 91x2 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M20.00,120.00L110.00,120.00L110.00,121.00L20.00,121.00"]
       KCanvasItem {rect} at (19,199) size 91x2 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M20.00,140.00L110.00,140.00L110.00,141.00L20.00,141.00"]
index 50fd34ee556367a9c63dba4edfb67baf05764d97..dc91451d462b208a0d7cfa5474f22e80b459cc15 100644 (file)
@@ -1 +1 @@
-3d466ae9b760f9f9c3f5cebb1de6c41f
\ No newline at end of file
+5cddf3fb8a7c62d5fd6e16b052557cbd
\ No newline at end of file
index 9e288732f329a22f1d1048f871c51f9ebe44f743..ce04e0303e5b2e208176ca402875179d99c47462 100644 (file)
Binary files a/LayoutTests/svg/W3C-SVG-1.1/resources/animation-extRef-image1-expected.png and b/LayoutTests/svg/W3C-SVG-1.1/resources/animation-extRef-image1-expected.png differ
index 31ac0062547f973613ec7fed43be43b32b9c1ed9..90a1e1a2cb00d7d0a0f2cc58409331be820b1e9a 100644 (file)
@@ -1,6 +1,3 @@
-KCanvasContainer at (1,10) size 2x100
-  KCanvasContainer at (1,10) size 2x100 [stroke={server=UNIMPLEMENTED, stroke width=2.000000}] [fill={server=UNIMPLEMENTED}]
-    KCanvasItem {rect} at (1,10) size 2x20 [stroke={server=UNIMPLEMENTED, stroke width=2.000000}] [fill={server=UNIMPLEMENTED}] [data="M2.00,10.00L2.00,10.00L2.00,30.00L2.00,30.00"]
-    KCanvasItem {rect} at (1,50) size 2x20 [stroke={server=UNIMPLEMENTED, stroke width=2.000000}] [fill={server=UNIMPLEMENTED}] [data="M2.00,50.00L2.00,50.00L2.00,70.00L2.00,70.00"]
-    KCanvasItem {rect} at (1,90) size 2x20 [stroke={server=UNIMPLEMENTED, stroke width=2.000000}] [fill={server=UNIMPLEMENTED}] [data="M2.00,90.00L2.00,90.00L2.00,110.00L2.00,110.00"]
+KCanvasContainer at (0,0) size 0x0
+  KCanvasContainer at (0,0) size 0x0 [stroke={server=UNIMPLEMENTED, stroke width=2.000000}] [fill={server=UNIMPLEMENTED}]
   KCanvasContainer at (0,0) size 0x0 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
index 2b2146cfe151da7e1d344e32913785eb32a0285e..8dc45f45f698cd26e1f3113e95b210886960d41c 100644 (file)
@@ -4,11 +4,10 @@ KCanvasContainer at (0,0) size 480x359
       KCanvasContainer at (0,0) size 240x150 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
         KCanvasContainer at (0,0) size 240x150 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
           KCanvasItem at (0,0) size 240x150 [fill={server=UNIMPLEMENTED}] [data="M0.00,0.00L240.00,0.00L240.00,150.00L0.00,150.00"]
-    KCanvasContainer at (2147483647,2147483647) size 0x0 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
-      KCanvasContainer at (2147483647,2147483647) size 0x0 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
-        KCanvasContainer at (2147483647,2147483647) size 0x0 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
-          KCanvasContainer at (2147483647,2147483647) size 0x0 [transform={m=((1.000000,0.000000)(0.000000,1.000000)) t=(240.000000,0.000000)}]
-            KCanvasItem {rect} at (2147483647,2147483647) size 0x0 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M0.00,0.00L0.00,0.00L0.00,0.00L0.00,0.00"]
+    KCanvasContainer at (0,0) size 0x0 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
+      KCanvasContainer at (0,0) size 0x0 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
+        KCanvasContainer at (0,0) size 0x0 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
+          KCanvasContainer at (0,0) size 0x0 [transform={m=((1.000000,0.000000)(0.000000,1.000000)) t=(240.000000,0.000000)}]
     KCanvasContainer at (0,149) size 241x151 [transform={m=((1.000000,0.000000)(0.000000,1.000000)) t=(0.000000,150.000000)}]
       KCanvasContainer at (0,149) size 241x151 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}]
         KCanvasItem {rect} at (0,149) size 241x151 [stroke={server=UNIMPLEMENTED}] [fill={server=UNIMPLEMENTED}] [data="M0.00,0.00L240.00,0.00L240.00,150.00L0.00,150.00"]
index 4289a4d03077586a302ca7cbdb44bfc4fba19651..0edfd4d7617c1a1bb6e61dd3088b316f72d34579 100644 (file)
@@ -1,3 +1,21 @@
+2005-08-28  Eric Seidel  <eseidel@apple.com>
+        Fix by Tobias Lidskog <tobiaslidskog@mac.com>
+
+        Reviewed by eseidel.
+
+        Test cases updated:
+        * svg-tests/W3C-SVG-1.1/Resources/animation-extRef-image1-expected.checksum:
+        * svg-tests/W3C-SVG-1.1/Resources/animation-extRef-image1-expected.txt:
+        * svg-tests/W3C-SVG-1.1/coords-units-03-b-expected.txt:
+        * svg-tests/W3C-SVG-1.1/struct-image-02-b-expected.txt:
+
+        * kcanvas/KCanvasCreator.cpp:
+        (KCanvasCreator::createRoundedRectangle): ignore 0 rects
+        (KCanvasCreator::createRectangle): ignore 0 rects
+        (KCanvasCreator::createEllipse): ignore empty elipses
+        (KCanvasCreator::createLine): ignore 0 lines
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=4706
+
 2005-08-28  Eric Seidel  <eseidel@apple.com>
         Fix by Tobias Lidskog <tobiaslidskog@mac.com>
 
index c103b71fabdd25573d2c3267a2b47a50afd33ad4..007145a33162305c2dc11b3a27237a56d2b209e4 100644 (file)
@@ -54,6 +54,9 @@ KCPathDataList KCanvasCreator::createRoundedRectangle(float x, float y, float wi
 {
        KCPathDataList list;
 
+    if (width <= 0.0f || height <= 0.0f)
+        return list;
+
        double nrx = rx, nry = ry;
        // If rx is greater than half of the width of the rectangle
        // then set rx to half of the width (required in SVG spec)
@@ -93,6 +96,10 @@ KCPathDataList KCanvasCreator::createRoundedRectangle(float x, float y, float wi
 KCPathDataList KCanvasCreator::createRectangle(float x, float y, float width, float height) const
 {
        KCPathDataList list;
+    
+    if (width <= 0.0f || height <= 0.0f)
+        return list;
+    
        list.moveTo(x, y);
        list.lineTo(x + width, y);
        list.lineTo(x + width, y + height);
@@ -105,6 +112,9 @@ KCPathDataList KCanvasCreator::createEllipse(float cx, float cy, float rx, float
 {
        KCPathDataList list;
 
+    if (rx <= 0.0f || ry <= 0.0f)
+        return list;
+
        // Ellipse creation - nice & clean agg2 code
        double x = cx, y = cy;
 
@@ -141,6 +151,10 @@ KCPathDataList KCanvasCreator::createCircle(float cx, float cy, float r) const
 KCPathDataList KCanvasCreator::createLine(float x1, float y1, float x2, float y2) const
 {
        KCPathDataList list;
+    
+    if (x1 == x2 && y1 == y2)
+        return list;
+
        list.moveTo(x1, y1);
        list.lineTo(x2, y2);
        return list;