From bfc1a6b99ed3fd28c1bc30e52c105060588853b8 Mon Sep 17 00:00:00 2001 From: Lennard Behrens Date: Thu, 24 Oct 2024 13:26:43 +0200 Subject: [PATCH 1/3] Add `AbstractRange` and `StaticRange` interfaces --- crates/web-sys/Cargo.toml | 5 +- .../web-sys/src/features/gen_AbstractRange.rs | 52 ++++++++++ crates/web-sys/src/features/gen_Range.rs | 2 +- .../web-sys/src/features/gen_StaticRange.rs | 23 +++++ .../src/features/gen_StaticRangeInit.rs | 99 +++++++++++++++++++ crates/web-sys/src/features/mod.rs | 21 ++++ .../webidls/enabled/AbstractRange.webidl | 23 +++++ crates/web-sys/webidls/enabled/Range.webidl | 4 +- .../webidls/enabled/StaticRange.webidl | 22 +++++ 9 files changed, 247 insertions(+), 4 deletions(-) create mode 100644 crates/web-sys/src/features/gen_AbstractRange.rs create mode 100644 crates/web-sys/src/features/gen_StaticRange.rs create mode 100644 crates/web-sys/src/features/gen_StaticRangeInit.rs create mode 100644 crates/web-sys/webidls/enabled/AbstractRange.webidl create mode 100644 crates/web-sys/webidls/enabled/StaticRange.webidl diff --git a/crates/web-sys/Cargo.toml b/crates/web-sys/Cargo.toml index c3a73eaa363..73b4fbf8e8d 100644 --- a/crates/web-sys/Cargo.toml +++ b/crates/web-sys/Cargo.toml @@ -47,6 +47,7 @@ default = ["std"] std = ["wasm-bindgen/std", "js-sys/std"] AbortController = [] AbortSignal = ["EventTarget"] +AbstractRange = [] AddEventListenerOptions = [] AesCbcParams = [] AesCtrParams = [] @@ -1066,7 +1067,7 @@ QueryOptions = [] QueuingStrategy = [] QueuingStrategyInit = [] RadioNodeList = ["NodeList"] -Range = [] +Range = ["AbstractRange"] RcwnPerfStats = [] RcwnStatus = [] ReadableByteStreamController = [] @@ -1279,6 +1280,8 @@ SpeechSynthesisEvent = ["Event"] SpeechSynthesisEventInit = [] SpeechSynthesisUtterance = ["EventTarget"] SpeechSynthesisVoice = [] +StaticRange = ["AbstractRange"] +StaticRangeInit = [] StereoPannerNode = ["AudioNode", "EventTarget"] StereoPannerOptions = [] Storage = [] diff --git a/crates/web-sys/src/features/gen_AbstractRange.rs b/crates/web-sys/src/features/gen_AbstractRange.rs new file mode 100644 index 00000000000..8b0a5fa9ab2 --- /dev/null +++ b/crates/web-sys/src/features/gen_AbstractRange.rs @@ -0,0 +1,52 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AbstractRange , typescript_type = "AbstractRange")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `AbstractRange` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbstractRange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbstractRange`*"] + pub type AbstractRange; + #[cfg(feature = "Node")] + # [wasm_bindgen (structural , catch , method , getter , js_class = "AbstractRange" , js_name = startContainer)] + #[doc = "Getter for the `startContainer` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbstractRange/startContainer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbstractRange`, `Node`*"] + pub fn start_container(this: &AbstractRange) -> Result; + # [wasm_bindgen (structural , catch , method , getter , js_class = "AbstractRange" , js_name = startOffset)] + #[doc = "Getter for the `startOffset` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbstractRange/startOffset)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbstractRange`*"] + pub fn start_offset(this: &AbstractRange) -> Result; + #[cfg(feature = "Node")] + # [wasm_bindgen (structural , catch , method , getter , js_class = "AbstractRange" , js_name = endContainer)] + #[doc = "Getter for the `endContainer` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbstractRange/endContainer)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbstractRange`, `Node`*"] + pub fn end_container(this: &AbstractRange) -> Result; + # [wasm_bindgen (structural , catch , method , getter , js_class = "AbstractRange" , js_name = endOffset)] + #[doc = "Getter for the `endOffset` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbstractRange/endOffset)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbstractRange`*"] + pub fn end_offset(this: &AbstractRange) -> Result; + # [wasm_bindgen (structural , method , getter , js_class = "AbstractRange" , js_name = collapsed)] + #[doc = "Getter for the `collapsed` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbstractRange/collapsed)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbstractRange`*"] + pub fn collapsed(this: &AbstractRange) -> bool; +} diff --git a/crates/web-sys/src/features/gen_Range.rs b/crates/web-sys/src/features/gen_Range.rs index 2d5b99f3a0e..33661647e23 100644 --- a/crates/web-sys/src/features/gen_Range.rs +++ b/crates/web-sys/src/features/gen_Range.rs @@ -4,7 +4,7 @@ use super::*; use wasm_bindgen::prelude::*; #[wasm_bindgen] extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = Range , typescript_type = "Range")] + # [wasm_bindgen (extends = AbstractRange , extends = :: js_sys :: Object , js_name = Range , typescript_type = "Range")] #[derive(Debug, Clone, PartialEq, Eq)] #[doc = "The `Range` class."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_StaticRange.rs b/crates/web-sys/src/features/gen_StaticRange.rs new file mode 100644 index 00000000000..0e602957045 --- /dev/null +++ b/crates/web-sys/src/features/gen_StaticRange.rs @@ -0,0 +1,23 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = AbstractRange , extends = :: js_sys :: Object , js_name = StaticRange , typescript_type = "StaticRange")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `StaticRange` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/StaticRange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StaticRange`*"] + pub type StaticRange; + #[cfg(feature = "StaticRangeInit")] + #[wasm_bindgen(catch, constructor, js_class = "StaticRange")] + #[doc = "The `new StaticRange(..)` constructor, creating a new instance of `StaticRange`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/StaticRange/StaticRange)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StaticRange`, `StaticRangeInit`*"] + pub fn new(init: &StaticRangeInit) -> Result; +} diff --git a/crates/web-sys/src/features/gen_StaticRangeInit.rs b/crates/web-sys/src/features/gen_StaticRangeInit.rs new file mode 100644 index 00000000000..8eec83d60ac --- /dev/null +++ b/crates/web-sys/src/features/gen_StaticRangeInit.rs @@ -0,0 +1,99 @@ +#![allow(unused_imports)] +#![allow(clippy::all)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = StaticRangeInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `StaticRangeInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StaticRangeInit`*"] + pub type StaticRangeInit; + #[cfg(feature = "Node")] + #[doc = "Get the `endContainer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Node`, `StaticRangeInit`*"] + #[wasm_bindgen(method, getter = "endContainer")] + pub fn get_end_container(this: &StaticRangeInit) -> Node; + #[cfg(feature = "Node")] + #[doc = "Change the `endContainer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Node`, `StaticRangeInit`*"] + #[wasm_bindgen(method, setter = "endContainer")] + pub fn set_end_container(this: &StaticRangeInit, val: &Node); + #[doc = "Get the `endOffset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StaticRangeInit`*"] + #[wasm_bindgen(method, getter = "endOffset")] + pub fn get_end_offset(this: &StaticRangeInit) -> u32; + #[doc = "Change the `endOffset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StaticRangeInit`*"] + #[wasm_bindgen(method, setter = "endOffset")] + pub fn set_end_offset(this: &StaticRangeInit, val: u32); + #[cfg(feature = "Node")] + #[doc = "Get the `startContainer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Node`, `StaticRangeInit`*"] + #[wasm_bindgen(method, getter = "startContainer")] + pub fn get_start_container(this: &StaticRangeInit) -> Node; + #[cfg(feature = "Node")] + #[doc = "Change the `startContainer` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Node`, `StaticRangeInit`*"] + #[wasm_bindgen(method, setter = "startContainer")] + pub fn set_start_container(this: &StaticRangeInit, val: &Node); + #[doc = "Get the `startOffset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StaticRangeInit`*"] + #[wasm_bindgen(method, getter = "startOffset")] + pub fn get_start_offset(this: &StaticRangeInit) -> u32; + #[doc = "Change the `startOffset` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `StaticRangeInit`*"] + #[wasm_bindgen(method, setter = "startOffset")] + pub fn set_start_offset(this: &StaticRangeInit, val: u32); +} +impl StaticRangeInit { + #[cfg(feature = "Node")] + #[doc = "Construct a new `StaticRangeInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Node`, `StaticRangeInit`*"] + pub fn new( + end_container: &Node, + end_offset: u32, + start_container: &Node, + start_offset: u32, + ) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.end_container(end_container); + ret.end_offset(end_offset); + ret.start_container(start_container); + ret.start_offset(start_offset); + ret + } + #[cfg(feature = "Node")] + #[deprecated = "Use `set_end_container()` instead."] + pub fn end_container(&mut self, val: &Node) -> &mut Self { + self.set_end_container(val); + self + } + #[deprecated = "Use `set_end_offset()` instead."] + pub fn end_offset(&mut self, val: u32) -> &mut Self { + self.set_end_offset(val); + self + } + #[cfg(feature = "Node")] + #[deprecated = "Use `set_start_container()` instead."] + pub fn start_container(&mut self, val: &Node) -> &mut Self { + self.set_start_container(val); + self + } + #[deprecated = "Use `set_start_offset()` instead."] + pub fn start_offset(&mut self, val: u32) -> &mut Self { + self.set_start_offset(val); + self + } +} diff --git a/crates/web-sys/src/features/mod.rs b/crates/web-sys/src/features/mod.rs index 4ffc9995e6f..127a4db77d5 100644 --- a/crates/web-sys/src/features/mod.rs +++ b/crates/web-sys/src/features/mod.rs @@ -12,6 +12,13 @@ mod gen_AbortSignal; #[allow(unused_imports)] pub use gen_AbortSignal::*; +#[cfg(feature = "AbstractRange")] +#[allow(non_snake_case)] +mod gen_AbstractRange; +#[cfg(feature = "AbstractRange")] +#[allow(unused_imports)] +pub use gen_AbstractRange::*; + #[cfg(feature = "AddEventListenerOptions")] #[allow(non_snake_case)] mod gen_AddEventListenerOptions; @@ -8636,6 +8643,20 @@ mod gen_SpeechSynthesisVoice; #[allow(unused_imports)] pub use gen_SpeechSynthesisVoice::*; +#[cfg(feature = "StaticRange")] +#[allow(non_snake_case)] +mod gen_StaticRange; +#[cfg(feature = "StaticRange")] +#[allow(unused_imports)] +pub use gen_StaticRange::*; + +#[cfg(feature = "StaticRangeInit")] +#[allow(non_snake_case)] +mod gen_StaticRangeInit; +#[cfg(feature = "StaticRangeInit")] +#[allow(unused_imports)] +pub use gen_StaticRangeInit::*; + #[cfg(feature = "StereoPannerNode")] #[allow(non_snake_case)] mod gen_StereoPannerNode; diff --git a/crates/web-sys/webidls/enabled/AbstractRange.webidl b/crates/web-sys/webidls/enabled/AbstractRange.webidl new file mode 100644 index 00000000000..f9908b6c9ce --- /dev/null +++ b/crates/web-sys/webidls/enabled/AbstractRange.webidl @@ -0,0 +1,23 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * The origin of this IDL file is + * https://dom.spec.whatwg.org/#abstractrange + * + * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C + * liability, trademark and document use rules apply. + */ + + +interface AbstractRange { + [Throws] + readonly attribute Node startContainer; + [Throws] + readonly attribute unsigned long startOffset; + [Throws] + readonly attribute Node endContainer; + [Throws] + readonly attribute unsigned long endOffset; + readonly attribute boolean collapsed; +}; \ No newline at end of file diff --git a/crates/web-sys/webidls/enabled/Range.webidl b/crates/web-sys/webidls/enabled/Range.webidl index 7904f234fc0..c25f64557cf 100644 --- a/crates/web-sys/webidls/enabled/Range.webidl +++ b/crates/web-sys/webidls/enabled/Range.webidl @@ -10,10 +10,10 @@ * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. - */ + */ [Constructor] -interface Range { +interface Range : AbstractRange { [Throws] readonly attribute Node startContainer; [Throws] diff --git a/crates/web-sys/webidls/enabled/StaticRange.webidl b/crates/web-sys/webidls/enabled/StaticRange.webidl new file mode 100644 index 00000000000..e1ef60fac3a --- /dev/null +++ b/crates/web-sys/webidls/enabled/StaticRange.webidl @@ -0,0 +1,22 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * The origin of this IDL file is + * https://dom.spec.whatwg.org/#staticrange + * + * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C + * liability, trademark and document use rules apply. + */ + +dictionary StaticRangeInit { + required Node startContainer; + required unsigned long startOffset; + required Node endContainer; + required unsigned long endOffset; +}; + +[Exposed=Window] +interface StaticRange : AbstractRange { + constructor(StaticRangeInit init); +}; \ No newline at end of file From 5ab37c6e7e5842d25ec16b7c1dcda12f02ec74ef Mon Sep 17 00:00:00 2001 From: Lennard Behrens Date: Fri, 28 Feb 2025 19:42:23 +0100 Subject: [PATCH 2/3] Fix AbstractRange, StaticRange and Range webidl files --- crates/web-sys/webidls/enabled/AbstractRange.webidl | 9 ++------- crates/web-sys/webidls/enabled/Range.webidl | 2 +- crates/web-sys/webidls/enabled/StaticRange.webidl | 6 +++--- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/crates/web-sys/webidls/enabled/AbstractRange.webidl b/crates/web-sys/webidls/enabled/AbstractRange.webidl index f9908b6c9ce..128b3e1323c 100644 --- a/crates/web-sys/webidls/enabled/AbstractRange.webidl +++ b/crates/web-sys/webidls/enabled/AbstractRange.webidl @@ -7,17 +7,12 @@ * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. - */ - + */ interface AbstractRange { - [Throws] readonly attribute Node startContainer; - [Throws] readonly attribute unsigned long startOffset; - [Throws] readonly attribute Node endContainer; - [Throws] readonly attribute unsigned long endOffset; readonly attribute boolean collapsed; -}; \ No newline at end of file +}; diff --git a/crates/web-sys/webidls/enabled/Range.webidl b/crates/web-sys/webidls/enabled/Range.webidl index c25f64557cf..f3406adb35d 100644 --- a/crates/web-sys/webidls/enabled/Range.webidl +++ b/crates/web-sys/webidls/enabled/Range.webidl @@ -10,7 +10,7 @@ * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. - */ + */ [Constructor] interface Range : AbstractRange { diff --git a/crates/web-sys/webidls/enabled/StaticRange.webidl b/crates/web-sys/webidls/enabled/StaticRange.webidl index e1ef60fac3a..9a87b0dba9c 100644 --- a/crates/web-sys/webidls/enabled/StaticRange.webidl +++ b/crates/web-sys/webidls/enabled/StaticRange.webidl @@ -7,7 +7,7 @@ * * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. - */ + */ dictionary StaticRangeInit { required Node startContainer; @@ -18,5 +18,5 @@ dictionary StaticRangeInit { [Exposed=Window] interface StaticRange : AbstractRange { - constructor(StaticRangeInit init); -}; \ No newline at end of file + [Throws] constructor(StaticRangeInit init); +}; From 576087abb7a9be14ef0305d4881007a68cc7cb9b Mon Sep 17 00:00:00 2001 From: Lennard Behrens Date: Fri, 28 Feb 2025 19:48:08 +0100 Subject: [PATCH 3/3] Fix changelog --- CHANGELOG.md | 5 +++++ crates/web-sys/src/features/gen_AbstractRange.rs | 16 ++++++++-------- .../web-sys/src/features/gen_StaticRangeInit.rs | 8 ++++---- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85cfdd4dce9..bdc6ba5efc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ * Deprecate async constructors. [#4402](https://github.com/rustwasm/wasm-bindgen/pull/4402) +### Added + +* Added bindings for `StaticRange` and `AbstractRange`. + [#4221](https://github.com/rustwasm/wasm-bindgen/pull/4221) + -------------------------------------------------------------------------------- ## [0.2.100](https://github.com/rustwasm/wasm-bindgen/compare/0.2.99...0.2.100) diff --git a/crates/web-sys/src/features/gen_AbstractRange.rs b/crates/web-sys/src/features/gen_AbstractRange.rs index 8b0a5fa9ab2..c9aac919c8b 100644 --- a/crates/web-sys/src/features/gen_AbstractRange.rs +++ b/crates/web-sys/src/features/gen_AbstractRange.rs @@ -13,35 +13,35 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `AbstractRange`*"] pub type AbstractRange; #[cfg(feature = "Node")] - # [wasm_bindgen (structural , catch , method , getter , js_class = "AbstractRange" , js_name = startContainer)] + # [wasm_bindgen (structural , method , getter , js_class = "AbstractRange" , js_name = startContainer)] #[doc = "Getter for the `startContainer` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbstractRange/startContainer)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AbstractRange`, `Node`*"] - pub fn start_container(this: &AbstractRange) -> Result; - # [wasm_bindgen (structural , catch , method , getter , js_class = "AbstractRange" , js_name = startOffset)] + pub fn start_container(this: &AbstractRange) -> Node; + # [wasm_bindgen (structural , method , getter , js_class = "AbstractRange" , js_name = startOffset)] #[doc = "Getter for the `startOffset` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbstractRange/startOffset)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AbstractRange`*"] - pub fn start_offset(this: &AbstractRange) -> Result; + pub fn start_offset(this: &AbstractRange) -> u32; #[cfg(feature = "Node")] - # [wasm_bindgen (structural , catch , method , getter , js_class = "AbstractRange" , js_name = endContainer)] + # [wasm_bindgen (structural , method , getter , js_class = "AbstractRange" , js_name = endContainer)] #[doc = "Getter for the `endContainer` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbstractRange/endContainer)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AbstractRange`, `Node`*"] - pub fn end_container(this: &AbstractRange) -> Result; - # [wasm_bindgen (structural , catch , method , getter , js_class = "AbstractRange" , js_name = endOffset)] + pub fn end_container(this: &AbstractRange) -> Node; + # [wasm_bindgen (structural , method , getter , js_class = "AbstractRange" , js_name = endOffset)] #[doc = "Getter for the `endOffset` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AbstractRange/endOffset)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AbstractRange`*"] - pub fn end_offset(this: &AbstractRange) -> Result; + pub fn end_offset(this: &AbstractRange) -> u32; # [wasm_bindgen (structural , method , getter , js_class = "AbstractRange" , js_name = collapsed)] #[doc = "Getter for the `collapsed` field of this object."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_StaticRangeInit.rs b/crates/web-sys/src/features/gen_StaticRangeInit.rs index 8eec83d60ac..706a0b599f0 100644 --- a/crates/web-sys/src/features/gen_StaticRangeInit.rs +++ b/crates/web-sys/src/features/gen_StaticRangeInit.rs @@ -68,10 +68,10 @@ impl StaticRangeInit { ) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.end_container(end_container); - ret.end_offset(end_offset); - ret.start_container(start_container); - ret.start_offset(start_offset); + ret.set_end_container(end_container); + ret.set_end_offset(end_offset); + ret.set_start_container(start_container); + ret.set_start_offset(start_offset); ret } #[cfg(feature = "Node")]