mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
Implement trusted types for setAttribute (#38700)
Callers now call `set_attribute` directly, to avoid the trusted types machinery, as well as skip validation. That's not required by spec as well. This implements part of the DOM integration from https://github.com/whatwg/dom/pull/1268 Part of #36258 Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
parent
8290761066
commit
18e05d3aab
18 changed files with 217 additions and 240 deletions
|
@ -17,7 +17,7 @@ use crate::dom::bindings::root::DomRoot;
|
|||
use crate::dom::bindings::str::DOMString;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::trustedtypepolicy::TrustedType;
|
||||
use crate::dom::trustedtypepolicyfactory::TrustedTypePolicyFactory;
|
||||
use crate::dom::trustedtypepolicyfactory::{DEFAULT_SCRIPT_SINK_GROUP, TrustedTypePolicyFactory};
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
|
@ -53,7 +53,7 @@ impl TrustedHTML {
|
|||
global,
|
||||
value,
|
||||
sink,
|
||||
"'script'",
|
||||
DEFAULT_SCRIPT_SINK_GROUP,
|
||||
can_gc,
|
||||
)
|
||||
},
|
||||
|
@ -61,6 +61,10 @@ impl TrustedHTML {
|
|||
TrustedHTMLOrString::TrustedHTML(trusted_html) => Ok(trusted_html.data.clone()),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn data(&self) -> DOMString {
|
||||
self.data.clone()
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for TrustedHTML {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue