diff --git a/content/base/src/FragmentOrElement.cpp b/content/base/src/FragmentOrElement.cpp index 0dac4e4a2e82..e3627d51a7ef 100644 --- a/content/base/src/FragmentOrElement.cpp +++ b/content/base/src/FragmentOrElement.cpp @@ -814,7 +814,7 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor) // all the events are allowed even in the native anonymous content.. nsCOMPtr t = do_QueryInterface(aVisitor.mEvent->originalTarget); NS_ASSERTION(!t || !t->ChromeOnlyAccess() || - aVisitor.mEvent->mClass != NS_MUTATION_EVENT || + aVisitor.mEvent->mClass != eMutationEventClass || aVisitor.mDOMEvent, "Mutation event dispatched in native anonymous content!?!"); #endif diff --git a/content/html/content/src/HTMLInputElement.cpp b/content/html/content/src/HTMLInputElement.cpp index ce45fcfc4dac..08922e04d98c 100644 --- a/content/html/content/src/HTMLInputElement.cpp +++ b/content/html/content/src/HTMLInputElement.cpp @@ -3251,7 +3251,7 @@ HTMLInputElement::NeedToInitializeEditorForEvent( // handled without the editor being initialized. These events include: // mousein/move/out, overflow/underflow, and DOM mutation events. if (!IsSingleLineTextControl(false) || - aVisitor.mEvent->mClass == NS_MUTATION_EVENT) { + aVisitor.mEvent->mClass == eMutationEventClass) { return false; } diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index f212c608beda..6f8ee130cc1c 100644 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -174,7 +174,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Event) case eClipboardEventClass: tmp->mEvent->AsClipboardEvent()->clipboardData = nullptr; break; - case NS_MUTATION_EVENT: + case eMutationEventClass: tmp->mEvent->AsMutationEvent()->mRelatedNode = nullptr; break; case eFocusEventClass: @@ -216,7 +216,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Event) NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->clipboardData"); cb.NoteXPCOMChild(tmp->mEvent->AsClipboardEvent()->clipboardData); break; - case NS_MUTATION_EVENT: + case eMutationEventClass: NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->mRelatedNode"); cb.NoteXPCOMChild(tmp->mEvent->AsMutationEvent()->mRelatedNode); break; diff --git a/dom/events/EventDispatcher.cpp b/dom/events/EventDispatcher.cpp index af59ce752c4b..753991467a11 100644 --- a/dom/events/EventDispatcher.cpp +++ b/dom/events/EventDispatcher.cpp @@ -685,7 +685,7 @@ EventDispatcher::CreateEvent(EventTarget* aOwner, if (aEvent) { switch(aEvent->mClass) { - case NS_MUTATION_EVENT: + case eMutationEventClass: return NS_NewDOMMutationEvent(aDOMEvent, aOwner, aPresContext, aEvent->AsMutationEvent()); case eGUIEventClass: diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index 39ef04628518..2e00e3501ac5 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -577,31 +577,31 @@ NON_IDL_EVENT(MozMouseHittest, NON_IDL_EVENT(DOMAttrModified, NS_MUTATION_ATTRMODIFIED, EventNameType_HTMLXUL, - NS_MUTATION_EVENT) + eMutationEventClass) NON_IDL_EVENT(DOMCharacterDataModified, NS_MUTATION_CHARACTERDATAMODIFIED, EventNameType_HTMLXUL, - NS_MUTATION_EVENT) + eMutationEventClass) NON_IDL_EVENT(DOMNodeInserted, NS_MUTATION_NODEINSERTED, EventNameType_HTMLXUL, - NS_MUTATION_EVENT) + eMutationEventClass) NON_IDL_EVENT(DOMNodeRemoved, NS_MUTATION_NODEREMOVED, EventNameType_HTMLXUL, - NS_MUTATION_EVENT) + eMutationEventClass) NON_IDL_EVENT(DOMNodeInsertedIntoDocument, NS_MUTATION_NODEINSERTEDINTODOCUMENT, EventNameType_HTMLXUL, - NS_MUTATION_EVENT) + eMutationEventClass) NON_IDL_EVENT(DOMNodeRemovedFromDocument, NS_MUTATION_NODEREMOVEDFROMDOCUMENT, EventNameType_HTMLXUL, - NS_MUTATION_EVENT) + eMutationEventClass) NON_IDL_EVENT(DOMSubtreeModified, NS_MUTATION_SUBTREEMODIFIED, EventNameType_HTMLXUL, - NS_MUTATION_EVENT) + eMutationEventClass) NON_IDL_EVENT(DOMActivate, NS_UI_ACTIVATE, diff --git a/dom/events/InternalMutationEvent.h b/dom/events/InternalMutationEvent.h index 58f0b2815eb6..f78368e6ad64 100644 --- a/dom/events/InternalMutationEvent.h +++ b/dom/events/InternalMutationEvent.h @@ -18,16 +18,16 @@ class InternalMutationEvent : public WidgetEvent public: virtual InternalMutationEvent* AsMutationEvent() MOZ_OVERRIDE { return this; } - InternalMutationEvent(bool aIsTrusted, uint32_t aMessage) : - WidgetEvent(aIsTrusted, aMessage, NS_MUTATION_EVENT), - mAttrChange(0) + InternalMutationEvent(bool aIsTrusted, uint32_t aMessage) + : WidgetEvent(aIsTrusted, aMessage, eMutationEventClass) + , mAttrChange(0) { mFlags.mCancelable = false; } virtual WidgetEvent* Duplicate() const MOZ_OVERRIDE { - MOZ_ASSERT(mClass == NS_MUTATION_EVENT, + MOZ_ASSERT(mClass == eMutationEventClass, "Duplicate() must be overridden by sub class"); InternalMutationEvent* result = new InternalMutationEvent(false, message); result->AssignMutationEventData(*this, true); diff --git a/widget/BasicEvents.h b/widget/BasicEvents.h index 5d0ef4675ab5..2ece97dffc34 100644 --- a/widget/BasicEvents.h +++ b/widget/BasicEvents.h @@ -68,7 +68,7 @@ enum EventClassID MOZ_ENUM_TYPE(EventClassIDType) ePluginEventClass, // WidgetPluginEvent // InternalMutationEvent.h (dom/events) - NS_MUTATION_EVENT // InternalMutationEvent + eMutationEventClass // InternalMutationEvent }; } // namespace mozilla