Bug 916879, remove SetterThrows from eventhandlers, r=emk
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Tue, 17 Sep 2013 14:01:28 +0300
changeset 156076 8fa498beb80566677963cbe61297516f544ee6e0
parent 156075 687282e81f183e0b6fd5ec630bc62731bc3d5c45
child 156077 3c697b72bb6f2b1bbb6ce86e08395f098747d06f
push idunknown
push userunknown
push dateunknown
reviewersemk
bugs916879
milestone26.0a1
Bug 916879, remove SetterThrows from eventhandlers, r=emk
content/base/public/nsINode.h
content/base/src/nsINode.cpp
content/events/public/EventTarget.h
content/events/src/EventTarget.cpp
content/events/src/nsDOMEventTargetHelper.cpp
content/events/src/nsDOMEventTargetHelper.h
content/events/src/nsEventListenerManager.cpp
content/events/src/nsEventListenerManager.h
content/html/content/src/HTMLBodyElement.cpp
content/html/content/src/HTMLBodyElement.h
content/html/content/src/HTMLFrameSetElement.cpp
content/html/content/src/HTMLFrameSetElement.h
content/html/content/src/nsGenericHTMLElement.cpp
content/html/content/src/nsGenericHTMLElement.h
dom/base/MessagePort.cpp
dom/base/MessagePort.h
dom/base/nsGlobalWindow.cpp
dom/base/nsGlobalWindow.h
dom/webidl/AudioBufferSourceNode.webidl
dom/webidl/AudioChannelManager.webidl
dom/webidl/BatteryManager.webidl
dom/webidl/BluetoothAdapter.webidl
dom/webidl/BluetoothManager.webidl
dom/webidl/DOMRequest.webidl
dom/webidl/DataChannel.webidl
dom/webidl/DesktopNotification.webidl
dom/webidl/DeviceStorage.webidl
dom/webidl/Document.webidl
dom/webidl/Element.webidl
dom/webidl/EventHandler.webidl
dom/webidl/EventSource.webidl
dom/webidl/FMRadio.webidl
dom/webidl/FileHandle.webidl
dom/webidl/FileReader.webidl
dom/webidl/FileRequest.webidl
dom/webidl/HTMLElement.webidl
dom/webidl/IDBDatabase.webidl
dom/webidl/IDBOpenDBRequest.webidl
dom/webidl/IDBRequest.webidl
dom/webidl/IDBTransaction.webidl
dom/webidl/MediaRecorder.webidl
dom/webidl/MessagePort.webidl
dom/webidl/MozCellBroadcast.webidl
dom/webidl/MozVoicemail.webidl
dom/webidl/Notification.webidl
dom/webidl/OfflineAudioContext.webidl
dom/webidl/OfflineResourceList.webidl
dom/webidl/OscillatorNode.webidl
dom/webidl/SVGElement.webidl
dom/webidl/Screen.webidl
dom/webidl/ScriptProcessorNode.webidl
dom/webidl/SpeechRecognition.webidl
dom/webidl/SpeechSynthesisUtterance.webidl
dom/webidl/Telephony.webidl
dom/webidl/TelephonyCall.webidl
dom/webidl/TelephonyCallGroup.webidl
dom/webidl/TextTrack.webidl
dom/webidl/TextTrackList.webidl
dom/webidl/VTTCue.webidl
dom/webidl/WebSocket.webidl
dom/webidl/XMLHttpRequest.webidl
dom/webidl/XMLHttpRequestEventTarget.webidl
--- a/content/base/public/nsINode.h
+++ b/content/base/public/nsINode.h
@@ -1682,18 +1682,17 @@ public:
      this exact name and signature and then the calling convention
      needs to match.
 
      Note that we include DOCUMENT_ONLY_EVENT events here so that we
      can forward all the document stuff to this implementation.
   */
 #define EVENT(name_, id_, type_, struct_)                             \
   mozilla::dom::EventHandlerNonNull* GetOn##name_();                  \
-  void SetOn##name_(mozilla::dom::EventHandlerNonNull* listener,      \
-                    mozilla::ErrorResult& error);                     \
+  void SetOn##name_(mozilla::dom::EventHandlerNonNull* listener);     \
   NS_IMETHOD GetOn##name_(JSContext *cx, JS::Value *vp);              \
   NS_IMETHOD SetOn##name_(JSContext *cx, const JS::Value &v);
 #define TOUCH_EVENT EVENT
 #define DOCUMENT_ONLY_EVENT EVENT
 #include "nsEventNameList.h"
 #undef DOCUMENT_ONLY_EVENT
 #undef TOUCH_EVENT
 #undef EVENT
--- a/content/base/src/nsINode.cpp
+++ b/content/base/src/nsINode.cpp
@@ -2183,41 +2183,37 @@ nsINode::SizeOfExcludingThis(MallocSizeO
 }
 
 #define EVENT(name_, id_, type_, struct_)                                    \
   EventHandlerNonNull* nsINode::GetOn##name_() {                             \
     nsEventListenerManager *elm = GetListenerManager(false);                 \
     return elm ? elm->GetEventHandler(nsGkAtoms::on##name_, EmptyString())   \
                : nullptr;                                                    \
   }                                                                          \
-  void nsINode::SetOn##name_(EventHandlerNonNull* handler,                   \
-                             ErrorResult& error) {                           \
+  void nsINode::SetOn##name_(EventHandlerNonNull* handler)                   \
+  {                                                                          \
     nsEventListenerManager *elm = GetListenerManager(true);                  \
     if (elm) {                                                               \
-      error = elm->SetEventHandler(nsGkAtoms::on##name_,                     \
-                                   EmptyString(), handler);                  \
-    } else {                                                                 \
-      error.Throw(NS_ERROR_OUT_OF_MEMORY);                                   \
+      elm->SetEventHandler(nsGkAtoms::on##name_, EmptyString(), handler);    \
     }                                                                        \
   }                                                                          \
   NS_IMETHODIMP nsINode::GetOn##name_(JSContext *cx, JS::Value *vp) {        \
     EventHandlerNonNull* h = GetOn##name_();                                 \
     vp->setObjectOrNull(h ? h->Callable().get() : nullptr);                  \
     return NS_OK;                                                            \
   }                                                                          \
   NS_IMETHODIMP nsINode::SetOn##name_(JSContext *cx, const JS::Value &v) {   \
     nsRefPtr<EventHandlerNonNull> handler;                                   \
     JSObject *callable;                                                      \
     if (v.isObject() &&                                                      \
         JS_ObjectIsCallable(cx, callable = &v.toObject())) {                 \
       handler = new EventHandlerNonNull(callable);                           \
     }                                                                        \
-    ErrorResult rv;                                                          \
-    SetOn##name_(handler, rv);                                               \
-    return rv.ErrorCode();                                                   \
+    SetOn##name_(handler);                                                   \
+    return NS_OK;                                                            \
   }
 #define TOUCH_EVENT EVENT
 #define DOCUMENT_ONLY_EVENT EVENT
 #include "nsEventNameList.h"
 #undef DOCUMENT_ONLY_EVENT
 #undef TOUCH_EVENT
 #undef EVENT
 
--- a/content/events/public/EventTarget.h
+++ b/content/events/public/EventTarget.h
@@ -69,17 +69,17 @@ public:
   // target is associated with.  Will return null if the inner window is not the
   // current inner or if there is no window around at all.
   virtual nsIDOMWindow* GetOwnerGlobal() = 0;
 
 protected:
   EventHandlerNonNull* GetEventHandler(nsIAtom* aType,
                                        const nsAString& aTypeString);
   void SetEventHandler(nsIAtom* aType, const nsAString& aTypeString,
-                       EventHandlerNonNull* aHandler, ErrorResult& rv);
+                       EventHandlerNonNull* aHandler);
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(EventTarget, NS_EVENTTARGET_IID)
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_EventTarget_h_
--- a/content/events/src/EventTarget.cpp
+++ b/content/events/src/EventTarget.cpp
@@ -27,31 +27,33 @@ EventTarget::GetEventHandler(nsIAtom* aT
 {
   nsEventListenerManager* elm = GetListenerManager(false);
   return elm ? elm->GetEventHandler(aType, aTypeString) : nullptr;
 }
 
 void
 EventTarget::SetEventHandler(const nsAString& aType,
                              EventHandlerNonNull* aHandler,
-                             ErrorResult& rv)
+                             ErrorResult& aRv)
 {
+  if (!StringBeginsWith(aType, NS_LITERAL_STRING("on"))) {
+    aRv.Throw(NS_ERROR_INVALID_ARG);
+    return;
+  }
   if (NS_IsMainThread()) {
     nsCOMPtr<nsIAtom> type = do_GetAtom(aType);
-    return SetEventHandler(type, EmptyString(), aHandler, rv);
+    SetEventHandler(type, EmptyString(), aHandler);
+    return;
   }
-  return SetEventHandler(nullptr,
-                         Substring(aType, 2), // Remove "on"
-                         aHandler, rv);
+  SetEventHandler(nullptr,
+                  Substring(aType, 2), // Remove "on"
+                  aHandler);
 }
 
 void
 EventTarget::SetEventHandler(nsIAtom* aType, const nsAString& aTypeString,
-                             EventHandlerNonNull* aHandler,
-                             ErrorResult& rv)
+                             EventHandlerNonNull* aHandler)
 {
-  rv = GetListenerManager(true)->SetEventHandler(aType,
-                                                 aTypeString,
-                                                 aHandler);
+  GetListenerManager(true)->SetEventHandler(aType, aTypeString, aHandler);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/content/events/src/nsDOMEventTargetHelper.cpp
+++ b/content/events/src/nsDOMEventTargetHelper.cpp
@@ -271,19 +271,18 @@ nsDOMEventTargetHelper::SetEventHandler(
                                         const JS::Value& aValue)
 {
   nsRefPtr<EventHandlerNonNull> handler;
   JSObject* callable;
   if (aValue.isObject() &&
       JS_ObjectIsCallable(aCx, callable = &aValue.toObject())) {
     handler = new EventHandlerNonNull(callable);
   }
-  ErrorResult rv;
-  SetEventHandler(aType, EmptyString(), handler, rv);
-  return rv.ErrorCode();
+  SetEventHandler(aType, EmptyString(), handler);
+  return NS_OK;
 }
 
 void
 nsDOMEventTargetHelper::GetEventHandler(nsIAtom* aType,
                                         JSContext* aCx,
                                         JS::Value* aValue)
 {
   EventHandlerNonNull* handler = GetEventHandler(aType, EmptyString());
--- a/content/events/src/nsDOMEventTargetHelper.h
+++ b/content/events/src/nsDOMEventTargetHelper.h
@@ -169,25 +169,22 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsDOMEvent
 #define IMPL_EVENT_HANDLER(_event)                                        \
   inline mozilla::dom::EventHandlerNonNull* GetOn##_event()               \
   {                                                                       \
     if (NS_IsMainThread()) {                                              \
       return GetEventHandler(nsGkAtoms::on##_event, EmptyString());       \
     }                                                                     \
     return GetEventHandler(nullptr, NS_LITERAL_STRING(#_event));          \
   }                                                                       \
-  inline void SetOn##_event(mozilla::dom::EventHandlerNonNull* aCallback, \
-                            mozilla::ErrorResult& aRv)                    \
+  inline void SetOn##_event(mozilla::dom::EventHandlerNonNull* aCallback) \
   {                                                                       \
     if (NS_IsMainThread()) {                                              \
-      SetEventHandler(nsGkAtoms::on##_event, EmptyString(),               \
-                      aCallback, aRv);                                    \
+      SetEventHandler(nsGkAtoms::on##_event, EmptyString(), aCallback);   \
     } else {                                                              \
-      SetEventHandler(nullptr, NS_LITERAL_STRING(#_event),                \
-                      aCallback, aRv);                                    \
+      SetEventHandler(nullptr, NS_LITERAL_STRING(#_event), aCallback);    \
     }                                                                     \
   }
 
 /* Use this macro to declare functions that forward the behavior of this
  * interface to another object.
  * This macro doesn't forward PreHandleEvent because sometimes subclasses
  * want to override it.
  */
--- a/content/events/src/nsEventListenerManager.cpp
+++ b/content/events/src/nsEventListenerManager.cpp
@@ -568,76 +568,67 @@ nsEventListenerManager::FindEventHandler
     if (ls->mListenerIsHandler &&
         EVENT_TYPE_EQUALS(ls, aEventType, aTypeAtom, aTypeString, false)) {
       return ls;
     }
   }
   return nullptr;
 }
 
-nsresult
+nsListenerStruct*
 nsEventListenerManager::SetEventHandlerInternal(nsIScriptContext *aContext,
                                                 JS::Handle<JSObject*> aScopeObject,
                                                 nsIAtom* aName,
                                                 const nsAString& aTypeString,
                                                 const nsEventHandler& aHandler,
-                                                bool aPermitUntrustedEvents,
-                                                nsListenerStruct **aListenerStruct)
+                                                bool aPermitUntrustedEvents)
 {
-  NS_ASSERTION((aContext && aScopeObject) || aHandler.HasEventHandler(),
-               "Must have one or the other!");
+  MOZ_ASSERT((aContext && aScopeObject) || aHandler.HasEventHandler(),
+             "Must have one or the other!");
+  MOZ_ASSERT(aName || !aTypeString.IsEmpty());
 
-  nsresult rv = NS_OK;
   uint32_t eventType = nsContentUtils::GetEventId(aName);
   nsListenerStruct* ls = FindEventHandler(eventType, aName, aTypeString);
 
   if (!ls) {
     // If we didn't find a script listener or no listeners existed
     // create and add a new one.
     EventListenerFlags flags;
     flags.mListenerIsJSListener = true;
 
     nsCOMPtr<nsIJSEventListener> scriptListener;
-    rv = NS_NewJSEventListener(aContext, aScopeObject, mTarget, aName,
-                               aHandler, getter_AddRefs(scriptListener));
+    NS_NewJSEventListener(aContext, aScopeObject, mTarget, aName,
+                          aHandler, getter_AddRefs(scriptListener));
 
-    if (NS_SUCCEEDED(rv)) {
-      EventListenerHolder holder(scriptListener);
-      AddEventListenerInternal(holder, eventType, aName, aTypeString, flags,
-                               true);
+    EventListenerHolder holder(scriptListener);
+    AddEventListenerInternal(holder, eventType, aName, aTypeString, flags,
+                             true);
 
-      ls = FindEventHandler(eventType, aName, aTypeString);
-    }
+    ls = FindEventHandler(eventType, aName, aTypeString);
   } else {
     nsIJSEventListener* scriptListener = ls->GetJSListener();
     MOZ_ASSERT(scriptListener,
                "How can we have an event handler with no nsIJSEventListener?");
 
     bool same = scriptListener->GetHandler() == aHandler;
     // Possibly the same listener, but update still the context and scope.
     scriptListener->SetHandler(aHandler, aContext, aScopeObject);
     if (mTarget && !same) {
       mTarget->EventListenerRemoved(aName);
       mTarget->EventListenerAdded(aName);
     }
   }
 
-  if (NS_SUCCEEDED(rv) && ls) {
-    // Set flag to indicate possible need for compilation later
-    ls->mHandlerIsString = !aHandler.HasEventHandler();
-    if (aPermitUntrustedEvents) {
-      ls->mFlags.mAllowUntrustedEvents = true;
-    }
-
-    *aListenerStruct = ls;
-  } else {
-    *aListenerStruct = nullptr;
+  // Set flag to indicate possible need for compilation later
+  ls->mHandlerIsString = !aHandler.HasEventHandler();
+  if (aPermitUntrustedEvents) {
+    ls->mFlags.mAllowUntrustedEvents = true;
   }
 
-  return rv;
+  return ls;
 }
 
 nsresult
 nsEventListenerManager::SetEventHandler(nsIAtom *aName,
                                         const nsAString& aBody,
                                         uint32_t aLanguage,
                                         bool aDeferCompilation,
                                         bool aPermitUntrustedEvents)
@@ -753,20 +744,20 @@ nsEventListenerManager::SetEventHandler(
 
   nsIScriptContext* context = global->GetScriptContext();
   NS_ENSURE_TRUE(context, NS_ERROR_FAILURE);
 
   JSAutoRequest ar(context->GetNativeContext());
   JS::Rooted<JSObject*> scope(context->GetNativeContext(),
                               global->GetGlobalJSObject());
 
-  nsListenerStruct *ls;
-  rv = SetEventHandlerInternal(context, scope, aName, EmptyString(),
-                               nsEventHandler(), aPermitUntrustedEvents, &ls);
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsListenerStruct* ls = SetEventHandlerInternal(context, scope, aName,
+                                                 EmptyString(),
+                                                 nsEventHandler(),
+                                                 aPermitUntrustedEvents);
 
   if (!aDeferCompilation) {
     return CompileEventHandlerInternal(ls, true, &aBody);
   }
 
   return NS_OK;
 }
 
@@ -1224,70 +1215,64 @@ nsEventListenerManager::HasUnloadListene
     if (ls->mEventType == NS_PAGE_UNLOAD ||
         ls->mEventType == NS_BEFORE_PAGE_UNLOAD) {
       return true;
     }
   }
   return false;
 }
 
-nsresult
+void
 nsEventListenerManager::SetEventHandler(nsIAtom* aEventName,
                                         const nsAString& aTypeString,
                                         EventHandlerNonNull* aHandler)
 {
   if (!aHandler) {
     RemoveEventHandler(aEventName, aTypeString);
-    return NS_OK;
+    return;
   }
 
   // Untrusted events are always permitted for non-chrome script
   // handlers.
-  nsListenerStruct *ignored;
-  return SetEventHandlerInternal(nullptr, JS::NullPtr(), aEventName,
-                                 aTypeString, nsEventHandler(aHandler),
-                                 !mIsMainThreadELM ||
-                                 !nsContentUtils::IsCallerChrome(),
-                                 &ignored);
+  SetEventHandlerInternal(nullptr, JS::NullPtr(), aEventName,
+                          aTypeString, nsEventHandler(aHandler),
+                          !mIsMainThreadELM ||
+                          !nsContentUtils::IsCallerChrome());
 }
 
-nsresult
+void
 nsEventListenerManager::SetEventHandler(OnErrorEventHandlerNonNull* aHandler)
 {
   if (!aHandler) {
     RemoveEventHandler(nsGkAtoms::onerror, EmptyString());
-    return NS_OK;
+    return;
   }
 
   // Untrusted events are always permitted for non-chrome script
   // handlers.
-  nsListenerStruct *ignored;
-  return SetEventHandlerInternal(nullptr, JS::NullPtr(), nsGkAtoms::onerror,
-                                 EmptyString(), nsEventHandler(aHandler),
-                                 !mIsMainThreadELM ||
-                                 !nsContentUtils::IsCallerChrome(),
-                                 &ignored);
+  SetEventHandlerInternal(nullptr, JS::NullPtr(), nsGkAtoms::onerror,
+                          EmptyString(), nsEventHandler(aHandler),
+                          !mIsMainThreadELM ||
+                          !nsContentUtils::IsCallerChrome());
 }
 
-nsresult
+void
 nsEventListenerManager::SetEventHandler(BeforeUnloadEventHandlerNonNull* aHandler)
 {
   if (!aHandler) {
     RemoveEventHandler(nsGkAtoms::onbeforeunload, EmptyString());
-    return NS_OK;
+    return;
   }
 
   // Untrusted events are always permitted for non-chrome script
   // handlers.
-  nsListenerStruct *ignored;
-  return SetEventHandlerInternal(nullptr, JS::NullPtr(), nsGkAtoms::onbeforeunload,
-                                 EmptyString(), nsEventHandler(aHandler),
-                                 !mIsMainThreadELM ||
-                                 !nsContentUtils::IsCallerChrome(),
-                                 &ignored);
+  SetEventHandlerInternal(nullptr, JS::NullPtr(), nsGkAtoms::onbeforeunload,
+                          EmptyString(), nsEventHandler(aHandler),
+                          !mIsMainThreadELM ||
+                          !nsContentUtils::IsCallerChrome());
 }
 
 const nsEventHandler*
 nsEventListenerManager::GetEventHandlerInternal(nsIAtom *aEventName,
                                                 const nsAString& aTypeString)
 {
   uint32_t eventType = nsContentUtils::GetEventId(aEventName);
   nsListenerStruct* ls = FindEventHandler(eventType, aEventName, aTypeString);
--- a/content/events/src/nsEventListenerManager.h
+++ b/content/events/src/nsEventListenerManager.h
@@ -435,38 +435,37 @@ protected:
   /**
    * Set the "inline" event listener for aName to aHandler.  aHandler may be
    * have no actual handler set to indicate that we should lazily get and
    * compile the string for this listener, but in that case aContext and
    * aScopeGlobal must be non-null.  Otherwise, aContext and aScopeGlobal are
    * allowed to be null.  The nsListenerStruct that results, if any, is returned
    * in aListenerStruct.
    */
-  nsresult SetEventHandlerInternal(nsIScriptContext *aContext,
-                                   JS::Handle<JSObject*> aScopeGlobal,
-                                   nsIAtom* aName,
-                                   const nsAString& aTypeString,
-                                   const nsEventHandler& aHandler,
-                                   bool aPermitUntrustedEvents,
-                                   nsListenerStruct **aListenerStruct);
+  nsListenerStruct* SetEventHandlerInternal(nsIScriptContext *aContext,
+                                            JS::Handle<JSObject*> aScopeGlobal,
+                                            nsIAtom* aName,
+                                            const nsAString& aTypeString,
+                                            const nsEventHandler& aHandler,
+                                            bool aPermitUntrustedEvents);
 
   bool IsDeviceType(uint32_t aType);
   void EnableDevice(uint32_t aType);
   void DisableDevice(uint32_t aType);
 
 public:
   /**
    * Set the "inline" event listener for aEventName to aHandler.  If
    * aHandler is null, this will actually remove the event listener
    */
-  nsresult SetEventHandler(nsIAtom* aEventName,
-                           const nsAString& aTypeString,
-                           mozilla::dom::EventHandlerNonNull* aHandler);
-  nsresult SetEventHandler(mozilla::dom::OnErrorEventHandlerNonNull* aHandler);
-  nsresult SetEventHandler(mozilla::dom::BeforeUnloadEventHandlerNonNull* aHandler);
+  void SetEventHandler(nsIAtom* aEventName,
+                       const nsAString& aTypeString,
+                       mozilla::dom::EventHandlerNonNull* aHandler);
+  void SetEventHandler(mozilla::dom::OnErrorEventHandlerNonNull* aHandler);
+  void SetEventHandler(mozilla::dom::BeforeUnloadEventHandlerNonNull* aHandler);
 
   /**
    * Get the value of the "inline" event listener for aEventName.
    * This may cause lazy compilation if the listener is uncompiled.
    *
    * Note: It's the caller's responsibility to make sure to call the right one
    * of these methods.  In particular, "onerror" events use
    * OnErrorEventHandlerNonNull for some event targets and EventHandlerNonNull
--- a/content/html/content/src/HTMLBodyElement.cpp
+++ b/content/html/content/src/HTMLBodyElement.cpp
@@ -497,19 +497,18 @@ HTMLBodyElement::IsEventAttributeName(ns
   HTMLBodyElement::SetOn##name_(JSContext *cx, const JS::Value &v)             \
   {                                                                            \
     nsRefPtr<type_> handler;                                                   \
     JSObject *callable;                                                        \
     if (v.isObject() &&                                                        \
         JS_ObjectIsCallable(cx, callable = &v.toObject())) {                   \
       handler = new type_(callable);                                           \
     }                                                                          \
-    ErrorResult rv;                                                            \
-    forwardto_::SetOn##name_(handler, rv);                                     \
-    return rv.ErrorCode();                                                     \
+    forwardto_::SetOn##name_(handler);                                         \
+    return NS_OK;                                                              \
   }
 #define FORWARDED_EVENT(name_, id_, type_, struct_)                            \
   FORWARDED_EVENT_HELPER(name_, nsGenericHTMLElement, EventHandlerNonNull,     \
                          EventHandlerNonNull*)
 #define ERROR_EVENT(name_, id_, type_, struct_)                                \
   FORWARDED_EVENT_HELPER(name_, nsGenericHTMLElement,                          \
                          EventHandlerNonNull, nsCOMPtr<EventHandlerNonNull>)
 #define WINDOW_EVENT_HELPER(name_, type_)                                      \
@@ -520,26 +519,26 @@ HTMLBodyElement::IsEventAttributeName(ns
     if (win) {                                                                 \
       nsCOMPtr<nsISupports> supports = do_QueryInterface(win);                 \
       nsGlobalWindow* globalWin = nsGlobalWindow::FromSupports(supports);      \
       return globalWin->GetOn##name_();                                        \
     }                                                                          \
     return nullptr;                                                            \
   }                                                                            \
   void                                                                         \
-  HTMLBodyElement::SetOn##name_(type_* handler, ErrorResult& error)            \
+  HTMLBodyElement::SetOn##name_(type_* handler)                                \
   {                                                                            \
     nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow();                         \
     if (!win) {                                                                \
       return;                                                                  \
     }                                                                          \
                                                                                \
     nsCOMPtr<nsISupports> supports = do_QueryInterface(win);                   \
     nsGlobalWindow* globalWin = nsGlobalWindow::FromSupports(supports);        \
-    return globalWin->SetOn##name_(handler, error);                            \
+    return globalWin->SetOn##name_(handler);                                   \
   }                                                                            \
   FORWARDED_EVENT_HELPER(name_, HTMLBodyElement, type_, type_*)
 #define WINDOW_EVENT(name_, id_, type_, struct_)                               \
   WINDOW_EVENT_HELPER(name_, EventHandlerNonNull)
 #define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_)                         \
   WINDOW_EVENT_HELPER(name_, BeforeUnloadEventHandlerNonNull)
 #include "nsEventNameList.h" // IWYU pragma: keep
 #undef BEFOREUNLOAD_EVENT
--- a/content/html/content/src/HTMLBodyElement.h
+++ b/content/html/content/src/HTMLBodyElement.h
@@ -55,17 +55,17 @@ public:
   // Event listener stuff; we need to declare only the ones we need to
   // forward to window that don't come from nsIDOMHTMLBodyElement.
 #define EVENT(name_, id_, type_, struct_) /* nothing; handled by the shim */
 #define FORWARDED_EVENT(name_, id_, type_, struct_)                     \
   NS_IMETHOD GetOn##name_(JSContext *cx, JS::Value *vp);                \
   NS_IMETHOD SetOn##name_(JSContext *cx, const JS::Value &v);
 #define WINDOW_EVENT_HELPER(name_, type_)                               \
   type_* GetOn##name_();                                                \
-  void SetOn##name_(type_* handler, ErrorResult& error);
+  void SetOn##name_(type_* handler);
 #define WINDOW_EVENT(name_, id_, type_, struct_)                        \
   WINDOW_EVENT_HELPER(name_, EventHandlerNonNull)
 #define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_)                  \
   WINDOW_EVENT_HELPER(name_, BeforeUnloadEventHandlerNonNull)
 #include "nsEventNameList.h" // IWYU pragma: keep
 #undef BEFOREUNLOAD_EVENT
 #undef WINDOW_EVENT
 #undef WINDOW_EVENT_HELPER
--- a/content/html/content/src/HTMLFrameSetElement.cpp
+++ b/content/html/content/src/HTMLFrameSetElement.cpp
@@ -356,19 +356,18 @@ HTMLFrameSetElement::IsEventAttributeNam
   HTMLFrameSetElement::SetOn##name_(JSContext *cx, const JS::Value &v)         \
   {                                                                            \
     nsRefPtr<type_> handler;                                                   \
     JSObject *callable;                                                        \
     if (v.isObject() &&                                                        \
         JS_ObjectIsCallable(cx, callable = &v.toObject())) {                   \
       handler = new type_(callable);                                           \
     }                                                                          \
-    ErrorResult rv;                                                            \
-    forwardto_::SetOn##name_(handler, rv);                                     \
-    return rv.ErrorCode();                                                     \
+    forwardto_::SetOn##name_(handler);                                         \
+    return NS_OK;                                                              \
   }
 #define FORWARDED_EVENT(name_, id_, type_, struct_)                            \
   FORWARDED_EVENT_HELPER(name_, nsGenericHTMLElement, EventHandlerNonNull,     \
                          EventHandlerNonNull*)
 #define ERROR_EVENT(name_, id_, type_, struct_)                                \
   FORWARDED_EVENT_HELPER(name_, nsGenericHTMLElement,                          \
                          EventHandlerNonNull, nsCOMPtr<EventHandlerNonNull>)
 #define WINDOW_EVENT_HELPER(name_, type_)                                      \
@@ -379,26 +378,26 @@ HTMLFrameSetElement::IsEventAttributeNam
     if (win) {                                                                 \
       nsCOMPtr<nsISupports> supports = do_QueryInterface(win);                 \
       nsGlobalWindow* globalWin = nsGlobalWindow::FromSupports(supports);      \
       return globalWin->GetOn##name_();                                        \
     }                                                                          \
     return nullptr;                                                            \
   }                                                                            \
   void                                                                         \
-  HTMLFrameSetElement::SetOn##name_(type_* handler, ErrorResult& error)        \
+  HTMLFrameSetElement::SetOn##name_(type_* handler)                            \
   {                                                                            \
     nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow();                         \
     if (!win) {                                                                \
       return;                                                                  \
     }                                                                          \
                                                                                \
     nsCOMPtr<nsISupports> supports = do_QueryInterface(win);                   \
     nsGlobalWindow* globalWin = nsGlobalWindow::FromSupports(supports);        \
-    return globalWin->SetOn##name_(handler, error);                            \
+    return globalWin->SetOn##name_(handler);                                   \
   }                                                                            \
   FORWARDED_EVENT_HELPER(name_, HTMLFrameSetElement, type_, type_*)
 #define WINDOW_EVENT(name_, id_, type_, struct_)                               \
   WINDOW_EVENT_HELPER(name_, EventHandlerNonNull)
 #define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_)                         \
   WINDOW_EVENT_HELPER(name_, BeforeUnloadEventHandlerNonNull)
 #include "nsEventNameList.h" // IWYU pragma: keep
 #undef BEFOREUNLOAD_EVENT
--- a/content/html/content/src/HTMLFrameSetElement.h
+++ b/content/html/content/src/HTMLFrameSetElement.h
@@ -85,17 +85,17 @@ public:
   // Event listener stuff; we need to declare only the ones we need to
   // forward to window that don't come from nsIDOMHTMLFrameSetElement.
 #define EVENT(name_, id_, type_, struct_) /* nothing; handled by the superclass */
 #define FORWARDED_EVENT(name_, id_, type_, struct_)                     \
   NS_IMETHOD GetOn##name_(JSContext *cx, JS::Value *vp);                \
   NS_IMETHOD SetOn##name_(JSContext *cx, const JS::Value &v);
 #define WINDOW_EVENT_HELPER(name_, type_)                               \
   type_* GetOn##name_();                                                \
-  void SetOn##name_(type_* handler, ErrorResult& error);
+  void SetOn##name_(type_* handler);
 #define WINDOW_EVENT(name_, id_, type_, struct_)                        \
   WINDOW_EVENT_HELPER(name_, EventHandlerNonNull)
 #define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_)                  \
   WINDOW_EVENT_HELPER(name_, BeforeUnloadEventHandlerNonNull)
 #include "nsEventNameList.h" // IWYU pragma: keep
 #undef BEFOREUNLOAD_EVENT
 #undef WINDOW_EVENT
 #undef WINDOW_EVENT_HELPER
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -863,31 +863,30 @@ nsGenericHTMLElement::GetOn##name_()    
       return globalWin->GetOn##name_();                                       \
     }                                                                         \
     return nullptr;                                                           \
   }                                                                           \
                                                                               \
   return nsINode::GetOn##name_();                                             \
 }                                                                             \
 void                                                                          \
-nsGenericHTMLElement::SetOn##name_(EventHandlerNonNull* handler,              \
-                                   ErrorResult& error)                        \
+nsGenericHTMLElement::SetOn##name_(EventHandlerNonNull* handler)              \
 {                                                                             \
   if (Tag() == nsGkAtoms::body || Tag() == nsGkAtoms::frameset) {             \
     nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow();                        \
     if (!win) {                                                               \
       return;                                                                 \
     }                                                                         \
                                                                               \
     nsCOMPtr<nsISupports> supports = do_QueryInterface(win);                  \
     nsGlobalWindow* globalWin = nsGlobalWindow::FromSupports(supports);       \
-    return globalWin->SetOn##name_(handler, error);                           \
+    return globalWin->SetOn##name_(handler);                                  \
   }                                                                           \
                                                                               \
-  return nsINode::SetOn##name_(handler, error);                               \
+  return nsINode::SetOn##name_(handler);                                      \
 }
 #define ERROR_EVENT(name_, id_, type_, struct_)                               \
 already_AddRefed<EventHandlerNonNull>                                         \
 nsGenericHTMLElement::GetOn##name_()                                          \
 {                                                                             \
   if (Tag() == nsGkAtoms::body || Tag() == nsGkAtoms::frameset) {             \
     /* XXXbz note to self: add tests for this! */                             \
     nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow();                        \
@@ -903,35 +902,34 @@ nsGenericHTMLElement::GetOn##name_()    
     }                                                                         \
     return nullptr;                                                           \
   }                                                                           \
                                                                               \
   nsRefPtr<EventHandlerNonNull> handler = nsINode::GetOn##name_();            \
   return handler.forget();                                                    \
 }                                                                             \
 void                                                                          \
-nsGenericHTMLElement::SetOn##name_(EventHandlerNonNull* handler,              \
-                                   ErrorResult& error)                        \
+nsGenericHTMLElement::SetOn##name_(EventHandlerNonNull* handler)              \
 {                                                                             \
   if (Tag() == nsGkAtoms::body || Tag() == nsGkAtoms::frameset) {             \
     nsPIDOMWindow* win = OwnerDoc()->GetInnerWindow();                        \
     if (!win) {                                                               \
       return;                                                                 \
     }                                                                         \
                                                                               \
     nsCOMPtr<nsISupports> supports = do_QueryInterface(win);                  \
     nsGlobalWindow* globalWin = nsGlobalWindow::FromSupports(supports);       \
     nsRefPtr<OnErrorEventHandlerNonNull> errorHandler;                        \
     if (handler) {                                                            \
       errorHandler = new OnErrorEventHandlerNonNull(handler);                 \
     }                                                                         \
-    return globalWin->SetOn##name_(errorHandler, error);                      \
+    return globalWin->SetOn##name_(errorHandler);                             \
   }                                                                           \
                                                                               \
-  return nsINode::SetOn##name_(handler, error);                               \
+  return nsINode::SetOn##name_(handler);                                      \
 }
 #include "nsEventNameList.h" // IWYU pragma: keep
 #undef ERROR_EVENT
 #undef FORWARDED_EVENT
 #undef EVENT
 
 nsresult
 nsGenericHTMLElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
--- a/content/html/content/src/nsGenericHTMLElement.h
+++ b/content/html/content/src/nsGenericHTMLElement.h
@@ -234,24 +234,22 @@ public:
 
 #define EVENT(name_, id_, type_, struct_) /* nothing; handled by nsINode */
 // The using nsINode::Get/SetOn* are to avoid warnings about shadowing the XPCOM
 // getter and setter on nsINode.
 #define FORWARDED_EVENT(name_, id_, type_, struct_)                           \
   using nsINode::GetOn##name_;                                                \
   using nsINode::SetOn##name_;                                                \
   mozilla::dom::EventHandlerNonNull* GetOn##name_();                          \
-  void SetOn##name_(mozilla::dom::EventHandlerNonNull* handler,               \
-                    mozilla::ErrorResult& error);
+  void SetOn##name_(mozilla::dom::EventHandlerNonNull* handler);
 #define ERROR_EVENT(name_, id_, type_, struct_)                               \
   using nsINode::GetOn##name_;                                                \
   using nsINode::SetOn##name_;                                                \
   already_AddRefed<mozilla::dom::EventHandlerNonNull> GetOn##name_();         \
-  void SetOn##name_(mozilla::dom::EventHandlerNonNull* handler,               \
-                    mozilla::ErrorResult& error);
+  void SetOn##name_(mozilla::dom::EventHandlerNonNull* handler);
 #include "nsEventNameList.h" // IWYU pragma: keep
 #undef ERROR_EVENT
 #undef FORWARDED_EVENT
 #undef EVENT
   void GetClassName(nsString& aClassName)
   {
     GetAttr(kNameSpaceID_None, nsGkAtoms::_class, aClassName);
   }
--- a/dom/base/MessagePort.cpp
+++ b/dom/base/MessagePort.cpp
@@ -427,22 +427,22 @@ MessagePort::GetOnmessage()
 {
   if (NS_IsMainThread()) {
     return GetEventHandler(nsGkAtoms::onmessage, EmptyString());
   }
   return GetEventHandler(nullptr, NS_LITERAL_STRING("message"));
 }
 
 void
-MessagePort::SetOnmessage(EventHandlerNonNull* aCallback, ErrorResult& aRv)
+MessagePort::SetOnmessage(EventHandlerNonNull* aCallback)
 {
   if (NS_IsMainThread()) {
-    SetEventHandler(nsGkAtoms::onmessage, EmptyString(), aCallback, aRv);
+    SetEventHandler(nsGkAtoms::onmessage, EmptyString(), aCallback);
   } else {
-    SetEventHandler(nullptr, NS_LITERAL_STRING("message"), aCallback, aRv);
+    SetEventHandler(nullptr, NS_LITERAL_STRING("message"), aCallback);
   }
 
   // When using onmessage, the call to start() is implied.
   Start();
 }
 
 void
 MessagePort::Entangle(MessagePort* aMessagePort)
--- a/dom/base/MessagePort.h
+++ b/dom/base/MessagePort.h
@@ -47,17 +47,17 @@ public:
   Close();
 
   // The 'message' event handler has to call |Start()| method, so we
   // cannot use IMPL_EVENT_HANDLER macro here.
   EventHandlerNonNull*
   GetOnmessage();
 
   void
-  SetOnmessage(EventHandlerNonNull* aCallback, ErrorResult& aRv);
+  SetOnmessage(EventHandlerNonNull* aCallback);
 
   // Non WebIDL methods
 
   // This method entangles this MessagePort with another one.
   // If it is already entangled, it's disentangled first and enatangle to the
   // new one.
   void
   Entangle(MessagePort* aMessagePort);
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -12051,19 +12051,18 @@ nsGlobalWindow::DisableNetworkEvent(uint
   NS_IMETHODIMP nsGlobalWindow::SetOn##name_(JSContext *cx,                  \
                                              const JS::Value &v) {           \
     nsRefPtr<EventHandlerNonNull> handler;                                   \
     JSObject *callable;                                                      \
     if (v.isObject() &&                                                      \
         JS_ObjectIsCallable(cx, callable = &v.toObject())) {                 \
       handler = new EventHandlerNonNull(callable);                           \
     }                                                                        \
-    ErrorResult rv;                                                          \
-    SetOn##name_(handler, rv);                                               \
-    return rv.ErrorCode();                                                   \
+    SetOn##name_(handler);                                                   \
+    return NS_OK;                                                            \
   }
 #define ERROR_EVENT(name_, id_, type_, struct_)                              \
   NS_IMETHODIMP nsGlobalWindow::GetOn##name_(JSContext *cx,                  \
                                              JS::Value *vp) {                \
     nsEventListenerManager *elm = GetListenerManager(false);                 \
     if (elm) {                                                               \
       OnErrorEventHandlerNonNull* h = elm->GetOnErrorEventHandler();         \
       if (h) {                                                               \
@@ -12082,17 +12081,18 @@ nsGlobalWindow::DisableNetworkEvent(uint
     }                                                                        \
                                                                              \
     nsRefPtr<OnErrorEventHandlerNonNull> handler;                            \
     JSObject *callable;                                                      \
     if (v.isObject() &&                                                      \
         JS_ObjectIsCallable(cx, callable = &v.toObject())) {                 \
       handler = new OnErrorEventHandlerNonNull(callable);                    \
     }                                                                        \
-    return elm->SetEventHandler(handler);                                    \
+    elm->SetEventHandler(handler);                                           \
+    return NS_OK;                                                            \
   }
 #define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_)                       \
   NS_IMETHODIMP nsGlobalWindow::GetOn##name_(JSContext *cx,                  \
                                              JS::Value *vp) {                \
     nsEventListenerManager *elm = GetListenerManager(false);                 \
     if (elm) {                                                               \
       BeforeUnloadEventHandlerNonNull* h =                                   \
         elm->GetOnBeforeUnloadEventHandler();                                \
@@ -12112,17 +12112,18 @@ nsGlobalWindow::DisableNetworkEvent(uint
     }                                                                        \
                                                                              \
     nsRefPtr<BeforeUnloadEventHandlerNonNull> handler;                       \
     JSObject *callable;                                                      \
     if (v.isObject() &&                                                      \
         JS_ObjectIsCallable(cx, callable = &v.toObject())) {                 \
       handler = new BeforeUnloadEventHandlerNonNull(callable);               \
     }                                                                        \
-    return elm->SetEventHandler(handler);                                    \
+    elm->SetEventHandler(handler);                                           \
+    return NS_OK;                                                            \
   }
 #define WINDOW_ONLY_EVENT EVENT
 #define TOUCH_EVENT EVENT
 #include "nsEventNameList.h"
 #undef TOUCH_EVENT
 #undef WINDOW_ONLY_EVENT
 #undef BEFOREUNLOAD_EVENT
 #undef ERROR_EVENT
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -702,57 +702,47 @@ public:
 
 #define EVENT(name_, id_, type_, struct_)                                     \
   mozilla::dom::EventHandlerNonNull* GetOn##name_()                           \
   {                                                                           \
     nsEventListenerManager *elm = GetListenerManager(false);                  \
     return elm ? elm->GetEventHandler(nsGkAtoms::on##name_, EmptyString())    \
                : nullptr;                                                     \
   }                                                                           \
-  void SetOn##name_(mozilla::dom::EventHandlerNonNull* handler,               \
-                    mozilla::ErrorResult& error)                              \
+  void SetOn##name_(mozilla::dom::EventHandlerNonNull* handler)               \
   {                                                                           \
     nsEventListenerManager *elm = GetListenerManager(true);                   \
     if (elm) {                                                                \
-      error = elm->SetEventHandler(nsGkAtoms::on##name_, EmptyString(),       \
-                                   handler);                                  \
-    } else {                                                                  \
-      error.Throw(NS_ERROR_OUT_OF_MEMORY);                                    \
+      elm->SetEventHandler(nsGkAtoms::on##name_, EmptyString(), handler);     \
     }                                                                         \
   }
 #define ERROR_EVENT(name_, id_, type_, struct_)                               \
   mozilla::dom::OnErrorEventHandlerNonNull* GetOn##name_()                    \
   {                                                                           \
     nsEventListenerManager *elm = GetListenerManager(false);                  \
     return elm ? elm->GetOnErrorEventHandler() : nullptr;                     \
   }                                                                           \
-  void SetOn##name_(mozilla::dom::OnErrorEventHandlerNonNull* handler,        \
-                    mozilla::ErrorResult& error)                              \
+  void SetOn##name_(mozilla::dom::OnErrorEventHandlerNonNull* handler)        \
   {                                                                           \
     nsEventListenerManager *elm = GetListenerManager(true);                   \
     if (elm) {                                                                \
-      error = elm->SetEventHandler(handler);                                  \
-    } else {                                                                  \
-      error.Throw(NS_ERROR_OUT_OF_MEMORY);                                    \
+      elm->SetEventHandler(handler);                                          \
     }                                                                         \
   }
 #define BEFOREUNLOAD_EVENT(name_, id_, type_, struct_)                        \
   mozilla::dom::BeforeUnloadEventHandlerNonNull* GetOn##name_()               \
   {                                                                           \
     nsEventListenerManager *elm = GetListenerManager(false);                  \
     return elm ? elm->GetOnBeforeUnloadEventHandler() : nullptr;              \
   }                                                                           \
-  void SetOn##name_(mozilla::dom::BeforeUnloadEventHandlerNonNull* handler,   \
-                    mozilla::ErrorResult& error)                              \
+  void SetOn##name_(mozilla::dom::BeforeUnloadEventHandlerNonNull* handler)   \
   {                                                                           \
     nsEventListenerManager *elm = GetListenerManager(true);                   \
     if (elm) {                                                                \
-      error = elm->SetEventHandler(handler);                                  \
-    } else {                                                                  \
-      error.Throw(NS_ERROR_OUT_OF_MEMORY);                                    \
+      elm->SetEventHandler(handler);                                          \
     }                                                                         \
   }
 #define WINDOW_ONLY_EVENT EVENT
 #define TOUCH_EVENT EVENT
 #include "nsEventNameList.h"
 #undef TOUCH_EVENT
 #undef WINDOW_ONLY_EVENT
 #undef BEFOREUNLOAD_EVENT
--- a/dom/webidl/AudioBufferSourceNode.webidl
+++ b/dom/webidl/AudioBufferSourceNode.webidl
@@ -22,17 +22,16 @@ interface AudioBufferSourceNode : AudioN
     attribute double loopEnd;
 
     [Throws]
     void start(optional double when = 0, optional double grainOffset = 0,
                optional double grainDuration);
     [Throws]
     void stop(optional double when = 0);
 
-    [SetterThrows]
     attribute EventHandler onended;
 };
 
 /*
  * The origin of this IDL file is
  * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
  */
 [PrefControlled]
--- a/dom/webidl/AudioChannelManager.webidl
+++ b/dom/webidl/AudioChannelManager.webidl
@@ -17,17 +17,16 @@ interface AudioChannelManager : EventTar
    * system's speakers.  Similarly, when headphones are plugged in, we may
    * switch audio from speakers to headphones.
    *
    * If audio is currently playing in this window or in one of its children, we
    * will fire this event before we switch the audio output from headphones to
    * speakers (or vice versa).  This allows you to, for example, pause your
    * window's audio when the headphones are unplugged.
    */
-  [SetterThrows]
   attribute EventHandler onheadphoneschange;
 
   /**
    * Indicates which audio channel is used to adjust volume when pressing HW
    * volume keys.
    */
   attribute DOMString volumeControlChannel;
 };
--- a/dom/webidl/BatteryManager.webidl
+++ b/dom/webidl/BatteryManager.webidl
@@ -11,17 +11,13 @@
  */
 
 interface BatteryManager : EventTarget {
     readonly attribute boolean             charging;
     readonly attribute unrestricted double chargingTime;
     readonly attribute unrestricted double dischargingTime;
     readonly attribute double              level;
 
-    [SetterThrows]
              attribute EventHandler        onchargingchange;
-    [SetterThrows]
              attribute EventHandler        onchargingtimechange;
-    [SetterThrows]
              attribute EventHandler        ondischargingtimechange;
-    [SetterThrows]
              attribute EventHandler        onlevelchange;
 };
--- a/dom/webidl/BluetoothAdapter.webidl
+++ b/dom/webidl/BluetoothAdapter.webidl
@@ -43,37 +43,31 @@ interface BluetoothAdapter : EventTarget
   // array of type BluetoothDevice[]
   [GetterThrows]
   readonly attribute any            devices;
 
   // array of type DOMString[]
   [GetterThrows]
   readonly attribute any            uuids;
 
-  [SetterThrows]
            attribute EventHandler   ondevicefound;
 
   // Fired when pairing process is completed
-  [SetterThrows]
            attribute EventHandler   onpairedstatuschanged;
 
   // Fired when a2dp connection status changed
-  [SetterThrows]
            attribute EventHandler   ona2dpstatuschanged;
 
   // Fired when handsfree connection status changed
-  [SetterThrows]
            attribute EventHandler   onhfpstatuschanged;
 
   // Fired when sco connection status changed
-  [SetterThrows]
            attribute EventHandler   onscostatuschanged;
 
   // Fired when remote devices query current media play status
-  [SetterThrows]
            attribute EventHandler   onrequestmediaplaystatus;
 
   [Creator, Throws]
   DOMRequest setName(DOMString name);
   [Creator, Throws]
   DOMRequest setDiscoverable(boolean discoverable);
   [Creator, Throws]
   DOMRequest setDiscoverableTimeout(unsigned long timeout);
--- a/dom/webidl/BluetoothManager.webidl
+++ b/dom/webidl/BluetoothManager.webidl
@@ -2,20 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 interface BluetoothManager : EventTarget {
   [Throws]
   readonly attribute boolean      enabled;
 
-  [SetterThrows]
            attribute EventHandler onenabled;
-  [SetterThrows]
            attribute EventHandler ondisabled;
-  [SetterThrows]
            attribute EventHandler onadapteradded;
 
   [Throws]
   boolean     isConnected(unsigned short aProfile);
   [Creator, Throws]
   DOMRequest? getDefaultAdapter();
 };
--- a/dom/webidl/DOMRequest.webidl
+++ b/dom/webidl/DOMRequest.webidl
@@ -9,13 +9,11 @@ interface nsISupports;
 enum DOMRequestReadyState { "pending", "done" };
 
 interface DOMRequest : EventTarget {
   readonly attribute DOMRequestReadyState readyState;
 
   readonly attribute any result;
   readonly attribute nsISupports? error;
 
-  [SetterThrows]
   attribute EventHandler onsuccess;
-  [SetterThrows]
   attribute EventHandler onerror;
 };
--- a/dom/webidl/DataChannel.webidl
+++ b/dom/webidl/DataChannel.webidl
@@ -16,24 +16,20 @@ enum RTCDataChannelType {
 
 // XXX This interface is called RTCDataChannel in the spec.
 interface DataChannel : EventTarget
 {
   readonly attribute DOMString label;
   readonly attribute boolean reliable;
   readonly attribute RTCDataChannelState readyState;
   readonly attribute unsigned long bufferedAmount;
-  [SetterThrows]
   attribute EventHandler onopen;
-  [SetterThrows]
   attribute EventHandler onerror;
-  [SetterThrows]
   attribute EventHandler onclose;
   void close();
-  [SetterThrows]
   attribute EventHandler onmessage;
   attribute RTCDataChannelType binaryType;
   [Throws]
   void send(DOMString data);
   [Throws]
   void send(Blob data);
   [Throws]
   void send(ArrayBuffer data);
--- a/dom/webidl/DesktopNotification.webidl
+++ b/dom/webidl/DesktopNotification.webidl
@@ -15,14 +15,12 @@ interface DesktopNotificationCenter
                                          optional DOMString iconURL = "");
 };
 
 interface DesktopNotification : EventTarget
 {
   [Throws]
   void show();
 
-  [SetterThrows]
   attribute EventHandler onclick;
 
-  [SetterThrows]
   attribute EventHandler onclose;
 };
--- a/dom/webidl/DeviceStorage.webidl
+++ b/dom/webidl/DeviceStorage.webidl
@@ -3,17 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 dictionary DeviceStorageEnumerationParameters {
   Date since;
 };
 
 interface DeviceStorage : EventTarget {
-  [SetterThrows]
   attribute EventHandler onchange;
 
   [Throws]
   DOMRequest? add(Blob? aBlob);
   [Throws]
   DOMRequest? addNamed(Blob? aBlob, DOMString aName);
 
   [Throws]
--- a/dom/webidl/Document.webidl
+++ b/dom/webidl/Document.webidl
@@ -131,27 +131,27 @@ partial interface Document {
   //(HTML only)boolean queryCommandEnabled(DOMString commandId);
   //(HTML only)boolean queryCommandIndeterm(DOMString commandId);
   //(HTML only)boolean queryCommandState(DOMString commandId);
   //(HTML only)boolean queryCommandSupported(DOMString commandId);
   //(HTML only)DOMString queryCommandValue(DOMString commandId);
   //(Not implemented)readonly attribute HTMLCollection commands;
 
   // special event handler IDL attributes that only apply to Document objects
-  [LenientThis, SetterThrows] attribute EventHandler onreadystatechange;
+  [LenientThis] attribute EventHandler onreadystatechange;
 
   // Gecko extensions?
-  [LenientThis, SetterThrows] attribute EventHandler onmouseenter;
-  [LenientThis, SetterThrows] attribute EventHandler onmouseleave;
-  [SetterThrows] attribute EventHandler onwheel;
-  [SetterThrows] attribute EventHandler oncopy;
-  [SetterThrows] attribute EventHandler oncut;
-  [SetterThrows] attribute EventHandler onpaste;
-  [SetterThrows] attribute EventHandler onbeforescriptexecute;
-  [SetterThrows] attribute EventHandler onafterscriptexecute;
+  [LenientThis] attribute EventHandler onmouseenter;
+  [LenientThis] attribute EventHandler onmouseleave;
+                attribute EventHandler onwheel;
+                attribute EventHandler oncopy;
+                attribute EventHandler oncut;
+                attribute EventHandler onpaste;
+                attribute EventHandler onbeforescriptexecute;
+                attribute EventHandler onafterscriptexecute;
   /**
    * True if this document is synthetic : stand alone image, video, audio file,
    * etc.
    */
   [ChromeOnly] readonly attribute boolean mozSyntheticDocument;
   /**
    * Returns the script element whose script is currently being processed.
    *
--- a/dom/webidl/Element.webidl
+++ b/dom/webidl/Element.webidl
@@ -66,21 +66,20 @@ interface Element : Node {
    *       font size inflation data for the element's _primary frame_, not the
    *       element itself, but for most purposes, this should be sufficient.
    */
   [ChromeOnly]
   readonly attribute float fontSizeInflation;
 
   // Mozilla specific stuff
 
-  [SetterThrows,LenientThis]
+  [LenientThis]
            attribute EventHandler onmouseenter;
-  [SetterThrows,LenientThis]
+  [LenientThis]
            attribute EventHandler onmouseleave;
-  [SetterThrows]
            attribute EventHandler onwheel;
 
   // Selectors API
   /**
    * Returns whether this element would be selected by the given selector
    * string.
    *
    * See <http://dev.w3.org/2006/webapi/selectors-api2/#matchesselector>
--- a/dom/webidl/EventHandler.webidl
+++ b/dom/webidl/EventHandler.webidl
@@ -19,175 +19,108 @@ callback BeforeUnloadEventHandlerNonNull
 typedef BeforeUnloadEventHandlerNonNull? BeforeUnloadEventHandler;
 
 [TreatNonCallableAsNull]
 callback OnErrorEventHandlerNonNull = boolean ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long column);
 typedef OnErrorEventHandlerNonNull? OnErrorEventHandler;
 
 [NoInterfaceObject]
 interface GlobalEventHandlers {
-           [SetterThrows]
            attribute EventHandler onabort;
            //(Not implemented)[SetterThrows]
            //(Not implemented)attribute EventHandler oncancel;
-           [SetterThrows]
            attribute EventHandler oncanplay;
-           [SetterThrows]
            attribute EventHandler oncanplaythrough;
-           [SetterThrows]
            attribute EventHandler onchange;
-           [SetterThrows]
            attribute EventHandler onclick;
            //(Not implemented)[SetterThrows]
            //(Not implemented)attribute EventHandler onclose;
-           [SetterThrows]
            attribute EventHandler oncontextmenu;
            //(Not implemented)[SetterThrows]
            //(Not implemented)attribute EventHandler oncuechange;
-           [SetterThrows]
            attribute EventHandler ondblclick;
-           [SetterThrows]
            attribute EventHandler ondrag;
-           [SetterThrows]
            attribute EventHandler ondragend;
-           [SetterThrows]
            attribute EventHandler ondragenter;
-           [SetterThrows]
            attribute EventHandler ondragleave;
-           [SetterThrows]
            attribute EventHandler ondragover;
-           [SetterThrows]
            attribute EventHandler ondragstart;
-           [SetterThrows]
            attribute EventHandler ondrop;
-           [SetterThrows]
            attribute EventHandler ondurationchange;
-           [SetterThrows]
            attribute EventHandler onemptied;
-           [SetterThrows]
            attribute EventHandler onended;
-           [SetterThrows]
            attribute EventHandler oninput;
-           [SetterThrows]
            attribute EventHandler oninvalid;
-           [SetterThrows]
            attribute EventHandler onkeydown;
-           [SetterThrows]
            attribute EventHandler onkeypress;
-           [SetterThrows]
            attribute EventHandler onkeyup;
-           [SetterThrows]
            attribute EventHandler onloadeddata;
-           [SetterThrows]
            attribute EventHandler onloadedmetadata;
-           [SetterThrows]
            attribute EventHandler onloadstart;
-           [SetterThrows]
            attribute EventHandler onmousedown;
-           [SetterThrows]
            attribute EventHandler onmousemove;
-           [SetterThrows]
            attribute EventHandler onmouseout;
-           [SetterThrows]
            attribute EventHandler onmouseover;
-           [SetterThrows]
            attribute EventHandler onmouseup;
            //(Not implemented)[SetterThrows]
            //(Not implemented)attribute EventHandler onmousewheel;
-           [SetterThrows]
            attribute EventHandler onpause;
-           [SetterThrows]
            attribute EventHandler onplay;
-           [SetterThrows]
            attribute EventHandler onplaying;
-           [SetterThrows]
            attribute EventHandler onprogress;
-           [SetterThrows]
            attribute EventHandler onratechange;
-           [SetterThrows]
            attribute EventHandler onreset;
-           [SetterThrows]
            attribute EventHandler onseeked;
-           [SetterThrows]
            attribute EventHandler onseeking;
-           [SetterThrows]
            attribute EventHandler onselect;
-           [SetterThrows]
            attribute EventHandler onshow;
            //(Not implemented)[SetterThrows]
            //(Not implemented)attribute EventHandler onsort;
-           [SetterThrows]
            attribute EventHandler onstalled;
-           [SetterThrows]
            attribute EventHandler onsubmit;
-           [SetterThrows]
            attribute EventHandler onsuspend;
-           [SetterThrows]
            attribute EventHandler ontimeupdate;
-           [SetterThrows]
            attribute EventHandler onvolumechange;
-           [SetterThrows]
            attribute EventHandler onwaiting;
 
            // Mozilla-specific handlers
-           [SetterThrows]
            attribute EventHandler onmozfullscreenchange;
-           [SetterThrows]
            attribute EventHandler onmozfullscreenerror;
-           [SetterThrows]
            attribute EventHandler onmozpointerlockchange;
-           [SetterThrows]
            attribute EventHandler onmozpointerlockerror;
 };
 
 [NoInterfaceObject]
 interface NodeEventHandlers {
-           [SetterThrows]
            attribute EventHandler onblur;
   // We think the spec is wrong here.
   //         attribute OnErrorEventHandler onerror;
-           [SetterThrows]
            attribute EventHandler onerror;
-           [SetterThrows]
            attribute EventHandler onfocus;
-           [SetterThrows]
            attribute EventHandler onload;
-           [SetterThrows]
            attribute EventHandler onscroll;
 };
 
 [NoInterfaceObject]
 interface WindowEventHandlers {
-           [SetterThrows]
            attribute EventHandler onafterprint;
-           [SetterThrows]
            attribute EventHandler onbeforeprint;
-           [SetterThrows]
            attribute BeforeUnloadEventHandler onbeforeunload;
   //       For now, onerror comes from NodeEventHandlers
   //       When we convert Window to WebIDL this may need to change.
   //       [SetterThrows]
   //       attribute OnErrorEventHandler onerror;
            //(Not implemented)[SetterThrows]
            //(Not implemented)attribute EventHandler onfullscreenchange;
            //(Not implemented)[SetterThrows]
            //(Not implemented)attribute EventHandler onfullscreenerror;
-           [SetterThrows]
            attribute EventHandler onhashchange;
-           [SetterThrows]
            attribute EventHandler onmessage;
-           [SetterThrows]
            attribute EventHandler onoffline;
-           [SetterThrows]
            attribute EventHandler ononline;
-           [SetterThrows]
            attribute EventHandler onpagehide;
-           [SetterThrows]
            attribute EventHandler onpageshow;
-           [SetterThrows]
            attribute EventHandler onpopstate;
-           [SetterThrows]
            attribute EventHandler onresize;
            //(Not implemented)[SetterThrows]
            //(Not implemented)attribute EventHandler onstorage;
-           [SetterThrows]
            attribute EventHandler onunload;
 };
--- a/dom/webidl/EventSource.webidl
+++ b/dom/webidl/EventSource.webidl
@@ -20,20 +20,17 @@ interface EventSource : EventTarget {
 
   // ready state
   const unsigned short CONNECTING = 0;
   const unsigned short OPEN = 1;
   const unsigned short CLOSED = 2;
   readonly attribute unsigned short readyState;
 
   // networking
-  [SetterThrows]
-           attribute EventHandler onopen;
-  [SetterThrows]
-           attribute EventHandler onmessage;
-  [SetterThrows]
-           attribute EventHandler onerror;
+  attribute EventHandler onopen;
+  attribute EventHandler onmessage;
+  attribute EventHandler onerror;
   void close();
 };
 
 dictionary EventSourceInit {
   boolean withCredentials = false;
 };
--- a/dom/webidl/FMRadio.webidl
+++ b/dom/webidl/FMRadio.webidl
@@ -27,32 +27,28 @@ interface FMRadio : EventTarget {
    * MHz. Usually, the value is one of:
    *  - 0.05 MHz
    *  - 0.1  MHz
    *  - 0.2  MHz
    */
   readonly attribute double channelWidth;
 
   /* Fired when the FM radio is enabled. */
-  [SetterThrows]
   attribute EventHandler onenabled;
 
   /* Fired when the FM radio is disabled. */
-  [SetterThrows]
   attribute EventHandler ondisabled;
 
   /**
    * Fired when the antenna becomes available or unavailable, i.e., fired when
    * the antennaAvailable attribute changes.
    */
-  [SetterThrows]
   attribute EventHandler onantennaavailablechange;
 
   /* Fired when the FM radio's frequency is changed. */
-  [SetterThrows]
   attribute EventHandler onfrequencychange;
 
   /**
    * Power the FM radio off. The disabled event will be fired if this request
    * completes successfully.
    */
   DOMRequest disable();
 
--- a/dom/webidl/FileHandle.webidl
+++ b/dom/webidl/FileHandle.webidl
@@ -10,13 +10,11 @@ interface FileHandle : EventTarget {
   readonly attribute DOMString type;
 
   [Throws]
   LockedFile open(optional FileMode mode = "readonly");
 
   [Throws]
   DOMRequest getFile();
 
-  [SetterThrows]
   attribute EventHandler onabort;
-  [SetterThrows]
   attribute EventHandler onerror;
 };
--- a/dom/webidl/FileReader.webidl
+++ b/dom/webidl/FileReader.webidl
@@ -34,27 +34,21 @@ interface FileReader : EventTarget {
   // File or Blob data
   // bug 858217: readonly attribute (DOMString or ArrayBuffer)? result;
   [Throws]
   readonly attribute any result;
 
   readonly attribute DOMError? error;
 
   // event handler attributes
-  [SetterThrows]
   attribute EventHandler onloadstart;
-  [SetterThrows]
   attribute EventHandler onprogress;
-  [SetterThrows]
   attribute EventHandler onload;
-  [SetterThrows]
   attribute EventHandler onabort;
-  [SetterThrows]
   attribute EventHandler onerror;
-  [SetterThrows]
   attribute EventHandler onloadend;
 };
 
 // Mozilla extensions.
 partial interface FileReader {
   [Throws]
   void readAsBinaryString(Blob filedata);
 };
--- a/dom/webidl/FileRequest.webidl
+++ b/dom/webidl/FileRequest.webidl
@@ -4,11 +4,10 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 interface LockedFile;
 
 interface FileRequest : DOMRequest {
   readonly attribute LockedFile? lockedFile;
 
-  [SetterThrows]
   attribute EventHandler onprogress;
 };
--- a/dom/webidl/HTMLElement.webidl
+++ b/dom/webidl/HTMLElement.webidl
@@ -74,47 +74,44 @@ interface HTMLElement : Element {
   // styling
   [PutForwards=cssText, Constant]
   readonly attribute CSSStyleDeclaration style;
 
   // Mozilla specific stuff
   // FIXME Bug 810677 Move className from HTMLElement to Element
            attribute DOMString className;
 
-  [SetterThrows]
            attribute EventHandler oncopy;
-  [SetterThrows]
            attribute EventHandler oncut;
-  [SetterThrows]
            attribute EventHandler onpaste;
 };
 
 // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-htmlelement-interface
 partial interface HTMLElement {
   // CSSOM things are not [Pure] because they can flush
   readonly attribute Element? offsetParent;
   readonly attribute long offsetTop;
   readonly attribute long offsetLeft;
   readonly attribute long offsetWidth;
   readonly attribute long offsetHeight;
 };
 
 [NoInterfaceObject]
 interface TouchEventHandlers {
-  [SetterThrows,Func="nsGenericHTMLElement::TouchEventsEnabled"]
+  [Func="nsGenericHTMLElement::TouchEventsEnabled"]
            attribute EventHandler ontouchstart;
-  [SetterThrows,Func="nsGenericHTMLElement::TouchEventsEnabled"]
+  [Func="nsGenericHTMLElement::TouchEventsEnabled"]
            attribute EventHandler ontouchend;
-  [SetterThrows,Func="nsGenericHTMLElement::TouchEventsEnabled"]
+  [Func="nsGenericHTMLElement::TouchEventsEnabled"]
            attribute EventHandler ontouchmove;
-  [SetterThrows,Func="nsGenericHTMLElement::TouchEventsEnabled"]
+  [Func="nsGenericHTMLElement::TouchEventsEnabled"]
            attribute EventHandler ontouchenter;
-  [SetterThrows,Func="nsGenericHTMLElement::TouchEventsEnabled"]
+  [Func="nsGenericHTMLElement::TouchEventsEnabled"]
            attribute EventHandler ontouchleave;
-  [SetterThrows,Func="nsGenericHTMLElement::TouchEventsEnabled"]
+  [Func="nsGenericHTMLElement::TouchEventsEnabled"]
            attribute EventHandler ontouchcancel;
 };
 
 HTMLElement implements GlobalEventHandlers;
 HTMLElement implements NodeEventHandlers;
 HTMLElement implements TouchEventHandlers;
 
 interface HTMLUnknownElement : HTMLElement {};
--- a/dom/webidl/IDBDatabase.webidl
+++ b/dom/webidl/IDBDatabase.webidl
@@ -30,21 +30,18 @@ interface IDBDatabase : EventTarget {
     [Throws]
     IDBTransaction transaction (DOMString storeName, optional IDBTransactionMode mode = "readonly");
 
     [Throws]
     IDBTransaction transaction (sequence<DOMString> storeNames, optional IDBTransactionMode mode = "readonly");
 
     void           close ();
 
-    [SetterThrows]
                 attribute EventHandler       onabort;
-    [SetterThrows]
                 attribute EventHandler       onerror;
-    [SetterThrows]
                 attribute EventHandler       onversionchange;
 };
 
 partial interface IDBDatabase {
     [Pref="dom.indexedDB.experimental"]
     readonly    attribute StorageType        storage;
 
     [Throws]
--- a/dom/webidl/IDBOpenDBRequest.webidl
+++ b/dom/webidl/IDBOpenDBRequest.webidl
@@ -3,14 +3,12 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * The origin of this IDL file is
  * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBOpenDBRequest
  */
 
 interface IDBOpenDBRequest : IDBRequest {
-    [SetterThrows]
                 attribute EventHandler onblocked;
 
-    [SetterThrows]
                 attribute EventHandler onupgradeneeded;
 };
--- a/dom/webidl/IDBRequest.webidl
+++ b/dom/webidl/IDBRequest.webidl
@@ -19,14 +19,12 @@ interface IDBRequest : EventTarget {
 
     [Throws]
     readonly    attribute DOMError?            error;
 
     readonly    attribute (IDBObjectStore or IDBIndex or IDBCursor)? source;
     readonly    attribute IDBTransaction?      transaction;
     readonly    attribute IDBRequestReadyState readyState;
 
-    [SetterThrows]
                 attribute EventHandler         onsuccess;
 
-    [SetterThrows]
                 attribute EventHandler         onerror;
 };
--- a/dom/webidl/IDBTransaction.webidl
+++ b/dom/webidl/IDBTransaction.webidl
@@ -23,21 +23,18 @@ interface IDBTransaction : EventTarget {
     readonly    attribute DOMError?          error;
 
     [Throws]
     IDBObjectStore objectStore (DOMString name);
 
     [Throws]
     void           abort();
 
-    [SetterThrows]
                 attribute EventHandler       onabort;
-    [SetterThrows]
                 attribute EventHandler       oncomplete;
-    [SetterThrows]
                 attribute EventHandler       onerror;
 };
 
 // This seems to be custom
 partial interface IDBTransaction {
     [Throws]
     readonly    attribute DOMStringList objectStoreNames;
 };
--- a/dom/webidl/MediaRecorder.webidl
+++ b/dom/webidl/MediaRecorder.webidl
@@ -16,26 +16,22 @@ enum RecordingState { "inactive", "recor
 interface MediaRecorder : EventTarget {
 
   readonly attribute MediaStream stream;
 
   readonly attribute RecordingState state;
 
   readonly attribute DOMString mimeType;
 
-  [SetterThrows]
   attribute EventHandler ondataavailable;
 
-  [SetterThrows]
   attribute EventHandler onerror;
 
-  [SetterThrows]
   attribute EventHandler onstop;
 
-  [SetterThrows]
   attribute EventHandler onwarning;
 
   [Throws]
   void start(optional long timeSlice);
 
   [Throws]
   void stop();
 
--- a/dom/webidl/MessagePort.webidl
+++ b/dom/webidl/MessagePort.webidl
@@ -12,12 +12,11 @@ interface MessagePort : EventTarget {
   // TODO void postMessage(any message, optional sequence<Transferable> transfer);
   [Throws]
   void postMessage(any message, optional any transfer);
 
   void start();
   void close();
 
   // event handlers
-  [SetterThrows]
-           attribute EventHandler onmessage;
+  attribute EventHandler onmessage;
 };
 // MessagePort implements Transferable;
--- a/dom/webidl/MozCellBroadcast.webidl
+++ b/dom/webidl/MozCellBroadcast.webidl
@@ -8,11 +8,10 @@
  * unacknowledged general CBS messages to be broadcast to all receivers within
  * a particular region.
  */
 interface MozCellBroadcast : EventTarget
 {
   /**
    * Cell Broadcast messages received.
    */
-  [SetterThrows]
   attribute EventHandler onreceived;
 };
--- a/dom/webidl/MozVoicemail.webidl
+++ b/dom/webidl/MozVoicemail.webidl
@@ -26,11 +26,10 @@ interface MozVoicemail : EventTarget
    * wasn't found
    */
   [GetterThrows]
   readonly attribute DOMString? displayName;
 
   /**
    * The current voicemail status has changed
    */
-  [SetterThrows]
   attribute EventHandler onstatuschanged;
 };
--- a/dom/webidl/Notification.webidl
+++ b/dom/webidl/Notification.webidl
@@ -14,26 +14,22 @@
 [PrefControlled, Constructor(DOMString title, optional NotificationOptions options)]
 interface Notification : EventTarget {
   [GetterThrows]
   static readonly attribute NotificationPermission permission;
 
   [Throws]
   static void requestPermission(optional NotificationPermissionCallback permissionCallback);
 
-  [SetterThrows]
   attribute EventHandler onclick;
 
-  [SetterThrows]
   attribute EventHandler onshow;
 
-  [SetterThrows]
   attribute EventHandler onerror;
 
-  [SetterThrows]
   attribute EventHandler onclose;
 
   [Constant]
   readonly attribute DOMString title;
 
   [Constant]
   readonly attribute NotificationDirection dir;
 
--- a/dom/webidl/OfflineAudioContext.webidl
+++ b/dom/webidl/OfflineAudioContext.webidl
@@ -13,12 +13,11 @@
 callback OfflineRenderSuccessCallback = void (AudioBuffer renderedData);
 
 [Constructor(unsigned long numberOfChannels, unsigned long length, float sampleRate),
  PrefControlled]
 interface OfflineAudioContext : AudioContext {
 
     void startRendering();
 
-    [SetterThrows]
     attribute EventHandler oncomplete;
 
 };
--- a/dom/webidl/OfflineResourceList.webidl
+++ b/dom/webidl/OfflineResourceList.webidl
@@ -37,31 +37,23 @@ interface OfflineResourceList : EventTar
   /**
    * Swap in the newest version of the application cache, or disassociate
    * from the cache if the cache group is obsolete.
    */
   [Throws]
   void swapCache();
 
   /* Events */
-  [SetterThrows]
   attribute EventHandler onchecking;
-  [SetterThrows]
   attribute EventHandler onerror;
-  [SetterThrows]
   attribute EventHandler onnoupdate;
-  [SetterThrows]
   attribute EventHandler ondownloading;
-  [SetterThrows]
   attribute EventHandler onprogress;
-  [SetterThrows]
   attribute EventHandler onupdateready;
-  [SetterThrows]
   attribute EventHandler oncached;
-  [SetterThrows]
   attribute EventHandler onobsolete;
 };
 
 // Mozilla extensions.
 partial interface OfflineResourceList {
   /**
    * Get the list of dynamically-managed entries.
    */
--- a/dom/webidl/OscillatorNode.webidl
+++ b/dom/webidl/OscillatorNode.webidl
@@ -31,17 +31,16 @@ interface OscillatorNode : AudioNode {
     readonly attribute AudioParam detune; // in Cents
 
     [Throws]
     void start(double when);
     [Throws]
     void stop(double when);
     void setPeriodicWave(PeriodicWave periodicWave);
 
-    [SetterThrows]
     attribute EventHandler onended;
 
 };
 
 /*
  * The origin of this IDL file is
  * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
  */
--- a/dom/webidl/SVGElement.webidl
+++ b/dom/webidl/SVGElement.webidl
@@ -26,19 +26,16 @@ interface SVGElement : Element {
   /*[SetterThrows]
   attribute DOMString xmllang;
   [SetterThrows]
   attribute DOMString xmlspace;*/
 
   readonly attribute SVGSVGElement? ownerSVGElement;
   readonly attribute SVGElement? viewportElement;
 
-  [SetterThrows]
            attribute EventHandler oncopy;
-  [SetterThrows]
            attribute EventHandler oncut;
-  [SetterThrows]
            attribute EventHandler onpaste;
 };
 
 SVGElement implements GlobalEventHandlers;
 SVGElement implements NodeEventHandlers;
 SVGElement implements TouchEventHandlers;
--- a/dom/webidl/Screen.webidl
+++ b/dom/webidl/Screen.webidl
@@ -30,17 +30,16 @@ interface Screen : EventTarget {
 
   /**
    * Returns the current screen orientation.
    * Can be: landscape-primary, landscape-secondary,
    *         portrait-primary or portrait-secondary.
    */
   readonly attribute DOMString mozOrientation;
 
-  [SetterThrows]
   attribute EventHandler onmozorientationchange;
 
   /**
    * Lock screen orientation to the specified type.
    */
   [Throws]
   boolean mozLockOrientation(DOMString orientation);
   [Throws]
--- a/dom/webidl/ScriptProcessorNode.webidl
+++ b/dom/webidl/ScriptProcessorNode.webidl
@@ -8,15 +8,14 @@
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 [PrefControlled]
 interface ScriptProcessorNode : AudioNode {
 
-    [SetterThrows]
     attribute EventHandler onaudioprocess;
 
     readonly attribute long bufferSize;
 
 };
 
--- a/dom/webidl/SpeechRecognition.webidl
+++ b/dom/webidl/SpeechRecognition.webidl
@@ -28,31 +28,20 @@ interface SpeechRecognition : EventTarge
 
     // methods to drive the speech interaction
     [Throws]
     void start();
     void stop();
     void abort();
 
     // event methods
-    [SetterThrows]
     attribute EventHandler onaudiostart;
-    [SetterThrows]
     attribute EventHandler onsoundstart;
-    [SetterThrows]
     attribute EventHandler onspeechstart;
-    [SetterThrows]
     attribute EventHandler onspeechend;
-    [SetterThrows]
     attribute EventHandler onsoundend;
-    [SetterThrows]
     attribute EventHandler onaudioend;
-    [SetterThrows]
     attribute EventHandler onresult;
-    [SetterThrows]
     attribute EventHandler onnomatch;
-    [SetterThrows]
     attribute EventHandler onerror;
-    [SetterThrows]
     attribute EventHandler onstart;
-    [SetterThrows]
     attribute EventHandler onend;
 };
--- a/dom/webidl/SpeechSynthesisUtterance.webidl
+++ b/dom/webidl/SpeechSynthesisUtterance.webidl
@@ -16,23 +16,16 @@
 interface SpeechSynthesisUtterance : EventTarget {
   attribute DOMString text;
   attribute DOMString lang;
   attribute SpeechSynthesisVoice? voice;
   attribute float volume;
   attribute float rate;
   attribute float pitch;
 
-  [SetterThrows]
   attribute EventHandler onstart;
-  [SetterThrows]
   attribute EventHandler onend;
-  [SetterThrows]
   attribute EventHandler onerror;
-  [SetterThrows]
   attribute EventHandler onpause;
-  [SetterThrows]
   attribute EventHandler onresume;
-  [SetterThrows]
   attribute EventHandler onmark;
-  [SetterThrows]
   attribute EventHandler onboundary;
 };
--- a/dom/webidl/Telephony.webidl
+++ b/dom/webidl/Telephony.webidl
@@ -22,17 +22,13 @@ interface Telephony : EventTarget {
   readonly attribute CallsList calls;
   readonly attribute TelephonyCallGroup conferenceGroup;
 
   [Throws]
   void startTone(DOMString tone);
   [Throws]
   void stopTone();
 
-  [SetterThrows]
   attribute EventHandler onincoming;
-  [SetterThrows]
   attribute EventHandler oncallschanged;
-  [SetterThrows]
   attribute EventHandler onremoteheld;
-  [SetterThrows]
   attribute EventHandler onremoteresumed;
 };
--- a/dom/webidl/TelephonyCall.webidl
+++ b/dom/webidl/TelephonyCall.webidl
@@ -27,35 +27,23 @@ interface TelephonyCall : EventTarget {
   void answer();
   [Throws]
   void hangUp();
   [Throws]
   void hold();
   [Throws]
   void resume();
 
-  [SetterThrows]
   attribute EventHandler onstatechange;
-  [SetterThrows]
   attribute EventHandler ondialing;
-  [SetterThrows]
   attribute EventHandler onalerting;
-  [SetterThrows]
   attribute EventHandler onconnecting;
-  [SetterThrows]
   attribute EventHandler onconnected;
-  [SetterThrows]
   attribute EventHandler ondisconnecting;
-  [SetterThrows]
   attribute EventHandler ondisconnected;
-  [SetterThrows]
   attribute EventHandler onholding;
-  [SetterThrows]
   attribute EventHandler onheld;
-  [SetterThrows]
   attribute EventHandler onresuming;
-  [SetterThrows]
   attribute EventHandler onerror;
 
   // Fired whenever the group attribute changes.
-  [SetterThrows]
   attribute EventHandler ongroupchange;
 };
--- a/dom/webidl/TelephonyCallGroup.webidl
+++ b/dom/webidl/TelephonyCallGroup.webidl
@@ -20,21 +20,15 @@ interface TelephonyCallGroup : EventTarg
   [Throws]
   void hold();
 
   [Throws]
   void resume();
 
   readonly attribute DOMString state;
 
-  [SetterThrows]
   attribute EventHandler onstatechange;
-  [SetterThrows]
   attribute EventHandler onconnected;
-  [SetterThrows]
   attribute EventHandler onholding;
-  [SetterThrows]
   attribute EventHandler onheld;
-  [SetterThrows]
   attribute EventHandler onresuming;
-  [SetterThrows]
   attribute EventHandler oncallschanged;
 };
--- a/dom/webidl/TextTrack.webidl
+++ b/dom/webidl/TextTrack.webidl
@@ -34,14 +34,13 @@ interface TextTrack : EventTarget {
 
   readonly attribute TextTrackCueList? cues;
   readonly attribute TextTrackCueList? activeCues;
   readonly attribute TextTrackRegionList? regions;
 
   void addCue(VTTCue cue);
   void removeCue(VTTCue cue);
 
-  [SetterThrows]
            attribute EventHandler oncuechange;
   [Throws]
   void removeRegion(TextTrackRegion region);
   void addRegion(TextTrackRegion region);
 };
--- a/dom/webidl/TextTrackList.webidl
+++ b/dom/webidl/TextTrackList.webidl
@@ -8,13 +8,11 @@
  */
 
 [Pref="media.webvtt.enabled"]
 interface TextTrackList : EventTarget {
   readonly attribute unsigned long length;
   getter TextTrack (unsigned long index);
   TextTrack? getTrackById(DOMString id);
 
-           [SetterThrows]
            attribute EventHandler onaddtrack;
-           [SetterThrows]
            attribute EventHandler onremovetrack;
 };
--- a/dom/webidl/VTTCue.webidl
+++ b/dom/webidl/VTTCue.webidl
@@ -36,14 +36,12 @@ interface VTTCue : EventTarget {
   [SetterThrows]
   attribute long position;
   [SetterThrows]
   attribute long size;
   attribute TextTrackCueAlign align;
   attribute DOMString text;
   DocumentFragment getCueAsHTML();
 
-  [SetterThrows]
-    attribute EventHandler onenter;
+  attribute EventHandler onenter;
 
-  [SetterThrows]
-    attribute EventHandler onexit;
+  attribute EventHandler onexit;
 };
--- a/dom/webidl/WebSocket.webidl
+++ b/dom/webidl/WebSocket.webidl
@@ -27,35 +27,31 @@ interface WebSocket : EventTarget {
   const unsigned short CLOSED = 3;
 
   readonly attribute unsigned short readyState;
 
   readonly attribute unsigned long bufferedAmount;
 
   // networking
 
-  [SetterThrows]
   attribute EventHandler onopen;
 
-  [SetterThrows]
   attribute EventHandler onerror;
 
-  [SetterThrows]
   attribute EventHandler onclose;
 
   readonly attribute DOMString extensions;
 
   readonly attribute DOMString protocol;
 
   [Throws]
   void close([Clamp] optional unsigned short code, optional DOMString reason);
 
   // messaging
 
-  [SetterThrows]
   attribute EventHandler onmessage;
 
   attribute BinaryType binaryType;
 
   [Throws]
   void send(DOMString data);
 
   [Throws]
--- a/dom/webidl/XMLHttpRequest.webidl
+++ b/dom/webidl/XMLHttpRequest.webidl
@@ -52,17 +52,17 @@ dictionary MozXMLHttpRequestParameters
 [Constructor(optional MozXMLHttpRequestParameters params),
  // There are apparently callers, specifically CoffeeScript, who do
  // things like this:
  //   c = new(window.ActiveXObject || XMLHttpRequest)("Microsoft.XMLHTTP")
  // To handle that, we need a constructor that takes a string.
  Constructor(DOMString ignored)]
 interface XMLHttpRequest : XMLHttpRequestEventTarget {
   // event handler
-  [SetterThrows, GetterThrows=Workers]
+  [SetterThrows=Workers, GetterThrows=Workers]
   attribute EventHandler onreadystatechange;
 
   // states
   const unsigned short UNSENT = 0;
   const unsigned short OPENED = 1;
   const unsigned short HEADERS_RECEIVED = 2;
   const unsigned short LOADING = 3;
   const unsigned short DONE = 4;
--- a/dom/webidl/XMLHttpRequestEventTarget.webidl
+++ b/dom/webidl/XMLHttpRequestEventTarget.webidl
@@ -8,29 +8,29 @@
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 [NoInterfaceObject]
 interface XMLHttpRequestEventTarget : EventTarget {
   // event handlers
-  [SetterThrows, GetterThrows=Workers]
+  [SetterThrows=Workers, GetterThrows=Workers]
   attribute EventHandler onloadstart;
 
-  [SetterThrows, GetterThrows=Workers]
+  [SetterThrows=Workers, GetterThrows=Workers]
   attribute EventHandler onprogress;
 
-  [SetterThrows, GetterThrows=Workers]
+  [SetterThrows=Workers, GetterThrows=Workers]
   attribute EventHandler onabort;
 
-  [SetterThrows, GetterThrows=Workers]
+  [SetterThrows=Workers, GetterThrows=Workers]
   attribute EventHandler onerror;
 
-  [SetterThrows, GetterThrows=Workers]
+  [SetterThrows=Workers, GetterThrows=Workers]
   attribute EventHandler onload;
 
-  [SetterThrows, GetterThrows=Workers]
+  [SetterThrows=Workers, GetterThrows=Workers]
   attribute EventHandler ontimeout;
 
-  [SetterThrows, GetterThrows=Workers]
+  [SetterThrows=Workers, GetterThrows=Workers]
   attribute EventHandler onloadend;
 };