diff --git a/content/events/src/nsDOMNotifyPaintEvent.cpp b/content/events/src/nsDOMNotifyPaintEvent.cpp index 2886af165232..97f316537c9b 100644 --- a/content/events/src/nsDOMNotifyPaintEvent.cpp +++ b/content/events/src/nsDOMNotifyPaintEvent.cpp @@ -92,7 +92,7 @@ nsDOMNotifyPaintEvent::ClientRects() } NS_IMETHODIMP -nsDOMNotifyPaintEvent::GetPaintRequests(nsIDOMPaintRequestList** aResult) +nsDOMNotifyPaintEvent::GetPaintRequests(nsISupports** aResult) { nsRefPtr requests = PaintRequests(); requests.forget(aResult); diff --git a/content/events/src/nsPaintRequest.cpp b/content/events/src/nsPaintRequest.cpp index 015a5d1acae6..901609631273 100644 --- a/content/events/src/nsPaintRequest.cpp +++ b/content/events/src/nsPaintRequest.cpp @@ -55,31 +55,16 @@ nsPaintRequest::GetXPCOMReason(nsAString& aResult) NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsPaintRequestList, mParent) -NS_INTERFACE_TABLE_HEAD(nsPaintRequestList) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsPaintRequestList) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY - NS_INTERFACE_TABLE1(nsPaintRequestList, nsIDOMPaintRequestList) - NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsPaintRequestList) + NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPaintRequestList) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPaintRequestList) JSObject* -nsPaintRequestList::WrapObject(JSContext *cx, JS::Handle scope) +nsPaintRequestList::WrapObject(JSContext* aCx, JS::Handle aScope) { - return mozilla::dom::PaintRequestListBinding::Wrap(cx, scope, this); -} - -NS_IMETHODIMP -nsPaintRequestList::GetLength(uint32_t* aLength) -{ - *aLength = Length(); - return NS_OK; -} - -NS_IMETHODIMP -nsPaintRequestList::Item(uint32_t aIndex, nsIDOMPaintRequest** aReturn) -{ - NS_IF_ADDREF(*aReturn = Item(aIndex)); - return NS_OK; + return PaintRequestListBinding::Wrap(aCx, aScope, this); } diff --git a/content/events/src/nsPaintRequest.h b/content/events/src/nsPaintRequest.h index b3ba890d92fd..f1b8e4dfc9e8 100644 --- a/content/events/src/nsPaintRequest.h +++ b/content/events/src/nsPaintRequest.h @@ -7,7 +7,6 @@ #define NSPAINTREQUEST_H_ #include "nsIDOMPaintRequest.h" -#include "nsIDOMPaintRequestList.h" #include "nsPresContext.h" #include "nsIDOMEvent.h" #include "mozilla/Attributes.h" @@ -53,7 +52,7 @@ private: nsInvalidateRequestList::Request mRequest; }; -class nsPaintRequestList MOZ_FINAL : public nsIDOMPaintRequestList, +class nsPaintRequestList MOZ_FINAL : public nsISupports, public nsWrapperCache { public: @@ -64,10 +63,9 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsPaintRequestList) - NS_DECL_NSIDOMPAINTREQUESTLIST - virtual JSObject* WrapObject(JSContext *cx, - JS::Handle scope) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, + JS::Handle aScope) MOZ_OVERRIDE; nsISupports* GetParentObject() { return mParent; @@ -78,23 +76,6 @@ public: mArray.AppendElement(aElement); } - static nsPaintRequestList* FromSupports(nsISupports* aSupports) - { -#ifdef DEBUG - { - nsCOMPtr list_qi = do_QueryInterface(aSupports); - - // If this assertion fires the QI implementation for the object in - // question doesn't use the nsIDOMClientRectList pointer as the nsISupports - // pointer. That must be fixed, or we'll crash... - NS_ASSERTION(list_qi == static_cast(aSupports), - "Uh, fix QI!"); - } -#endif - - return static_cast(aSupports); - } - uint32_t Length() { return mArray.Length(); diff --git a/dom/interfaces/events/moz.build b/dom/interfaces/events/moz.build index a03c15eb3885..72da456eb09b 100644 --- a/dom/interfaces/events/moz.build +++ b/dom/interfaces/events/moz.build @@ -40,7 +40,6 @@ XPIDL_SOURCES += [ 'nsIDOMNotifyPaintEvent.idl', 'nsIDOMPageTransitionEvent.idl', 'nsIDOMPaintRequest.idl', - 'nsIDOMPaintRequestList.idl', 'nsIDOMPopStateEvent.idl', 'nsIDOMPopupBlockedEvent.idl', 'nsIDOMProgressEvent.idl', diff --git a/dom/interfaces/events/nsIDOMNotifyPaintEvent.idl b/dom/interfaces/events/nsIDOMNotifyPaintEvent.idl index c1883f2fe2da..543f2c946407 100644 --- a/dom/interfaces/events/nsIDOMNotifyPaintEvent.idl +++ b/dom/interfaces/events/nsIDOMNotifyPaintEvent.idl @@ -12,7 +12,7 @@ interface nsIDOMPaintRequestList; * event, which fires at a window when painting has happened in * that window. */ -[scriptable, builtinclass, uuid(e3560df8-0926-48da-b13a-36d3938c95af)] +[scriptable, builtinclass, uuid(ef68f0d5-5b55-4198-9e59-a5e2c57d3adc)] interface nsIDOMNotifyPaintEvent : nsIDOMEvent { /** @@ -32,6 +32,6 @@ interface nsIDOMNotifyPaintEvent : nsIDOMEvent */ readonly attribute nsIDOMClientRect boundingClientRect; - readonly attribute nsIDOMPaintRequestList paintRequests; + readonly attribute nsISupports /* PaintRequestList */ paintRequests; }; diff --git a/dom/interfaces/events/nsIDOMPaintRequestList.idl b/dom/interfaces/events/nsIDOMPaintRequestList.idl deleted file mode 100644 index df0dce556f9d..000000000000 --- a/dom/interfaces/events/nsIDOMPaintRequestList.idl +++ /dev/null @@ -1,15 +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 nsIDOMPaintRequest; - -[scriptable, uuid(1d6a6e10-e9f0-468b-b8e5-da39c945690e)] -interface nsIDOMPaintRequestList : nsISupports -{ - readonly attribute unsigned long length; - nsIDOMPaintRequest item(in unsigned long index); -};