Skip to content

Commit 10777c5

Browse files
committed
Stabilize ResizeObserver
1 parent a2ab2d5 commit 10777c5

6 files changed

+0
-77
lines changed

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

-24
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#![allow(clippy::all)]
33
use super::*;
44
use wasm_bindgen::prelude::*;
5-
#[cfg(web_sys_unstable_apis)]
65
#[wasm_bindgen]
76
extern "C" {
87
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = ResizeObserver , typescript_type = "ResizeObserver")]
@@ -12,70 +11,47 @@ extern "C" {
1211
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)"]
1312
#[doc = ""]
1413
#[doc = "*This API requires the following crate features to be activated: `ResizeObserver`*"]
15-
#[doc = ""]
16-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
17-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
1814
pub type ResizeObserver;
19-
#[cfg(web_sys_unstable_apis)]
2015
#[wasm_bindgen(catch, constructor, js_class = "ResizeObserver")]
2116
#[doc = "The `new ResizeObserver(..)` constructor, creating a new instance of `ResizeObserver`."]
2217
#[doc = ""]
2318
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver)"]
2419
#[doc = ""]
2520
#[doc = "*This API requires the following crate features to be activated: `ResizeObserver`*"]
26-
#[doc = ""]
27-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
28-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
2921
pub fn new(callback: &::js_sys::Function) -> Result<ResizeObserver, JsValue>;
30-
#[cfg(web_sys_unstable_apis)]
3122
# [wasm_bindgen (method , structural , js_class = "ResizeObserver" , js_name = disconnect)]
3223
#[doc = "The `disconnect()` method."]
3324
#[doc = ""]
3425
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/disconnect)"]
3526
#[doc = ""]
3627
#[doc = "*This API requires the following crate features to be activated: `ResizeObserver`*"]
37-
#[doc = ""]
38-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
39-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
4028
pub fn disconnect(this: &ResizeObserver);
41-
#[cfg(web_sys_unstable_apis)]
4229
#[cfg(feature = "Element")]
4330
# [wasm_bindgen (method , structural , js_class = "ResizeObserver" , js_name = observe)]
4431
#[doc = "The `observe()` method."]
4532
#[doc = ""]
4633
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/observe)"]
4734
#[doc = ""]
4835
#[doc = "*This API requires the following crate features to be activated: `Element`, `ResizeObserver`*"]
49-
#[doc = ""]
50-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
51-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
5236
pub fn observe(this: &ResizeObserver, target: &Element);
53-
#[cfg(web_sys_unstable_apis)]
5437
#[cfg(all(feature = "Element", feature = "ResizeObserverOptions",))]
5538
# [wasm_bindgen (method , structural , js_class = "ResizeObserver" , js_name = observe)]
5639
#[doc = "The `observe()` method."]
5740
#[doc = ""]
5841
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/observe)"]
5942
#[doc = ""]
6043
#[doc = "*This API requires the following crate features to be activated: `Element`, `ResizeObserver`, `ResizeObserverOptions`*"]
61-
#[doc = ""]
62-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
63-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
6444
pub fn observe_with_options(
6545
this: &ResizeObserver,
6646
target: &Element,
6747
options: &ResizeObserverOptions,
6848
);
69-
#[cfg(web_sys_unstable_apis)]
7049
#[cfg(feature = "Element")]
7150
# [wasm_bindgen (method , structural , js_class = "ResizeObserver" , js_name = unobserve)]
7251
#[doc = "The `unobserve()` method."]
7352
#[doc = ""]
7453
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/unobserve)"]
7554
#[doc = ""]
7655
#[doc = "*This API requires the following crate features to be activated: `Element`, `ResizeObserver`*"]
77-
#[doc = ""]
78-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
79-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
8056
pub fn unobserve(this: &ResizeObserver, target: &Element);
8157
}

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

-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
#![allow(unused_imports)]
22
#![allow(clippy::all)]
33
use wasm_bindgen::prelude::*;
4-
#[cfg(web_sys_unstable_apis)]
54
#[wasm_bindgen]
65
#[doc = "The `ResizeObserverBoxOptions` enum."]
76
#[doc = ""]
87
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverBoxOptions`*"]
9-
#[doc = ""]
10-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
11-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
128
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
139
pub enum ResizeObserverBoxOptions {
1410
BorderBox = "border-box",

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

-24
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#![allow(clippy::all)]
33
use super::*;
44
use wasm_bindgen::prelude::*;
5-
#[cfg(web_sys_unstable_apis)]
65
#[wasm_bindgen]
76
extern "C" {
87
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = ResizeObserverEntry , typescript_type = "ResizeObserverEntry")]
@@ -12,65 +11,42 @@ extern "C" {
1211
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry)"]
1312
#[doc = ""]
1413
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverEntry`*"]
15-
#[doc = ""]
16-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
17-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
1814
pub type ResizeObserverEntry;
19-
#[cfg(web_sys_unstable_apis)]
2015
#[cfg(feature = "Element")]
2116
# [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverEntry" , js_name = target)]
2217
#[doc = "Getter for the `target` field of this object."]
2318
#[doc = ""]
2419
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/target)"]
2520
#[doc = ""]
2621
#[doc = "*This API requires the following crate features to be activated: `Element`, `ResizeObserverEntry`*"]
27-
#[doc = ""]
28-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
29-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
3022
pub fn target(this: &ResizeObserverEntry) -> Element;
31-
#[cfg(web_sys_unstable_apis)]
3223
#[cfg(feature = "DomRectReadOnly")]
3324
# [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverEntry" , js_name = contentRect)]
3425
#[doc = "Getter for the `contentRect` field of this object."]
3526
#[doc = ""]
3627
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/contentRect)"]
3728
#[doc = ""]
3829
#[doc = "*This API requires the following crate features to be activated: `DomRectReadOnly`, `ResizeObserverEntry`*"]
39-
#[doc = ""]
40-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
41-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
4230
pub fn content_rect(this: &ResizeObserverEntry) -> DomRectReadOnly;
43-
#[cfg(web_sys_unstable_apis)]
4431
# [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverEntry" , js_name = borderBoxSize)]
4532
#[doc = "Getter for the `borderBoxSize` field of this object."]
4633
#[doc = ""]
4734
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/borderBoxSize)"]
4835
#[doc = ""]
4936
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverEntry`*"]
50-
#[doc = ""]
51-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
5337
pub fn border_box_size(this: &ResizeObserverEntry) -> ::js_sys::Array;
54-
#[cfg(web_sys_unstable_apis)]
5538
# [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverEntry" , js_name = contentBoxSize)]
5639
#[doc = "Getter for the `contentBoxSize` field of this object."]
5740
#[doc = ""]
5841
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/contentBoxSize)"]
5942
#[doc = ""]
6043
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverEntry`*"]
61-
#[doc = ""]
62-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
63-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
6444
pub fn content_box_size(this: &ResizeObserverEntry) -> ::js_sys::Array;
65-
#[cfg(web_sys_unstable_apis)]
6645
# [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverEntry" , js_name = devicePixelContentBoxSize)]
6746
#[doc = "Getter for the `devicePixelContentBoxSize` field of this object."]
6847
#[doc = ""]
6948
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/devicePixelContentBoxSize)"]
7049
#[doc = ""]
7150
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverEntry`*"]
72-
#[doc = ""]
73-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
74-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
7551
pub fn device_pixel_content_box_size(this: &ResizeObserverEntry) -> ::js_sys::Array;
7652
}

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

-13
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,28 @@
22
#![allow(clippy::all)]
33
use super::*;
44
use wasm_bindgen::prelude::*;
5-
#[cfg(web_sys_unstable_apis)]
65
#[wasm_bindgen]
76
extern "C" {
87
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = ResizeObserverOptions)]
98
#[derive(Debug, Clone, PartialEq, Eq)]
109
#[doc = "The `ResizeObserverOptions` dictionary."]
1110
#[doc = ""]
1211
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverOptions`*"]
13-
#[doc = ""]
14-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
1612
pub type ResizeObserverOptions;
1713
}
18-
#[cfg(web_sys_unstable_apis)]
1914
impl ResizeObserverOptions {
2015
#[doc = "Construct a new `ResizeObserverOptions`."]
2116
#[doc = ""]
2217
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverOptions`*"]
23-
#[doc = ""]
24-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
25-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
2618
pub fn new() -> Self {
2719
#[allow(unused_mut)]
2820
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
2921
ret
3022
}
31-
#[cfg(web_sys_unstable_apis)]
3223
#[cfg(feature = "ResizeObserverBoxOptions")]
3324
#[doc = "Change the `box` field of this object."]
3425
#[doc = ""]
3526
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverBoxOptions`, `ResizeObserverOptions`*"]
36-
#[doc = ""]
37-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
38-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
3927
pub fn box_(&mut self, val: ResizeObserverBoxOptions) -> &mut Self {
4028
use wasm_bindgen::JsValue;
4129
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("box"), &JsValue::from(val));
@@ -47,7 +35,6 @@ impl ResizeObserverOptions {
4735
self
4836
}
4937
}
50-
#[cfg(web_sys_unstable_apis)]
5138
impl Default for ResizeObserverOptions {
5239
fn default() -> Self {
5340
Self::new()

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

-12
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#![allow(clippy::all)]
33
use super::*;
44
use wasm_bindgen::prelude::*;
5-
#[cfg(web_sys_unstable_apis)]
65
#[wasm_bindgen]
76
extern "C" {
87
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = ResizeObserverSize , typescript_type = "ResizeObserverSize")]
@@ -12,30 +11,19 @@ extern "C" {
1211
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverSize)"]
1312
#[doc = ""]
1413
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverSize`*"]
15-
#[doc = ""]
16-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
17-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
1814
pub type ResizeObserverSize;
19-
#[cfg(web_sys_unstable_apis)]
2015
# [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverSize" , js_name = inlineSize)]
2116
#[doc = "Getter for the `inlineSize` field of this object."]
2217
#[doc = ""]
2318
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverSize/inlineSize)"]
2419
#[doc = ""]
2520
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverSize`*"]
26-
#[doc = ""]
27-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
28-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
2921
pub fn inline_size(this: &ResizeObserverSize) -> f64;
30-
#[cfg(web_sys_unstable_apis)]
3122
# [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverSize" , js_name = blockSize)]
3223
#[doc = "Getter for the `blockSize` field of this object."]
3324
#[doc = ""]
3425
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverSize/blockSize)"]
3526
#[doc = ""]
3627
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverSize`*"]
37-
#[doc = ""]
38-
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
39-
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
4028
pub fn block_size(this: &ResizeObserverSize) -> f64;
4129
}

0 commit comments

Comments
 (0)