Bug 1455052 part 10. Remove various unused nsIDOMEvent bits. r=masayuki
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 20 Apr 2018 12:55:31 -0400
changeset 414725 7d824df868b789d6c8bfe8376ba34b45af6d2110
parent 414724 43abd16157caaffe8f9166be815c09aef8f4b42e
child 414726 9c8bb777529631a14072b9a17345f5a58db65bdf
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 10. Remove various unused nsIDOMEvent bits. r=masayuki MozReview-Commit-ID: Fzckal7RGUv
dom/base/nsContentUtils.cpp
dom/events/Event.cpp
dom/events/Event.h
dom/events/NotifyPaintEvent.cpp
dom/events/NotifyPaintEvent.h
dom/events/ScrollAreaEvent.cpp
dom/events/ScrollAreaEvent.h
dom/events/UIEvent.cpp
dom/events/UIEvent.h
dom/indexedDB/IndexedDatabaseManager.cpp
dom/indexedDB/ProfilerHelpers.h
dom/interfaces/events/nsIDOMEvent.idl
dom/xhr/XMLHttpRequestWorker.cpp
editor/libeditor/EditorEventListener.cpp
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -4434,18 +4434,17 @@ nsresult GetEventAndTarget(nsIDocument* 
                                           CallerType::System, err);
   if (NS_WARN_IF(err.Failed())) {
     return err.StealNSResult();
   }
 
   event->InitEvent(aEventName, aCanBubble, aCancelable);
   event->SetTrusted(aTrusted);
 
-  nsresult rv = event->SetTarget(target);
-  NS_ENSURE_SUCCESS(rv, rv);
+  event->SetTarget(target);
 
   event.forget(aEvent);
   target.forget(aTargetOut);
   return NS_OK;
 }
 
 // static
 nsresult
--- a/dom/events/Event.cpp
+++ b/dom/events/Event.cpp
@@ -218,26 +218,24 @@ Event::WrapObject(JSContext* aCx, JS::Ha
 }
 
 JSObject*
 Event::WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return EventBinding::Wrap(aCx, this, aGivenProto);
 }
 
-// nsIDOMEventInterface
-NS_IMETHODIMP
-Event::GetType(nsAString& aType)
+void
+Event::GetType(nsAString& aType) const
 {
   if (!mIsMainThreadEvent) {
     aType = mEvent->mSpecifiedEventTypeString;
-    return NS_OK;
+    return;
   }
   GetWidgetEventType(mEvent, aType);
-  return NS_OK;
 }
 
 EventTarget*
 Event::GetTarget() const
 {
   return mEvent->GetDOMEventTarget();
 }
 
@@ -306,17 +304,17 @@ Event::GetComposedTarget() const
     return et;
   }
   nsIContent* nonChrome = content->FindFirstNonChromeOnlyAccessContent();
   return nonChrome ?
     static_cast<EventTarget*>(nonChrome) :
     static_cast<EventTarget*>(content->GetComposedDoc());
 }
 
-NS_IMETHODIMP_(void)
+void
 Event::SetTrusted(bool aTrusted)
 {
   mEvent->mFlags.mIsTrusted = aTrusted;
 }
 
 bool
 Event::Init(mozilla::dom::EventTarget* aGlobal)
 {
@@ -377,79 +375,40 @@ Event::EventPhase() const
     return EventBinding::CAPTURING_PHASE;
   }
   if (mEvent->mFlags.mInBubblingPhase) {
     return EventBinding::BUBBLING_PHASE;
   }
   return EventBinding::NONE;
 }
 
-NS_IMETHODIMP
-Event::GetEventPhase(uint16_t* aEventPhase)
-{
-  *aEventPhase = EventPhase();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-Event::GetBubbles(bool* aBubbles)
-{
-  *aBubbles = Bubbles();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-Event::GetCancelable(bool* aCancelable)
-{
-  *aCancelable = Cancelable();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-Event::GetTimeStamp(uint64_t* aTimeStamp)
-{
-  *aTimeStamp = mEvent->mTime;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
+void
 Event::StopPropagation()
 {
   mEvent->StopPropagation();
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 Event::StopImmediatePropagation()
 {
   mEvent->StopImmediatePropagation();
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 Event::StopCrossProcessForwarding()
 {
   mEvent->StopCrossProcessForwarding();
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-Event::GetIsTrusted(bool* aIsTrusted)
-{
-  *aIsTrusted = IsTrusted();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
+void
 Event::PreventDefault()
 {
   // This method is called only from C++ code which must handle default action
   // of this event.  So, pass true always.
   PreventDefaultInternal(true);
-  return NS_OK;
 }
 
 void
 Event::PreventDefault(JSContext* aCx, CallerType aCallerType)
 {
   // Note that at handling default action, another event may be dispatched.
   // Then, JS in content mey be call preventDefault()
   // even in the event is in system event group.  Therefore, don't refer
@@ -571,46 +530,43 @@ Event::InitEvent(const nsAString& aEvent
   mEvent->mFlags.mImmediatePropagationStopped = false;
 
   // Clearing the old targets, so that the event is targeted correctly when
   // re-dispatching it.
   mEvent->mTarget = nullptr;
   mEvent->mOriginalTarget = nullptr;
 }
 
-NS_IMETHODIMP
+void
 Event::DuplicatePrivateData()
 {
   NS_ASSERTION(mEvent, "No WidgetEvent for Event duplication!");
   if (mEventIsInternal) {
-    return NS_OK;
+    return;
   }
 
   mEvent = mEvent->Duplicate();
   mPresContext = nullptr;
   mEventIsInternal = true;
   mPrivateDataDuplicated = true;
-
-  return NS_OK;
 }
 
-NS_IMETHODIMP
+void
 Event::SetTarget(EventTarget* aTarget)
 {
   mEvent->mTarget = aTarget;
-  return NS_OK;
 }
 
-NS_IMETHODIMP_(bool)
+bool
 Event::IsDispatchStopped()
 {
   return mEvent->PropagationStopped();
 }
 
-NS_IMETHODIMP_(WidgetEvent*)
+WidgetEvent*
 Event::WidgetEventPtr()
 {
   return mEvent;
 }
 
 NS_IMETHODIMP_(Event*)
 Event::InternalDOMEvent()
 {
@@ -1114,28 +1070,17 @@ Event::TimeStamp()
   double ret = workerPrivate->TimeStampToDOMHighRes(mEvent->mTimeStamp);
   if (workerPrivate->UsesSystemPrincipal())
     return ret;
 
   return nsRFPService::ReduceTimePrecisionAsMSecs(ret,
     workerPrivate->GetRandomTimelineSeed());
 }
 
-NS_IMETHODIMP
-Event::GetDefaultPrevented(bool* aReturn)
-{
-  NS_ENSURE_ARG_POINTER(aReturn);
-  // This method must be called by only event handlers implemented by C++.
-  // Then, the handlers must handle default action.  So, this method don't need
-  // to check if preventDefault() has been called by content or chrome.
-  *aReturn = DefaultPrevented();
-  return NS_OK;
-}
-
-NS_IMETHODIMP_(void)
+void
 Event::Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType)
 {
   if (aSerializeInterfaceType) {
     IPC::WriteParam(aMsg, NS_LITERAL_STRING("event"));
   }
 
   nsString type;
   GetType(type);
@@ -1144,17 +1089,17 @@ Event::Serialize(IPC::Message* aMsg, boo
   IPC::WriteParam(aMsg, Bubbles());
   IPC::WriteParam(aMsg, Cancelable());
   IPC::WriteParam(aMsg, IsTrusted());
   IPC::WriteParam(aMsg, Composed());
 
   // No timestamp serialization for now!
 }
 
-NS_IMETHODIMP_(bool)
+bool
 Event::Deserialize(const IPC::Message* aMsg, PickleIterator* aIter)
 {
   nsString type;
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &type), false);
 
   bool bubbles = false;
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &bubbles), false);
 
@@ -1169,17 +1114,17 @@ Event::Deserialize(const IPC::Message* a
 
   InitEvent(type, bubbles, cancelable);
   SetTrusted(trusted);
   SetComposed(composed);
 
   return true;
 }
 
-NS_IMETHODIMP_(void)
+void
 Event::SetOwner(EventTarget* aOwner)
 {
   mOwner = nullptr;
 
   if (!aOwner) {
     return;
   }
 
@@ -1226,33 +1171,16 @@ Event::GetWidgetEventType(WidgetEvent* a
     aType = Substring(nsDependentAtomString(aEvent->mSpecifiedEventType), 2);
     aEvent->mSpecifiedEventTypeString = aType;
     return;
   }
 
   aType.Truncate();
 }
 
-NS_IMETHODIMP
-Event::GetCancelBubble(bool* aCancelBubble)
-{
-  NS_ENSURE_ARG_POINTER(aCancelBubble);
-  *aCancelBubble = CancelBubble();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-Event::SetCancelBubble(bool aCancelBubble)
-{
-  if (aCancelBubble) {
-    mEvent->StopPropagation();
-  }
-  return NS_OK;
-}
-
 } // namespace dom
 } // namespace mozilla
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 already_AddRefed<Event>
 NS_NewDOMEvent(EventTarget* aOwner,
--- a/dom/events/Event.h
+++ b/dom/events/Event.h
@@ -19,16 +19,21 @@
 #include "mozilla/dom/EventBinding.h"
 #include "nsIScriptGlobalObject.h"
 #include "Units.h"
 #include "js/TypeDecls.h"
 #include "nsIGlobalObject.h"
 
 class nsIContent;
 class nsPresContext;
+class PickleIterator;
+
+namespace IPC {
+class Message;
+} // namespace IPC
 
 namespace mozilla {
 namespace dom {
 
 class BeforeUnloadEvent;
 class CustomEvent;
 class DragEvent;
 class EventTarget;
@@ -141,16 +146,29 @@ public:
   virtual CustomEvent* AsCustomEvent()
   {
     return nullptr;
   }
 
   // nsIDOMEvent Interface
   NS_DECL_NSIDOMEVENT
 
+  void InitEvent(const nsAString& aEventTypeArg,
+                 bool aCanBubbleArg,
+                 bool aCancelableArg);
+  void SetTarget(EventTarget* aTarget);
+  virtual void DuplicatePrivateData();
+  bool IsDispatchStopped();
+  WidgetEvent* WidgetEventPtr();
+  virtual void Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType);
+  virtual bool Deserialize(const IPC::Message* aMsg, PickleIterator* aIter);
+  void SetOwner(EventTarget* aOwner);
+  void StopCrossProcessForwarding();
+  void SetTrusted(bool aTrusted);
+
   void InitPresContextData(nsPresContext* aPresContext);
 
   // Returns true if the event should be trusted.
   bool Init(EventTarget* aGlobal);
 
   static PopupControlState GetEventPopupControlState(WidgetEvent* aEvent,
                                                      Event* aDOMEvent = nullptr);
 
@@ -179,32 +197,29 @@ public:
                                              const nsAString& aType,
                                              const EventInit& aParam);
 
   static already_AddRefed<Event> Constructor(const GlobalObject& aGlobal,
                                              const nsAString& aType,
                                              const EventInit& aParam,
                                              ErrorResult& aRv);
 
-  // Implemented as xpidl method
-  // void GetType(nsString& aRetval) {}
+  void GetType(nsAString& aType) const;
 
   EventTarget* GetTarget() const;
   static bool IsSrcElementEnabled(JSContext* /* unused */, JSObject* /* unused */);
   EventTarget* GetCurrentTarget() const;
 
   void ComposedPath(nsTArray<RefPtr<EventTarget>>& aPath);
 
   uint16_t EventPhase() const;
 
-  // xpidl implementation
-  // void StopPropagation();
+  void StopPropagation();
 
-  // xpidl implementation
-  // void StopImmediatePropagation();
+  void StopImmediatePropagation();
 
   bool Bubbles() const
   {
     return mEvent->mFlags.mBubbles;
   }
 
   bool Cancelable() const
   {
@@ -215,19 +230,25 @@ public:
   {
     return mEvent->mFlags.mComposed;
   }
 
   bool CancelBubble() const
   {
     return mEvent->PropagationStopped();
   }
+  void SetCancelBubble(bool aCancelBubble)
+  {
+    if (aCancelBubble)  {
+      mEvent->StopPropagation();
+    }
+  }
 
-  // xpidl implementation
-  // void PreventDefault();
+  // For C++ consumers only!
+  void PreventDefault();
 
   // You MUST NOT call PreventDefault(JSContext*, CallerType) from C++ code.  A
   // call of this method always sets Event.defaultPrevented true for web
   // contents.  If default action handler calls this, web applications see wrong
   // defaultPrevented value.
   virtual void PreventDefault(JSContext* aCx, CallerType aCallerType);
 
   // You MUST NOT call DefaultPrevented(CallerType) from C++ code.  This may
--- a/dom/events/NotifyPaintEvent.cpp
+++ b/dom/events/NotifyPaintEvent.cpp
@@ -84,34 +84,34 @@ NotifyPaintEvent::PaintRequests(SystemCa
     RefPtr<PaintRequest> r = new PaintRequest(parent);
     r->SetRequest(mInvalidateRequests[i]);
     requests->Append(r);
   }
 
   return requests.forget();
 }
 
-NS_IMETHODIMP_(void)
+void
 NotifyPaintEvent::Serialize(IPC::Message* aMsg,
                             bool aSerializeInterfaceType)
 {
   if (aSerializeInterfaceType) {
     IPC::WriteParam(aMsg, NS_LITERAL_STRING("notifypaintevent"));
   }
 
   Event::Serialize(aMsg, false);
 
   uint32_t length = mInvalidateRequests.Length();
   IPC::WriteParam(aMsg, length);
   for (uint32_t i = 0; i < length; ++i) {
     IPC::WriteParam(aMsg, mInvalidateRequests[i]);
   }
 }
 
-NS_IMETHODIMP_(bool)
+bool
 NotifyPaintEvent::Deserialize(const IPC::Message* aMsg, PickleIterator* aIter)
 {
   NS_ENSURE_TRUE(Event::Deserialize(aMsg, aIter), false);
 
   uint32_t length = 0;
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &length), false);
   mInvalidateRequests.SetCapacity(length);
   for (uint32_t i = 0; i < length; ++i) {
--- a/dom/events/NotifyPaintEvent.h
+++ b/dom/events/NotifyPaintEvent.h
@@ -29,18 +29,18 @@ public:
                    WidgetEvent* aEvent,
                    EventMessage aEventMessage,
                    nsTArray<nsRect>* aInvalidateRequests,
                    uint64_t aTransactionId,
                    DOMHighResTimeStamp aTimeStamp);
 
   NS_INLINE_DECL_REFCOUNTING_INHERITED(NotifyPaintEvent, Event)
 
-  NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override;
-  NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) override;
+  void Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override;
+  bool Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) override;
 
   virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
   {
     return NotifyPaintEventBinding::Wrap(aCx, this, aGivenProto);
   }
 
   already_AddRefed<DOMRectList> ClientRects(SystemCallerGuarantee aGuarantee);
 
--- a/dom/events/ScrollAreaEvent.cpp
+++ b/dom/events/ScrollAreaEvent.cpp
@@ -43,33 +43,33 @@ ScrollAreaEvent::InitScrollAreaEvent(con
                                      float aHeight)
 {
   NS_ENSURE_TRUE_VOID(!mEvent->mFlags.mIsBeingDispatched);
 
   UIEvent::InitUIEvent(aEventType, aCanBubble, aCancelable, aView, aDetail);
   mClientArea->SetRect(aX, aY, aWidth, aHeight);
 }
 
-NS_IMETHODIMP_(void)
+void
 ScrollAreaEvent::Serialize(IPC::Message* aMsg,
                            bool aSerializeInterfaceType)
 {
   if (aSerializeInterfaceType) {
     IPC::WriteParam(aMsg, NS_LITERAL_STRING("scrollareaevent"));
   }
 
   Event::Serialize(aMsg, false);
 
   IPC::WriteParam(aMsg, X());
   IPC::WriteParam(aMsg, Y());
   IPC::WriteParam(aMsg, Width());
   IPC::WriteParam(aMsg, Height());
 }
 
-NS_IMETHODIMP_(bool)
+bool
 ScrollAreaEvent::Deserialize(const IPC::Message* aMsg, PickleIterator* aIter)
 {
   NS_ENSURE_TRUE(Event::Deserialize(aMsg, aIter), false);
 
   float x, y, width, height;
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &x), false);
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &y), false);
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &width), false);
--- a/dom/events/ScrollAreaEvent.h
+++ b/dom/events/ScrollAreaEvent.h
@@ -21,18 +21,18 @@ class ScrollAreaEvent : public UIEvent
 public:
   ScrollAreaEvent(EventTarget* aOwner,
                   nsPresContext* aPresContext,
                   InternalScrollAreaEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ScrollAreaEvent, UIEvent)
 
-  NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override;
-  NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) override;
+  void Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override;
+  bool Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) override;
 
   virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
   {
     return ScrollAreaEventBinding::Wrap(aCx, this, aGivenProto);
   }
 
   float X() const
   {
--- a/dom/events/UIEvent.cpp
+++ b/dom/events/UIEvent.cpp
@@ -259,51 +259,50 @@ UIEvent::GetLayerPoint() const
   if (!targetFrame)
     return mLayerPoint;
   nsIFrame* layer = nsLayoutUtils::GetClosestLayer(targetFrame);
   nsPoint pt(nsLayoutUtils::GetEventCoordinatesRelativeTo(mEvent, layer));
   return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(pt.x),
                     nsPresContext::AppUnitsToIntCSSPixels(pt.y));
 }
 
-NS_IMETHODIMP
+void
 UIEvent::DuplicatePrivateData()
 {
   mClientPoint =
     Event::GetClientCoords(mPresContext, mEvent, mEvent->mRefPoint,
                            mClientPoint);
   mMovementPoint = GetMovementPoint();
   mLayerPoint = GetLayerPoint();
   mPagePoint =
     Event::GetPageCoords(mPresContext, mEvent, mEvent->mRefPoint, mClientPoint);
   // GetScreenPoint converts mEvent->mRefPoint to right coordinates.
   CSSIntPoint screenPoint =
     Event::GetScreenCoords(mPresContext, mEvent, mEvent->mRefPoint);
-  nsresult rv = Event::DuplicatePrivateData();
-  if (NS_SUCCEEDED(rv)) {
-    CSSToLayoutDeviceScale scale = mPresContext ? mPresContext->CSSToDevPixelScale()
-                                                : CSSToLayoutDeviceScale(1);
-    mEvent->mRefPoint = RoundedToInt(screenPoint * scale);
-  }
-  return rv;
+
+  Event::DuplicatePrivateData();
+
+  CSSToLayoutDeviceScale scale = mPresContext ? mPresContext->CSSToDevPixelScale()
+                                              : CSSToLayoutDeviceScale(1);
+  mEvent->mRefPoint = RoundedToInt(screenPoint * scale);
 }
 
-NS_IMETHODIMP_(void)
+void
 UIEvent::Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType)
 {
   if (aSerializeInterfaceType) {
     IPC::WriteParam(aMsg, NS_LITERAL_STRING("uievent"));
   }
 
   Event::Serialize(aMsg, false);
 
   IPC::WriteParam(aMsg, Detail());
 }
 
-NS_IMETHODIMP_(bool)
+bool
 UIEvent::Deserialize(const IPC::Message* aMsg, PickleIterator* aIter)
 {
   NS_ENSURE_TRUE(Event::Deserialize(aMsg, aIter), false);
   NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &mDetail), false);
   return true;
 }
 
 // XXX Following struct and array are used only in
--- a/dom/events/UIEvent.h
+++ b/dom/events/UIEvent.h
@@ -24,20 +24,19 @@ class UIEvent : public Event
 public:
   UIEvent(EventTarget* aOwner,
           nsPresContext* aPresContext,
           WidgetGUIEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(UIEvent, Event)
 
-  NS_IMETHOD DuplicatePrivateData() override;
-  NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override;
-  NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) override;
-
+  void DuplicatePrivateData() override;
+  void Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override;
+  bool Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) override;
 
   static already_AddRefed<UIEvent> Constructor(const GlobalObject& aGlobal,
                                                const nsAString& aType,
                                                const UIEventInit& aParam,
                                                ErrorResult& aRv);
 
   virtual JSObject*
     WrapObjectInternal(JSContext* aCx,
--- a/dom/indexedDB/IndexedDatabaseManager.cpp
+++ b/dom/indexedDB/IndexedDatabaseManager.cpp
@@ -516,18 +516,18 @@ IndexedDatabaseManager::CommonPostHandle
   if (aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault) {
     return NS_OK;
   }
 
   if (!aVisitor.mDOMEvent->IsTrusted()) {
     return NS_OK;
   }
 
-  nsString type;
-  MOZ_ALWAYS_SUCCEEDS(aVisitor.mDOMEvent->GetType(type));
+  nsAutoString type;
+  aVisitor.mDOMEvent->GetType(type);
 
   MOZ_ASSERT(nsDependentString(kErrorEventType).EqualsLiteral("error"));
   if (!type.EqualsLiteral("error")) {
     return NS_OK;
   }
 
   nsCOMPtr<EventTarget> eventTarget = aVisitor.mDOMEvent->GetTarget();
   MOZ_ASSERT(eventTarget);
--- a/dom/indexedDB/ProfilerHelpers.h
+++ b/dom/indexedDB/ProfilerHelpers.h
@@ -260,20 +260,20 @@ public:
     }
   }
 
   LoggingString(Event* aEvent, const char16_t* aDefault)
     : nsAutoCString(kQuote)
   {
     MOZ_ASSERT(aDefault);
 
-    nsString eventType;
+    nsAutoString eventType;
 
     if (aEvent) {
-      MOZ_ALWAYS_SUCCEEDS(aEvent->GetType(eventType));
+      aEvent->GetType(eventType);
     } else {
       eventType = nsDependentString(aDefault);
     }
 
     AppendUTF16toUTF8(eventType, *this);
     Append(kQuote);
   }
 };
--- a/dom/interfaces/events/nsIDOMEvent.idl
+++ b/dom/interfaces/events/nsIDOMEvent.idl
@@ -14,20 +14,16 @@
 %{C++
 #ifdef ERROR
 #undef ERROR
 #endif
 
 #include "mozilla/EventForwards.h"
 class nsPresContext;
 class nsInvalidateRequestList;
-namespace IPC {
-class Message;
-}
-class PickleIterator;
 namespace mozilla {
 namespace dom {
 class Event;
 class EventTarget;
 } // namespace dom
 } // namespace mozilla
 %}
 
@@ -60,129 +56,15 @@ interface nsIDOMEvent : nsISupports
    */
   const unsigned short      AT_TARGET                      = 2;
 
   /**
    * The current event phase is the bubbling phase.
    */
   const unsigned short      BUBBLING_PHASE                 = 3;
 
-  /**
-   * The name of the event (case-insensitive). The name must be an XML 
-   * name.
-   */
-  readonly attribute DOMString          type;
-
-  /**
-   * Used to indicate which phase of event flow is currently being 
-   * evaluated.
-   */
-  readonly attribute unsigned short     eventPhase;
-
-  /**
-   * Used to indicate whether or not an event is a bubbling event. If the 
-   * event can bubble the value is true, else the value is false.
-   */
-  readonly attribute boolean            bubbles;
-
-  /**
-   * Used to indicate whether or not an event can have its default action 
-   * prevented. If the default action can be prevented the value is true, 
-   * else the value is false.
-   */
-  readonly attribute boolean            cancelable;
-
-  /**
-   * Used to specify the time (in milliseconds relative to the epoch) at 
-   * which the event was created. Due to the fact that some systems may 
-   * not provide this information the value of timeStamp may be not 
-   * available for all events. When not available, a value of 0 will be 
-   * returned. Examples of epoch time are the time of the system start or 
-   * 0:0:0 UTC 1st January 1970.
-   */
-  readonly attribute DOMTimeStamp       timeStamp;
-
-  /**
-   * The stopPropagation method is used prevent further propagation of an 
-   * event during event flow. If this method is called by any 
-   * EventListener the event will cease propagating through the tree. The 
-   * event will complete dispatch to all listeners on the current 
-   * EventTarget before event flow stops. This method may be used during 
-   * any stage of event flow.
-   */
-  void                      stopPropagation();
-
-  /**
-   * If an event is cancelable, the preventDefault method is used to 
-   * signify that the event is to be canceled, meaning any default action 
-   * normally taken by the implementation as a result of the event will 
-   * not occur. If, during any stage of event flow, the preventDefault 
-   * method is called the event is canceled. Any default action associated 
-   * with the event will not occur. Calling this method for a 
-   * non-cancelable event has no effect. Once preventDefault has been 
-   * called it will remain in effect throughout the remainder of the 
-   * event's propagation. This method may be used during any stage of 
-   * event flow.
-   */
-  void                      preventDefault();
-
-  /**
-   * The initEvent method is used to initialize the value of an Event 
-   * created through the DocumentEvent interface. This method may only be 
-   * called before the Event has been dispatched via the dispatchEvent 
-   * method, though it may be called multiple times during that phase if 
-   * necessary. If called multiple times the final invocation takes 
-   * precedence. If called from a subclass of Event interface only the 
-   * values specified in the initEvent method are modified, all other 
-   * attributes are left unchanged.
-   *
-   * @param   eventTypeArg Specifies the event type. This type may be 
-   *                       any event type currently defined in this 
-   *                       specification or a new event type.. The string 
-   *                       must be an XML name.
-   *                       Any new event type must not begin with any 
-   *                       upper, lower, or mixed case version of the 
-   *                       string "DOM". This prefix is reserved for 
-   *                       future DOM event sets. It is also strongly 
-   *                       recommended that third parties adding their 
-   *                       own events use their own prefix to avoid 
-   *                       confusion and lessen the probability of 
-   *                       conflicts with other new events.
-   * @param   canBubbleArg Specifies whether or not the event can bubble.
-   * @param   cancelableArg Specifies whether or not the event's default 
-   *                        action can be prevented.
-   */
-  [notxpcom,nostdcall]
-  void                      initEvent(in DOMString eventTypeArg,
-                                      in boolean canBubbleArg,
-                                      in boolean cancelableArg);
-
-  /**
-   * Used to indicate whether preventDefault() has been called for this event.
-   */
-  readonly attribute boolean defaultPrevented;
-
-  /**
-   * Prevents other event listeners from being triggered and,
-   * unlike Event.stopPropagation() its effect is immediate.
-   */
-  void                       stopImmediatePropagation();
-
   const long ALT_MASK     = 0x00000001;
   const long CONTROL_MASK = 0x00000002;
   const long SHIFT_MASK   = 0x00000004;
   const long META_MASK    = 0x00000008;
 
-  readonly attribute boolean isTrusted;
-  attribute boolean cancelBubble;
-
-  [noscript] void duplicatePrivateData();
-  [noscript] void setTarget(in EventTarget aTarget);
-  [notxpcom] boolean IsDispatchStopped();
-  [notxpcom] WidgetEvent WidgetEventPtr();
-  [noscript,notxpcom] void SetTrusted(in boolean aTrusted);
-  [notxpcom] void Serialize(in IPCMessagePtr aMsg,
-                            in boolean aSerializeInterfaceType);
-  [notxpcom] boolean Deserialize(in ConstIPCMessagePtr aMsg, in PickleIterator aIter);
-  [noscript,notxpcom] void SetOwner(in EventTargetPtr aOwner);
   [notxpcom] DOMEventPtr InternalDOMEvent();
-  [noscript] void stopCrossProcessForwarding();
 };
--- a/dom/xhr/XMLHttpRequestWorker.cpp
+++ b/dom/xhr/XMLHttpRequestWorker.cpp
@@ -982,21 +982,18 @@ Proxy::HandleEvent(Event* aEvent)
 {
   AssertIsOnMainThread();
 
   if (!mWorkerPrivate || !mXMLHttpRequestPrivate) {
     NS_ERROR("Shouldn't get here!");
     return NS_OK;
   }
 
-  nsString type;
-  if (NS_FAILED(aEvent->GetType(type))) {
-    NS_WARNING("Failed to get event type!");
-    return NS_ERROR_FAILURE;
-  }
+  nsAutoString type;
+  aEvent->GetType(type);
 
   bool isUploadTarget = mXHR != aEvent->GetTarget();
   ProgressEvent* progressEvent = aEvent->AsProgressEvent();
 
   if (mInOpen && type.EqualsASCII(sEventStrings[STRING_readystatechange])) {
     if (mXHR->ReadyState() == 1) {
       mInnerEventStreamId++;
     }
@@ -1082,23 +1079,19 @@ LoadStartDetectionRunnable::Run()
 
 NS_IMETHODIMP
 LoadStartDetectionRunnable::HandleEvent(Event* aEvent)
 {
   AssertIsOnMainThread();
 
 #ifdef DEBUG
   {
-    nsString type;
-    if (NS_SUCCEEDED(aEvent->GetType(type))) {
-      MOZ_ASSERT(type == mEventType);
-    }
-    else {
-      NS_WARNING("Failed to get event type!");
-    }
+    nsAutoString type;
+    aEvent->GetType(type);
+    MOZ_ASSERT(type == mEventType);
   }
 #endif
 
   mReceivedLoadStart = true;
   return NS_OK;
 }
 
 bool
--- a/editor/libeditor/EditorEventListener.cpp
+++ b/editor/libeditor/EditorEventListener.cpp
@@ -906,17 +906,17 @@ EditorEventListener::Drop(DragEvent* aDr
     // was it because we're read-only?
     RefPtr<EditorBase> editorBase(mEditorBase);
     if ((editorBase->IsReadonly() || editorBase->IsDisabled()) &&
         !IsFileControlTextBox()) {
       // it was decided to "eat" the event as this is the "least surprise"
       // since someone else handling it might be unintentional and the
       // user could probably re-drag to be not over the disabled/readonly
       // editfields if that is what is desired.
-      return aDragEvent->StopPropagation();
+      aDragEvent->StopPropagation();
     }
     return NS_OK;
   }
 
   aDragEvent->StopPropagation();
   aDragEvent->PreventDefault();
   RefPtr<EditorBase> editorBase(mEditorBase);
   return editorBase->InsertFromDrop(aDragEvent);