From c7b8259574dc06462cfc4189d2760df5fa9c2719 Mon Sep 17 00:00:00 2001 From: David Young Date: Tue, 19 Dec 2023 17:32:26 +0000 Subject: [PATCH 1/3] Add missing HtmlFormElement::request_submit method --- .../web-sys/src/features/gen_HtmlFormElement.rs | 17 +++++++++++++++++ .../webidls/enabled/HTMLFormElement.webidl | 2 ++ 2 files changed, 19 insertions(+) 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(); From 2905374895f42d774794b0a4973f2c967979f9e1 Mon Sep 17 00:00:00 2001 From: David Young Date: Wed, 20 Dec 2023 17:57:00 +0000 Subject: [PATCH 2/3] Add changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8929a240823..b8e21aeaea3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ ### Added +* Add bindings for `HtmlFormElement::request_submit` and `HtmlFormElement::request_submit_with_submitter` methods + [#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) From 2941aae9215362e2f1ce1489256f352a1627757e Mon Sep 17 00:00:00 2001 From: daxpedda Date: Wed, 20 Dec 2023 20:12:23 +0100 Subject: [PATCH 3/3] Update wording --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8e21aeaea3..ad9a3c88627 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ ### Added -* Add bindings for `HtmlFormElement::request_submit` and `HtmlFormElement::request_submit_with_submitter` methods +* 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`.