mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Implement inline CSP check for style element (#36860)
Part of #4577 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com> Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
parent
d73b7653b4
commit
e9f364ef51
14 changed files with 23 additions and 59 deletions
|
@ -4307,16 +4307,16 @@ impl Document {
|
|||
type_: csp::InlineCheckType,
|
||||
source: &str,
|
||||
) -> csp::CheckResult {
|
||||
let element = csp::Element {
|
||||
nonce: el
|
||||
.get_attribute(&ns!(), &local_name!("nonce"))
|
||||
.map(|attr| Cow::Owned(attr.value().to_string())),
|
||||
};
|
||||
let (result, violations) = match self.get_csp_list() {
|
||||
None => {
|
||||
return csp::CheckResult::Allowed;
|
||||
},
|
||||
Some(csp_list) => {
|
||||
let element = csp::Element {
|
||||
nonce: el
|
||||
.get_attribute(&ns!(), &local_name!("nonce"))
|
||||
.map(|attr| Cow::Owned(attr.value().to_string())),
|
||||
};
|
||||
csp_list.should_elements_inline_type_behavior_be_blocked(&element, type_, source)
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue