From a23823f27d8b4f8eb6692b1b8b16697075ab4037 Mon Sep 17 00:00:00 2001 From: David Zbarsky Date: Sat, 22 Dec 2012 23:54:21 -0500 Subject: [PATCH] Bug 817442 Part 1: Remove nsIDOMSVGPointList r=bz, jwatt --- content/svg/content/src/DOMSVGPointList.cpp | 108 +----------------- content/svg/content/src/DOMSVGPointList.h | 4 +- content/svg/content/src/nsSVGPolyElement.cpp | 8 +- dom/base/nsDOMClassInfo.cpp | 7 -- dom/base/nsDOMClassInfo.h | 1 - dom/base/nsDOMClassInfoClasses.h | 1 - dom/interfaces/svg/Makefile.in | 1 - .../svg/nsIDOMSVGAnimatedPoints.idl | 6 +- dom/interfaces/svg/nsIDOMSVGPointList.idl | 30 ----- 9 files changed, 10 insertions(+), 156 deletions(-) delete mode 100644 dom/interfaces/svg/nsIDOMSVGPointList.idl diff --git a/content/svg/content/src/DOMSVGPointList.cpp b/content/svg/content/src/DOMSVGPointList.cpp index 58fec77fc98..7e4dfc2be3b 100644 --- a/content/svg/content/src/DOMSVGPointList.cpp +++ b/content/svg/content/src/DOMSVGPointList.cpp @@ -57,15 +57,9 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGPointList) NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGPointList) -} // namespace mozilla -DOMCI_DATA(SVGPointList, mozilla::DOMSVGPointList) -namespace mozilla { - NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMSVGPointList) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY - NS_INTERFACE_MAP_ENTRY(nsIDOMSVGPointList) NS_INTERFACE_MAP_ENTRY(nsISupports) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGPointList) NS_INTERFACE_MAP_END @@ -171,13 +165,6 @@ DOMSVGPointList::InternalAList() const // ---------------------------------------------------------------------------- // nsIDOMSVGPointList implementation: -NS_IMETHODIMP -DOMSVGPointList::GetNumberOfItems(uint32_t *aNumberOfItems) -{ - *aNumberOfItems = NumberOfItems(); - return NS_OK; -} - void DOMSVGPointList::Clear(ErrorResult& aError) { @@ -211,14 +198,6 @@ DOMSVGPointList::Clear(ErrorResult& aError) } } -NS_IMETHODIMP -DOMSVGPointList::Clear() -{ - ErrorResult rv; - Clear(rv); - return rv.ErrorCode(); -} - already_AddRefed DOMSVGPointList::Initialize(nsISVGPoint& aNewItem, ErrorResult& aError) { @@ -244,22 +223,10 @@ DOMSVGPointList::Initialize(nsISVGPoint& aNewItem, ErrorResult& aError) domItem = domItem->Clone(); // must do this before changing anything! } - Clear(); - return InsertItemBefore(*domItem, 0, aError); -} - -NS_IMETHODIMP -DOMSVGPointList::Initialize(nsIDOMSVGPoint *aNewItem, - nsIDOMSVGPoint **_retval) -{ - nsCOMPtr domItem = do_QueryInterface(aNewItem); - if (!domItem) { - *_retval = nullptr; - return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR; - } ErrorResult rv; - *_retval = Initialize(*domItem, rv).get(); - return rv.ErrorCode(); + Clear(rv); + MOZ_ASSERT(!rv.Failed()); + return InsertItemBefore(*domItem, 0, aError); } nsISVGPoint* @@ -277,15 +244,6 @@ DOMSVGPointList::IndexedGetter(uint32_t aIndex, bool& aFound, return nullptr; } -NS_IMETHODIMP -DOMSVGPointList::GetItem(uint32_t aIndex, - nsIDOMSVGPoint **_retval) -{ - ErrorResult rv; - NS_IF_ADDREF(*_retval = GetItem(aIndex, rv)); - return rv.ErrorCode(); -} - already_AddRefed DOMSVGPointList::InsertItemBefore(nsISVGPoint& aNewItem, uint32_t aIndex, ErrorResult& aError) @@ -338,21 +296,6 @@ DOMSVGPointList::InsertItemBefore(nsISVGPoint& aNewItem, uint32_t aIndex, return domItem.forget(); } -NS_IMETHODIMP -DOMSVGPointList::InsertItemBefore(nsIDOMSVGPoint *aNewItem, - uint32_t aIndex, - nsIDOMSVGPoint **_retval) -{ - nsCOMPtr domItem = do_QueryInterface(aNewItem); - if (!domItem) { - *_retval = nullptr; - return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR; - } - ErrorResult rv; - *_retval = InsertItemBefore(*domItem, aIndex, rv).get(); - return rv.ErrorCode(); -} - already_AddRefed DOMSVGPointList::ReplaceItem(nsISVGPoint& aNewItem, uint32_t aIndex, ErrorResult& aError) @@ -397,21 +340,6 @@ DOMSVGPointList::ReplaceItem(nsISVGPoint& aNewItem, uint32_t aIndex, return domItem.forget(); } -NS_IMETHODIMP -DOMSVGPointList::ReplaceItem(nsIDOMSVGPoint *aNewItem, - uint32_t aIndex, - nsIDOMSVGPoint **_retval) -{ - nsCOMPtr domItem = do_QueryInterface(aNewItem); - if (!domItem) { - *_retval = nullptr; - return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR; - } - ErrorResult rv; - *_retval = ReplaceItem(*domItem, aIndex, rv).get(); - return rv.ErrorCode(); -} - already_AddRefed DOMSVGPointList::RemoveItem(uint32_t aIndex, ErrorResult& aError) { @@ -451,36 +379,6 @@ DOMSVGPointList::RemoveItem(uint32_t aIndex, ErrorResult& aError) return result.forget(); } -NS_IMETHODIMP -DOMSVGPointList::RemoveItem(uint32_t aIndex, - nsIDOMSVGPoint **_retval) -{ - ErrorResult rv; - *_retval = RemoveItem(aIndex, rv).get(); - return rv.ErrorCode(); -} - -NS_IMETHODIMP -DOMSVGPointList::AppendItem(nsIDOMSVGPoint *aNewItem, - nsIDOMSVGPoint **_retval) -{ - nsCOMPtr domItem = do_QueryInterface(aNewItem); - if (!domItem) { - *_retval = nullptr; - return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR; - } - ErrorResult rv; - *_retval = AppendItem(*domItem, rv).get(); - return rv.ErrorCode(); -} - -NS_IMETHODIMP -DOMSVGPointList::GetLength(uint32_t *aLength) -{ - *aLength = LengthNoFlush(); - return NS_OK; -} - void DOMSVGPointList::EnsureItemAt(uint32_t aIndex) { diff --git a/content/svg/content/src/DOMSVGPointList.h b/content/svg/content/src/DOMSVGPointList.h index 2d914212fd2..5210e916844 100644 --- a/content/svg/content/src/DOMSVGPointList.h +++ b/content/svg/content/src/DOMSVGPointList.h @@ -10,7 +10,6 @@ #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" #include "nsDebug.h" -#include "nsIDOMSVGPointList.h" #include "nsSVGElement.h" #include "nsTArray.h" #include "SVGPointList.h" // IWYU pragma: keep @@ -50,7 +49,7 @@ class SVGAnimatedPointList; * * Our DOM items are created lazily on demand as and when script requests them. */ -class DOMSVGPointList MOZ_FINAL : public nsIDOMSVGPointList, +class DOMSVGPointList MOZ_FINAL : public nsISupports, public nsWrapperCache { friend class DOMSVGPoint; @@ -58,7 +57,6 @@ class DOMSVGPointList MOZ_FINAL : public nsIDOMSVGPointList, public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGPointList) - NS_DECL_NSIDOMSVGPOINTLIST virtual JSObject* WrapObject(JSContext *cx, JSObject *scope, bool *triedToWrap); diff --git a/content/svg/content/src/nsSVGPolyElement.cpp b/content/svg/content/src/nsSVGPolyElement.cpp index 49c2daa1c30..ccda6ad0cef 100644 --- a/content/svg/content/src/nsSVGPolyElement.cpp +++ b/content/svg/content/src/nsSVGPolyElement.cpp @@ -34,18 +34,18 @@ nsSVGPolyElement::nsSVGPolyElement(already_AddRefed aNodeInfo) //---------------------------------------------------------------------- // nsIDOMSGAnimatedPoints methods: -/* readonly attribute nsIDOMSVGPointList points; */ +/* readonly attribute DOMSVGPointList points; */ NS_IMETHODIMP -nsSVGPolyElement::GetPoints(nsIDOMSVGPointList * *aPoints) +nsSVGPolyElement::GetPoints(nsISupports * *aPoints) { void *key = mPoints.GetBaseValKey(); *aPoints = DOMSVGPointList::GetDOMWrapper(key, this, false).get(); return NS_OK; } -/* readonly attribute nsIDOMSVGPointList animatedPoints; */ +/* readonly attribute DOMSVGPointList animatedPoints; */ NS_IMETHODIMP -nsSVGPolyElement::GetAnimatedPoints(nsIDOMSVGPointList * *aAnimatedPoints) +nsSVGPolyElement::GetAnimatedPoints(nsISupports * *aAnimatedPoints) { void *key = mPoints.GetAnimValKey(); *aAnimatedPoints = DOMSVGPointList::GetDOMWrapper(key, this, true).get(); diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 67f8ef0ab57..0ce7f41b9cc 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -365,7 +365,6 @@ #include "nsIDOMSVGPathSegList.h" #include "nsIDOMSVGPatternElement.h" #include "nsIDOMSVGPoint.h" -#include "nsIDOMSVGPointList.h" #include "nsIDOMSVGPolygonElement.h" #include "nsIDOMSVGPolylineElement.h" #include "nsIDOMSVGPresAspectRatio.h" @@ -1308,8 +1307,6 @@ static nsDOMClassInfoData sClassInfoData[] = { DOM_DEFAULT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGPoint, nsDOMGenericSH, DOM_DEFAULT_SCRIPTABLE_FLAGS) - NS_DEFINE_CLASSINFO_DATA(SVGPointList, nsDOMGenericSH, - DOM_DEFAULT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGPreserveAspectRatio, nsDOMGenericSH, DOM_DEFAULT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(SVGRect, nsDOMGenericSH, @@ -3730,10 +3727,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPoint) DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN(SVGPointList, nsIDOMSVGPointList) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPointList) - DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN(SVGPreserveAspectRatio, nsIDOMSVGPreserveAspectRatio) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPreserveAspectRatio) DOM_CLASSINFO_MAP_END diff --git a/dom/base/nsDOMClassInfo.h b/dom/base/nsDOMClassInfo.h index 17bc5f94a5a..4a9ef45eac7 100644 --- a/dom/base/nsDOMClassInfo.h +++ b/dom/base/nsDOMClassInfo.h @@ -40,7 +40,6 @@ class nsIDOMSVGNumberList; class nsIDOMSVGPathSeg; class nsIDOMSVGPathSegList; class nsIDOMSVGPoint; -class nsIDOMSVGPointList; class nsIDOMSVGStringList; class nsIDOMSVGTests; class nsIDOMSVGTransform; diff --git a/dom/base/nsDOMClassInfoClasses.h b/dom/base/nsDOMClassInfoClasses.h index 95a33cd68a5..4dcaa5a652f 100644 --- a/dom/base/nsDOMClassInfoClasses.h +++ b/dom/base/nsDOMClassInfoClasses.h @@ -295,7 +295,6 @@ DOMCI_CLASS(SVGPathSegList) DOMCI_CLASS(SVGPathSegMovetoAbs) DOMCI_CLASS(SVGPathSegMovetoRel) DOMCI_CLASS(SVGPoint) -DOMCI_CLASS(SVGPointList) DOMCI_CLASS(SVGPreserveAspectRatio) DOMCI_CLASS(SVGRect) DOMCI_CLASS(SVGStringList) diff --git a/dom/interfaces/svg/Makefile.in b/dom/interfaces/svg/Makefile.in index efedec2fa67..a00c4038d03 100644 --- a/dom/interfaces/svg/Makefile.in +++ b/dom/interfaces/svg/Makefile.in @@ -69,7 +69,6 @@ XPIDLSRCS = \ nsIDOMSVGPathSegList.idl \ nsIDOMSVGPatternElement.idl \ nsIDOMSVGPoint.idl \ - nsIDOMSVGPointList.idl \ nsIDOMSVGPolygonElement.idl \ nsIDOMSVGPolylineElement.idl \ nsIDOMSVGPresAspectRatio.idl \ diff --git a/dom/interfaces/svg/nsIDOMSVGAnimatedPoints.idl b/dom/interfaces/svg/nsIDOMSVGAnimatedPoints.idl index 1a7e37fc535..16bd9d9159d 100644 --- a/dom/interfaces/svg/nsIDOMSVGAnimatedPoints.idl +++ b/dom/interfaces/svg/nsIDOMSVGAnimatedPoints.idl @@ -6,11 +6,9 @@ #include "domstubs.idl" -interface nsIDOMSVGPointList; - [scriptable, uuid(ebf334b3-86ef-4bf3-8a92-d775c72defa4)] interface nsIDOMSVGAnimatedPoints : nsISupports { - readonly attribute nsIDOMSVGPointList points; - readonly attribute nsIDOMSVGPointList animatedPoints; + readonly attribute nsISupports points; + readonly attribute nsISupports animatedPoints; }; diff --git a/dom/interfaces/svg/nsIDOMSVGPointList.idl b/dom/interfaces/svg/nsIDOMSVGPointList.idl deleted file mode 100644 index 5f73ab11b01..00000000000 --- a/dom/interfaces/svg/nsIDOMSVGPointList.idl +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "domstubs.idl" - -interface nsIDOMSVGPoint; - -[scriptable, uuid(1cc66e7d-c874-4429-9f73-a0e5f2c77a85)] -interface nsIDOMSVGPointList : nsISupports -{ - readonly attribute unsigned long numberOfItems; - readonly attribute unsigned long length; // synonym for numberOfItems - - void clear(); - // raises( DOMException ); - nsIDOMSVGPoint initialize(in nsIDOMSVGPoint newItem); - // raises( DOMException, SVGException ); - nsIDOMSVGPoint getItem (in unsigned long index); - // raises( DOMException ); - nsIDOMSVGPoint insertItemBefore(in nsIDOMSVGPoint newItem, in unsigned long index); - // raises( DOMException, SVGException ); - nsIDOMSVGPoint replaceItem(in nsIDOMSVGPoint newItem, in unsigned long index); - // raises( DOMException, SVGException ); - nsIDOMSVGPoint removeItem(in unsigned long index); - // raises( DOMException ); - nsIDOMSVGPoint appendItem(in nsIDOMSVGPoint newItem); - // raises( DOMException, SVGException ); -};