Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize ResizeObserver #3459

Merged
merged 1 commit into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 0 additions & 24 deletions crates/web-sys/src/features/gen_ResizeObserver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#![allow(clippy::all)]
use super::*;
use wasm_bindgen::prelude::*;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen]
extern "C" {
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = ResizeObserver , typescript_type = "ResizeObserver")]
Expand All @@ -12,70 +11,47 @@ extern "C" {
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ResizeObserver`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type ResizeObserver;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen(catch, constructor, js_class = "ResizeObserver")]
#[doc = "The `new ResizeObserver(..)` constructor, creating a new instance of `ResizeObserver`."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/ResizeObserver)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ResizeObserver`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn new(callback: &::js_sys::Function) -> Result<ResizeObserver, JsValue>;
#[cfg(web_sys_unstable_apis)]
# [wasm_bindgen (method , structural , js_class = "ResizeObserver" , js_name = disconnect)]
#[doc = "The `disconnect()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/disconnect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ResizeObserver`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn disconnect(this: &ResizeObserver);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "Element")]
# [wasm_bindgen (method , structural , js_class = "ResizeObserver" , js_name = observe)]
#[doc = "The `observe()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/observe)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Element`, `ResizeObserver`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn observe(this: &ResizeObserver, target: &Element);
#[cfg(web_sys_unstable_apis)]
#[cfg(all(feature = "Element", feature = "ResizeObserverOptions",))]
# [wasm_bindgen (method , structural , js_class = "ResizeObserver" , js_name = observe)]
#[doc = "The `observe()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/observe)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Element`, `ResizeObserver`, `ResizeObserverOptions`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn observe_with_options(
this: &ResizeObserver,
target: &Element,
options: &ResizeObserverOptions,
);
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "Element")]
# [wasm_bindgen (method , structural , js_class = "ResizeObserver" , js_name = unobserve)]
#[doc = "The `unobserve()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/unobserve)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Element`, `ResizeObserver`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn unobserve(this: &ResizeObserver, target: &Element);
}
4 changes: 0 additions & 4 deletions crates/web-sys/src/features/gen_ResizeObserverBoxOptions.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
#![allow(unused_imports)]
#![allow(clippy::all)]
use wasm_bindgen::prelude::*;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen]
#[doc = "The `ResizeObserverBoxOptions` enum."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverBoxOptions`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ResizeObserverBoxOptions {
BorderBox = "border-box",
Expand Down
24 changes: 0 additions & 24 deletions crates/web-sys/src/features/gen_ResizeObserverEntry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#![allow(clippy::all)]
use super::*;
use wasm_bindgen::prelude::*;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen]
extern "C" {
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = ResizeObserverEntry , typescript_type = "ResizeObserverEntry")]
Expand All @@ -12,65 +11,42 @@ extern "C" {
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverEntry`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type ResizeObserverEntry;
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "Element")]
# [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverEntry" , js_name = target)]
#[doc = "Getter for the `target` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/target)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Element`, `ResizeObserverEntry`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn target(this: &ResizeObserverEntry) -> Element;
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "DomRectReadOnly")]
# [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverEntry" , js_name = contentRect)]
#[doc = "Getter for the `contentRect` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/contentRect)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `DomRectReadOnly`, `ResizeObserverEntry`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn content_rect(this: &ResizeObserverEntry) -> DomRectReadOnly;
#[cfg(web_sys_unstable_apis)]
# [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverEntry" , js_name = borderBoxSize)]
#[doc = "Getter for the `borderBoxSize` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/borderBoxSize)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverEntry`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn border_box_size(this: &ResizeObserverEntry) -> ::js_sys::Array;
#[cfg(web_sys_unstable_apis)]
# [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverEntry" , js_name = contentBoxSize)]
#[doc = "Getter for the `contentBoxSize` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/contentBoxSize)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverEntry`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn content_box_size(this: &ResizeObserverEntry) -> ::js_sys::Array;
#[cfg(web_sys_unstable_apis)]
# [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverEntry" , js_name = devicePixelContentBoxSize)]
#[doc = "Getter for the `devicePixelContentBoxSize` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/devicePixelContentBoxSize)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverEntry`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn device_pixel_content_box_size(this: &ResizeObserverEntry) -> ::js_sys::Array;
}
13 changes: 0 additions & 13 deletions crates/web-sys/src/features/gen_ResizeObserverOptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,28 @@
#![allow(clippy::all)]
use super::*;
use wasm_bindgen::prelude::*;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen]
extern "C" {
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = ResizeObserverOptions)]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `ResizeObserverOptions` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverOptions`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type ResizeObserverOptions;
}
#[cfg(web_sys_unstable_apis)]
impl ResizeObserverOptions {
#[doc = "Construct a new `ResizeObserverOptions`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverOptions`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[cfg(web_sys_unstable_apis)]
#[cfg(feature = "ResizeObserverBoxOptions")]
#[doc = "Change the `box` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverBoxOptions`, `ResizeObserverOptions`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn box_(&mut self, val: ResizeObserverBoxOptions) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("box"), &JsValue::from(val));
Expand All @@ -47,7 +35,6 @@ impl ResizeObserverOptions {
self
}
}
#[cfg(web_sys_unstable_apis)]
impl Default for ResizeObserverOptions {
fn default() -> Self {
Self::new()
Expand Down
12 changes: 0 additions & 12 deletions crates/web-sys/src/features/gen_ResizeObserverSize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#![allow(clippy::all)]
use super::*;
use wasm_bindgen::prelude::*;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen]
extern "C" {
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = ResizeObserverSize , typescript_type = "ResizeObserverSize")]
Expand All @@ -12,30 +11,19 @@ extern "C" {
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverSize)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverSize`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type ResizeObserverSize;
#[cfg(web_sys_unstable_apis)]
# [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverSize" , js_name = inlineSize)]
#[doc = "Getter for the `inlineSize` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverSize/inlineSize)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverSize`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn inline_size(this: &ResizeObserverSize) -> f64;
#[cfg(web_sys_unstable_apis)]
# [wasm_bindgen (structural , method , getter , js_class = "ResizeObserverSize" , js_name = blockSize)]
#[doc = "Getter for the `blockSize` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverSize/blockSize)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `ResizeObserverSize`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn block_size(this: &ResizeObserverSize) -> f64;
}