mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
enhance: Add support for unsafe-eval
and wasm-unsafe-eval
(#32893)
Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>
This commit is contained in:
parent
2cf207ddc8
commit
92866ab911
51 changed files with 755 additions and 73 deletions
|
@ -88,8 +88,10 @@ impl HTMLMetaElement {
|
|||
// https://html.spec.whatwg.org/multipage/#attr-meta-http-equiv
|
||||
} else if !self.HttpEquiv().is_empty() {
|
||||
// TODO: Implement additional http-equiv candidates
|
||||
if self.HttpEquiv().to_ascii_lowercase().as_str() == "refresh" {
|
||||
self.declarative_refresh();
|
||||
match self.HttpEquiv().to_ascii_lowercase().as_str() {
|
||||
"refresh" => self.declarative_refresh(),
|
||||
"content-security-policy" => self.apply_csp_list(),
|
||||
_ => {},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -115,6 +117,15 @@ impl HTMLMetaElement {
|
|||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#attr-meta-http-equiv-content-security-policy>
|
||||
fn apply_csp_list(&self) {
|
||||
if let Some(parent) = self.upcast::<Node>().GetParentElement() {
|
||||
if let Some(head) = parent.downcast::<HTMLHeadElement>() {
|
||||
head.set_content_security_policy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#shared-declarative-refresh-steps>
|
||||
fn declarative_refresh(&self) {
|
||||
// 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue