Skip to content

feat: Add SubmitEvent #1005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -5761,7 +5763,7 @@ interface GlobalEventHandlersEventMap {
"selectionchange": Event;
"selectstart": Event;
"stalled": Event;
"submit": Event;
"submit": SubmitEvent;
"suspend": Event;
"timeupdate": Event;
"toggle": Event;
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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<ArrayBuffer>;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down
31 changes: 30 additions & 1 deletion inputfiles/addedTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,15 @@
{
"name": "form"
}
]
],
"events": {
"event": [
{
"name": "submit",
"type": "SubmitEvent"
}
]
}
},
"HTMLHeadElement": {
"element": [
Expand Down Expand Up @@ -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": [
Expand Down