mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Correct event_target for CSP violations (#36887)
All logic is implemented in `report_csp_violations` to avoid pulling in various element-logic into SecurityManager. Update the `icon-blocked.sub.html` WPT test to ensure that the document is the correct target (verified in Firefox and Chrome). Fixes #36806 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
parent
f3f4cc5500
commit
b6b80d4f6f
56 changed files with 167 additions and 193 deletions
|
@ -1040,14 +1040,39 @@ impl From<bool> for EventCancelable {
|
|||
}
|
||||
|
||||
impl From<EventCancelable> for bool {
|
||||
fn from(bubbles: EventCancelable) -> Self {
|
||||
match bubbles {
|
||||
fn from(cancelable: EventCancelable) -> Self {
|
||||
match cancelable {
|
||||
EventCancelable::Cancelable => true,
|
||||
EventCancelable::NotCancelable => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, MallocSizeOf, PartialEq)]
|
||||
pub(crate) enum EventComposed {
|
||||
Composed,
|
||||
NotComposed,
|
||||
}
|
||||
|
||||
impl From<bool> for EventComposed {
|
||||
fn from(boolean: bool) -> Self {
|
||||
if boolean {
|
||||
EventComposed::Composed
|
||||
} else {
|
||||
EventComposed::NotComposed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<EventComposed> for bool {
|
||||
fn from(composed: EventComposed) -> Self {
|
||||
match composed {
|
||||
EventComposed::Composed => true,
|
||||
EventComposed::NotComposed => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, JSTraceable, PartialEq)]
|
||||
#[repr(u16)]
|
||||
#[derive(MallocSizeOf)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue