diff --git a/dom/events/DataTransferItem.cpp b/dom/events/DataTransferItem.cpp index 0cf53e83a36f..aea429a6810e 100644 --- a/dom/events/DataTransferItem.cpp +++ b/dom/events/DataTransferItem.cpp @@ -326,10 +326,9 @@ DataTransferItem::GetAsEntry(nsIPrincipal& aSubjectPrincipal, if (target) { global = target->GetOwnerGlobal(); } else { - nsCOMPtr event = - do_QueryInterface(mDataTransfer->GetParentObject()); + RefPtr event = do_QueryObject(mDataTransfer->GetParentObject()); if (event) { - global = event->InternalDOMEvent()->GetParentObject(); + global = event->GetParentObject(); } } @@ -469,8 +468,8 @@ DataTransferItem::GetAsString(FunctionStringCallback* aCallback, if (parent && !global) { if (nsCOMPtr target = do_QueryInterface(parent)) { global = target->GetOwnerGlobal(); - } else if (nsCOMPtr event = do_QueryInterface(parent)) { - global = event->InternalDOMEvent()->GetParentObject(); + } else if (RefPtr event = do_QueryObject(parent)) { + global = event->GetParentObject(); } } if (global) { diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index fa33dcc3ab43..96ef83e85511 100644 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -137,6 +137,7 @@ Event::~Event() NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Event) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY NS_INTERFACE_MAP_ENTRY(nsISupports) + NS_INTERFACE_MAP_ENTRY(Event) NS_INTERFACE_MAP_ENTRY(nsIDOMEvent) NS_INTERFACE_MAP_END diff --git a/dom/events/Event.h b/dom/events/Event.h index 1a267e409cd1..cfcf8a639387 100755 --- a/dom/events/Event.h +++ b/dom/events/Event.h @@ -46,10 +46,17 @@ class XULCommandEvent; #include "mozilla/dom/GeneratedEventList.h" #undef GENERATED_EVENT +// IID for Event +#define NS_EVENT_IID \ + { 0x71139716, 0x4d91, 0x4dee, \ + { 0xba, 0xf9, 0xe3, 0x3b, 0x80, 0xc1, 0x61, 0x61 } } + class Event : public nsIDOMEvent, public nsWrapperCache { public: + NS_DECLARE_STATIC_IID_ACCESSOR(NS_EVENT_IID) + Event(EventTarget* aOwner, nsPresContext* aPresContext, WidgetEvent* aEvent); @@ -393,6 +400,8 @@ private: bool mOriginalWantsPopupControlCheck; }; +NS_DEFINE_STATIC_IID_ACCESSOR(Event, NS_EVENT_IID) + } // namespace dom } // namespace mozilla