mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
Implement Trusted Types for ShadowRoot (#38595)
Also make TrustedHTML work the same as TrustedScript by only taking 1 `&str` to make things easier. Part of #36258 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
parent
abc549eff7
commit
3976fa77bc
10 changed files with 38 additions and 52 deletions
|
@ -43,18 +43,16 @@ impl TrustedHTML {
|
|||
pub(crate) fn get_trusted_script_compliant_string(
|
||||
global: &GlobalScope,
|
||||
value: TrustedHTMLOrString,
|
||||
containing_class: &str,
|
||||
field: &str,
|
||||
sink: &str,
|
||||
can_gc: CanGc,
|
||||
) -> Fallible<DOMString> {
|
||||
match value {
|
||||
TrustedHTMLOrString::String(value) => {
|
||||
let sink = format!("{} {}", containing_class, field);
|
||||
TrustedTypePolicyFactory::get_trusted_type_compliant_string(
|
||||
TrustedType::TrustedHTML,
|
||||
global,
|
||||
value,
|
||||
&sink,
|
||||
sink,
|
||||
"'script'",
|
||||
can_gc,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue