diff --git a/CHANGELOG.md b/CHANGELOG.md index 8929a240823..ad9a3c88627 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ ### Added +* Add bindings for `HTMLFormElement.requestSubmit()`. + [#3747](https://github.com/rustwasm/wasm-bindgen/pull/3747) + * Add bindings for `RTCRtpSender.getCapabilities(DOMString)` method, `RTCRtpCapabilities`, `RTCRtpCodecCapability` and `RTCRtpHeaderExtensionCapability`. [#3737](https://github.com/rustwasm/wasm-bindgen/pull/3737) diff --git a/crates/web-sys/src/features/gen_HtmlFormElement.rs b/crates/web-sys/src/features/gen_HtmlFormElement.rs index aad396637c0..4745000980e 100644 --- a/crates/web-sys/src/features/gen_HtmlFormElement.rs +++ b/crates/web-sys/src/features/gen_HtmlFormElement.rs @@ -167,6 +167,23 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] pub fn report_validity(this: &HtmlFormElement) -> bool; + # [wasm_bindgen (catch , method , structural , js_class = "HTMLFormElement" , js_name = requestSubmit)] + #[doc = "The `requestSubmit()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] + pub fn request_submit(this: &HtmlFormElement) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "HTMLFormElement" , js_name = requestSubmit)] + #[doc = "The `requestSubmit()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"] + pub fn request_submit_with_submitter( + this: &HtmlFormElement, + submitter: Option<&HtmlElement>, + ) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "HTMLFormElement" , js_name = reset)] #[doc = "The `reset()` method."] #[doc = ""] diff --git a/crates/web-sys/webidls/enabled/HTMLFormElement.webidl b/crates/web-sys/webidls/enabled/HTMLFormElement.webidl index 793be48b7c2..74b001c9bc4 100644 --- a/crates/web-sys/webidls/enabled/HTMLFormElement.webidl +++ b/crates/web-sys/webidls/enabled/HTMLFormElement.webidl @@ -43,6 +43,8 @@ interface HTMLFormElement : HTMLElement { [Throws] undefined submit(); + [Throws] + undefined requestSubmit(optional HTMLElement? submitter = null); [CEReactions] undefined reset(); boolean checkValidity();