diff options
Diffstat (limited to 'dom/events/Event.cpp')
-rwxr-xr-x | dom/events/Event.cpp | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index 280e40ad5..aff65b40f 100755 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -11,6 +11,7 @@ #include "mozilla/dom/ShadowRoot.h" #include "mozilla/ContentEvents.h" #include "mozilla/DOMEventTargetHelper.h" +#include "mozilla/EventDispatcher.h" #include "mozilla/EventStateManager.h" #include "mozilla/InternalMutationEvent.h" #include "mozilla/dom/Performance.h" @@ -157,18 +158,11 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Event) tmp->mEvent->mTarget = nullptr; tmp->mEvent->mCurrentTarget = nullptr; tmp->mEvent->mOriginalTarget = nullptr; + tmp->mEvent->mRelatedTarget = nullptr; switch (tmp->mEvent->mClass) { - case eMouseEventClass: - case eMouseScrollEventClass: - case eWheelEventClass: - case eSimpleGestureEventClass: - case ePointerEventClass: - tmp->mEvent->AsMouseEventBase()->relatedTarget = nullptr; - break; case eDragEventClass: { WidgetDragEvent* dragEvent = tmp->mEvent->AsDragEvent(); dragEvent->mDataTransfer = nullptr; - dragEvent->relatedTarget = nullptr; break; } case eClipboardEventClass: @@ -177,9 +171,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Event) case eMutationEventClass: tmp->mEvent->AsMutationEvent()->mRelatedNode = nullptr; break; - case eFocusEventClass: - tmp->mEvent->AsFocusEvent()->mRelatedTarget = nullptr; - break; default: break; } @@ -195,21 +186,12 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Event) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEvent->mTarget) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEvent->mCurrentTarget) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEvent->mOriginalTarget) + NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEvent->mRelatedTarget) switch (tmp->mEvent->mClass) { - case eMouseEventClass: - case eMouseScrollEventClass: - case eWheelEventClass: - case eSimpleGestureEventClass: - case ePointerEventClass: - NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->relatedTarget"); - cb.NoteXPCOMChild(tmp->mEvent->AsMouseEventBase()->relatedTarget); - break; case eDragEventClass: { WidgetDragEvent* dragEvent = tmp->mEvent->AsDragEvent(); NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->mDataTransfer"); cb.NoteXPCOMChild(dragEvent->mDataTransfer); - NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->relatedTarget"); - cb.NoteXPCOMChild(dragEvent->relatedTarget); break; } case eClipboardEventClass: @@ -220,10 +202,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Event) NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->mRelatedNode"); cb.NoteXPCOMChild(tmp->mEvent->AsMutationEvent()->mRelatedNode); break; - case eFocusEventClass: - NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->mRelatedTarget"); - cb.NoteXPCOMChild(tmp->mEvent->AsFocusEvent()->mRelatedTarget); - break; default: break; } @@ -298,6 +276,12 @@ Event::GetCurrentTarget() const return mEvent->GetCurrentDOMEventTarget(); } +void +Event::ComposedPath(nsTArray<RefPtr<EventTarget>>& aPath) +{ + EventDispatcher::GetComposedPathFor(mEvent, aPath); +} + NS_IMETHODIMP Event::GetCurrentTarget(nsIDOMEventTarget** aCurrentTarget) { |