From 750dfa0c7079468065b8fb506a4fef5903e77b69 Mon Sep 17 00:00:00 2001 From: Tom Schuster Date: Sun, 26 Nov 2023 11:15:04 +0100 Subject: [PATCH] Remove Gecko-internal CSP dictionary bindings (#3721) --- CHANGELOG.md | 5 + crates/web-sys/Cargo.toml | 4 - crates/web-sys/src/features/gen_Csp.rs | 402 ------------------ .../web-sys/src/features/gen_CspPolicies.rs | 45 -- crates/web-sys/src/features/gen_CspReport.rs | 46 -- .../src/features/gen_CspReportProperties.rs | 181 -------- crates/web-sys/src/features/mod.rs | 24 -- .../webidls/enabled/CSPDictionaries.webidl | 38 -- .../web-sys/webidls/enabled/CSPReport.webidl | 24 -- 9 files changed, 5 insertions(+), 764 deletions(-) delete mode 100644 crates/web-sys/src/features/gen_Csp.rs delete mode 100644 crates/web-sys/src/features/gen_CspPolicies.rs delete mode 100644 crates/web-sys/src/features/gen_CspReport.rs delete mode 100644 crates/web-sys/src/features/gen_CspReportProperties.rs delete mode 100644 crates/web-sys/webidls/enabled/CSPDictionaries.webidl delete mode 100644 crates/web-sys/webidls/enabled/CSPReport.webidl diff --git a/CHANGELOG.md b/CHANGELOG.md index c45e8a41ae0..b28250be07c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,11 @@ * Update the TypeScript signature of `__wbindgen_thread_destroy` to indicate that it's parameters are optional. [#3703](https://github.com/rustwasm/wasm-bindgen/pull/3703) +### Removed + +* Removed Gecko-internal dictionary bindings `Csp`, `CspPolicies`, `CspReport` and `CspReportProperties`. + [#3721](https://github.com/rustwasm/wasm-bindgen/pull/3721) + ## [0.2.88](https://github.com/rustwasm/wasm-bindgen/compare/0.2.87...0.2.88) Released 2023-11-01 diff --git a/crates/web-sys/Cargo.toml b/crates/web-sys/Cargo.toml index afb2bfa55d7..c3c483a00d7 100644 --- a/crates/web-sys/Cargo.toml +++ b/crates/web-sys/Cargo.toml @@ -237,10 +237,6 @@ CredentialsContainer = [] Crypto = [] CryptoKey = [] CryptoKeyPair = [] -Csp = [] -CspPolicies = [] -CspReport = [] -CspReportProperties = [] CssAnimation = ["Animation", "EventTarget"] CssBoxType = [] CssConditionRule = ["CssGroupingRule", "CssRule"] diff --git a/crates/web-sys/src/features/gen_Csp.rs b/crates/web-sys/src/features/gen_Csp.rs deleted file mode 100644 index 5fb46ed9cf0..00000000000 --- a/crates/web-sys/src/features/gen_Csp.rs +++ /dev/null @@ -1,402 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::all)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CSP)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `Csp` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub type Csp; -} -impl Csp { - #[doc = "Construct a new `Csp`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `base-uri` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn base_uri(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("base-uri"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `block-all-mixed-content` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn block_all_mixed_content(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("block-all-mixed-content"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `child-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn child_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("child-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `connect-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn connect_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("connect-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `default-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn default_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("default-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `font-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn font_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("font-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `form-action` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn form_action(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("form-action"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `frame-ancestors` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn frame_ancestors(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frame-ancestors"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `frame-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn frame_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("frame-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `img-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn img_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("img-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `manifest-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn manifest_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("manifest-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `media-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn media_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("media-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `object-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn object_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("object-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `referrer` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn referrer(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("referrer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `report-only` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn report_only(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("report-only"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `report-uri` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn report_uri(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("report-uri"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `require-sri-for` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn require_sri_for(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("require-sri-for"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `sandbox` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn sandbox(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("sandbox"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `script-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn script_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("script-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `style-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn style_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("style-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `upgrade-insecure-requests` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn upgrade_insecure_requests(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("upgrade-insecure-requests"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `worker-src` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Csp`*"] - pub fn worker_src(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("worker-src"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for Csp { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_CspPolicies.rs b/crates/web-sys/src/features/gen_CspPolicies.rs deleted file mode 100644 index 2ee8221acf3..00000000000 --- a/crates/web-sys/src/features/gen_CspPolicies.rs +++ /dev/null @@ -1,45 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::all)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CSPPolicies)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `CspPolicies` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspPolicies`*"] - pub type CspPolicies; -} -impl CspPolicies { - #[doc = "Construct a new `CspPolicies`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspPolicies`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `csp-policies` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspPolicies`*"] - pub fn csp_policies(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("csp-policies"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for CspPolicies { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_CspReport.rs b/crates/web-sys/src/features/gen_CspReport.rs deleted file mode 100644 index 77ef67e05aa..00000000000 --- a/crates/web-sys/src/features/gen_CspReport.rs +++ /dev/null @@ -1,46 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::all)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CSPReport)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `CspReport` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReport`*"] - pub type CspReport; -} -impl CspReport { - #[doc = "Construct a new `CspReport`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReport`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[cfg(feature = "CspReportProperties")] - #[doc = "Change the `csp-report` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReport`, `CspReportProperties`*"] - pub fn csp_report(&mut self, val: &CspReportProperties) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("csp-report"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for CspReport { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_CspReportProperties.rs b/crates/web-sys/src/features/gen_CspReportProperties.rs deleted file mode 100644 index 8b7cb00565b..00000000000 --- a/crates/web-sys/src/features/gen_CspReportProperties.rs +++ /dev/null @@ -1,181 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::all)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CSPReportProperties)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `CspReportProperties` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub type CspReportProperties; -} -impl CspReportProperties { - #[doc = "Construct a new `CspReportProperties`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `blocked-uri` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn blocked_uri(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("blocked-uri"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `column-number` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn column_number(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("column-number"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `document-uri` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn document_uri(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("document-uri"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `line-number` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn line_number(&mut self, val: i32) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("line-number"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `original-policy` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn original_policy(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("original-policy"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `referrer` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn referrer(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("referrer"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `script-sample` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn script_sample(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("script-sample"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `source-file` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn source_file(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("source-file"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `violated-directive` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CspReportProperties`*"] - pub fn violated_directive(&mut self, val: &str) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("violated-directive"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for CspReportProperties { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/mod.rs b/crates/web-sys/src/features/mod.rs index 12094200303..16189dcc688 100644 --- a/crates/web-sys/src/features/mod.rs +++ b/crates/web-sys/src/features/mod.rs @@ -1234,30 +1234,6 @@ mod gen_CryptoKeyPair; #[cfg(feature = "CryptoKeyPair")] pub use gen_CryptoKeyPair::*; -#[cfg(feature = "Csp")] -#[allow(non_snake_case)] -mod gen_Csp; -#[cfg(feature = "Csp")] -pub use gen_Csp::*; - -#[cfg(feature = "CspPolicies")] -#[allow(non_snake_case)] -mod gen_CspPolicies; -#[cfg(feature = "CspPolicies")] -pub use gen_CspPolicies::*; - -#[cfg(feature = "CspReport")] -#[allow(non_snake_case)] -mod gen_CspReport; -#[cfg(feature = "CspReport")] -pub use gen_CspReport::*; - -#[cfg(feature = "CspReportProperties")] -#[allow(non_snake_case)] -mod gen_CspReportProperties; -#[cfg(feature = "CspReportProperties")] -pub use gen_CspReportProperties::*; - #[cfg(feature = "CssAnimation")] #[allow(non_snake_case)] mod gen_CssAnimation; diff --git a/crates/web-sys/webidls/enabled/CSPDictionaries.webidl b/crates/web-sys/webidls/enabled/CSPDictionaries.webidl deleted file mode 100644 index f8de1c9ad82..00000000000 --- a/crates/web-sys/webidls/enabled/CSPDictionaries.webidl +++ /dev/null @@ -1,38 +0,0 @@ -/* 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/. */ - -/** - * Dictionary used to display CSP info. - */ - -dictionary CSP { - boolean report-only = false; - - sequence default-src; - sequence script-src; - sequence object-src; - sequence style-src; - sequence img-src; - sequence media-src; - sequence frame-src; - sequence font-src; - sequence connect-src; - sequence report-uri; - sequence frame-ancestors; - // sequence reflected-xss; // not supported in Firefox - sequence base-uri; - sequence form-action; - sequence referrer; - sequence manifest-src; - sequence upgrade-insecure-requests; - sequence child-src; - sequence block-all-mixed-content; - sequence require-sri-for; - sequence sandbox; - sequence worker-src; -}; - -dictionary CSPPolicies { - sequence csp-policies; -}; diff --git a/crates/web-sys/webidls/enabled/CSPReport.webidl b/crates/web-sys/webidls/enabled/CSPReport.webidl deleted file mode 100644 index 301ca2885c9..00000000000 --- a/crates/web-sys/webidls/enabled/CSPReport.webidl +++ /dev/null @@ -1,24 +0,0 @@ -/* 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/. */ - -/** - * This dictionary holds the parameters used to send - * CSP reports in JSON format. - */ - -dictionary CSPReportProperties { - DOMString document-uri = ""; - DOMString referrer = ""; - DOMString blocked-uri = ""; - DOMString violated-directive = ""; - DOMString original-policy= ""; - DOMString source-file; - DOMString script-sample; - long line-number; - long column-number; -}; - -dictionary CSPReport { - CSPReportProperties csp-report; -};