Skip to content

Commit a070715

Browse files
authored
Add bindings for HTMLFormElement.requestSubmit() (#3747)
1 parent cc9a219 commit a070715

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
### Added
1212

13+
* Add bindings for `HTMLFormElement.requestSubmit()`.
14+
[#3747](https://github.com/rustwasm/wasm-bindgen/pull/3747)
15+
1316
* Add bindings for `RTCRtpSender.getCapabilities(DOMString)` method, `RTCRtpCapabilities`, `RTCRtpCodecCapability` and `RTCRtpHeaderExtensionCapability`.
1417
[#3737](https://github.com/rustwasm/wasm-bindgen/pull/3737)
1518

crates/web-sys/src/features/gen_HtmlFormElement.rs

+17
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,23 @@ extern "C" {
167167
#[doc = ""]
168168
#[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"]
169169
pub fn report_validity(this: &HtmlFormElement) -> bool;
170+
# [wasm_bindgen (catch , method , structural , js_class = "HTMLFormElement" , js_name = requestSubmit)]
171+
#[doc = "The `requestSubmit()` method."]
172+
#[doc = ""]
173+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit)"]
174+
#[doc = ""]
175+
#[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"]
176+
pub fn request_submit(this: &HtmlFormElement) -> Result<(), JsValue>;
177+
# [wasm_bindgen (catch , method , structural , js_class = "HTMLFormElement" , js_name = requestSubmit)]
178+
#[doc = "The `requestSubmit()` method."]
179+
#[doc = ""]
180+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit)"]
181+
#[doc = ""]
182+
#[doc = "*This API requires the following crate features to be activated: `HtmlFormElement`*"]
183+
pub fn request_submit_with_submitter(
184+
this: &HtmlFormElement,
185+
submitter: Option<&HtmlElement>,
186+
) -> Result<(), JsValue>;
170187
# [wasm_bindgen (method , structural , js_class = "HTMLFormElement" , js_name = reset)]
171188
#[doc = "The `reset()` method."]
172189
#[doc = ""]

crates/web-sys/webidls/enabled/HTMLFormElement.webidl

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ interface HTMLFormElement : HTMLElement {
4343

4444
[Throws]
4545
undefined submit();
46+
[Throws]
47+
undefined requestSubmit(optional HTMLElement? submitter = null);
4648
[CEReactions]
4749
undefined reset();
4850
boolean checkValidity();

0 commit comments

Comments
 (0)