mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Implement iframe.srcdoc trusted type sink (#36960)
Part of https://github.com/servo/servo/issues/36258 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
9f6a40e6aa
commit
c985c08737
9 changed files with 36 additions and 38 deletions
|
@ -1996,6 +1996,15 @@ impl Element {
|
|||
.unwrap_or_else(|_| TrustedScriptURLOrUSVString::USVString(USVString(value.to_owned())))
|
||||
}
|
||||
|
||||
pub(crate) fn get_trusted_html_attribute(&self, local_name: &LocalName) -> TrustedHTMLOrString {
|
||||
assert_eq!(*local_name, local_name.to_ascii_lowercase());
|
||||
let value = match self.get_attribute(&ns!(), local_name) {
|
||||
Some(attr) => (&**attr.value()).into(),
|
||||
None => "".into(),
|
||||
};
|
||||
TrustedHTMLOrString::String(value)
|
||||
}
|
||||
|
||||
pub(crate) fn get_string_attribute(&self, local_name: &LocalName) -> DOMString {
|
||||
match self.get_attribute(&ns!(), local_name) {
|
||||
Some(x) => x.Value(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue