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
This commit is contained in:
Boris Zbarsky 2019-09-11 14:35:28 +00:00
Родитель 122af58092
Коммит 14c30e58d6
135 изменённых файлов: 389 добавлений и 287 удалений

Просмотреть файл

@ -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)

Просмотреть файл

@ -26,7 +26,7 @@ AnimationEvent::AnimationEvent(EventTarget* aOwner, nsPresContext* aPresContext,
// static
already_AddRefed<AnimationEvent> AnimationEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const AnimationEventInit& aParam, ErrorResult& aRv) {
const AnimationEventInit& aParam) {
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<AnimationEvent> e = new AnimationEvent(t, nullptr, nullptr);
bool trusted = e->Init(t);

Просмотреть файл

@ -23,7 +23,7 @@ class AnimationEvent : public Event {
static already_AddRefed<AnimationEvent> Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const AnimationEventInit& aParam, ErrorResult& aRv);
const AnimationEventInit& aParam);
virtual JSObject* WrapObjectInternal(
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {

Просмотреть файл

@ -39,7 +39,7 @@ CompositionEvent::CompositionEvent(EventTarget* aOwner,
// static
already_AddRefed<CompositionEvent> CompositionEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const CompositionEventInit& aParam, ErrorResult& aRv) {
const CompositionEventInit& aParam) {
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<CompositionEvent> e = new CompositionEvent(t, nullptr, nullptr);
bool trusted = e->Init(t);

Просмотреть файл

@ -28,7 +28,7 @@ class CompositionEvent : public UIEvent {
static already_AddRefed<CompositionEvent> Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const CompositionEventInit& aParam, ErrorResult& aRv);
const CompositionEventInit& aParam);
virtual JSObject* WrapObjectInternal(
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {

Просмотреть файл

@ -44,7 +44,7 @@ NS_INTERFACE_MAP_END_INHERITING(Event)
already_AddRefed<CustomEvent> CustomEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const CustomEventInit& aParam, ErrorResult& aRv) {
const CustomEventInit& aParam) {
nsCOMPtr<mozilla::dom::EventTarget> t =
do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<CustomEvent> e = new CustomEvent(t, nullptr, nullptr);

Просмотреть файл

@ -30,7 +30,7 @@ class CustomEvent final : public Event {
static already_AddRefed<CustomEvent> Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const CustomEventInit& aParam, ErrorResult& aRv);
const CustomEventInit& aParam);
virtual JSObject* WrapObjectInternal(
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;

Просмотреть файл

@ -67,7 +67,7 @@ void DeviceMotionEvent::InitDeviceMotionEvent(
already_AddRefed<DeviceMotionEvent> DeviceMotionEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const DeviceMotionEventInit& aEventInitDict, ErrorResult& aRv) {
const DeviceMotionEventInit& aEventInitDict) {
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<DeviceMotionEvent> e = new DeviceMotionEvent(t, nullptr, nullptr);
e->InitEvent(aType, aEventInitDict.mBubbles, aEventInitDict.mCancelable);

Просмотреть файл

@ -110,7 +110,7 @@ class DeviceMotionEvent final : public Event {
static already_AddRefed<DeviceMotionEvent> Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const DeviceMotionEventInit& aEventInitDict, ErrorResult& aRv);
const DeviceMotionEventInit& aEventInitDict);
protected:
~DeviceMotionEvent() {}

Просмотреть файл

@ -70,10 +70,9 @@ DataTransfer* DragEvent::GetDataTransfer() {
}
// static
already_AddRefed<DragEvent> DragEvent::Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const DragEventInit& aParam,
ErrorResult& aRv) {
already_AddRefed<DragEvent> DragEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const DragEventInit& aParam) {
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<DragEvent> e = new DragEvent(t, nullptr, nullptr);
bool trusted = e->Init(t);

Просмотреть файл

@ -41,8 +41,7 @@ class DragEvent : public MouseEvent {
static already_AddRefed<DragEvent> Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const DragEventInit& aParam,
ErrorResult& aRv);
const DragEventInit& aParam);
protected:
~DragEvent() {}

Просмотреть файл

@ -314,8 +314,7 @@ bool Event::Init(mozilla::dom::EventTarget* aGlobal) {
// static
already_AddRefed<Event> Event::Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const EventInit& aParam,
ErrorResult& aRv) {
const EventInit& aParam) {
nsCOMPtr<mozilla::dom::EventTarget> t =
do_QueryInterface(aGlobal.GetAsSupports());
return Constructor(t, aType, aParam);

Просмотреть файл

@ -166,8 +166,7 @@ class Event : public nsISupports, public nsWrapperCache {
static already_AddRefed<Event> Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const EventInit& aParam,
ErrorResult& aRv);
const EventInit& aParam);
void GetType(nsAString& aType) const;

Просмотреть файл

@ -39,7 +39,7 @@ void FocusEvent::InitFocusEvent(const nsAString& aType, bool aCanBubble,
already_AddRefed<FocusEvent> FocusEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const FocusEventInit& aParam, ErrorResult& aRv) {
const FocusEventInit& aParam) {
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<FocusEvent> e = new FocusEvent(t, nullptr, nullptr);
bool trusted = e->Init(t);

Просмотреть файл

@ -29,8 +29,7 @@ class FocusEvent : public UIEvent {
static already_AddRefed<FocusEvent> Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const FocusEventInit& aParam,
ErrorResult& aRv);
const FocusEventInit& aParam);
protected:
~FocusEvent() {}

Просмотреть файл

@ -79,7 +79,7 @@ bool InputEvent::IsComposing() {
already_AddRefed<InputEvent> InputEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const InputEventInit& aParam, ErrorResult& aRv) {
const InputEventInit& aParam) {
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<InputEvent> e = new InputEvent(t, nullptr, nullptr);
bool trusted = e->Init(t);

Просмотреть файл

@ -25,8 +25,7 @@ class InputEvent : public UIEvent {
static already_AddRefed<InputEvent> Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const InputEventInit& aParam,
ErrorResult& aRv);
const InputEventInit& aParam);
virtual JSObject* WrapObjectInternal(
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {

Просмотреть файл

@ -273,18 +273,17 @@ uint32_t KeyboardEvent::Location() {
// static
already_AddRefed<KeyboardEvent> KeyboardEvent::ConstructorJS(
const GlobalObject& aGlobal, const nsAString& aType,
const KeyboardEventInit& aParam, ErrorResult& aRv) {
const KeyboardEventInit& aParam) {
nsCOMPtr<EventTarget> target = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<KeyboardEvent> 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;

Просмотреть файл

@ -26,7 +26,7 @@ class KeyboardEvent : public UIEvent {
static already_AddRefed<KeyboardEvent> ConstructorJS(
const GlobalObject& aGlobal, const nsAString& aType,
const KeyboardEventInit& aParam, ErrorResult& aRv);
const KeyboardEventInit& aParam);
virtual JSObject* WrapObjectInternal(
JSContext* aCx, JS::Handle<JSObject*> 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.

Просмотреть файл

@ -86,7 +86,7 @@ void MessageEvent::GetSource(
/* static */
already_AddRefed<MessageEvent> MessageEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const MessageEventInit& aParam, ErrorResult& aRv) {
const MessageEventInit& aParam) {
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
return Constructor(t, aType, aParam);
}

Просмотреть файл

@ -50,7 +50,7 @@ class MessageEvent final : public Event {
static already_AddRefed<MessageEvent> Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const MessageEventInit& aEventInit, ErrorResult& aRv);
const MessageEventInit& aEventInit);
static already_AddRefed<MessageEvent> Constructor(
EventTarget* aEventTarget, const nsAString& aType,

Просмотреть файл

@ -120,7 +120,7 @@ void MouseEvent::InitializeExtraMouseEventDictionaryMembers(
already_AddRefed<MouseEvent> MouseEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const MouseEventInit& aParam, ErrorResult& aRv) {
const MouseEventInit& aParam) {
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<MouseEvent> e = new MouseEvent(t, nullptr, nullptr);
bool trusted = e->Init(t);

Просмотреть файл

@ -64,8 +64,7 @@ class MouseEvent : public UIEvent {
}
static already_AddRefed<MouseEvent> 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;

Просмотреть файл

@ -112,7 +112,7 @@ already_AddRefed<PointerEvent> PointerEvent::Constructor(
// static
already_AddRefed<PointerEvent> PointerEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const PointerEventInit& aParam, ErrorResult& aRv) {
const PointerEventInit& aParam) {
nsCOMPtr<EventTarget> owner = do_QueryInterface(aGlobal.GetAsSupports());
return Constructor(owner, aType, aParam);
}

Просмотреть файл

@ -32,7 +32,7 @@ class PointerEvent : public MouseEvent {
static already_AddRefed<PointerEvent> Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const PointerEventInit& aParam, ErrorResult& aRv);
const PointerEventInit& aParam);
static already_AddRefed<PointerEvent> Constructor(
EventTarget* aOwner, const nsAString& aType,

Просмотреть файл

@ -60,7 +60,7 @@ already_AddRefed<StorageEvent> StorageEvent::Constructor(
already_AddRefed<StorageEvent> StorageEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const StorageEventInit& aEventInitDict, ErrorResult& aRv) {
const StorageEventInit& aEventInitDict) {
nsCOMPtr<EventTarget> owner = do_QueryInterface(aGlobal.GetAsSupports());
return Constructor(owner, aType, aEventInitDict);
}

Просмотреть файл

@ -49,7 +49,7 @@ class StorageEvent : public Event {
static already_AddRefed<StorageEvent> 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,

Просмотреть файл

@ -303,7 +303,7 @@ bool TouchEvent::LegacyAPIEnabled(nsIDocShell* aDocShell,
// static
already_AddRefed<TouchEvent> TouchEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const TouchEventInit& aParam, ErrorResult& aRv) {
const TouchEventInit& aParam) {
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<TouchEvent> e = new TouchEvent(t, nullptr, nullptr);
bool trusted = e->Init(t);

Просмотреть файл

@ -102,8 +102,7 @@ class TouchEvent : public UIEvent {
static already_AddRefed<TouchEvent> Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const TouchEventInit& aParam,
ErrorResult& aRv);
const TouchEventInit& aParam);
protected:
~TouchEvent() {}

Просмотреть файл

@ -27,7 +27,7 @@ TransitionEvent::TransitionEvent(EventTarget* aOwner,
// static
already_AddRefed<TransitionEvent> TransitionEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const TransitionEventInit& aParam, ErrorResult& aRv) {
const TransitionEventInit& aParam) {
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<TransitionEvent> e = new TransitionEvent(t, nullptr, nullptr);
bool trusted = e->Init(t);

Просмотреть файл

@ -23,7 +23,7 @@ class TransitionEvent : public Event {
static already_AddRefed<TransitionEvent> Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const TransitionEventInit& aParam, ErrorResult& aRv);
const TransitionEventInit& aParam);
virtual JSObject* WrapObjectInternal(
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {

Просмотреть файл

@ -73,8 +73,7 @@ UIEvent::UIEvent(EventTarget* aOwner, nsPresContext* aPresContext,
// static
already_AddRefed<UIEvent> UIEvent::Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const UIEventInit& aParam,
ErrorResult& aRv) {
const UIEventInit& aParam) {
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<UIEvent> e = new UIEvent(t, nullptr, nullptr);
bool trusted = e->Init(t);

Просмотреть файл

@ -36,8 +36,7 @@ class UIEvent : public Event {
static already_AddRefed<UIEvent> Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const UIEventInit& aParam,
ErrorResult& aRv);
const UIEventInit& aParam);
virtual JSObject* WrapObjectInternal(
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {

Просмотреть файл

@ -84,7 +84,7 @@ uint32_t WheelEvent::DeltaMode() { return mEvent->AsWheelEvent()->mDeltaMode; }
already_AddRefed<WheelEvent> WheelEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const WheelEventInit& aParam, ErrorResult& aRv) {
const WheelEventInit& aParam) {
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<WheelEvent> e = new WheelEvent(t, nullptr, nullptr);
bool trusted = e->Init(t);

Просмотреть файл

@ -23,8 +23,7 @@ class WheelEvent : public MouseEvent {
static already_AddRefed<WheelEvent> Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const WheelEventInit& aParam,
ErrorResult& aRv);
const WheelEventInit& aParam);
virtual JSObject* WrapObjectInternal(
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {

Просмотреть файл

@ -63,7 +63,7 @@ already_AddRefed<IDBVersionChangeEvent> IDBVersionChangeEvent::CreateInternal(
already_AddRefed<IDBVersionChangeEvent> IDBVersionChangeEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const IDBVersionChangeEventInit& aOptions, ErrorResult& aRv) {
const IDBVersionChangeEventInit& aOptions) {
nsCOMPtr<EventTarget> target = do_QueryInterface(aGlobal.GetAsSupports());
return CreateInternal(target, aType, aOptions.mOldVersion,

Просмотреть файл

@ -74,7 +74,7 @@ class IDBVersionChangeEvent final : public Event {
static already_AddRefed<IDBVersionChangeEvent> Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const IDBVersionChangeEventInit& aOptions, ErrorResult& aRv);
const IDBVersionChangeEventInit& aOptions);
uint64_t OldVersion() const { return mOldVersion; }

Просмотреть файл

@ -34,7 +34,7 @@ class NotificationEvent final : public ExtendableEvent {
static already_AddRefed<NotificationEvent> Constructor(
mozilla::dom::EventTarget* aOwner, const nsAString& aType,
const NotificationEventInit& aOptions, ErrorResult& aRv) {
const NotificationEventInit& aOptions) {
RefPtr<NotificationEvent> 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<NotificationEvent> Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const NotificationEventInit& aOptions, ErrorResult& aRv) {
const NotificationEventInit& aOptions) {
nsCOMPtr<EventTarget> owner = do_QueryInterface(aGlobal.GetAsSupports());
return Constructor(owner, aType, aOptions, aRv);
return Constructor(owner, aType, aOptions);
}
already_AddRefed<Notification> Notification_() {

Просмотреть файл

@ -52,7 +52,7 @@ PaymentMethodChangeEvent::Constructor(
already_AddRefed<PaymentMethodChangeEvent>
PaymentMethodChangeEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const PaymentMethodChangeEventInit& aEventInitDict, ErrorResult& aRv) {
const PaymentMethodChangeEventInit& aEventInitDict) {
nsCOMPtr<mozilla::dom::EventTarget> owner =
do_QueryInterface(aGlobal.GetAsSupports());
RefPtr<PaymentMethodChangeEvent> e = new PaymentMethodChangeEvent(owner);

Просмотреть файл

@ -35,7 +35,7 @@ class PaymentMethodChangeEvent final : public PaymentRequestUpdateEvent {
// Called by WebIDL constructor
static already_AddRefed<PaymentMethodChangeEvent> Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const PaymentMethodChangeEventInit& aEventInitDict, ErrorResult& aRv);
const PaymentMethodChangeEventInit& aEventInitDict);
void GetMethodName(nsAString& aMethodName);
void SetMethodName(const nsAString& aMethodName);

Просмотреть файл

@ -36,7 +36,7 @@ PaymentRequestUpdateEvent::Constructor(
already_AddRefed<PaymentRequestUpdateEvent>
PaymentRequestUpdateEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const PaymentRequestUpdateEventInit& aEventInitDict, ErrorResult& aRv) {
const PaymentRequestUpdateEventInit& aEventInitDict) {
nsCOMPtr<mozilla::dom::EventTarget> owner =
do_QueryInterface(aGlobal.GetAsSupports());
return Constructor(owner, aType, aEventInitDict);

Просмотреть файл

@ -41,7 +41,7 @@ class PaymentRequestUpdateEvent : public Event, public PromiseNativeHandler {
// Called by WebIDL constructor
static already_AddRefed<PaymentRequestUpdateEvent> Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const PaymentRequestUpdateEventInit& aEventInitDict, ErrorResult& aRv);
const PaymentRequestUpdateEventInit& aEventInitDict);
void UpdateWith(Promise& aPromise, ErrorResult& aRv);

Просмотреть файл

@ -150,7 +150,7 @@ void FetchEvent::PostInit(const nsACString& aScriptSpec,
/*static*/
already_AddRefed<FetchEvent> FetchEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const FetchEventInit& aOptions, ErrorResult& aRv) {
const FetchEventInit& aOptions) {
RefPtr<EventTarget> owner = do_QueryObject(aGlobal.GetAsSupports());
MOZ_ASSERT(owner);
RefPtr<FetchEvent> e = new FetchEvent(owner);
@ -1203,15 +1203,15 @@ void ExtendableMessageEvent::GetSource(
/* static */
already_AddRefed<ExtendableMessageEvent> ExtendableMessageEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const ExtendableMessageEventInit& aOptions, ErrorResult& aRv) {
const ExtendableMessageEventInit& aOptions) {
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
return Constructor(t, aType, aOptions, aRv);
return Constructor(t, aType, aOptions);
}
/* static */
already_AddRefed<ExtendableMessageEvent> ExtendableMessageEvent::Constructor(
mozilla::dom::EventTarget* aEventTarget, const nsAString& aType,
const ExtendableMessageEventInit& aOptions, ErrorResult& aRv) {
const ExtendableMessageEventInit& aOptions) {
RefPtr<ExtendableMessageEvent> event =
new ExtendableMessageEvent(aEventTarget);

Просмотреть файл

@ -101,7 +101,7 @@ class ExtendableEvent : public Event {
static already_AddRefed<ExtendableEvent> Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const EventInit& aOptions, ErrorResult& aRv) {
const EventInit& aOptions) {
nsCOMPtr<EventTarget> target = do_QueryInterface(aGlobal.GetAsSupports());
return Constructor(target, aType, aOptions);
}
@ -148,7 +148,7 @@ class FetchEvent final : public ExtendableEvent {
static already_AddRefed<FetchEvent> 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<ExtendableMessageEvent> Constructor(
mozilla::dom::EventTarget* aOwner, const nsAString& aType,
const ExtendableMessageEventInit& aOptions, ErrorResult& aRv);
const ExtendableMessageEventInit& aOptions);
static already_AddRefed<ExtendableMessageEvent> Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const ExtendableMessageEventInit& aOptions, ErrorResult& aRv);
const ExtendableMessageEventInit& aOptions);
void GetData(JSContext* aCx, JS::MutableHandle<JS::Value> aData,
ErrorResult& aRv);

Просмотреть файл

@ -881,11 +881,7 @@ class NotificationEventOp : public ExtendableEventOp,
init.mCancelable = false;
RefPtr<NotificationEvent> 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<OwningNonNull<MessagePort>> 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<EventTarget> target = aWorkerPrivate->GlobalScope();
RefPtr<ExtendableMessageEvent> 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 = 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);

Просмотреть файл

@ -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<EventTarget> target = aWorkerPrivate->GlobalScope();
RefPtr<ExtendableMessageEvent> 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<NotificationEvent> 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<FetchEvent> event = FetchEvent::Constructor(
globalObj, NS_LITERAL_STRING("fetch"), init, result);
if (NS_WARN_IF(result.Failed())) {
result.SuppressException();
return false;
}
RefPtr<FetchEvent> event =
FetchEvent::Constructor(globalObj, NS_LITERAL_STRING("fetch"), init);
event->PostInit(mInterceptedChannel, mRegistration, mScriptSpec);
event->SetTrusted(true);

Просмотреть файл

@ -58,7 +58,7 @@ already_AddRefed<VRDisplayEvent> VRDisplayEvent::Constructor(
already_AddRefed<VRDisplayEvent> VRDisplayEvent::Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const VRDisplayEventInit& aEventInitDict, ErrorResult& aRv) {
const VRDisplayEventInit& aEventInitDict) {
nsCOMPtr<mozilla::dom::EventTarget> owner =
do_QueryInterface(aGlobal.GetAsSupports());
return Constructor(owner, aType, aEventInitDict);

Просмотреть файл

@ -51,7 +51,7 @@ class VRDisplayEvent final : public Event {
static already_AddRefed<VRDisplayEvent> Constructor(
const GlobalObject& aGlobal, const nsAString& aType,
const VRDisplayEventInit& aEventInitDict, ErrorResult& aRv);
const VRDisplayEventInit& aEventInitDict);
};
} // namespace dom

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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.

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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,

Просмотреть файл

@ -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;

Просмотреть файл

@ -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"]

Просмотреть файл

@ -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<any> p);

Просмотреть файл

@ -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.
*/

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -14,8 +14,10 @@ dictionary FontFaceSetLoadEventInit : EventInit {
sequence<FontFace> 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<FontFace> fontfaces;
};

Просмотреть файл

@ -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;

Просмотреть файл

@ -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.
*/

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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;

Просмотреть файл

@ -1,8 +1,10 @@
interface PluginTag;
[Constructor(DOMString type, optional HiddenPluginEventInit eventInit = {}), ChromeOnly]
[ChromeOnly]
interface HiddenPluginEvent : Event
{
constructor(DOMString type, optional HiddenPluginEventInit eventInit = {});
readonly attribute PluginTag? tag;
};

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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"]

Просмотреть файл

@ -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,

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -14,8 +14,9 @@ dictionary MediaRecorderErrorEventInit : EventInit {
required DOMException error;
};
[Exposed=Window,
Constructor(DOMString type, MediaRecorderErrorEventInit eventInitDict)]
[Exposed=Window]
interface MediaRecorderErrorEvent : Event {
constructor(DOMString type, MediaRecorderErrorEventInit eventInitDict);
[SameObject] readonly attribute DOMException error;
};

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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]

Просмотреть файл

@ -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.
*/

Просмотреть файл

@ -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]

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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 {
constructor(DOMString type, OfflineAudioCompletionEventInit eventInitDict);
readonly attribute AudioBuffer renderedBuffer;
};

Просмотреть файл

@ -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

Просмотреть файл

@ -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;
};

Просмотреть файл

@ -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<PaymentDetailsUpdate> detailsPromise);
};

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше