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

oliver at apple.com oliver at apple.com
Thu Apr 8 00:15:08 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit a6c1ae622fa2775783d8e4dda3720b0dac3d9b13
Author: oliver at apple.com <oliver at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 3 19:34:46 2009 +0000

    REGRESSION (r51627): 3 SVG tests are failing
    https://bugs.webkit.org/show_bug.cgi?id=32117
    
    Reviewed by Dan Bernstein.
    
    Null checking Items in the SVGList is insufficient as items may
    be floats, etc so add SVGListTraits::isNull and add appropriate
    specializations.
    
    Test: svg/dom/svglist-exception-on-out-bounds-error.html
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51649 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7908dfb..0893237 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2009-12-03  Oliver Hunt  <oliver at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        REGRESSION (r51627): 3 SVG tests are failing
+        https://bugs.webkit.org/show_bug.cgi?id=32117
+
+        Improve testing of svglist.
+
+        * svg/dom/svglist-exception-on-out-bounds-error-expected.txt:
+        * svg/dom/svglist-exception-on-out-bounds-error.html:
+
 2009-12-03  Enrica Casucci  <enrica at apple.com>
 
         Reviewed by Adele Peterson.
diff --git a/LayoutTests/svg/dom/svglist-exception-on-out-bounds-error-expected.txt b/LayoutTests/svg/dom/svglist-exception-on-out-bounds-error-expected.txt
index 3660063..83af6bb 100644
--- a/LayoutTests/svg/dom/svglist-exception-on-out-bounds-error-expected.txt
+++ b/LayoutTests/svg/dom/svglist-exception-on-out-bounds-error-expected.txt
@@ -4,27 +4,39 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS svgList.getItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.insertItemBefore(null, i) is null
+PASS svgList.insertItemBefore(null, i) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.insertItemBefore(seg, i) is seg
+PASS svgList.replaceItem(seg, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.replaceItem(null, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.removeItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.getItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.insertItemBefore(null, i) is null
+PASS svgList.insertItemBefore(null, i) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.insertItemBefore(seg, i) is seg
+PASS svgList.replaceItem(seg, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.replaceItem(null, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.removeItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.getItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.insertItemBefore(null, i) is null
+PASS svgList.insertItemBefore(null, i) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.insertItemBefore(seg, i) is seg
+PASS svgList.replaceItem(seg, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.replaceItem(null, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.removeItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.getItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.insertItemBefore(null, i) is null
+PASS svgList.insertItemBefore(null, i) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.insertItemBefore(seg, i) is seg
+PASS svgList.replaceItem(seg, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.replaceItem(null, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.removeItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.getItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.insertItemBefore(null, i) is null
+PASS svgList.insertItemBefore(null, i) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.insertItemBefore(seg, i) is seg
+PASS svgList.replaceItem(seg, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.replaceItem(null, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.removeItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.getItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.insertItemBefore(null, i) is null
+PASS svgList.insertItemBefore(null, i) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.insertItemBefore(seg, i) is seg
+PASS svgList.replaceItem(seg, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.replaceItem(null, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS svgList.removeItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
 PASS successfullyParsed is true
diff --git a/LayoutTests/svg/dom/svglist-exception-on-out-bounds-error.html b/LayoutTests/svg/dom/svglist-exception-on-out-bounds-error.html
index a1e3eb9..1a0d571 100644
--- a/LayoutTests/svg/dom/svglist-exception-on-out-bounds-error.html
+++ b/LayoutTests/svg/dom/svglist-exception-on-out-bounds-error.html
@@ -14,8 +14,11 @@
     var indicesToTest = [-Infinity, NaN, -1, 0, 1, Infinity];
     for (var i = 0; i < indicesToTest.length; i++) {
          shouldThrow("svgList.getItem(i)");
-         shouldBeNull("svgList.insertItemBefore(null, i)");
+         shouldThrow("svgList.insertItemBefore(null, i)");
+         var seg = path.createSVGPathSegClosePath();
+         shouldBe("svgList.insertItemBefore(seg, i)", "seg");
          svgList.removeItem(0);
+         shouldThrow("svgList.replaceItem(seg, i)");
          shouldThrow("svgList.replaceItem(null, i)");
          shouldThrow("svgList.removeItem(i)");
     }
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index cea3a07..9271eed 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2009-12-03  Oliver Hunt  <oliver at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        REGRESSION (r51627): 3 SVG tests are failing
+        https://bugs.webkit.org/show_bug.cgi?id=32117
+
+        Null checking Items in the SVGList is insufficient as items may
+        be floats, etc so add SVGListTraits::isNull and add appropriate
+        specializations.
+
+        Test: svg/dom/svglist-exception-on-out-bounds-error.html
+
+        * svg/SVGList.h:
+        (WebCore::SVGListTypeOperations::isNull):
+        (WebCore::SVGList::initialize):
+        (WebCore::SVGList::insertItemBefore):
+        (WebCore::SVGList::replaceItem):
+        (WebCore::SVGList::appendItem):
+        * svg/SVGListTraits.h:
+        (WebCore::):
+
 2009-12-03  Brady Eidson  <beidson at apple.com>
 
         No review - release build fix.
diff --git a/WebCore/svg/SVGList.h b/WebCore/svg/SVGList.h
index 6a3e7ad..8fb3bc1 100644
--- a/WebCore/svg/SVGList.h
+++ b/WebCore/svg/SVGList.h
@@ -39,6 +39,10 @@ namespace WebCore {
         {
             return SVGListTraits<UsesDefaultInitializer<Item>::value, Item>::nullItem();
         }
+        static bool isNull(const Item& it)
+        {
+            return SVGListTraits<UsesDefaultInitializer<Item>::value, Item>::isNull(it);
+        }
     };
 
     template<typename Item>
@@ -56,7 +60,7 @@ namespace WebCore {
 
         Item initialize(Item newItem, ExceptionCode& ec)
         {
-            if (!newItem) {
+            if (TypeOperations::isNull(newItem)) {
                 ec = TYPE_MISMATCH_ERR;
                 return TypeOperations::nullItem();
             }
@@ -98,7 +102,7 @@ namespace WebCore {
 
         Item insertItemBefore(Item newItem, unsigned int index, ExceptionCode& ec)
         {
-            if (!newItem) {
+            if (TypeOperations::isNull(newItem)) {
                 ec = TYPE_MISMATCH_ERR;
                 return TypeOperations::nullItem();
             }
@@ -118,7 +122,7 @@ namespace WebCore {
                 return TypeOperations::nullItem();
             }
     
-            if (!newItem) {
+            if (TypeOperations::isNull(newItem)) {
                 ec = TYPE_MISMATCH_ERR;
                 return TypeOperations::nullItem();
             }
@@ -141,7 +145,7 @@ namespace WebCore {
 
         Item appendItem(Item newItem, ExceptionCode& ec)
         {
-            if (!newItem) {
+            if (TypeOperations::isNull(newItem)) {
                 ec = TYPE_MISMATCH_ERR;
                 return TypeOperations::nullItem();
             }
diff --git a/WebCore/svg/SVGListTraits.h b/WebCore/svg/SVGListTraits.h
index a32b2e0..5790c8c 100644
--- a/WebCore/svg/SVGListTraits.h
+++ b/WebCore/svg/SVGListTraits.h
@@ -23,24 +23,48 @@
 
 #if ENABLE(SVG)
 
+#include <wtf/RefPtr.h>
+
 namespace WebCore {
 
     template<typename Item> struct UsesDefaultInitializer { static const bool value = true; };
     template<> struct UsesDefaultInitializer<double>      { static const bool value = false; };
+    template<> struct UsesDefaultInitializer<float>       { static const bool value = false; };
 
     template<bool usesDefaultInitializer, typename Item>
     struct SVGListTraits { };
 
+    template<typename ItemPtr>
+    struct SVGListTraits<true, ItemPtr*> {
+        static ItemPtr nullItem() { return 0; }
+        static bool isNull(ItemPtr it) { return !it; }
+    };
+    
+    template<typename ItemPtr>
+    struct SVGListTraits<true, RefPtr<ItemPtr> > {
+        static RefPtr<ItemPtr> nullItem() { return 0; }
+        static bool isNull(RefPtr<ItemPtr> it) { return !it; }
+    };
+    
     template<typename Item>
     struct SVGListTraits<true, Item> {
-        static Item nullItem() { return Item(); } 
+        static Item nullItem() { return Item(); }
+        static bool isNull(Item it) { return !it; }
     };
 
     template<>
     struct SVGListTraits<false, double> {
         static double nullItem() { return 0.0; }
+        static bool isNull(double) { return false; }
+    };
+
+    template<>
+    struct SVGListTraits<false, float> {
+        static double nullItem() { return 0.0; }
+        static bool isNull(double) { return false; }
     };
 
+
 } // namespace WebCore
 
 #endif // SVG_SUPPORT

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list