Bug 817442 Part 1: Remove nsIDOMSVGPointList r=bz, jwatt

This commit is contained in:
David Zbarsky 2012-12-22 23:54:21 -05:00
parent a4094217c8
commit a23823f27d
9 changed files with 10 additions and 156 deletions

View File

@ -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<nsISVGPoint>
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<DOMSVGPoint> 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<nsISVGPoint>
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<DOMSVGPoint> 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<nsISVGPoint>
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<DOMSVGPoint> 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<nsISVGPoint>
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<DOMSVGPoint> 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)
{

View File

@ -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);

View File

@ -34,18 +34,18 @@ nsSVGPolyElement::nsSVGPolyElement(already_AddRefed<nsINodeInfo> 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();

View File

@ -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

View File

@ -40,7 +40,6 @@ class nsIDOMSVGNumberList;
class nsIDOMSVGPathSeg;
class nsIDOMSVGPathSegList;
class nsIDOMSVGPoint;
class nsIDOMSVGPointList;
class nsIDOMSVGStringList;
class nsIDOMSVGTests;
class nsIDOMSVGTransform;

View File

@ -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)

View File

@ -69,7 +69,6 @@ XPIDLSRCS = \
nsIDOMSVGPathSegList.idl \
nsIDOMSVGPatternElement.idl \
nsIDOMSVGPoint.idl \
nsIDOMSVGPointList.idl \
nsIDOMSVGPolygonElement.idl \
nsIDOMSVGPolylineElement.idl \
nsIDOMSVGPresAspectRatio.idl \

View File

@ -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;
};

View File

@ -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 );
};