aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlvideoelement.rs
diff options
context:
space:
mode:
authorTim van der Lippe <TimvdLippe@users.noreply.github.com>2025-04-13 22:54:59 +0200
committerGitHub <noreply@github.com>2025-04-13 20:54:59 +0000
commit85e4a2b5c7b4d6422d29d65e9948e61c5d2b00f9 (patch)
treec497c1b3897f68bef1ec715b8d21c6757a68a0d1 /components/script/dom/htmlvideoelement.rs
parent5d84acc06e2cb4ee6360059aa0497c6f013acbb8 (diff)
downloadservo-85e4a2b5c7b4d6422d29d65e9948e61c5d2b00f9.tar.gz
servo-85e4a2b5c7b4d6422d29d65e9948e61c5d2b00f9.zip
Update FetchTaskTarget to propagate CSP violations. (#36409)
It also updates the FetchResponseListener to process CSP violations to ensure that iframe elements (amongst others) properly generate the CSP events. These iframe elements are used in the Trusted Types tests themselves and weren't propagating the violations before. However, the tests themselves are still not passing since they also use Websockets, which currently aren't using the fetch machinery itself. That is fixed as part of [1]. [1]: https://github.com/servo/servo/issues/35028 --------- Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com> Signed-off-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Diffstat (limited to 'components/script/dom/htmlvideoelement.rs')
-rw-r--r--components/script/dom/htmlvideoelement.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/script/dom/htmlvideoelement.rs b/components/script/dom/htmlvideoelement.rs
index 49f81f78d8d..a6f9103200b 100644
--- a/components/script/dom/htmlvideoelement.rs
+++ b/components/script/dom/htmlvideoelement.rs
@@ -5,6 +5,7 @@
use std::cell::Cell;
use std::sync::Arc;
+use content_security_policy as csp;
use dom_struct::dom_struct;
use euclid::default::Size2D;
use html5ever::{LocalName, Prefix, local_name, namespace_url, ns};
@@ -416,6 +417,11 @@ impl FetchResponseListener for PosterFrameFetchContext {
fn submit_resource_timing(&mut self) {
network_listener::submit_timing(self, CanGc::note())
}
+
+ fn process_csp_violations(&mut self, _request_id: RequestId, violations: Vec<csp::Violation>) {
+ let global = &self.resource_timing_global();
+ global.report_csp_violations(violations);
+ }
}
impl ResourceTimingListener for PosterFrameFetchContext {