From edc5adf4365831a5c9cc8b9a62cff9b011a9103f Mon Sep 17 00:00:00 2001 From: Nam Se Hyun <3580430+namse@users.noreply.github.com> Date: Wed, 7 Sep 2022 00:50:29 +0900 Subject: [PATCH] Put FontFace constructor to Immutable slice whitelist (#3072) * Put FontFace constructor to Immutable slice whitelist * Update gen_FontFace.rs --- crates/web-sys/src/features/gen_FontFace.rs | 4 ++-- crates/webidl/src/constants.rs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/web-sys/src/features/gen_FontFace.rs b/crates/web-sys/src/features/gen_FontFace.rs index 4c841ed0c75..b1c93184a97 100644 --- a/crates/web-sys/src/features/gen_FontFace.rs +++ b/crates/web-sys/src/features/gen_FontFace.rs @@ -185,7 +185,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontFace/FontFace)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFace`*"] - pub fn new_with_u8_array(family: &str, source: &mut [u8]) -> Result; + pub fn new_with_u8_array(family: &str, source: &[u8]) -> Result; #[cfg(feature = "FontFaceDescriptors")] #[wasm_bindgen(catch, constructor, js_class = "FontFace")] #[doc = "The `new FontFace(..)` constructor, creating a new instance of `FontFace`."] @@ -231,7 +231,7 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `FontFace`, `FontFaceDescriptors`*"] pub fn new_with_u8_array_and_descriptors( family: &str, - source: &mut [u8], + source: &[u8], descriptors: &FontFaceDescriptors, ) -> Result; # [wasm_bindgen (catch , method , structural , js_class = "FontFace" , js_name = load)] diff --git a/crates/webidl/src/constants.rs b/crates/webidl/src/constants.rs index d2dfe839f48..076110fd749 100644 --- a/crates/webidl/src/constants.rs +++ b/crates/webidl/src/constants.rs @@ -87,6 +87,8 @@ pub(crate) static IMMUTABLE_SLICE_WHITELIST: Lazy> = Lazy "writeBuffer", "writeTexture", // AudioBuffer - "copyToChannel", // TODO: Add another type's functions here. Leave a comment header with the type name + "copyToChannel", + // FontFace + "FontFace", // TODO: Add another type's functions here. Leave a comment header with the type name ]) });