Changeset 51649 in webkit
- Timestamp:
- Dec 3, 2009 11:34:46 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r51645 r51649 1 2009-12-03 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 REGRESSION (r51627): 3 SVG tests are failing 6 https://bugs.webkit.org/show_bug.cgi?id=32117 7 8 Improve testing of svglist. 9 10 * svg/dom/svglist-exception-on-out-bounds-error-expected.txt: 11 * svg/dom/svglist-exception-on-out-bounds-error.html: 12 1 13 2009-12-03 Enrica Casucci <enrica@apple.com> 2 14 -
trunk/LayoutTests/svg/dom/svglist-exception-on-out-bounds-error-expected.txt
r43795 r51649 5 5 6 6 PASS svgList.getItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 7 PASS svgList.insertItemBefore(null, i) is null 7 PASS svgList.insertItemBefore(null, i) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 8 PASS svgList.insertItemBefore(seg, i) is seg 9 PASS svgList.replaceItem(seg, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 8 10 PASS svgList.replaceItem(null, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 9 11 PASS svgList.removeItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 10 12 PASS svgList.getItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 11 PASS svgList.insertItemBefore(null, i) is null 13 PASS svgList.insertItemBefore(null, i) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 14 PASS svgList.insertItemBefore(seg, i) is seg 15 PASS svgList.replaceItem(seg, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 12 16 PASS svgList.replaceItem(null, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 13 17 PASS svgList.removeItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 14 18 PASS svgList.getItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 15 PASS svgList.insertItemBefore(null, i) is null 19 PASS svgList.insertItemBefore(null, i) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 20 PASS svgList.insertItemBefore(seg, i) is seg 21 PASS svgList.replaceItem(seg, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 16 22 PASS svgList.replaceItem(null, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 17 23 PASS svgList.removeItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 18 24 PASS svgList.getItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 19 PASS svgList.insertItemBefore(null, i) is null 25 PASS svgList.insertItemBefore(null, i) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 26 PASS svgList.insertItemBefore(seg, i) is seg 27 PASS svgList.replaceItem(seg, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 20 28 PASS svgList.replaceItem(null, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 21 29 PASS svgList.removeItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 22 30 PASS svgList.getItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 23 PASS svgList.insertItemBefore(null, i) is null 31 PASS svgList.insertItemBefore(null, i) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 32 PASS svgList.insertItemBefore(seg, i) is seg 33 PASS svgList.replaceItem(seg, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 24 34 PASS svgList.replaceItem(null, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 25 35 PASS svgList.removeItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 26 36 PASS svgList.getItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 27 PASS svgList.insertItemBefore(null, i) is null 37 PASS svgList.insertItemBefore(null, i) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17. 38 PASS svgList.insertItemBefore(seg, i) is seg 39 PASS svgList.replaceItem(seg, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 28 40 PASS svgList.replaceItem(null, i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. 29 41 PASS svgList.removeItem(i) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1. -
trunk/LayoutTests/svg/dom/svglist-exception-on-out-bounds-error.html
r43795 r51649 15 15 for (var i = 0; i < indicesToTest.length; i++) { 16 16 shouldThrow("svgList.getItem(i)"); 17 shouldBeNull("svgList.insertItemBefore(null, i)"); 17 shouldThrow("svgList.insertItemBefore(null, i)"); 18 var seg = path.createSVGPathSegClosePath(); 19 shouldBe("svgList.insertItemBefore(seg, i)", "seg"); 18 20 svgList.removeItem(0); 21 shouldThrow("svgList.replaceItem(seg, i)"); 19 22 shouldThrow("svgList.replaceItem(null, i)"); 20 23 shouldThrow("svgList.removeItem(i)"); -
trunk/WebCore/ChangeLog
r51648 r51649 1 2009-12-03 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 REGRESSION (r51627): 3 SVG tests are failing 6 https://bugs.webkit.org/show_bug.cgi?id=32117 7 8 Null checking Items in the SVGList is insufficient as items may 9 be floats, etc so add SVGListTraits::isNull and add appropriate 10 specializations. 11 12 Test: svg/dom/svglist-exception-on-out-bounds-error.html 13 14 * svg/SVGList.h: 15 (WebCore::SVGListTypeOperations::isNull): 16 (WebCore::SVGList::initialize): 17 (WebCore::SVGList::insertItemBefore): 18 (WebCore::SVGList::replaceItem): 19 (WebCore::SVGList::appendItem): 20 * svg/SVGListTraits.h: 21 (WebCore::): 22 1 23 2009-12-03 Brady Eidson <beidson@apple.com> 2 24 -
trunk/WebCore/svg/SVGList.h
r51627 r51649 40 40 return SVGListTraits<UsesDefaultInitializer<Item>::value, Item>::nullItem(); 41 41 } 42 static bool isNull(const Item& it) 43 { 44 return SVGListTraits<UsesDefaultInitializer<Item>::value, Item>::isNull(it); 45 } 42 46 }; 43 47 … … 57 61 Item initialize(Item newItem, ExceptionCode& ec) 58 62 { 59 if ( !newItem) {63 if (TypeOperations::isNull(newItem)) { 60 64 ec = TYPE_MISMATCH_ERR; 61 65 return TypeOperations::nullItem(); … … 99 103 Item insertItemBefore(Item newItem, unsigned int index, ExceptionCode& ec) 100 104 { 101 if ( !newItem) {105 if (TypeOperations::isNull(newItem)) { 102 106 ec = TYPE_MISMATCH_ERR; 103 107 return TypeOperations::nullItem(); … … 119 123 } 120 124 121 if ( !newItem) {125 if (TypeOperations::isNull(newItem)) { 122 126 ec = TYPE_MISMATCH_ERR; 123 127 return TypeOperations::nullItem(); … … 142 146 Item appendItem(Item newItem, ExceptionCode& ec) 143 147 { 144 if ( !newItem) {148 if (TypeOperations::isNull(newItem)) { 145 149 ec = TYPE_MISMATCH_ERR; 146 150 return TypeOperations::nullItem(); -
trunk/WebCore/svg/SVGListTraits.h
r50583 r51649 24 24 #if ENABLE(SVG) 25 25 26 #include <wtf/RefPtr.h> 27 26 28 namespace WebCore { 27 29 28 30 template<typename Item> struct UsesDefaultInitializer { static const bool value = true; }; 29 31 template<> struct UsesDefaultInitializer<double> { static const bool value = false; }; 32 template<> struct UsesDefaultInitializer<float> { static const bool value = false; }; 30 33 31 34 template<bool usesDefaultInitializer, typename Item> 32 35 struct SVGListTraits { }; 33 36 37 template<typename ItemPtr> 38 struct SVGListTraits<true, ItemPtr*> { 39 static ItemPtr nullItem() { return 0; } 40 static bool isNull(ItemPtr it) { return !it; } 41 }; 42 43 template<typename ItemPtr> 44 struct SVGListTraits<true, RefPtr<ItemPtr> > { 45 static RefPtr<ItemPtr> nullItem() { return 0; } 46 static bool isNull(RefPtr<ItemPtr> it) { return !it; } 47 }; 48 34 49 template<typename Item> 35 50 struct SVGListTraits<true, Item> { 36 static Item nullItem() { return Item(); } 51 static Item nullItem() { return Item(); } 52 static bool isNull(Item it) { return !it; } 37 53 }; 38 54 … … 40 56 struct SVGListTraits<false, double> { 41 57 static double nullItem() { return 0.0; } 58 static bool isNull(double) { return false; } 42 59 }; 60 61 template<> 62 struct SVGListTraits<false, float> { 63 static double nullItem() { return 0.0; } 64 static bool isNull(double) { return false; } 65 }; 66 43 67 44 68 } // namespace WebCore
Note: See TracChangeset
for help on using the changeset viewer.