mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
CanGc fixes in several files (#33958)
* few cangc fixes Signed-off-by: L Ashwin B <lashwinib@gmail.com> * few cangc fixes Signed-off-by: L Ashwin B <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com>
This commit is contained in:
parent
1bf68567b8
commit
ebfea9b352
22 changed files with 170 additions and 129 deletions
|
@ -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.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue