From 14c30e58d61bd9bb9cdce40709df6e484761bf10 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 11 Sep 2019 14:35:28 +0000 Subject: [PATCH] Bug 1578173 part 4. Switch event subclasses to constructor operations. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D45391 --HG-- extra : moz-landing-system : lando --- dom/bindings/Codegen.py | 3 +- dom/events/AnimationEvent.cpp | 2 +- dom/events/AnimationEvent.h | 2 +- dom/events/CompositionEvent.cpp | 2 +- dom/events/CompositionEvent.h | 2 +- dom/events/CustomEvent.cpp | 2 +- dom/events/CustomEvent.h | 2 +- dom/events/DeviceMotionEvent.cpp | 2 +- dom/events/DeviceMotionEvent.h | 2 +- dom/events/DragEvent.cpp | 7 ++- dom/events/DragEvent.h | 3 +- dom/events/Event.cpp | 3 +- dom/events/Event.h | 3 +- dom/events/FocusEvent.cpp | 2 +- dom/events/FocusEvent.h | 3 +- dom/events/InputEvent.cpp | 2 +- dom/events/InputEvent.h | 3 +- dom/events/KeyboardEvent.cpp | 18 +++----- dom/events/KeyboardEvent.h | 7 ++- dom/events/MessageEvent.cpp | 2 +- dom/events/MessageEvent.h | 2 +- dom/events/MouseEvent.cpp | 2 +- dom/events/MouseEvent.h | 3 +- dom/events/PointerEvent.cpp | 2 +- dom/events/PointerEvent.h | 2 +- dom/events/StorageEvent.cpp | 2 +- dom/events/StorageEvent.h | 2 +- dom/events/TouchEvent.cpp | 2 +- dom/events/TouchEvent.h | 3 +- dom/events/TransitionEvent.cpp | 2 +- dom/events/TransitionEvent.h | 2 +- dom/events/UIEvent.cpp | 3 +- dom/events/UIEvent.h | 3 +- dom/events/WheelEvent.cpp | 2 +- dom/events/WheelEvent.h | 3 +- dom/indexedDB/IDBEvents.cpp | 2 +- dom/indexedDB/IDBEvents.h | 2 +- dom/notification/NotificationEvent.h | 6 +-- dom/payments/PaymentMethodChangeEvent.cpp | 2 +- dom/payments/PaymentMethodChangeEvent.h | 2 +- dom/payments/PaymentRequestUpdateEvent.cpp | 2 +- dom/payments/PaymentRequestUpdateEvent.h | 2 +- dom/serviceworkers/ServiceWorkerEvents.cpp | 8 ++-- dom/serviceworkers/ServiceWorkerEvents.h | 8 ++-- dom/serviceworkers/ServiceWorkerOp.cpp | 21 +++------ dom/serviceworkers/ServiceWorkerPrivate.cpp | 22 +++------- dom/vr/VRDisplayEvent.cpp | 2 +- dom/vr/VRDisplayEvent.h | 2 +- dom/webidl/AddonEvent.webidl | 5 ++- dom/webidl/AnimationEvent.webidl | 3 +- dom/webidl/AnimationPlaybackEvent.webidl | 7 +-- dom/webidl/BlobEvent.webidl | 2 +- dom/webidl/CaretStateChangedEvent.webidl | 6 ++- dom/webidl/ClipboardEvent.webidl | 4 +- dom/webidl/CloseEvent.webidl | 4 +- dom/webidl/CompositionEvent.webidl | 3 +- dom/webidl/CustomEvent.webidl | 5 ++- dom/webidl/DeviceLightEvent.webidl | 4 +- dom/webidl/DeviceMotionEvent.webidl | 5 ++- dom/webidl/DeviceOrientationEvent.webidl | 5 ++- dom/webidl/DeviceProximityEvent.webidl | 5 ++- dom/webidl/DragEvent.webidl | 3 +- dom/webidl/ErrorEvent.webidl | 5 ++- dom/webidl/Event.webidl | 5 ++- dom/webidl/ExtendableEvent.webidl | 5 ++- dom/webidl/ExtendableMessageEvent.webidl | 6 ++- dom/webidl/FetchEvent.webidl | 5 ++- dom/webidl/FocusEvent.webidl | 4 +- dom/webidl/FontFaceSetLoadEvent.webidl | 6 ++- dom/webidl/FormDataEvent.webidl | 3 +- dom/webidl/FrameCrashedEvent.webidl | 5 ++- dom/webidl/GamepadAxisMoveEvent.webidl | 6 ++- dom/webidl/GamepadButtonEvent.webidl | 6 ++- dom/webidl/GamepadEvent.webidl | 5 ++- dom/webidl/HashChangeEvent.webidl | 4 +- dom/webidl/HiddenPluginEvent.webidl | 26 +++++------ dom/webidl/IDBVersionChangeEvent.webidl | 6 ++- dom/webidl/ImageCaptureErrorEvent.webidl | 6 ++- dom/webidl/InputEvent.webidl | 3 +- dom/webidl/KeyboardEvent.webidl | 6 ++- dom/webidl/MIDIConnectionEvent.webidl | 6 ++- dom/webidl/MIDIMessageEvent.webidl | 6 ++- dom/webidl/MediaEncryptedEvent.webidl | 5 ++- dom/webidl/MediaKeyMessageEvent.webidl | 4 +- dom/webidl/MediaQueryListEvent.webidl | 4 +- dom/webidl/MediaRecorderErrorEvent.webidl | 43 ++++++++++--------- dom/webidl/MediaStreamEvent.webidl | 5 ++- dom/webidl/MediaStreamTrackEvent.webidl | 5 ++- dom/webidl/MerchantValidationEvent.webidl | 7 ++- dom/webidl/MessageEvent.webidl | 5 ++- dom/webidl/MouseEvent.webidl | 4 +- dom/webidl/MozApplicationEvent.webidl | 5 ++- dom/webidl/NotificationEvent.webidl | 5 ++- dom/webidl/OfflineAudioCompletionEvent.webidl | 7 +-- dom/webidl/PageTransitionEvent.webidl | 4 +- dom/webidl/PaymentMethodChangeEvent.webidl | 6 ++- dom/webidl/PaymentRequestUpdateEvent.webidl | 7 +-- dom/webidl/PerformanceEntryEvent.webidl | 6 ++- dom/webidl/PluginCrashedEvent.webidl | 5 ++- dom/webidl/PointerEvent.webidl | 5 ++- dom/webidl/PopStateEvent.webidl | 3 +- dom/webidl/PopupBlockedEvent.webidl | 4 +- ...resentationConnectionAvailableEvent.webidl | 7 +-- .../PresentationConnectionCloseEvent.webidl | 7 +-- dom/webidl/ProgressEvent.webidl | 5 ++- dom/webidl/PromiseRejectionEvent.webidl | 5 ++- dom/webidl/PushEvent.webidl | 6 ++- dom/webidl/RTCDTMFToneChangeEvent.webidl | 4 +- dom/webidl/RTCDataChannelEvent.webidl | 7 +-- dom/webidl/RTCPeerConnectionIceEvent.webidl | 7 +-- dom/webidl/RTCTrackEvent.webidl | 5 ++- dom/webidl/ScrollViewChangeEvent.webidl | 6 ++- .../SecurityPolicyViolationEvent.webidl | 4 +- dom/webidl/SpeechRecognitionEvent.webidl | 6 ++- dom/webidl/SpeechSynthesisErrorEvent.webidl | 5 ++- dom/webidl/SpeechSynthesisEvent.webidl | 5 ++- dom/webidl/StorageEvent.webidl | 3 +- dom/webidl/StreamFilterDataEvent.webidl | 6 ++- dom/webidl/StyleRuleChangeEvent.webidl | 5 ++- ...tyleSheetApplicableStateChangeEvent.webidl | 5 ++- dom/webidl/StyleSheetChangeEvent.webidl | 5 ++- dom/webidl/TCPServerSocketEvent.webidl | 6 ++- dom/webidl/TCPSocketErrorEvent.webidl | 6 ++- dom/webidl/TCPSocketEvent.webidl | 5 ++- dom/webidl/TouchEvent.webidl | 5 ++- dom/webidl/TrackEvent.webidl | 3 +- dom/webidl/TransitionEvent.webidl | 3 +- dom/webidl/UDPMessageEvent.webidl | 6 ++- dom/webidl/UIEvent.webidl | 3 +- dom/webidl/UserProximityEvent.webidl | 7 ++- dom/webidl/VRDisplayEvent.webidl | 5 ++- dom/webidl/WebGLContextEvent.webidl | 5 ++- dom/webidl/WheelEvent.webidl | 3 +- dom/workers/WorkerPrivate.cpp | 2 +- .../webrequest/StreamFilterEvents.h | 2 +- 135 files changed, 389 insertions(+), 287 deletions(-) diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 3988ac43d862..77148a0fbd51 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -18348,7 +18348,7 @@ class CGEventMethod(CGNativeMember): self.args.insert(0, Argument("JSContext*", "aCx")) if not self.isInit: self.args.insert(0, Argument("const GlobalObject&", "aGlobal")) - self.args.append(Argument('ErrorResult&', 'aRv')) + return constructorForNativeCaller + CGNativeMember.declare(self, cgClass) def defineInit(self, cgClass): @@ -18470,7 +18470,6 @@ class CGEventMethod(CGNativeMember): if needCx(None, self.arguments(), [], considerTypes=True, static=True): self.args.insert(0, Argument("JSContext*", "aCx")) self.args.insert(0, Argument("const GlobalObject&", "aGlobal")) - self.args.append(Argument('ErrorResult&', 'aRv')) return constructorForNativeCaller + CGNativeMember.define(self, cgClass) diff --git a/dom/events/AnimationEvent.cpp b/dom/events/AnimationEvent.cpp index 3f8aaa7575fe..0efd24e5bcb8 100644 --- a/dom/events/AnimationEvent.cpp +++ b/dom/events/AnimationEvent.cpp @@ -26,7 +26,7 @@ AnimationEvent::AnimationEvent(EventTarget* aOwner, nsPresContext* aPresContext, // static already_AddRefed AnimationEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const AnimationEventInit& aParam, ErrorResult& aRv) { + const AnimationEventInit& aParam) { nsCOMPtr t = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr e = new AnimationEvent(t, nullptr, nullptr); bool trusted = e->Init(t); diff --git a/dom/events/AnimationEvent.h b/dom/events/AnimationEvent.h index 5f30e68dcbd0..8fe21f0dfb62 100644 --- a/dom/events/AnimationEvent.h +++ b/dom/events/AnimationEvent.h @@ -23,7 +23,7 @@ class AnimationEvent : public Event { static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const AnimationEventInit& aParam, ErrorResult& aRv); + const AnimationEventInit& aParam); virtual JSObject* WrapObjectInternal( JSContext* aCx, JS::Handle aGivenProto) override { diff --git a/dom/events/CompositionEvent.cpp b/dom/events/CompositionEvent.cpp index 7836e6253a5a..9cff61fe3dcc 100644 --- a/dom/events/CompositionEvent.cpp +++ b/dom/events/CompositionEvent.cpp @@ -39,7 +39,7 @@ CompositionEvent::CompositionEvent(EventTarget* aOwner, // static already_AddRefed CompositionEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const CompositionEventInit& aParam, ErrorResult& aRv) { + const CompositionEventInit& aParam) { nsCOMPtr t = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr e = new CompositionEvent(t, nullptr, nullptr); bool trusted = e->Init(t); diff --git a/dom/events/CompositionEvent.h b/dom/events/CompositionEvent.h index 76108602434b..6ed223ae4259 100644 --- a/dom/events/CompositionEvent.h +++ b/dom/events/CompositionEvent.h @@ -28,7 +28,7 @@ class CompositionEvent : public UIEvent { static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const CompositionEventInit& aParam, ErrorResult& aRv); + const CompositionEventInit& aParam); virtual JSObject* WrapObjectInternal( JSContext* aCx, JS::Handle aGivenProto) override { diff --git a/dom/events/CustomEvent.cpp b/dom/events/CustomEvent.cpp index 7ac712c5e19d..39b47911ab58 100644 --- a/dom/events/CustomEvent.cpp +++ b/dom/events/CustomEvent.cpp @@ -44,7 +44,7 @@ NS_INTERFACE_MAP_END_INHERITING(Event) already_AddRefed CustomEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const CustomEventInit& aParam, ErrorResult& aRv) { + const CustomEventInit& aParam) { nsCOMPtr t = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr e = new CustomEvent(t, nullptr, nullptr); diff --git a/dom/events/CustomEvent.h b/dom/events/CustomEvent.h index 7cc8ab1a0ecc..f4a40a267147 100644 --- a/dom/events/CustomEvent.h +++ b/dom/events/CustomEvent.h @@ -30,7 +30,7 @@ class CustomEvent final : public Event { static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const CustomEventInit& aParam, ErrorResult& aRv); + const CustomEventInit& aParam); virtual JSObject* WrapObjectInternal( JSContext* aCx, JS::Handle aGivenProto) override; diff --git a/dom/events/DeviceMotionEvent.cpp b/dom/events/DeviceMotionEvent.cpp index c622928e8acd..6d8b39241692 100644 --- a/dom/events/DeviceMotionEvent.cpp +++ b/dom/events/DeviceMotionEvent.cpp @@ -67,7 +67,7 @@ void DeviceMotionEvent::InitDeviceMotionEvent( already_AddRefed DeviceMotionEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const DeviceMotionEventInit& aEventInitDict, ErrorResult& aRv) { + const DeviceMotionEventInit& aEventInitDict) { nsCOMPtr t = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr e = new DeviceMotionEvent(t, nullptr, nullptr); e->InitEvent(aType, aEventInitDict.mBubbles, aEventInitDict.mCancelable); diff --git a/dom/events/DeviceMotionEvent.h b/dom/events/DeviceMotionEvent.h index 1bb40ab22304..96719c125a22 100644 --- a/dom/events/DeviceMotionEvent.h +++ b/dom/events/DeviceMotionEvent.h @@ -110,7 +110,7 @@ class DeviceMotionEvent final : public Event { static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const DeviceMotionEventInit& aEventInitDict, ErrorResult& aRv); + const DeviceMotionEventInit& aEventInitDict); protected: ~DeviceMotionEvent() {} diff --git a/dom/events/DragEvent.cpp b/dom/events/DragEvent.cpp index 112763cad716..83ef8983e17a 100644 --- a/dom/events/DragEvent.cpp +++ b/dom/events/DragEvent.cpp @@ -70,10 +70,9 @@ DataTransfer* DragEvent::GetDataTransfer() { } // static -already_AddRefed DragEvent::Constructor(const GlobalObject& aGlobal, - const nsAString& aType, - const DragEventInit& aParam, - ErrorResult& aRv) { +already_AddRefed DragEvent::Constructor( + const GlobalObject& aGlobal, const nsAString& aType, + const DragEventInit& aParam) { nsCOMPtr t = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr e = new DragEvent(t, nullptr, nullptr); bool trusted = e->Init(t); diff --git a/dom/events/DragEvent.h b/dom/events/DragEvent.h index bce1bc26321b..2945919ace58 100644 --- a/dom/events/DragEvent.h +++ b/dom/events/DragEvent.h @@ -41,8 +41,7 @@ class DragEvent : public MouseEvent { static already_AddRefed Constructor(const GlobalObject& aGlobal, const nsAString& aType, - const DragEventInit& aParam, - ErrorResult& aRv); + const DragEventInit& aParam); protected: ~DragEvent() {} diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index f9e9f10bc8b3..a7d49d5f70e9 100644 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -314,8 +314,7 @@ bool Event::Init(mozilla::dom::EventTarget* aGlobal) { // static already_AddRefed Event::Constructor(const GlobalObject& aGlobal, const nsAString& aType, - const EventInit& aParam, - ErrorResult& aRv) { + const EventInit& aParam) { nsCOMPtr t = do_QueryInterface(aGlobal.GetAsSupports()); return Constructor(t, aType, aParam); diff --git a/dom/events/Event.h b/dom/events/Event.h index b1c6a0054fe1..27b10eaf5562 100644 --- a/dom/events/Event.h +++ b/dom/events/Event.h @@ -166,8 +166,7 @@ class Event : public nsISupports, public nsWrapperCache { static already_AddRefed Constructor(const GlobalObject& aGlobal, const nsAString& aType, - const EventInit& aParam, - ErrorResult& aRv); + const EventInit& aParam); void GetType(nsAString& aType) const; diff --git a/dom/events/FocusEvent.cpp b/dom/events/FocusEvent.cpp index 69cc179d3ac6..ddb16a94cbc7 100644 --- a/dom/events/FocusEvent.cpp +++ b/dom/events/FocusEvent.cpp @@ -39,7 +39,7 @@ void FocusEvent::InitFocusEvent(const nsAString& aType, bool aCanBubble, already_AddRefed FocusEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const FocusEventInit& aParam, ErrorResult& aRv) { + const FocusEventInit& aParam) { nsCOMPtr t = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr e = new FocusEvent(t, nullptr, nullptr); bool trusted = e->Init(t); diff --git a/dom/events/FocusEvent.h b/dom/events/FocusEvent.h index fba102bbc90b..75e56fbafa13 100644 --- a/dom/events/FocusEvent.h +++ b/dom/events/FocusEvent.h @@ -29,8 +29,7 @@ class FocusEvent : public UIEvent { static already_AddRefed Constructor(const GlobalObject& aGlobal, const nsAString& aType, - const FocusEventInit& aParam, - ErrorResult& aRv); + const FocusEventInit& aParam); protected: ~FocusEvent() {} diff --git a/dom/events/InputEvent.cpp b/dom/events/InputEvent.cpp index ad580d686854..0d3423bf0dde 100644 --- a/dom/events/InputEvent.cpp +++ b/dom/events/InputEvent.cpp @@ -79,7 +79,7 @@ bool InputEvent::IsComposing() { already_AddRefed InputEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const InputEventInit& aParam, ErrorResult& aRv) { + const InputEventInit& aParam) { nsCOMPtr t = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr e = new InputEvent(t, nullptr, nullptr); bool trusted = e->Init(t); diff --git a/dom/events/InputEvent.h b/dom/events/InputEvent.h index ae19ef98d6a0..26fb4f5874b6 100644 --- a/dom/events/InputEvent.h +++ b/dom/events/InputEvent.h @@ -25,8 +25,7 @@ class InputEvent : public UIEvent { static already_AddRefed Constructor(const GlobalObject& aGlobal, const nsAString& aType, - const InputEventInit& aParam, - ErrorResult& aRv); + const InputEventInit& aParam); virtual JSObject* WrapObjectInternal( JSContext* aCx, JS::Handle aGivenProto) override { diff --git a/dom/events/KeyboardEvent.cpp b/dom/events/KeyboardEvent.cpp index 721adf808c51..7b078e23b97d 100644 --- a/dom/events/KeyboardEvent.cpp +++ b/dom/events/KeyboardEvent.cpp @@ -273,18 +273,17 @@ uint32_t KeyboardEvent::Location() { // static already_AddRefed KeyboardEvent::ConstructorJS( const GlobalObject& aGlobal, const nsAString& aType, - const KeyboardEventInit& aParam, ErrorResult& aRv) { + const KeyboardEventInit& aParam) { nsCOMPtr target = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr newEvent = new KeyboardEvent(target, nullptr, nullptr); - newEvent->InitWithKeyboardEventInit(target, aType, aParam, aRv); + newEvent->InitWithKeyboardEventInit(target, aType, aParam); return newEvent.forget(); } void KeyboardEvent::InitWithKeyboardEventInit(EventTarget* aOwner, const nsAString& aType, - const KeyboardEventInit& aParam, - ErrorResult& aRv) { + const KeyboardEventInit& aParam) { bool trusted = Init(aOwner); InitKeyEventJS(aType, aParam.mBubbles, aParam.mCancelable, aParam.mView, false, false, false, false, aParam.mKeyCode, aParam.mCharCode); @@ -328,13 +327,10 @@ void KeyboardEvent::InitKeyEventJS(const nsAString& aType, bool aCanBubble, keyEvent->mCharCode = aCharCode; } -void KeyboardEvent::InitKeyboardEventJS(const nsAString& aType, bool aCanBubble, - bool aCancelable, - nsGlobalWindowInner* aView, - const nsAString& aKey, - uint32_t aLocation, bool aCtrlKey, - bool aAltKey, bool aShiftKey, - bool aMetaKey, ErrorResult& aRv) { +void KeyboardEvent::InitKeyboardEventJS( + const nsAString& aType, bool aCanBubble, bool aCancelable, + nsGlobalWindowInner* aView, const nsAString& aKey, uint32_t aLocation, + bool aCtrlKey, bool aAltKey, bool aShiftKey, bool aMetaKey) { NS_ENSURE_TRUE_VOID(!mEvent->mFlags.mIsBeingDispatched); mInitializedByJS = true; mInitializedByCtor = false; diff --git a/dom/events/KeyboardEvent.h b/dom/events/KeyboardEvent.h index f9e0d3aef45c..afc7269eb29e 100644 --- a/dom/events/KeyboardEvent.h +++ b/dom/events/KeyboardEvent.h @@ -26,7 +26,7 @@ class KeyboardEvent : public UIEvent { static already_AddRefed ConstructorJS( const GlobalObject& aGlobal, const nsAString& aType, - const KeyboardEventInit& aParam, ErrorResult& aRv); + const KeyboardEventInit& aParam); virtual JSObject* WrapObjectInternal( JSContext* aCx, JS::Handle aGivenProto) override { @@ -70,14 +70,13 @@ class KeyboardEvent : public UIEvent { bool aCancelable, nsGlobalWindowInner* aView, const nsAString& aKey, uint32_t aLocation, bool aCtrlKey, bool aAltKey, bool aShiftKey, - bool aMetaKey, ErrorResult& aRv); + bool aMetaKey); protected: ~KeyboardEvent() {} void InitWithKeyboardEventInit(EventTarget* aOwner, const nsAString& aType, - const KeyboardEventInit& aParam, - ErrorResult& aRv); + const KeyboardEventInit& aParam); private: // True, if the instance is initialized by JS. diff --git a/dom/events/MessageEvent.cpp b/dom/events/MessageEvent.cpp index 28e8f5d73515..4e8ae41433ce 100644 --- a/dom/events/MessageEvent.cpp +++ b/dom/events/MessageEvent.cpp @@ -86,7 +86,7 @@ void MessageEvent::GetSource( /* static */ already_AddRefed MessageEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const MessageEventInit& aParam, ErrorResult& aRv) { + const MessageEventInit& aParam) { nsCOMPtr t = do_QueryInterface(aGlobal.GetAsSupports()); return Constructor(t, aType, aParam); } diff --git a/dom/events/MessageEvent.h b/dom/events/MessageEvent.h index 0ef12a45c1b9..3bee8e6c2803 100644 --- a/dom/events/MessageEvent.h +++ b/dom/events/MessageEvent.h @@ -50,7 +50,7 @@ class MessageEvent final : public Event { static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const MessageEventInit& aEventInit, ErrorResult& aRv); + const MessageEventInit& aEventInit); static already_AddRefed Constructor( EventTarget* aEventTarget, const nsAString& aType, diff --git a/dom/events/MouseEvent.cpp b/dom/events/MouseEvent.cpp index 50676ca86e39..b84f9fd621cb 100644 --- a/dom/events/MouseEvent.cpp +++ b/dom/events/MouseEvent.cpp @@ -120,7 +120,7 @@ void MouseEvent::InitializeExtraMouseEventDictionaryMembers( already_AddRefed MouseEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const MouseEventInit& aParam, ErrorResult& aRv) { + const MouseEventInit& aParam) { nsCOMPtr t = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr e = new MouseEvent(t, nullptr, nullptr); bool trusted = e->Init(t); diff --git a/dom/events/MouseEvent.h b/dom/events/MouseEvent.h index e47ab2a691ab..7068498f9c92 100644 --- a/dom/events/MouseEvent.h +++ b/dom/events/MouseEvent.h @@ -64,8 +64,7 @@ class MouseEvent : public UIEvent { } static already_AddRefed Constructor(const GlobalObject& aGlobal, const nsAString& aType, - const MouseEventInit& aParam, - ErrorResult& aRv); + const MouseEventInit& aParam); int32_t MovementX() { return GetMovementPoint().x; } int32_t MovementY() { return GetMovementPoint().y; } float MozPressure() const; diff --git a/dom/events/PointerEvent.cpp b/dom/events/PointerEvent.cpp index 9a77a5c3bb94..7e3706c992e4 100644 --- a/dom/events/PointerEvent.cpp +++ b/dom/events/PointerEvent.cpp @@ -112,7 +112,7 @@ already_AddRefed PointerEvent::Constructor( // static already_AddRefed PointerEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const PointerEventInit& aParam, ErrorResult& aRv) { + const PointerEventInit& aParam) { nsCOMPtr owner = do_QueryInterface(aGlobal.GetAsSupports()); return Constructor(owner, aType, aParam); } diff --git a/dom/events/PointerEvent.h b/dom/events/PointerEvent.h index 03fcf22334fd..253890a27044 100644 --- a/dom/events/PointerEvent.h +++ b/dom/events/PointerEvent.h @@ -32,7 +32,7 @@ class PointerEvent : public MouseEvent { static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const PointerEventInit& aParam, ErrorResult& aRv); + const PointerEventInit& aParam); static already_AddRefed Constructor( EventTarget* aOwner, const nsAString& aType, diff --git a/dom/events/StorageEvent.cpp b/dom/events/StorageEvent.cpp index 42a19a19b02e..d3abfd2f1cf0 100644 --- a/dom/events/StorageEvent.cpp +++ b/dom/events/StorageEvent.cpp @@ -60,7 +60,7 @@ already_AddRefed StorageEvent::Constructor( already_AddRefed StorageEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const StorageEventInit& aEventInitDict, ErrorResult& aRv) { + const StorageEventInit& aEventInitDict) { nsCOMPtr owner = do_QueryInterface(aGlobal.GetAsSupports()); return Constructor(owner, aType, aEventInitDict); } diff --git a/dom/events/StorageEvent.h b/dom/events/StorageEvent.h index bab922b9287a..1bc8c5c33faf 100644 --- a/dom/events/StorageEvent.h +++ b/dom/events/StorageEvent.h @@ -49,7 +49,7 @@ class StorageEvent : public Event { static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const StorageEventInit& aEventInitDict, ErrorResult& aRv); + const StorageEventInit& aEventInitDict); void InitStorageEvent(const nsAString& aType, bool aCanBubble, bool aCancelable, const nsAString& aKey, diff --git a/dom/events/TouchEvent.cpp b/dom/events/TouchEvent.cpp index 52db045d73b9..a07f08368dca 100644 --- a/dom/events/TouchEvent.cpp +++ b/dom/events/TouchEvent.cpp @@ -303,7 +303,7 @@ bool TouchEvent::LegacyAPIEnabled(nsIDocShell* aDocShell, // static already_AddRefed TouchEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const TouchEventInit& aParam, ErrorResult& aRv) { + const TouchEventInit& aParam) { nsCOMPtr t = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr e = new TouchEvent(t, nullptr, nullptr); bool trusted = e->Init(t); diff --git a/dom/events/TouchEvent.h b/dom/events/TouchEvent.h index 027b02d69192..31b4622a9fa8 100644 --- a/dom/events/TouchEvent.h +++ b/dom/events/TouchEvent.h @@ -102,8 +102,7 @@ class TouchEvent : public UIEvent { static already_AddRefed Constructor(const GlobalObject& aGlobal, const nsAString& aType, - const TouchEventInit& aParam, - ErrorResult& aRv); + const TouchEventInit& aParam); protected: ~TouchEvent() {} diff --git a/dom/events/TransitionEvent.cpp b/dom/events/TransitionEvent.cpp index 04175db2e627..8fde3c6537dc 100644 --- a/dom/events/TransitionEvent.cpp +++ b/dom/events/TransitionEvent.cpp @@ -27,7 +27,7 @@ TransitionEvent::TransitionEvent(EventTarget* aOwner, // static already_AddRefed TransitionEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const TransitionEventInit& aParam, ErrorResult& aRv) { + const TransitionEventInit& aParam) { nsCOMPtr t = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr e = new TransitionEvent(t, nullptr, nullptr); bool trusted = e->Init(t); diff --git a/dom/events/TransitionEvent.h b/dom/events/TransitionEvent.h index 6f2221850ba3..b4afc229813c 100644 --- a/dom/events/TransitionEvent.h +++ b/dom/events/TransitionEvent.h @@ -23,7 +23,7 @@ class TransitionEvent : public Event { static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const TransitionEventInit& aParam, ErrorResult& aRv); + const TransitionEventInit& aParam); virtual JSObject* WrapObjectInternal( JSContext* aCx, JS::Handle aGivenProto) override { diff --git a/dom/events/UIEvent.cpp b/dom/events/UIEvent.cpp index 74474c04c80e..3e561e04d9aa 100644 --- a/dom/events/UIEvent.cpp +++ b/dom/events/UIEvent.cpp @@ -73,8 +73,7 @@ UIEvent::UIEvent(EventTarget* aOwner, nsPresContext* aPresContext, // static already_AddRefed UIEvent::Constructor(const GlobalObject& aGlobal, const nsAString& aType, - const UIEventInit& aParam, - ErrorResult& aRv) { + const UIEventInit& aParam) { nsCOMPtr t = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr e = new UIEvent(t, nullptr, nullptr); bool trusted = e->Init(t); diff --git a/dom/events/UIEvent.h b/dom/events/UIEvent.h index 907d6c1bac31..6706ba5699f6 100644 --- a/dom/events/UIEvent.h +++ b/dom/events/UIEvent.h @@ -36,8 +36,7 @@ class UIEvent : public Event { static already_AddRefed Constructor(const GlobalObject& aGlobal, const nsAString& aType, - const UIEventInit& aParam, - ErrorResult& aRv); + const UIEventInit& aParam); virtual JSObject* WrapObjectInternal( JSContext* aCx, JS::Handle aGivenProto) override { diff --git a/dom/events/WheelEvent.cpp b/dom/events/WheelEvent.cpp index f91a36e29f51..173cbde81d43 100644 --- a/dom/events/WheelEvent.cpp +++ b/dom/events/WheelEvent.cpp @@ -84,7 +84,7 @@ uint32_t WheelEvent::DeltaMode() { return mEvent->AsWheelEvent()->mDeltaMode; } already_AddRefed WheelEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const WheelEventInit& aParam, ErrorResult& aRv) { + const WheelEventInit& aParam) { nsCOMPtr t = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr e = new WheelEvent(t, nullptr, nullptr); bool trusted = e->Init(t); diff --git a/dom/events/WheelEvent.h b/dom/events/WheelEvent.h index 7635a51ff494..db87dbc87a00 100644 --- a/dom/events/WheelEvent.h +++ b/dom/events/WheelEvent.h @@ -23,8 +23,7 @@ class WheelEvent : public MouseEvent { static already_AddRefed Constructor(const GlobalObject& aGlobal, const nsAString& aType, - const WheelEventInit& aParam, - ErrorResult& aRv); + const WheelEventInit& aParam); virtual JSObject* WrapObjectInternal( JSContext* aCx, JS::Handle aGivenProto) override { diff --git a/dom/indexedDB/IDBEvents.cpp b/dom/indexedDB/IDBEvents.cpp index d7f57a917386..2319b32c110d 100644 --- a/dom/indexedDB/IDBEvents.cpp +++ b/dom/indexedDB/IDBEvents.cpp @@ -63,7 +63,7 @@ already_AddRefed IDBVersionChangeEvent::CreateInternal( already_AddRefed IDBVersionChangeEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const IDBVersionChangeEventInit& aOptions, ErrorResult& aRv) { + const IDBVersionChangeEventInit& aOptions) { nsCOMPtr target = do_QueryInterface(aGlobal.GetAsSupports()); return CreateInternal(target, aType, aOptions.mOldVersion, diff --git a/dom/indexedDB/IDBEvents.h b/dom/indexedDB/IDBEvents.h index 1724d2a6bee1..e620be8a51db 100644 --- a/dom/indexedDB/IDBEvents.h +++ b/dom/indexedDB/IDBEvents.h @@ -74,7 +74,7 @@ class IDBVersionChangeEvent final : public Event { static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const IDBVersionChangeEventInit& aOptions, ErrorResult& aRv); + const IDBVersionChangeEventInit& aOptions); uint64_t OldVersion() const { return mOldVersion; } diff --git a/dom/notification/NotificationEvent.h b/dom/notification/NotificationEvent.h index 15884db85c03..098eec1d45a5 100644 --- a/dom/notification/NotificationEvent.h +++ b/dom/notification/NotificationEvent.h @@ -34,7 +34,7 @@ class NotificationEvent final : public ExtendableEvent { static already_AddRefed Constructor( mozilla::dom::EventTarget* aOwner, const nsAString& aType, - const NotificationEventInit& aOptions, ErrorResult& aRv) { + const NotificationEventInit& aOptions) { RefPtr e = new NotificationEvent(aOwner); bool trusted = e->Init(aOwner); e->InitEvent(aType, aOptions.mBubbles, aOptions.mCancelable); @@ -47,9 +47,9 @@ class NotificationEvent final : public ExtendableEvent { static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const NotificationEventInit& aOptions, ErrorResult& aRv) { + const NotificationEventInit& aOptions) { nsCOMPtr owner = do_QueryInterface(aGlobal.GetAsSupports()); - return Constructor(owner, aType, aOptions, aRv); + return Constructor(owner, aType, aOptions); } already_AddRefed Notification_() { diff --git a/dom/payments/PaymentMethodChangeEvent.cpp b/dom/payments/PaymentMethodChangeEvent.cpp index 86966905fc02..a27d09bce8fb 100644 --- a/dom/payments/PaymentMethodChangeEvent.cpp +++ b/dom/payments/PaymentMethodChangeEvent.cpp @@ -52,7 +52,7 @@ PaymentMethodChangeEvent::Constructor( already_AddRefed PaymentMethodChangeEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const PaymentMethodChangeEventInit& aEventInitDict, ErrorResult& aRv) { + const PaymentMethodChangeEventInit& aEventInitDict) { nsCOMPtr owner = do_QueryInterface(aGlobal.GetAsSupports()); RefPtr e = new PaymentMethodChangeEvent(owner); diff --git a/dom/payments/PaymentMethodChangeEvent.h b/dom/payments/PaymentMethodChangeEvent.h index 7559fa044533..44f5e0112a10 100644 --- a/dom/payments/PaymentMethodChangeEvent.h +++ b/dom/payments/PaymentMethodChangeEvent.h @@ -35,7 +35,7 @@ class PaymentMethodChangeEvent final : public PaymentRequestUpdateEvent { // Called by WebIDL constructor static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const PaymentMethodChangeEventInit& aEventInitDict, ErrorResult& aRv); + const PaymentMethodChangeEventInit& aEventInitDict); void GetMethodName(nsAString& aMethodName); void SetMethodName(const nsAString& aMethodName); diff --git a/dom/payments/PaymentRequestUpdateEvent.cpp b/dom/payments/PaymentRequestUpdateEvent.cpp index 4db583fcc5e5..568a056cc28e 100644 --- a/dom/payments/PaymentRequestUpdateEvent.cpp +++ b/dom/payments/PaymentRequestUpdateEvent.cpp @@ -36,7 +36,7 @@ PaymentRequestUpdateEvent::Constructor( already_AddRefed PaymentRequestUpdateEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const PaymentRequestUpdateEventInit& aEventInitDict, ErrorResult& aRv) { + const PaymentRequestUpdateEventInit& aEventInitDict) { nsCOMPtr owner = do_QueryInterface(aGlobal.GetAsSupports()); return Constructor(owner, aType, aEventInitDict); diff --git a/dom/payments/PaymentRequestUpdateEvent.h b/dom/payments/PaymentRequestUpdateEvent.h index 452857cc166e..8fcf2af05302 100644 --- a/dom/payments/PaymentRequestUpdateEvent.h +++ b/dom/payments/PaymentRequestUpdateEvent.h @@ -41,7 +41,7 @@ class PaymentRequestUpdateEvent : public Event, public PromiseNativeHandler { // Called by WebIDL constructor static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const PaymentRequestUpdateEventInit& aEventInitDict, ErrorResult& aRv); + const PaymentRequestUpdateEventInit& aEventInitDict); void UpdateWith(Promise& aPromise, ErrorResult& aRv); diff --git a/dom/serviceworkers/ServiceWorkerEvents.cpp b/dom/serviceworkers/ServiceWorkerEvents.cpp index f93464ea31b4..22f55c625ca7 100644 --- a/dom/serviceworkers/ServiceWorkerEvents.cpp +++ b/dom/serviceworkers/ServiceWorkerEvents.cpp @@ -150,7 +150,7 @@ void FetchEvent::PostInit(const nsACString& aScriptSpec, /*static*/ already_AddRefed FetchEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const FetchEventInit& aOptions, ErrorResult& aRv) { + const FetchEventInit& aOptions) { RefPtr owner = do_QueryObject(aGlobal.GetAsSupports()); MOZ_ASSERT(owner); RefPtr e = new FetchEvent(owner); @@ -1203,15 +1203,15 @@ void ExtendableMessageEvent::GetSource( /* static */ already_AddRefed ExtendableMessageEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const ExtendableMessageEventInit& aOptions, ErrorResult& aRv) { + const ExtendableMessageEventInit& aOptions) { nsCOMPtr t = do_QueryInterface(aGlobal.GetAsSupports()); - return Constructor(t, aType, aOptions, aRv); + return Constructor(t, aType, aOptions); } /* static */ already_AddRefed ExtendableMessageEvent::Constructor( mozilla::dom::EventTarget* aEventTarget, const nsAString& aType, - const ExtendableMessageEventInit& aOptions, ErrorResult& aRv) { + const ExtendableMessageEventInit& aOptions) { RefPtr event = new ExtendableMessageEvent(aEventTarget); diff --git a/dom/serviceworkers/ServiceWorkerEvents.h b/dom/serviceworkers/ServiceWorkerEvents.h index 85b504914a0b..ebdae877f2ab 100644 --- a/dom/serviceworkers/ServiceWorkerEvents.h +++ b/dom/serviceworkers/ServiceWorkerEvents.h @@ -101,7 +101,7 @@ class ExtendableEvent : public Event { static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const EventInit& aOptions, ErrorResult& aRv) { + const EventInit& aOptions) { nsCOMPtr target = do_QueryInterface(aGlobal.GetAsSupports()); return Constructor(target, aType, aOptions); } @@ -148,7 +148,7 @@ class FetchEvent final : public ExtendableEvent { static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const FetchEventInit& aOptions, ErrorResult& aRv); + const FetchEventInit& aOptions); bool WaitToRespond() const { return mWaitToRespond; } @@ -259,11 +259,11 @@ class ExtendableMessageEvent final : public ExtendableEvent { static already_AddRefed Constructor( mozilla::dom::EventTarget* aOwner, const nsAString& aType, - const ExtendableMessageEventInit& aOptions, ErrorResult& aRv); + const ExtendableMessageEventInit& aOptions); static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const ExtendableMessageEventInit& aOptions, ErrorResult& aRv); + const ExtendableMessageEventInit& aOptions); void GetData(JSContext* aCx, JS::MutableHandle aData, ErrorResult& aRv); diff --git a/dom/serviceworkers/ServiceWorkerOp.cpp b/dom/serviceworkers/ServiceWorkerOp.cpp index d2896d8807a6..51452a467c49 100644 --- a/dom/serviceworkers/ServiceWorkerOp.cpp +++ b/dom/serviceworkers/ServiceWorkerOp.cpp @@ -881,11 +881,7 @@ class NotificationEventOp : public ExtendableEventOp, init.mCancelable = false; RefPtr notificationEvent = - NotificationEvent::Constructor(target, args.eventName(), init, result); - - if (NS_WARN_IF(result.Failed())) { - return false; - } + NotificationEvent::Constructor(target, args.eventName(), init); notificationEvent->SetTrusted(true); @@ -974,6 +970,7 @@ class MessageEventOp final : public ExtendableEventOp { Sequence> ports; if (!mData->TakeTransferredPortsAsSequence(ports)) { RejectAll(NS_ERROR_FAILURE); + rv.SuppressException(); return true; } @@ -992,18 +989,14 @@ class MessageEventOp final : public ExtendableEventOp { init.mSource.SetValue().SetAsClient() = new Client( sgo, mArgs.get_ServiceWorkerMessageEventOpArgs().clientInfoAndState()); - rv = NS_OK; + rv.SuppressException(); RefPtr target = aWorkerPrivate->GlobalScope(); RefPtr extendableEvent = ExtendableMessageEvent::Constructor( target, deserializationFailed ? NS_LITERAL_STRING("messageerror") : NS_LITERAL_STRING("message"), - init, rv); - if (NS_WARN_IF(rv.Failed())) { - RejectAll(rv.StealNSResult()); - return false; - } + init); extendableEvent->SetTrusted(true); @@ -1577,12 +1570,8 @@ nsresult FetchEventOp::DispatchFetchEvent(JSContext* aCx, /** * Step 4b: create the FetchEvent */ - ErrorResult result; RefPtr fetchEvent = FetchEvent::Constructor( - globalObject, NS_LITERAL_STRING("fetch"), fetchEventInit, result); - if (NS_WARN_IF(result.Failed())) { - return result.StealNSResult(); - } + globalObject, NS_LITERAL_STRING("fetch"), fetchEventInit); fetchEvent->SetTrusted(true); fetchEvent->PostInit(args.workerScriptSpec(), this); diff --git a/dom/serviceworkers/ServiceWorkerPrivate.cpp b/dom/serviceworkers/ServiceWorkerPrivate.cpp index 2b290bff6074..da3be186b335 100644 --- a/dom/serviceworkers/ServiceWorkerPrivate.cpp +++ b/dom/serviceworkers/ServiceWorkerPrivate.cpp @@ -475,6 +475,7 @@ class SendMessageEventRunnable final : public ExtendableEventWorkerRunnable { bool deserializationFailed = rv.ErrorCodeIs(NS_ERROR_DOM_DATA_CLONE_ERR); if (!deserializationFailed && NS_WARN_IF(rv.Failed())) { + rv.SuppressException(); return true; } @@ -498,18 +499,14 @@ class SendMessageEventRunnable final : public ExtendableEventWorkerRunnable { init.mSource.SetValue().SetAsClient() = new Client(sgo, mClientInfoAndState); - rv = NS_OK; + rv.SuppressException(); RefPtr target = aWorkerPrivate->GlobalScope(); RefPtr extendableEvent = ExtendableMessageEvent::Constructor( target, deserializationFailed ? NS_LITERAL_STRING("messageerror") : NS_LITERAL_STRING("message"), - init, rv); - if (NS_WARN_IF(rv.Failed())) { - rv.SuppressException(); - return false; - } + init); extendableEvent->SetTrusted(true); @@ -1125,10 +1122,7 @@ class SendNotificationEventRunnable final nei.mCancelable = false; RefPtr event = - NotificationEvent::Constructor(target, mEventName, nei, result); - if (NS_WARN_IF(result.Failed())) { - return false; - } + NotificationEvent::Constructor(target, mEventName, nei); event->SetTrusted(true); @@ -1490,12 +1484,8 @@ class FetchEventRunnable : public ExtendableFunctionalEventWorkerRunnable, } init.mIsReload = mIsReload; - RefPtr event = FetchEvent::Constructor( - globalObj, NS_LITERAL_STRING("fetch"), init, result); - if (NS_WARN_IF(result.Failed())) { - result.SuppressException(); - return false; - } + RefPtr event = + FetchEvent::Constructor(globalObj, NS_LITERAL_STRING("fetch"), init); event->PostInit(mInterceptedChannel, mRegistration, mScriptSpec); event->SetTrusted(true); diff --git a/dom/vr/VRDisplayEvent.cpp b/dom/vr/VRDisplayEvent.cpp index 2232086e329f..42c9f4b38a53 100644 --- a/dom/vr/VRDisplayEvent.cpp +++ b/dom/vr/VRDisplayEvent.cpp @@ -58,7 +58,7 @@ already_AddRefed VRDisplayEvent::Constructor( already_AddRefed VRDisplayEvent::Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const VRDisplayEventInit& aEventInitDict, ErrorResult& aRv) { + const VRDisplayEventInit& aEventInitDict) { nsCOMPtr owner = do_QueryInterface(aGlobal.GetAsSupports()); return Constructor(owner, aType, aEventInitDict); diff --git a/dom/vr/VRDisplayEvent.h b/dom/vr/VRDisplayEvent.h index 1834bc95e8cb..00a2eae91796 100644 --- a/dom/vr/VRDisplayEvent.h +++ b/dom/vr/VRDisplayEvent.h @@ -51,7 +51,7 @@ class VRDisplayEvent final : public Event { static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aType, - const VRDisplayEventInit& aEventInitDict, ErrorResult& aRv); + const VRDisplayEventInit& aEventInitDict); }; } // namespace dom diff --git a/dom/webidl/AddonEvent.webidl b/dom/webidl/AddonEvent.webidl index 1ec8ec1b23fc..805375d2a347 100644 --- a/dom/webidl/AddonEvent.webidl +++ b/dom/webidl/AddonEvent.webidl @@ -1,6 +1,7 @@ -[ Func="mozilla::AddonManagerWebAPI::IsAPIEnabled", - Constructor(DOMString type, AddonEventInit eventInitDict)] +[Func="mozilla::AddonManagerWebAPI::IsAPIEnabled"] interface AddonEvent : Event { + constructor(DOMString type, AddonEventInit eventInitDict); + readonly attribute DOMString id; }; diff --git a/dom/webidl/AnimationEvent.webidl b/dom/webidl/AnimationEvent.webidl index 820af93de378..ad8055d1fb87 100644 --- a/dom/webidl/AnimationEvent.webidl +++ b/dom/webidl/AnimationEvent.webidl @@ -11,8 +11,9 @@ * liability, trademark and document use rules apply. */ -[Constructor(DOMString type, optional AnimationEventInit eventInitDict = {})] interface AnimationEvent : Event { + constructor(DOMString type, optional AnimationEventInit eventInitDict = {}); + readonly attribute DOMString animationName; readonly attribute float elapsedTime; readonly attribute DOMString pseudoElement; diff --git a/dom/webidl/AnimationPlaybackEvent.webidl b/dom/webidl/AnimationPlaybackEvent.webidl index 055f96533b4f..c65d1d52a5c1 100644 --- a/dom/webidl/AnimationPlaybackEvent.webidl +++ b/dom/webidl/AnimationPlaybackEvent.webidl @@ -10,10 +10,11 @@ * liability, trademark and document use rules apply. */ -[Func="Document::IsWebAnimationsEnabled", - Constructor(DOMString type, - optional AnimationPlaybackEventInit eventInitDict = {})] +[Func="Document::IsWebAnimationsEnabled"] interface AnimationPlaybackEvent : Event { + constructor(DOMString type, + optional AnimationPlaybackEventInit eventInitDict = {}); + readonly attribute double? currentTime; readonly attribute double? timelineTime; }; diff --git a/dom/webidl/BlobEvent.webidl b/dom/webidl/BlobEvent.webidl index c0b3497c1b0e..241c2e128149 100644 --- a/dom/webidl/BlobEvent.webidl +++ b/dom/webidl/BlobEvent.webidl @@ -7,9 +7,9 @@ * https://w3c.github.io/mediacapture-record/#blobevent-section */ -[Constructor(DOMString type, optional BlobEventInit eventInitDict = {})] interface BlobEvent : Event { + constructor(DOMString type, optional BlobEventInit eventInitDict = {}); readonly attribute Blob? data; }; diff --git a/dom/webidl/CaretStateChangedEvent.webidl b/dom/webidl/CaretStateChangedEvent.webidl index a4d4f18a2bc6..106a49fc933f 100644 --- a/dom/webidl/CaretStateChangedEvent.webidl +++ b/dom/webidl/CaretStateChangedEvent.webidl @@ -25,9 +25,11 @@ dictionary CaretStateChangedEventInit : EventInit { DOMString selectedTextContent = ""; }; -[Constructor(DOMString type, optional CaretStateChangedEventInit eventInit = {}), - ChromeOnly] +[ChromeOnly] interface CaretStateChangedEvent : Event { + constructor(DOMString type, + optional CaretStateChangedEventInit eventInit = {}); + readonly attribute boolean collapsed; /* The bounding client rect is relative to the visual viewport. */ readonly attribute DOMRectReadOnly? boundingClientRect; diff --git a/dom/webidl/ClipboardEvent.webidl b/dom/webidl/ClipboardEvent.webidl index 0c15bf3f7442..a90922adaec6 100644 --- a/dom/webidl/ClipboardEvent.webidl +++ b/dom/webidl/ClipboardEvent.webidl @@ -10,9 +10,11 @@ * liability, trademark and document use rules apply. */ -[Constructor(DOMString type, optional ClipboardEventInit eventInitDict = {})] interface ClipboardEvent : Event { + [Throws] + constructor(DOMString type, optional ClipboardEventInit eventInitDict = {}); + readonly attribute DataTransfer? clipboardData; }; diff --git a/dom/webidl/CloseEvent.webidl b/dom/webidl/CloseEvent.webidl index 50be9f104bbc..a74e219fc4d0 100644 --- a/dom/webidl/CloseEvent.webidl +++ b/dom/webidl/CloseEvent.webidl @@ -10,10 +10,12 @@ * http://www.whatwg.org/specs/web-apps/current-work/multipage/network.html#closeevent */ -[Constructor(DOMString type, optional CloseEventInit eventInitDict = {}),LegacyEventInit, +[LegacyEventInit, Exposed=(Window,Worker)] interface CloseEvent : Event { + constructor(DOMString type, optional CloseEventInit eventInitDict = {}); + readonly attribute boolean wasClean; readonly attribute unsigned short code; readonly attribute DOMString reason; diff --git a/dom/webidl/CompositionEvent.webidl b/dom/webidl/CompositionEvent.webidl index 8e3314627a85..d62f160022bd 100644 --- a/dom/webidl/CompositionEvent.webidl +++ b/dom/webidl/CompositionEvent.webidl @@ -9,9 +9,10 @@ * liability, trademark and document use rules apply. */ -[Constructor(DOMString type, optional CompositionEventInit eventInitDict = {})] interface CompositionEvent : UIEvent { + constructor(DOMString type, optional CompositionEventInit eventInitDict = {}); + readonly attribute DOMString? data; // locale is currently non-standard readonly attribute DOMString locale; diff --git a/dom/webidl/CustomEvent.webidl b/dom/webidl/CustomEvent.webidl index a42dbb46ee31..31296afd7b5c 100644 --- a/dom/webidl/CustomEvent.webidl +++ b/dom/webidl/CustomEvent.webidl @@ -10,10 +10,11 @@ * liability, trademark and document use rules apply. */ -[Constructor(DOMString type, optional CustomEventInit eventInitDict = {}), - Exposed=(Window, Worker)] +[Exposed=(Window, Worker)] interface CustomEvent : Event { + constructor(DOMString type, optional CustomEventInit eventInitDict = {}); + readonly attribute any detail; // initCustomEvent is a Gecko specific deprecated method. diff --git a/dom/webidl/DeviceLightEvent.webidl b/dom/webidl/DeviceLightEvent.webidl index d06bab57982d..0c85bec497c7 100644 --- a/dom/webidl/DeviceLightEvent.webidl +++ b/dom/webidl/DeviceLightEvent.webidl @@ -4,9 +4,11 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Pref="device.sensors.ambientLight.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", Constructor(DOMString type, optional DeviceLightEventInit eventInitDict = {})] +[Pref="device.sensors.ambientLight.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled"] interface DeviceLightEvent : Event { + constructor(DOMString type, optional DeviceLightEventInit eventInitDict = {}); + readonly attribute unrestricted double value; }; diff --git a/dom/webidl/DeviceMotionEvent.webidl b/dom/webidl/DeviceMotionEvent.webidl index 11f4d7e8be0d..e17907619c79 100644 --- a/dom/webidl/DeviceMotionEvent.webidl +++ b/dom/webidl/DeviceMotionEvent.webidl @@ -20,8 +20,11 @@ interface DeviceRotationRate { readonly attribute double? gamma; }; -[Pref="device.sensors.motion.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", Constructor(DOMString type, optional DeviceMotionEventInit eventInitDict = {})] +[Pref="device.sensors.motion.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled"] interface DeviceMotionEvent : Event { + constructor(DOMString type, + optional DeviceMotionEventInit eventInitDict = {}); + readonly attribute DeviceAcceleration? acceleration; readonly attribute DeviceAcceleration? accelerationIncludingGravity; readonly attribute DeviceRotationRate? rotationRate; diff --git a/dom/webidl/DeviceOrientationEvent.webidl b/dom/webidl/DeviceOrientationEvent.webidl index 009d4dd0bd45..ba3bf6a17d41 100644 --- a/dom/webidl/DeviceOrientationEvent.webidl +++ b/dom/webidl/DeviceOrientationEvent.webidl @@ -4,9 +4,12 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Pref="device.sensors.orientation.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", Constructor(DOMString type, optional DeviceOrientationEventInit eventInitDict = {}), LegacyEventInit] +[Pref="device.sensors.orientation.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", LegacyEventInit] interface DeviceOrientationEvent : Event { + constructor(DOMString type, + optional DeviceOrientationEventInit eventInitDict = {}); + readonly attribute double? alpha; readonly attribute double? beta; readonly attribute double? gamma; diff --git a/dom/webidl/DeviceProximityEvent.webidl b/dom/webidl/DeviceProximityEvent.webidl index 2351a6cb20f3..b4c1c4ca8e58 100644 --- a/dom/webidl/DeviceProximityEvent.webidl +++ b/dom/webidl/DeviceProximityEvent.webidl @@ -4,9 +4,12 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Pref="device.sensors.proximity.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", Constructor(DOMString type, optional DeviceProximityEventInit eventInitDict = {})] +[Pref="device.sensors.proximity.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled"] interface DeviceProximityEvent : Event { + constructor(DOMString type, + optional DeviceProximityEventInit eventInitDict = {}); + readonly attribute double value; readonly attribute double min; readonly attribute double max; diff --git a/dom/webidl/DragEvent.webidl b/dom/webidl/DragEvent.webidl index 04446bfa2fc4..2b2a430c6e9d 100644 --- a/dom/webidl/DragEvent.webidl +++ b/dom/webidl/DragEvent.webidl @@ -7,9 +7,10 @@ * https://html.spec.whatwg.org/multipage/#dragevent */ -[Constructor(DOMString type, optional DragEventInit eventInitDict = {})] interface DragEvent : MouseEvent { + constructor(DOMString type, optional DragEventInit eventInitDict = {}); + readonly attribute DataTransfer? dataTransfer; void initDragEvent(DOMString type, diff --git a/dom/webidl/ErrorEvent.webidl b/dom/webidl/ErrorEvent.webidl index def07b875cd5..729f59be2680 100644 --- a/dom/webidl/ErrorEvent.webidl +++ b/dom/webidl/ErrorEvent.webidl @@ -7,10 +7,11 @@ * https://html.spec.whatwg.org/multipage/#the-errorevent-interface */ -[Constructor(DOMString type, optional ErrorEventInit eventInitDict = {}), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface ErrorEvent : Event { + constructor(DOMString type, optional ErrorEventInit eventInitDict = {}); + readonly attribute DOMString message; readonly attribute DOMString filename; readonly attribute unsigned long lineno; diff --git a/dom/webidl/Event.webidl b/dom/webidl/Event.webidl index 5831b0e28cb8..da551094cf3c 100644 --- a/dom/webidl/Event.webidl +++ b/dom/webidl/Event.webidl @@ -10,9 +10,10 @@ * liability, trademark and document use rules apply. */ -[Constructor(DOMString type, optional EventInit eventInitDict = {}), - Exposed=(Window,Worker), ProbablyShortLivingWrapper] +[Exposed=(Window,Worker), ProbablyShortLivingWrapper] interface Event { + constructor(DOMString type, optional EventInit eventInitDict = {}); + [Pure] readonly attribute DOMString type; [Pure, BindingAlias="srcElement"] diff --git a/dom/webidl/ExtendableEvent.webidl b/dom/webidl/ExtendableEvent.webidl index f4816f58ea7a..c311b5364114 100644 --- a/dom/webidl/ExtendableEvent.webidl +++ b/dom/webidl/ExtendableEvent.webidl @@ -7,9 +7,10 @@ * http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html */ -[Constructor(DOMString type, optional ExtendableEventInit eventInitDict = {}), - Exposed=ServiceWorker] +[Exposed=ServiceWorker] interface ExtendableEvent : Event { + constructor(DOMString type, optional ExtendableEventInit eventInitDict = {}); + // https://github.com/slightlyoff/ServiceWorker/issues/261 [Throws] void waitUntil(Promise p); diff --git a/dom/webidl/ExtendableMessageEvent.webidl b/dom/webidl/ExtendableMessageEvent.webidl index 04aba1a3bdc9..cde11e8e7588 100644 --- a/dom/webidl/ExtendableMessageEvent.webidl +++ b/dom/webidl/ExtendableMessageEvent.webidl @@ -7,9 +7,11 @@ * https://w3c.github.io/ServiceWorker/#extendablemessage-event-section */ -[Constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict = {}), - Exposed=(ServiceWorker)] +[Exposed=(ServiceWorker)] interface ExtendableMessageEvent : ExtendableEvent { + constructor(DOMString type, + optional ExtendableMessageEventInit eventInitDict = {}); + /** * Custom data associated with this event. */ diff --git a/dom/webidl/FetchEvent.webidl b/dom/webidl/FetchEvent.webidl index 3b1e0989144b..76f88af3deee 100644 --- a/dom/webidl/FetchEvent.webidl +++ b/dom/webidl/FetchEvent.webidl @@ -7,10 +7,11 @@ * http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html */ -[Constructor(DOMString type, FetchEventInit eventInitDict), - Func="ServiceWorkerVisible", +[Func="ServiceWorkerVisible", Exposed=(ServiceWorker)] interface FetchEvent : ExtendableEvent { + constructor(DOMString type, FetchEventInit eventInitDict); + [SameObject, BinaryName="request_"] readonly attribute Request request; readonly attribute DOMString clientId; readonly attribute DOMString resultingClientId; diff --git a/dom/webidl/FocusEvent.webidl b/dom/webidl/FocusEvent.webidl index 300327312179..9adcb14ee1d2 100644 --- a/dom/webidl/FocusEvent.webidl +++ b/dom/webidl/FocusEvent.webidl @@ -10,8 +10,10 @@ * liability, trademark and document use rules apply. */ -[Constructor(DOMString typeArg, optional FocusEventInit focusEventInitDict = {})] interface FocusEvent : UIEvent { + constructor(DOMString typeArg, + optional FocusEventInit focusEventInitDict = {}); + // Introduced in DOM Level 3: readonly attribute EventTarget? relatedTarget; }; diff --git a/dom/webidl/FontFaceSetLoadEvent.webidl b/dom/webidl/FontFaceSetLoadEvent.webidl index aa878bab998e..402db7382e14 100644 --- a/dom/webidl/FontFaceSetLoadEvent.webidl +++ b/dom/webidl/FontFaceSetLoadEvent.webidl @@ -14,8 +14,10 @@ dictionary FontFaceSetLoadEventInit : EventInit { sequence fontfaces = []; }; -[Constructor(DOMString type, optional FontFaceSetLoadEventInit eventInitDict = {}), - Pref="layout.css.font-loading-api.enabled"] +[Pref="layout.css.font-loading-api.enabled"] interface FontFaceSetLoadEvent : Event { + constructor(DOMString type, + optional FontFaceSetLoadEventInit eventInitDict = {}); + [Cached, Constant, Frozen] readonly attribute sequence fontfaces; }; diff --git a/dom/webidl/FormDataEvent.webidl b/dom/webidl/FormDataEvent.webidl index c20262b67200..14a52eb4650a 100644 --- a/dom/webidl/FormDataEvent.webidl +++ b/dom/webidl/FormDataEvent.webidl @@ -8,9 +8,10 @@ */ [Exposed=Window, - Constructor(DOMString type, optional FormDataEventInit eventInitDict = {}), Pref="dom.formdata.event.enabled"] interface FormDataEvent : Event { + constructor(DOMString type, optional FormDataEventInit eventInitDict = {}); + // C++ can't deal with a method called FormData() in the generated code [BinaryName="GetFormData"] readonly attribute FormData formData; diff --git a/dom/webidl/FrameCrashedEvent.webidl b/dom/webidl/FrameCrashedEvent.webidl index 0ec462398952..9dd021a712e6 100644 --- a/dom/webidl/FrameCrashedEvent.webidl +++ b/dom/webidl/FrameCrashedEvent.webidl @@ -4,9 +4,12 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Constructor(DOMString type, optional FrameCrashedEventInit eventInitDict = {}), ChromeOnly] +[ChromeOnly] interface FrameCrashedEvent : Event { + constructor(DOMString type, + optional FrameCrashedEventInit eventInitDict = {}); + /** * The browsingContextId of the frame that crashed. */ diff --git a/dom/webidl/GamepadAxisMoveEvent.webidl b/dom/webidl/GamepadAxisMoveEvent.webidl index 47b13b80d825..fd8a1115988f 100644 --- a/dom/webidl/GamepadAxisMoveEvent.webidl +++ b/dom/webidl/GamepadAxisMoveEvent.webidl @@ -4,10 +4,12 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Pref="dom.gamepad.non_standard_events.enabled", - Constructor(DOMString type, optional GamepadAxisMoveEventInit eventInitDict = {})] +[Pref="dom.gamepad.non_standard_events.enabled"] interface GamepadAxisMoveEvent : GamepadEvent { + constructor(DOMString type, + optional GamepadAxisMoveEventInit eventInitDict = {}); + readonly attribute unsigned long axis; readonly attribute double value; }; diff --git a/dom/webidl/GamepadButtonEvent.webidl b/dom/webidl/GamepadButtonEvent.webidl index b1057ff7e23a..764fcdd3fac2 100644 --- a/dom/webidl/GamepadButtonEvent.webidl +++ b/dom/webidl/GamepadButtonEvent.webidl @@ -4,10 +4,12 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Pref="dom.gamepad.non_standard_events.enabled", - Constructor(DOMString type, optional GamepadButtonEventInit eventInitDict = {})] +[Pref="dom.gamepad.non_standard_events.enabled"] interface GamepadButtonEvent : GamepadEvent { + constructor(DOMString type, + optional GamepadButtonEventInit eventInitDict = {}); + readonly attribute unsigned long button; }; diff --git a/dom/webidl/GamepadEvent.webidl b/dom/webidl/GamepadEvent.webidl index 29f4e9a053c8..09cc45a85d57 100644 --- a/dom/webidl/GamepadEvent.webidl +++ b/dom/webidl/GamepadEvent.webidl @@ -7,10 +7,11 @@ * https://w3c.github.io/gamepad/#gamepadevent-interface */ -[Pref="dom.gamepad.enabled", - Constructor(DOMString type, optional GamepadEventInit eventInitDict = {})] +[Pref="dom.gamepad.enabled"] interface GamepadEvent : Event { + constructor(DOMString type, optional GamepadEventInit eventInitDict = {}); + readonly attribute Gamepad? gamepad; }; diff --git a/dom/webidl/HashChangeEvent.webidl b/dom/webidl/HashChangeEvent.webidl index 1d7f9badb16b..77ac5354d582 100644 --- a/dom/webidl/HashChangeEvent.webidl +++ b/dom/webidl/HashChangeEvent.webidl @@ -7,9 +7,11 @@ * https://html.spec.whatwg.org/multipage/#the-hashchangeevent-interface */ -[Constructor(DOMString type, optional HashChangeEventInit eventInitDict = {}), LegacyEventInit] +[LegacyEventInit] interface HashChangeEvent : Event { + constructor(DOMString type, optional HashChangeEventInit eventInitDict = {}); + readonly attribute DOMString oldURL; readonly attribute DOMString newURL; diff --git a/dom/webidl/HiddenPluginEvent.webidl b/dom/webidl/HiddenPluginEvent.webidl index 3ccd4a8550fe..f89def019530 100644 --- a/dom/webidl/HiddenPluginEvent.webidl +++ b/dom/webidl/HiddenPluginEvent.webidl @@ -1,12 +1,14 @@ -interface PluginTag; - -[Constructor(DOMString type, optional HiddenPluginEventInit eventInit = {}), ChromeOnly] -interface HiddenPluginEvent : Event -{ - readonly attribute PluginTag? tag; -}; - -dictionary HiddenPluginEventInit : EventInit -{ - PluginTag? tag = null; -}; +interface PluginTag; + +[ChromeOnly] +interface HiddenPluginEvent : Event +{ + constructor(DOMString type, optional HiddenPluginEventInit eventInit = {}); + + readonly attribute PluginTag? tag; +}; + +dictionary HiddenPluginEventInit : EventInit +{ + PluginTag? tag = null; +}; diff --git a/dom/webidl/IDBVersionChangeEvent.webidl b/dom/webidl/IDBVersionChangeEvent.webidl index 87f483662347..d35030164f16 100644 --- a/dom/webidl/IDBVersionChangeEvent.webidl +++ b/dom/webidl/IDBVersionChangeEvent.webidl @@ -15,9 +15,11 @@ dictionary IDBVersionChangeEventInit : EventInit { unsigned long long? newVersion = null; }; -[Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict = {}), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface IDBVersionChangeEvent : Event { + constructor(DOMString type, + optional IDBVersionChangeEventInit eventInitDict = {}); + readonly attribute unsigned long long oldVersion; readonly attribute unsigned long long? newVersion; }; diff --git a/dom/webidl/ImageCaptureErrorEvent.webidl b/dom/webidl/ImageCaptureErrorEvent.webidl index a6537fbed5aa..66e506c193ad 100644 --- a/dom/webidl/ImageCaptureErrorEvent.webidl +++ b/dom/webidl/ImageCaptureErrorEvent.webidl @@ -10,9 +10,11 @@ * W3C liability, trademark and document use rules apply. */ -[Pref="dom.imagecapture.enabled", -Constructor(DOMString type, optional ImageCaptureErrorEventInit imageCaptureErrorInitDict = {})] +[Pref="dom.imagecapture.enabled"] interface ImageCaptureErrorEvent : Event { + constructor(DOMString type, + optional ImageCaptureErrorEventInit imageCaptureErrorInitDict = {}); + readonly attribute ImageCaptureError? imageCaptureError; }; diff --git a/dom/webidl/InputEvent.webidl b/dom/webidl/InputEvent.webidl index e88e73316247..484f22bccaca 100644 --- a/dom/webidl/InputEvent.webidl +++ b/dom/webidl/InputEvent.webidl @@ -7,9 +7,10 @@ * https://w3c.github.io/input-events/#interface-InputEvent */ -[Constructor(DOMString type, optional InputEventInit eventInitDict = {})] interface InputEvent : UIEvent { + constructor(DOMString type, optional InputEventInit eventInitDict = {}); + readonly attribute boolean isComposing; [Pref="dom.inputevent.inputtype.enabled"] diff --git a/dom/webidl/KeyboardEvent.webidl b/dom/webidl/KeyboardEvent.webidl index 7d11eb547a5c..f667311972ed 100644 --- a/dom/webidl/KeyboardEvent.webidl +++ b/dom/webidl/KeyboardEvent.webidl @@ -4,9 +4,11 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict= {})] interface KeyboardEvent : UIEvent { + constructor(DOMString typeArg, + optional KeyboardEventInit keyboardEventInitDict= {}); + [NeedsCallerType] readonly attribute unsigned long charCode; [NeedsCallerType] @@ -36,7 +38,7 @@ interface KeyboardEvent : UIEvent [NeedsCallerType] readonly attribute DOMString code; - [Throws, BinaryName="initKeyboardEventJS"] + [BinaryName="initKeyboardEventJS"] void initKeyboardEvent(DOMString typeArg, optional boolean bubblesArg = false, optional boolean cancelableArg = false, diff --git a/dom/webidl/MIDIConnectionEvent.webidl b/dom/webidl/MIDIConnectionEvent.webidl index 608f0deffc1b..cf7320981c61 100644 --- a/dom/webidl/MIDIConnectionEvent.webidl +++ b/dom/webidl/MIDIConnectionEvent.webidl @@ -7,11 +7,13 @@ * https://webaudio.github.io/web-midi-api/ */ -[Constructor(DOMString type, optional MIDIConnectionEventInit eventInitDict = {}), - SecureContext, +[SecureContext, Pref="dom.webmidi.enabled"] interface MIDIConnectionEvent : Event { + constructor(DOMString type, + optional MIDIConnectionEventInit eventInitDict = {}); + readonly attribute MIDIPort? port; }; diff --git a/dom/webidl/MIDIMessageEvent.webidl b/dom/webidl/MIDIMessageEvent.webidl index 7e54959f00b2..9dadd6887bac 100644 --- a/dom/webidl/MIDIMessageEvent.webidl +++ b/dom/webidl/MIDIMessageEvent.webidl @@ -7,11 +7,13 @@ * https://webaudio.github.io/web-midi-api/ */ -[Constructor(DOMString type, optional MIDIMessageEventInit eventInitDict = {}), - SecureContext, +[SecureContext, Pref="dom.webmidi.enabled"] interface MIDIMessageEvent : Event { + [Throws] + constructor(DOMString type, optional MIDIMessageEventInit eventInitDict = {}); + [Throws] readonly attribute Uint8Array data; }; diff --git a/dom/webidl/MediaEncryptedEvent.webidl b/dom/webidl/MediaEncryptedEvent.webidl index 8535df7800b2..54cd3c7d9029 100644 --- a/dom/webidl/MediaEncryptedEvent.webidl +++ b/dom/webidl/MediaEncryptedEvent.webidl @@ -10,8 +10,11 @@ * W3C liability, trademark and document use rules apply. */ -[Constructor(DOMString type, optional MediaKeyNeededEventInit eventInitDict = {})] interface MediaEncryptedEvent : Event { + [Throws] + constructor(DOMString type, + optional MediaKeyNeededEventInit eventInitDict = {}); + readonly attribute DOMString initDataType; [Throws] readonly attribute ArrayBuffer? initData; diff --git a/dom/webidl/MediaKeyMessageEvent.webidl b/dom/webidl/MediaKeyMessageEvent.webidl index eabef221fea0..a469bed4c6fd 100644 --- a/dom/webidl/MediaKeyMessageEvent.webidl +++ b/dom/webidl/MediaKeyMessageEvent.webidl @@ -17,8 +17,10 @@ enum MediaKeyMessageType { "individualization-request" }; -[Constructor(DOMString type, MediaKeyMessageEventInit eventInitDict)] interface MediaKeyMessageEvent : Event { + [Throws] + constructor(DOMString type, MediaKeyMessageEventInit eventInitDict); + readonly attribute MediaKeyMessageType messageType; [Throws] readonly attribute ArrayBuffer message; diff --git a/dom/webidl/MediaQueryListEvent.webidl b/dom/webidl/MediaQueryListEvent.webidl index 6a4d664f62d9..0d4955fff30c 100644 --- a/dom/webidl/MediaQueryListEvent.webidl +++ b/dom/webidl/MediaQueryListEvent.webidl @@ -6,8 +6,10 @@ * https://drafts.csswg.org/cssom-view/#mediaquerylistevent */ -[Constructor(DOMString type, optional MediaQueryListEventInit eventInitDict = {})] interface MediaQueryListEvent : Event { + constructor(DOMString type, + optional MediaQueryListEventInit eventInitDict = {}); + readonly attribute DOMString media; readonly attribute boolean matches; }; diff --git a/dom/webidl/MediaRecorderErrorEvent.webidl b/dom/webidl/MediaRecorderErrorEvent.webidl index 619329728f4e..0158d4b52a0a 100644 --- a/dom/webidl/MediaRecorderErrorEvent.webidl +++ b/dom/webidl/MediaRecorderErrorEvent.webidl @@ -1,21 +1,22 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. - * - * The origin of this IDL file is - * https://w3c.github.io/mediacapture-record/ - * - * Copyright © 2017 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark - * and document use rules apply. - */ - -dictionary MediaRecorderErrorEventInit : EventInit { - required DOMException error; -}; - -[Exposed=Window, - Constructor(DOMString type, MediaRecorderErrorEventInit eventInitDict)] -interface MediaRecorderErrorEvent : Event { - [SameObject] readonly attribute DOMException error; -}; \ No newline at end of file +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* 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/. + * + * The origin of this IDL file is + * https://w3c.github.io/mediacapture-record/ + * + * Copyright © 2017 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark + * and document use rules apply. + */ + +dictionary MediaRecorderErrorEventInit : EventInit { + required DOMException error; +}; + +[Exposed=Window] +interface MediaRecorderErrorEvent : Event { + constructor(DOMString type, MediaRecorderErrorEventInit eventInitDict); + + [SameObject] readonly attribute DOMException error; +}; diff --git a/dom/webidl/MediaStreamEvent.webidl b/dom/webidl/MediaStreamEvent.webidl index d008e49572b5..301a20d58240 100644 --- a/dom/webidl/MediaStreamEvent.webidl +++ b/dom/webidl/MediaStreamEvent.webidl @@ -11,8 +11,9 @@ dictionary MediaStreamEventInit : EventInit { MediaStream? stream = null; }; -[Pref="media.peerconnection.enabled", - Constructor(DOMString type, optional MediaStreamEventInit eventInitDict = {})] +[Pref="media.peerconnection.enabled"] interface MediaStreamEvent : Event { + constructor(DOMString type, optional MediaStreamEventInit eventInitDict = {}); + readonly attribute MediaStream? stream; }; diff --git a/dom/webidl/MediaStreamTrackEvent.webidl b/dom/webidl/MediaStreamTrackEvent.webidl index 538adf2f9306..8a202581e735 100644 --- a/dom/webidl/MediaStreamTrackEvent.webidl +++ b/dom/webidl/MediaStreamTrackEvent.webidl @@ -11,9 +11,10 @@ dictionary MediaStreamTrackEventInit : EventInit { required MediaStreamTrack track; }; -[Exposed=Window, - Constructor (DOMString type, MediaStreamTrackEventInit eventInitDict)] +[Exposed=Window] interface MediaStreamTrackEvent : Event { + constructor(DOMString type, MediaStreamTrackEventInit eventInitDict); + [SameObject] readonly attribute MediaStreamTrack track; }; diff --git a/dom/webidl/MerchantValidationEvent.webidl b/dom/webidl/MerchantValidationEvent.webidl index 60fb776f8bff..4e9f7b117454 100644 --- a/dom/webidl/MerchantValidationEvent.webidl +++ b/dom/webidl/MerchantValidationEvent.webidl @@ -11,11 +11,14 @@ * liability, trademark and document use rules apply. */ -[Constructor(DOMString type, optional MerchantValidationEventInit eventInitDict = {}), -SecureContext, +[SecureContext, Exposed=Window, Func="mozilla::dom::PaymentRequest::PrefEnabled"] interface MerchantValidationEvent : Event { + [Throws] + constructor(DOMString type, + optional MerchantValidationEventInit eventInitDict = {}); + readonly attribute DOMString methodName; readonly attribute USVString validationURL; [Throws] diff --git a/dom/webidl/MessageEvent.webidl b/dom/webidl/MessageEvent.webidl index cd86107296a2..5b8925b6f10a 100644 --- a/dom/webidl/MessageEvent.webidl +++ b/dom/webidl/MessageEvent.webidl @@ -7,9 +7,10 @@ * https://html.spec.whatwg.org/#messageevent */ -[Constructor(DOMString type, optional MessageEventInit eventInitDict = {}), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface MessageEvent : Event { + constructor(DOMString type, optional MessageEventInit eventInitDict = {}); + /** * Custom data associated with this event. */ diff --git a/dom/webidl/MouseEvent.webidl b/dom/webidl/MouseEvent.webidl index 82aca7363e58..e604b05cd323 100644 --- a/dom/webidl/MouseEvent.webidl +++ b/dom/webidl/MouseEvent.webidl @@ -11,8 +11,10 @@ * liability, trademark and document use rules apply. */ -[Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict = {})] interface MouseEvent : UIEvent { + constructor(DOMString typeArg, + optional MouseEventInit mouseEventInitDict = {}); + [NeedsCallerType] readonly attribute long screenX; [NeedsCallerType] diff --git a/dom/webidl/MozApplicationEvent.webidl b/dom/webidl/MozApplicationEvent.webidl index 2fe37bdb55d7..86d70383bede 100644 --- a/dom/webidl/MozApplicationEvent.webidl +++ b/dom/webidl/MozApplicationEvent.webidl @@ -4,9 +4,12 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Constructor(DOMString type, optional MozApplicationEventInit eventInitDict = {}), ChromeOnly] +[ChromeOnly] interface MozApplicationEvent : Event { + constructor(DOMString type, + optional MozApplicationEventInit eventInitDict = {}); + readonly attribute DOMApplication? application; }; diff --git a/dom/webidl/NotificationEvent.webidl b/dom/webidl/NotificationEvent.webidl index ed1d3104b581..9e77eb3434ed 100644 --- a/dom/webidl/NotificationEvent.webidl +++ b/dom/webidl/NotificationEvent.webidl @@ -11,9 +11,10 @@ * related or neighboring rights to this work. */ -[Constructor(DOMString type, NotificationEventInit eventInitDict), - Exposed=ServiceWorker,Func="mozilla::dom::Notification::PrefEnabled"] +[Exposed=ServiceWorker,Func="mozilla::dom::Notification::PrefEnabled"] interface NotificationEvent : ExtendableEvent { + constructor(DOMString type, NotificationEventInit eventInitDict); + [BinaryName="notification_"] readonly attribute Notification notification; }; diff --git a/dom/webidl/OfflineAudioCompletionEvent.webidl b/dom/webidl/OfflineAudioCompletionEvent.webidl index 03c58b96ef00..3262630049ef 100644 --- a/dom/webidl/OfflineAudioCompletionEvent.webidl +++ b/dom/webidl/OfflineAudioCompletionEvent.webidl @@ -14,8 +14,9 @@ dictionary OfflineAudioCompletionEventInit : EventInit { required AudioBuffer renderedBuffer; }; -[Constructor(DOMString type, OfflineAudioCompletionEventInit eventInitDict), - Pref="dom.webaudio.enabled"] +[Pref="dom.webaudio.enabled"] interface OfflineAudioCompletionEvent : Event { - readonly attribute AudioBuffer renderedBuffer; + constructor(DOMString type, OfflineAudioCompletionEventInit eventInitDict); + + readonly attribute AudioBuffer renderedBuffer; }; diff --git a/dom/webidl/PageTransitionEvent.webidl b/dom/webidl/PageTransitionEvent.webidl index 6bdec1d048a4..68d574e51a42 100644 --- a/dom/webidl/PageTransitionEvent.webidl +++ b/dom/webidl/PageTransitionEvent.webidl @@ -10,9 +10,11 @@ * load/unload and saving/restoring a document from session history. */ -[Constructor(DOMString type, optional PageTransitionEventInit eventInitDict = {})] interface PageTransitionEvent : Event { + constructor(DOMString type, + optional PageTransitionEventInit eventInitDict = {}); + /** * Set to true if the document has been or will be persisted across * firing of the event. For example, if a document is being cached in diff --git a/dom/webidl/PaymentMethodChangeEvent.webidl b/dom/webidl/PaymentMethodChangeEvent.webidl index 38de0447abd3..525ca1cc3d6a 100644 --- a/dom/webidl/PaymentMethodChangeEvent.webidl +++ b/dom/webidl/PaymentMethodChangeEvent.webidl @@ -10,11 +10,13 @@ * liability, trademark and document use rules apply. */ -[Constructor(DOMString type, optional PaymentMethodChangeEventInit eventInitDict = {}), - SecureContext, +[SecureContext, Exposed=Window, Func="mozilla::dom::PaymentRequest::PrefEnabled"] interface PaymentMethodChangeEvent : PaymentRequestUpdateEvent { + constructor(DOMString type, + optional PaymentMethodChangeEventInit eventInitDict = {}); + readonly attribute DOMString methodName; readonly attribute object? methodDetails; }; diff --git a/dom/webidl/PaymentRequestUpdateEvent.webidl b/dom/webidl/PaymentRequestUpdateEvent.webidl index 70bbb55d4ad9..caf280bf44e4 100644 --- a/dom/webidl/PaymentRequestUpdateEvent.webidl +++ b/dom/webidl/PaymentRequestUpdateEvent.webidl @@ -10,11 +10,12 @@ * liability, trademark and document use rules apply. */ -[Constructor(DOMString type, - optional PaymentRequestUpdateEventInit eventInitDict = {}), - SecureContext, +[SecureContext, Func="mozilla::dom::PaymentRequest::PrefEnabled"] interface PaymentRequestUpdateEvent : Event { + constructor(DOMString type, + optional PaymentRequestUpdateEventInit eventInitDict = {}); + [Throws] void updateWith(Promise detailsPromise); }; diff --git a/dom/webidl/PerformanceEntryEvent.webidl b/dom/webidl/PerformanceEntryEvent.webidl index 8be9e1b0a764..315cbe9ed176 100644 --- a/dom/webidl/PerformanceEntryEvent.webidl +++ b/dom/webidl/PerformanceEntryEvent.webidl @@ -14,10 +14,12 @@ dictionary PerformanceEntryEventInit : EventInit DOMString origin = ""; }; -[Constructor(DOMString type, optional PerformanceEntryEventInit eventInitDict = {}), - ChromeOnly] +[ChromeOnly] interface PerformanceEntryEvent : Event { + constructor(DOMString type, + optional PerformanceEntryEventInit eventInitDict = {}); + readonly attribute DOMString name; readonly attribute DOMString entryType; readonly attribute DOMHighResTimeStamp startTime; diff --git a/dom/webidl/PluginCrashedEvent.webidl b/dom/webidl/PluginCrashedEvent.webidl index 7913757e8698..b937ed8f3839 100644 --- a/dom/webidl/PluginCrashedEvent.webidl +++ b/dom/webidl/PluginCrashedEvent.webidl @@ -4,9 +4,12 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Constructor(DOMString type, optional PluginCrashedEventInit eventInitDict = {}), ChromeOnly] +[ChromeOnly] interface PluginCrashedEvent : Event { + constructor(DOMString type, + optional PluginCrashedEventInit eventInitDict = {}); + readonly attribute unsigned long pluginID; readonly attribute DOMString pluginDumpID; readonly attribute DOMString pluginName; diff --git a/dom/webidl/PointerEvent.webidl b/dom/webidl/PointerEvent.webidl index 39e43d5c51ee..2724c6d926f6 100644 --- a/dom/webidl/PointerEvent.webidl +++ b/dom/webidl/PointerEvent.webidl @@ -9,10 +9,11 @@ interface WindowProxy; -[Pref="dom.w3c_pointer_events.enabled", - Constructor(DOMString type, optional PointerEventInit eventInitDict = {})] +[Pref="dom.w3c_pointer_events.enabled"] interface PointerEvent : MouseEvent { + constructor(DOMString type, optional PointerEventInit eventInitDict = {}); + [NeedsCallerType] readonly attribute long pointerId; diff --git a/dom/webidl/PopStateEvent.webidl b/dom/webidl/PopStateEvent.webidl index 16f5e5204ae7..bbeae0d259a5 100644 --- a/dom/webidl/PopStateEvent.webidl +++ b/dom/webidl/PopStateEvent.webidl @@ -4,9 +4,10 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Constructor(DOMString type, optional PopStateEventInit eventInitDict = {})] interface PopStateEvent : Event { + constructor(DOMString type, optional PopStateEventInit eventInitDict = {}); + readonly attribute any state; }; diff --git a/dom/webidl/PopupBlockedEvent.webidl b/dom/webidl/PopupBlockedEvent.webidl index 308ce1b07bf0..4cf6fe3f1a08 100644 --- a/dom/webidl/PopupBlockedEvent.webidl +++ b/dom/webidl/PopupBlockedEvent.webidl @@ -5,9 +5,11 @@ */ interface URI; -[Constructor(DOMString type, optional PopupBlockedEventInit eventInitDict = {})] interface PopupBlockedEvent : Event { + constructor(DOMString type, + optional PopupBlockedEventInit eventInitDict = {}); + readonly attribute Window? requestingWindow; readonly attribute URI? popupWindowURI; readonly attribute DOMString? popupWindowName; diff --git a/dom/webidl/PresentationConnectionAvailableEvent.webidl b/dom/webidl/PresentationConnectionAvailableEvent.webidl index 9efecb7d6275..e50f0785b21d 100644 --- a/dom/webidl/PresentationConnectionAvailableEvent.webidl +++ b/dom/webidl/PresentationConnectionAvailableEvent.webidl @@ -7,11 +7,12 @@ * https://w3c.github.io/presentation-api/#interface-presentationconnectionavailableevent */ -[Constructor(DOMString type, - PresentationConnectionAvailableEventInit eventInitDict), - Pref="dom.presentation.enabled"] +[Pref="dom.presentation.enabled"] interface PresentationConnectionAvailableEvent : Event { + constructor(DOMString type, + PresentationConnectionAvailableEventInit eventInitDict); + [SameObject] readonly attribute PresentationConnection connection; }; diff --git a/dom/webidl/PresentationConnectionCloseEvent.webidl b/dom/webidl/PresentationConnectionCloseEvent.webidl index da6c25545ef8..6fb837c5f29c 100644 --- a/dom/webidl/PresentationConnectionCloseEvent.webidl +++ b/dom/webidl/PresentationConnectionCloseEvent.webidl @@ -21,11 +21,12 @@ enum PresentationConnectionClosedReason "wentaway" }; -[Constructor(DOMString type, - PresentationConnectionCloseEventInit eventInitDict), - Pref="dom.presentation.enabled"] +[Pref="dom.presentation.enabled"] interface PresentationConnectionCloseEvent : Event { + constructor(DOMString type, + PresentationConnectionCloseEventInit eventInitDict); + readonly attribute PresentationConnectionClosedReason reason; // The message is a human readable description of diff --git a/dom/webidl/ProgressEvent.webidl b/dom/webidl/ProgressEvent.webidl index ddd20f67a391..56b1e72b13a7 100644 --- a/dom/webidl/ProgressEvent.webidl +++ b/dom/webidl/ProgressEvent.webidl @@ -4,10 +4,11 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Constructor(DOMString type, optional ProgressEventInit eventInitDict = {}), - Exposed=(Window,Worker)] +[Exposed=(Window,Worker)] interface ProgressEvent : Event { + constructor(DOMString type, optional ProgressEventInit eventInitDict = {}); + readonly attribute boolean lengthComputable; readonly attribute unsigned long long loaded; readonly attribute unsigned long long total; diff --git a/dom/webidl/PromiseRejectionEvent.webidl b/dom/webidl/PromiseRejectionEvent.webidl index eca0baef72ef..faf99d0df094 100644 --- a/dom/webidl/PromiseRejectionEvent.webidl +++ b/dom/webidl/PromiseRejectionEvent.webidl @@ -4,11 +4,12 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Constructor(DOMString type, PromiseRejectionEventInit eventInitDict), - Exposed=(Window,Worker), +[Exposed=(Window,Worker), Pref="dom.promise_rejection_events.enabled"] interface PromiseRejectionEvent : Event { + constructor(DOMString type, PromiseRejectionEventInit eventInitDict); + [BinaryName="rejectedPromise"] readonly attribute Promise promise; readonly attribute any reason; diff --git a/dom/webidl/PushEvent.webidl b/dom/webidl/PushEvent.webidl index 2abbfc178d9b..6a47e8a62b38 100644 --- a/dom/webidl/PushEvent.webidl +++ b/dom/webidl/PushEvent.webidl @@ -7,10 +7,12 @@ * https://w3c.github.io/push-api/ */ -[Constructor(DOMString type, optional PushEventInit eventInitDict = {}), - Pref="dom.push.enabled", +[Pref="dom.push.enabled", Exposed=ServiceWorker] interface PushEvent : ExtendableEvent { + [Throws] + constructor(DOMString type, optional PushEventInit eventInitDict = {}); + readonly attribute PushMessageData? data; }; diff --git a/dom/webidl/RTCDTMFToneChangeEvent.webidl b/dom/webidl/RTCDTMFToneChangeEvent.webidl index 53f48318b407..94aa903352df 100644 --- a/dom/webidl/RTCDTMFToneChangeEvent.webidl +++ b/dom/webidl/RTCDTMFToneChangeEvent.webidl @@ -7,8 +7,10 @@ * https://www.w3.org/TR/webrtc/#rtcdtmftonechangeevent */ -[Constructor(DOMString type, optional RTCDTMFToneChangeEventInit eventInitDict = {})] interface RTCDTMFToneChangeEvent : Event { + constructor(DOMString type, + optional RTCDTMFToneChangeEventInit eventInitDict = {}); + readonly attribute DOMString tone; }; diff --git a/dom/webidl/RTCDataChannelEvent.webidl b/dom/webidl/RTCDataChannelEvent.webidl index 9eba382439de..f5dbefffd81d 100644 --- a/dom/webidl/RTCDataChannelEvent.webidl +++ b/dom/webidl/RTCDataChannelEvent.webidl @@ -11,8 +11,9 @@ dictionary RTCDataChannelEventInit : EventInit { required RTCDataChannel channel; }; -[Pref="media.peerconnection.enabled", - Constructor(DOMString type, RTCDataChannelEventInit eventInitDict)] +[Pref="media.peerconnection.enabled"] interface RTCDataChannelEvent : Event { - readonly attribute RTCDataChannel channel; + constructor(DOMString type, RTCDataChannelEventInit eventInitDict); + + readonly attribute RTCDataChannel channel; }; diff --git a/dom/webidl/RTCPeerConnectionIceEvent.webidl b/dom/webidl/RTCPeerConnectionIceEvent.webidl index c82c99336503..cb255a2b585a 100644 --- a/dom/webidl/RTCPeerConnectionIceEvent.webidl +++ b/dom/webidl/RTCPeerConnectionIceEvent.webidl @@ -11,9 +11,10 @@ dictionary RTCPeerConnectionIceEventInit : EventInit { RTCIceCandidate? candidate = null; }; -[Pref="media.peerconnection.enabled", - Constructor(DOMString type, - optional RTCPeerConnectionIceEventInit eventInitDict = {})] +[Pref="media.peerconnection.enabled"] interface RTCPeerConnectionIceEvent : Event { + constructor(DOMString type, + optional RTCPeerConnectionIceEventInit eventInitDict = {}); + readonly attribute RTCIceCandidate? candidate; }; diff --git a/dom/webidl/RTCTrackEvent.webidl b/dom/webidl/RTCTrackEvent.webidl index 27da47c6855a..ed4a65b52f5f 100644 --- a/dom/webidl/RTCTrackEvent.webidl +++ b/dom/webidl/RTCTrackEvent.webidl @@ -14,9 +14,10 @@ dictionary RTCTrackEventInit : EventInit { required RTCRtpTransceiver transceiver; }; -[Pref="media.peerconnection.enabled", - Constructor(DOMString type, RTCTrackEventInit eventInitDict)] +[Pref="media.peerconnection.enabled"] interface RTCTrackEvent : Event { + constructor(DOMString type, RTCTrackEventInit eventInitDict); + readonly attribute RTCRtpReceiver receiver; readonly attribute MediaStreamTrack track; diff --git a/dom/webidl/ScrollViewChangeEvent.webidl b/dom/webidl/ScrollViewChangeEvent.webidl index 0c4d481beff3..b0fabafed8d7 100644 --- a/dom/webidl/ScrollViewChangeEvent.webidl +++ b/dom/webidl/ScrollViewChangeEvent.webidl @@ -10,8 +10,10 @@ dictionary ScrollViewChangeEventInit : EventInit { ScrollState state = "started"; }; -[Constructor(DOMString type, optional ScrollViewChangeEventInit eventInit = {}), - ChromeOnly] +[ChromeOnly] interface ScrollViewChangeEvent : Event { + constructor(DOMString type, + optional ScrollViewChangeEventInit eventInit = {}); + readonly attribute ScrollState state; }; diff --git a/dom/webidl/SecurityPolicyViolationEvent.webidl b/dom/webidl/SecurityPolicyViolationEvent.webidl index 8db7d4369eb5..dbd1e0ef5b47 100644 --- a/dom/webidl/SecurityPolicyViolationEvent.webidl +++ b/dom/webidl/SecurityPolicyViolationEvent.webidl @@ -7,9 +7,11 @@ enum SecurityPolicyViolationEventDisposition "enforce", "report" }; -[Constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict = {})] interface SecurityPolicyViolationEvent : Event { + constructor(DOMString type, + optional SecurityPolicyViolationEventInit eventInitDict = {}); + readonly attribute DOMString documentURI; readonly attribute DOMString referrer; readonly attribute DOMString blockedURI; diff --git a/dom/webidl/SpeechRecognitionEvent.webidl b/dom/webidl/SpeechRecognitionEvent.webidl index 72ae49cd9b31..db7b986190cd 100644 --- a/dom/webidl/SpeechRecognitionEvent.webidl +++ b/dom/webidl/SpeechRecognitionEvent.webidl @@ -6,10 +6,12 @@ interface nsISupports; [Pref="media.webspeech.recognition.enable", - Func="SpeechRecognition::IsAuthorized", - Constructor(DOMString type, optional SpeechRecognitionEventInit eventInitDict = {})] + Func="SpeechRecognition::IsAuthorized"] interface SpeechRecognitionEvent : Event { + constructor(DOMString type, + optional SpeechRecognitionEventInit eventInitDict = {}); + readonly attribute unsigned long resultIndex; readonly attribute SpeechRecognitionResultList? results; readonly attribute any interpretation; diff --git a/dom/webidl/SpeechSynthesisErrorEvent.webidl b/dom/webidl/SpeechSynthesisErrorEvent.webidl index 1388755d3139..305f25fd75ad 100644 --- a/dom/webidl/SpeechSynthesisErrorEvent.webidl +++ b/dom/webidl/SpeechSynthesisErrorEvent.webidl @@ -24,9 +24,10 @@ enum SpeechSynthesisErrorCode { "invalid-argument", }; -[Constructor(DOMString type, SpeechSynthesisErrorEventInit eventInitDict), - Pref="media.webspeech.synth.enabled"] +[Pref="media.webspeech.synth.enabled"] interface SpeechSynthesisErrorEvent : SpeechSynthesisEvent { + constructor(DOMString type, SpeechSynthesisErrorEventInit eventInitDict); + readonly attribute SpeechSynthesisErrorCode error; }; diff --git a/dom/webidl/SpeechSynthesisEvent.webidl b/dom/webidl/SpeechSynthesisEvent.webidl index 310ad6867d11..90b8c1c9e6db 100644 --- a/dom/webidl/SpeechSynthesisEvent.webidl +++ b/dom/webidl/SpeechSynthesisEvent.webidl @@ -10,10 +10,11 @@ * liability, trademark and document use rules apply. */ -[Constructor(DOMString type, SpeechSynthesisEventInit eventInitDict), - Pref="media.webspeech.synth.enabled"] +[Pref="media.webspeech.synth.enabled"] interface SpeechSynthesisEvent : Event { + constructor(DOMString type, SpeechSynthesisEventInit eventInitDict); + readonly attribute SpeechSynthesisUtterance utterance; readonly attribute unsigned long charIndex; readonly attribute unsigned long? charLength; diff --git a/dom/webidl/StorageEvent.webidl b/dom/webidl/StorageEvent.webidl index 038cc31f6dad..45cab9245786 100644 --- a/dom/webidl/StorageEvent.webidl +++ b/dom/webidl/StorageEvent.webidl @@ -10,9 +10,10 @@ * Event sent to a window when a storage area changes. */ -[Constructor(DOMString type, optional StorageEventInit eventInitDict = {})] interface StorageEvent : Event { + constructor(DOMString type, optional StorageEventInit eventInitDict = {}); + readonly attribute DOMString? key; readonly attribute DOMString? oldValue; readonly attribute DOMString? newValue; diff --git a/dom/webidl/StreamFilterDataEvent.webidl b/dom/webidl/StreamFilterDataEvent.webidl index d9bb7b6e0306..06a28f506140 100644 --- a/dom/webidl/StreamFilterDataEvent.webidl +++ b/dom/webidl/StreamFilterDataEvent.webidl @@ -11,10 +11,12 @@ * any standard. */ -[Constructor(DOMString type, optional StreamFilterDataEventInit eventInitDict = {}), - Func="mozilla::extensions::StreamFilter::IsAllowedInContext", +[Func="mozilla::extensions::StreamFilter::IsAllowedInContext", Exposed=Window] interface StreamFilterDataEvent : Event { + constructor(DOMString type, + optional StreamFilterDataEventInit eventInitDict = {}); + /** * Contains a chunk of data read from the input stream. */ diff --git a/dom/webidl/StyleRuleChangeEvent.webidl b/dom/webidl/StyleRuleChangeEvent.webidl index 53b487e5e355..83399fcac18b 100644 --- a/dom/webidl/StyleRuleChangeEvent.webidl +++ b/dom/webidl/StyleRuleChangeEvent.webidl @@ -3,9 +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/. */ -[ChromeOnly, Constructor(DOMString type, optional StyleRuleChangeEventInit eventInitDict = {})] +[ChromeOnly] interface StyleRuleChangeEvent : Event { + constructor(DOMString type, + optional StyleRuleChangeEventInit eventInitDict = {}); + readonly attribute CSSStyleSheet? stylesheet; readonly attribute CSSRule? rule; }; diff --git a/dom/webidl/StyleSheetApplicableStateChangeEvent.webidl b/dom/webidl/StyleSheetApplicableStateChangeEvent.webidl index 017693d755c2..286ee26aca08 100644 --- a/dom/webidl/StyleSheetApplicableStateChangeEvent.webidl +++ b/dom/webidl/StyleSheetApplicableStateChangeEvent.webidl @@ -4,9 +4,12 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[ChromeOnly, Constructor(DOMString type, optional StyleSheetApplicableStateChangeEventInit eventInitDict = {})] +[ChromeOnly] interface StyleSheetApplicableStateChangeEvent : Event { + constructor(DOMString type, + optional StyleSheetApplicableStateChangeEventInit eventInitDict = {}); + readonly attribute CSSStyleSheet? stylesheet; readonly attribute boolean applicable; }; diff --git a/dom/webidl/StyleSheetChangeEvent.webidl b/dom/webidl/StyleSheetChangeEvent.webidl index 89a54879f77f..f1d8f1bd5bf7 100644 --- a/dom/webidl/StyleSheetChangeEvent.webidl +++ b/dom/webidl/StyleSheetChangeEvent.webidl @@ -4,9 +4,12 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[ChromeOnly, Constructor(DOMString type, optional StyleSheetChangeEventInit eventInitDict = {})] +[ChromeOnly] interface StyleSheetChangeEvent : Event { + constructor(DOMString type, + optional StyleSheetChangeEventInit eventInitDict = {}); + readonly attribute CSSStyleSheet? stylesheet; readonly attribute boolean documentSheet; }; diff --git a/dom/webidl/TCPServerSocketEvent.webidl b/dom/webidl/TCPServerSocketEvent.webidl index 16cd3cfc8d18..23f502deb83b 100644 --- a/dom/webidl/TCPServerSocketEvent.webidl +++ b/dom/webidl/TCPServerSocketEvent.webidl @@ -3,10 +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/. */ -[Constructor(DOMString type, optional TCPServerSocketEventInit eventInitDict = {}), - Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist", +[Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist", Exposed=Window] interface TCPServerSocketEvent : Event { + constructor(DOMString type, + optional TCPServerSocketEventInit eventInitDict = {}); + readonly attribute TCPSocket socket; }; diff --git a/dom/webidl/TCPSocketErrorEvent.webidl b/dom/webidl/TCPSocketErrorEvent.webidl index 6533472d879d..d47656cd6c01 100644 --- a/dom/webidl/TCPSocketErrorEvent.webidl +++ b/dom/webidl/TCPSocketErrorEvent.webidl @@ -9,10 +9,12 @@ * - if there's an error connecting to the host */ -[Constructor(DOMString type, optional TCPSocketErrorEventInit eventInitDict = {}), - Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist", +[Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist", Exposed=Window] interface TCPSocketErrorEvent : Event { + constructor(DOMString type, + optional TCPSocketErrorEventInit eventInitDict = {}); + readonly attribute DOMString name; readonly attribute DOMString message; }; diff --git a/dom/webidl/TCPSocketEvent.webidl b/dom/webidl/TCPSocketEvent.webidl index c252d1eadd3d..408a3938ade5 100644 --- a/dom/webidl/TCPSocketEvent.webidl +++ b/dom/webidl/TCPSocketEvent.webidl @@ -9,10 +9,11 @@ * the type of event, and the data associated with the event if the event is a "data" event. */ -[Constructor(DOMString type, optional TCPSocketEventInit eventInitDict = {}), - Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist", +[Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist", Exposed=Window] interface TCPSocketEvent : Event { + constructor(DOMString type, optional TCPSocketEventInit eventInitDict = {}); + /** * If the event is a "data" event, data will be the bytes read from the network; * if the binaryType of the socket was "arraybuffer", this value will be of type diff --git a/dom/webidl/TouchEvent.webidl b/dom/webidl/TouchEvent.webidl index 49c524c33b7c..f52e0394397f 100644 --- a/dom/webidl/TouchEvent.webidl +++ b/dom/webidl/TouchEvent.webidl @@ -10,9 +10,10 @@ dictionary TouchEventInit : EventModifierInit { sequence changedTouches = []; }; -[Constructor(DOMString type, optional TouchEventInit eventInitDict = {}), - Func="mozilla::dom::TouchEvent::PrefEnabled"] +[Func="mozilla::dom::TouchEvent::PrefEnabled"] interface TouchEvent : UIEvent { + constructor(DOMString type, optional TouchEventInit eventInitDict = {}); + readonly attribute TouchList touches; readonly attribute TouchList targetTouches; readonly attribute TouchList changedTouches; diff --git a/dom/webidl/TrackEvent.webidl b/dom/webidl/TrackEvent.webidl index 3cd6427b0c13..5900a4a25c9b 100644 --- a/dom/webidl/TrackEvent.webidl +++ b/dom/webidl/TrackEvent.webidl @@ -7,9 +7,10 @@ * http://www.whatwg.org/specs/web-apps/current-work/#trackevent */ -[Constructor(DOMString type, optional TrackEventInit eventInitDict = {})] interface TrackEvent : Event { + constructor(DOMString type, optional TrackEventInit eventInitDict = {}); + readonly attribute (VideoTrack or AudioTrack or TextTrack)? track; }; diff --git a/dom/webidl/TransitionEvent.webidl b/dom/webidl/TransitionEvent.webidl index 2a017361890e..f25d61dc0cc4 100644 --- a/dom/webidl/TransitionEvent.webidl +++ b/dom/webidl/TransitionEvent.webidl @@ -11,8 +11,9 @@ * liability, trademark and document use rules apply. */ -[Constructor(DOMString type, optional TransitionEventInit eventInitDict = {})] interface TransitionEvent : Event { + constructor(DOMString type, optional TransitionEventInit eventInitDict = {}); + readonly attribute DOMString propertyName; readonly attribute float elapsedTime; readonly attribute DOMString pseudoElement; diff --git a/dom/webidl/UDPMessageEvent.webidl b/dom/webidl/UDPMessageEvent.webidl index b26a1ae10afc..100b2921c3c4 100644 --- a/dom/webidl/UDPMessageEvent.webidl +++ b/dom/webidl/UDPMessageEvent.webidl @@ -8,10 +8,12 @@ */ //Bug 1056444: This interface should be removed after UDPSocket.input/UDPSocket.output are ready. -[Constructor(DOMString type, optional UDPMessageEventInit eventInitDict = {}), - Pref="dom.udpsocket.enabled", +[Pref="dom.udpsocket.enabled", ChromeOnly] interface UDPMessageEvent : Event { + constructor(DOMString type, + optional UDPMessageEventInit eventInitDict = {}); + readonly attribute DOMString remoteAddress; readonly attribute unsigned short remotePort; readonly attribute any data; diff --git a/dom/webidl/UIEvent.webidl b/dom/webidl/UIEvent.webidl index c0197e860229..c9621398a015 100644 --- a/dom/webidl/UIEvent.webidl +++ b/dom/webidl/UIEvent.webidl @@ -10,9 +10,10 @@ * liability, trademark and document use rules apply. */ -[Constructor(DOMString type, optional UIEventInit eventInitDict = {})] interface UIEvent : Event { + constructor(DOMString type, optional UIEventInit eventInitDict = {}); + readonly attribute WindowProxy? view; readonly attribute long detail; void initUIEvent(DOMString aType, diff --git a/dom/webidl/UserProximityEvent.webidl b/dom/webidl/UserProximityEvent.webidl index 9694480a33b2..d1910f10a517 100644 --- a/dom/webidl/UserProximityEvent.webidl +++ b/dom/webidl/UserProximityEvent.webidl @@ -4,10 +4,13 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -[Pref="device.sensors.proximity.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled", Constructor(DOMString type, optional UserProximityEventInit eventInitDict = {})] +[Pref="device.sensors.proximity.enabled", Func="nsGlobalWindowInner::DeviceSensorsEnabled"] interface UserProximityEvent : Event { - readonly attribute boolean near; + constructor(DOMString type, + optional UserProximityEventInit eventInitDict = {}); + + readonly attribute boolean near; }; dictionary UserProximityEventInit : EventInit diff --git a/dom/webidl/VRDisplayEvent.webidl b/dom/webidl/VRDisplayEvent.webidl index 83d39e7cb73d..f7850881a22e 100644 --- a/dom/webidl/VRDisplayEvent.webidl +++ b/dom/webidl/VRDisplayEvent.webidl @@ -15,9 +15,10 @@ dictionary VRDisplayEventInit : EventInit { VRDisplayEventReason reason; }; -[Pref="dom.vr.enabled", - Constructor(DOMString type, VRDisplayEventInit eventInitDict)] +[Pref="dom.vr.enabled"] interface VRDisplayEvent : Event { + constructor(DOMString type, VRDisplayEventInit eventInitDict); + readonly attribute VRDisplay display; readonly attribute VRDisplayEventReason? reason; }; diff --git a/dom/webidl/WebGLContextEvent.webidl b/dom/webidl/WebGLContextEvent.webidl index cfaea2de8c16..02fd9b4fa194 100644 --- a/dom/webidl/WebGLContextEvent.webidl +++ b/dom/webidl/WebGLContextEvent.webidl @@ -7,10 +7,11 @@ * https://www.khronos.org/registry/webgl/specs/latest/1.0/#fire-a-webgl-context-event */ -[Constructor(DOMString type, optional WebGLContextEventInit eventInit = {}), - Exposed=(Window,Worker), +[Exposed=(Window,Worker), Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"] interface WebGLContextEvent : Event { + constructor(DOMString type, optional WebGLContextEventInit eventInit = {}); + readonly attribute DOMString statusMessage; }; diff --git a/dom/webidl/WheelEvent.webidl b/dom/webidl/WheelEvent.webidl index 039e81cf0364..6a541b257165 100644 --- a/dom/webidl/WheelEvent.webidl +++ b/dom/webidl/WheelEvent.webidl @@ -10,9 +10,10 @@ * liability, trademark and document use rules apply. */ -[Constructor(DOMString type, optional WheelEventInit eventInitDict = {})] interface WheelEvent : MouseEvent { + constructor(DOMString type, optional WheelEventInit eventInitDict = {}); + const unsigned long DOM_DELTA_PIXEL = 0x00; const unsigned long DOM_DELTA_LINE = 0x01; const unsigned long DOM_DELTA_PAGE = 0x02; diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 895b6609d7e3..6cb9c3778d38 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -4746,7 +4746,7 @@ bool WorkerPrivate::ConnectMessagePort( } RefPtr event = MessageEvent::Constructor( - globalObject, NS_LITERAL_STRING("connect"), init, rv); + globalObject, NS_LITERAL_STRING("connect"), init); event->SetTrusted(true); diff --git a/toolkit/components/extensions/webrequest/StreamFilterEvents.h b/toolkit/components/extensions/webrequest/StreamFilterEvents.h index 58222e150dd4..5d929818b54d 100644 --- a/toolkit/components/extensions/webrequest/StreamFilterEvents.h +++ b/toolkit/components/extensions/webrequest/StreamFilterEvents.h @@ -40,7 +40,7 @@ class StreamFilterDataEvent : public Event { static already_AddRefed Constructor( GlobalObject& aGlobal, const nsAString& aType, - const StreamFilterDataEventInit& aParam, ErrorResult& aRv) { + const StreamFilterDataEventInit& aParam) { nsCOMPtr target = do_QueryInterface(aGlobal.GetAsSupports()); return Constructor(target, aType, aParam); }