Bug 1455052 part 11. Remove nsIDOMEvent::InternalDOMEvent. r=masayuki
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 20 Apr 2018 12:55:31 -0400
changeset 414726 9c8bb777529631a14072b9a17345f5a58db65bdf
parent 414725 7d824df868b789d6c8bfe8376ba34b45af6d2110
child 414727 b52ecaafe0df2f53a61c8179c49fb5742a2933a4
push id102409
push userbzbarsky@mozilla.com
push dateFri, 20 Apr 2018 16:56:05 +0000
treeherdermozilla-inbound@27df0b6428b6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1455052
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1455052 part 11. Remove nsIDOMEvent::InternalDOMEvent. r=masayuki MozReview-Commit-ID: 2ytv7CjkPGz
dom/base/nsContentUtils.cpp
dom/events/Event.cpp
dom/events/KeyboardEvent.cpp
dom/events/PointerEventHandler.cpp
dom/interfaces/events/nsIDOMEvent.idl
dom/xul/nsXULElement.cpp
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -6534,18 +6534,17 @@ nsContentUtils::DispatchXULCommand(nsICo
   nsPresContext* presContext = doc->GetPresContext();
 
   RefPtr<XULCommandEvent> xulCommand = new XULCommandEvent(doc, presContext,
                                                            nullptr);
   xulCommand->InitCommandEvent(NS_LITERAL_STRING("command"), true, true,
                                nsGlobalWindowInner::Cast(doc->GetInnerWindow()),
                                0, aCtrl, aAlt, aShift,
                                aMeta,
-                               aSourceEvent ?
-                                 aSourceEvent->InternalDOMEvent() : nullptr,
+                               aSourceEvent,
                                aInputSource, IgnoreErrors());
 
   if (aShell) {
     nsEventStatus status = nsEventStatus_eIgnore;
     nsCOMPtr<nsIPresShell> kungFuDeathGrip = aShell;
     return aShell->HandleDOMEventWithTarget(aTarget, xulCommand, &status);
   }
 
--- a/dom/events/Event.cpp
+++ b/dom/events/Event.cpp
@@ -562,22 +562,16 @@ Event::IsDispatchStopped()
 }
 
 WidgetEvent*
 Event::WidgetEventPtr()
 {
   return mEvent;
 }
 
-NS_IMETHODIMP_(Event*)
-Event::InternalDOMEvent()
-{
-  return this;
-}
-
 // return true if eventName is contained within events, delimited by
 // spaces
 static bool
 PopupAllowedForEvent(const char *eventName)
 {
   if (!sPopupAllowedEvents) {
     Event::PopupAllowedEventsChanged();
 
--- a/dom/events/KeyboardEvent.cpp
+++ b/dom/events/KeyboardEvent.cpp
@@ -326,17 +326,17 @@ KeyboardEvent::InitKeyboardEvent(const n
   keyEvent->mKeyNameIndex = KEY_NAME_INDEX_USE_STRING;
   keyEvent->mKeyValue = aKey;
 }
 
 already_AddRefed<nsIDocument>
 KeyboardEvent::GetDocument()
 {
   nsCOMPtr<nsIDocument> doc;
-  nsCOMPtr<EventTarget> eventTarget = InternalDOMEvent()->GetTarget();
+  nsCOMPtr<EventTarget> eventTarget = GetTarget();
 
   if (eventTarget) {
     nsCOMPtr<nsPIDOMWindowInner> win =
       do_QueryInterface(eventTarget->GetOwnerGlobal());
 
     if (win) {
       doc = win->GetExtantDoc();
     }
--- a/dom/events/PointerEventHandler.cpp
+++ b/dom/events/PointerEventHandler.cpp
@@ -640,17 +640,17 @@ PointerEventHandler::DispatchGotOrLostPo
     init.mBubbles = true;
     init.mComposed = true;
     ConvertPointerTypeToString(aPointerEvent->inputSource, init.mPointerType);
     init.mIsPrimary = aPointerEvent->mIsPrimary;
     RefPtr<PointerEvent> event;
     event = PointerEvent::Constructor(aCaptureTarget,
                                       NS_LITERAL_STRING("lostpointercapture"),
                                       init);
-    targetDoc->DispatchEvent(*event->InternalDOMEvent());
+    targetDoc->DispatchEvent(*event);
     return;
   }
   nsEventStatus status = nsEventStatus_eIgnore;
   WidgetPointerEvent localEvent(aPointerEvent->IsTrusted(),
                                 aIsGotCapture ? ePointerGotCapture :
                                                 ePointerLostCapture,
                                 aPointerEvent->mWidget);
 
--- a/dom/interfaces/events/nsIDOMEvent.idl
+++ b/dom/interfaces/events/nsIDOMEvent.idl
@@ -61,10 +61,9 @@ interface nsIDOMEvent : nsISupports
    */
   const unsigned short      BUBBLING_PHASE                 = 3;
 
   const long ALT_MASK     = 0x00000001;
   const long CONTROL_MASK = 0x00000002;
   const long SHIFT_MASK   = 0x00000004;
   const long META_MASK    = 0x00000008;
 
-  [notxpcom] DOMEventPtr InternalDOMEvent();
 };
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -1343,17 +1343,17 @@ nsXULElement::GetEventTargetParent(Event
         aVisitor.mEvent->mOriginalTarget == static_cast<nsIContent*>(this) &&
         !IsXULElement(nsGkAtoms::command)) {
         // Check that we really have an xul command event. That will be handled
         // in a special way.
         // See if we have a command elt.  If so, we execute on the command
         // instead of on our content element.
         nsAutoString command;
         if (aVisitor.mDOMEvent &&
-            aVisitor.mDOMEvent->InternalDOMEvent()->AsXULCommandEvent() &&
+            aVisitor.mDOMEvent->AsXULCommandEvent() &&
             GetAttr(kNameSpaceID_None, nsGkAtoms::command, command) &&
             !command.IsEmpty()) {
             // Stop building the event target chain for the original event.
             // We don't want it to propagate to any DOM nodes.
             aVisitor.mCanHandle = false;
             aVisitor.mAutomaticChromeDispatch = false;
             // Dispatch XUL command in PreHandleEvent to prevent it breaks event
             // target chain creation