diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 1a8c1c6ee..8d2345d4b 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -4705,6 +4705,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent; createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent; createEvent(eventInterface: "StorageEvent"): StorageEvent; + createEvent(eventInterface: "SubmitEvent"): SubmitEvent; createEvent(eventInterface: "TextEvent"): TextEvent; createEvent(eventInterface: "TouchEvent"): TouchEvent; createEvent(eventInterface: "TrackEvent"): TrackEvent; @@ -4949,6 +4950,7 @@ interface DocumentEvent { createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent; createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent; createEvent(eventInterface: "StorageEvent"): StorageEvent; + createEvent(eventInterface: "SubmitEvent"): SubmitEvent; createEvent(eventInterface: "TextEvent"): TextEvent; createEvent(eventInterface: "TouchEvent"): TouchEvent; createEvent(eventInterface: "TrackEvent"): TrackEvent; @@ -5761,7 +5763,7 @@ interface GlobalEventHandlersEventMap { "selectionchange": Event; "selectstart": Event; "stalled": Event; - "submit": Event; + "submit": SubmitEvent; "suspend": Event; "timeupdate": Event; "toggle": Event; @@ -6013,7 +6015,7 @@ interface GlobalEventHandlers { * @param ev The event. */ onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null; - onsubmit: ((this: GlobalEventHandlers, ev: Event) => any) | null; + onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null; /** * Occurs if the load operation has been intentionally halted. * @param ev The event. @@ -15235,6 +15237,16 @@ declare var StyleSheetList: { new(): StyleSheetList; }; +interface SubmitEvent extends Event { + readonly submitter: HTMLElement | null; + readonly target: HTMLFormElement; +} + +declare var SubmitEvent: { + prototype: SubmitEvent; + new(): SubmitEvent; +}; + /** This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto). */ interface SubtleCrypto { decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): Promise; @@ -18192,7 +18204,7 @@ interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandler "select": Event; "stalled": Event; "storage": StorageEvent; - "submit": Event; + "submit": SubmitEvent; "suspend": Event; "timeupdate": Event; "unload": Event; @@ -19582,7 +19594,7 @@ declare var onselectstart: ((this: Window, ev: Event) => any) | null; * @param ev The event. */ declare var onstalled: ((this: Window, ev: Event) => any) | null; -declare var onsubmit: ((this: Window, ev: Event) => any) | null; +declare var onsubmit: ((this: Window, ev: SubmitEvent) => any) | null; /** * Occurs if the load operation has been intentionally halted. * @param ev The event. diff --git a/inputfiles/addedTypes.json b/inputfiles/addedTypes.json index e280d8334..a2f3444f2 100644 --- a/inputfiles/addedTypes.json +++ b/inputfiles/addedTypes.json @@ -1334,7 +1334,15 @@ { "name": "form" } - ] + ], + "events": { + "event": [ + { + "name": "submit", + "type": "SubmitEvent" + } + ] + } }, "HTMLHeadElement": { "element": [ @@ -2202,6 +2210,27 @@ } } }, + "SubmitEvent": { + "name": "SubmitEvent", + "extends": "Event", + "exposed": "Window", + "properties": { + "property": { + "target": { + "name": "target", + "read-only": 1, + "nullable": 0, + "override-type": "HTMLFormElement" + }, + "submitter": { + "name": "submitter", + "read-only": 1, + "nullable": 1, + "override-type": "HTMLElement" + } + } + } + }, "SharedWorker": { "events": { "event": [