aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/security_manager.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/security_manager.rs')
-rw-r--r--components/script/security_manager.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/security_manager.rs b/components/script/security_manager.rs
index 2040414384a..30ff4242b39 100644
--- a/components/script/security_manager.rs
+++ b/components/script/security_manager.rs
@@ -19,6 +19,7 @@ use crate::dom::event::{Event, EventBubbles, EventCancelable};
use crate::dom::eventtarget::EventTarget;
use crate::dom::securitypolicyviolationevent::SecurityPolicyViolationEvent;
use crate::dom::types::GlobalScope;
+use crate::script_runtime::CanGc;
use crate::task::TaskOnce;
pub struct CSPViolationReporter {
@@ -100,7 +101,7 @@ impl CSPViolationReporter {
}
}
- fn fire_violation_event(&self) {
+ fn fire_violation_event(&self, can_gc: CanGc) {
let target = self.target.root();
let global = &target.global();
let report = self.get_report(global);
@@ -111,6 +112,7 @@ impl CSPViolationReporter {
EventBubbles::Bubbles,
EventCancelable::Cancelable,
&report.into(),
+ can_gc,
);
event.upcast::<Event>().fire(&target);
@@ -142,7 +144,7 @@ impl TaskOnce for CSPViolationReporter {
// > If target implements EventTarget, fire an event named securitypolicyviolation
// > that uses the SecurityPolicyViolationEvent interface
// > at target with its attributes initialized as follows:
- self.fire_violation_event();
+ self.fire_violation_event(CanGc::note());
// TODO: Support `report-to` directive that corresponds to 5.5.3.5.
}
}