Propagate Trusted Types errors for Node.textContent (#38871)

Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
Tim van der Lippe 2025-08-22 21:41:50 +02:00 committed by GitHub
parent f1a5da6836
commit 10ac177aa5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 52 additions and 85 deletions

View file

@ -4982,7 +4982,7 @@ impl DocumentMethods<crate::DomTypeHolder> for Document {
None => return,
};
let elem = if root.namespace() == &ns!(svg) && root.local_name() == &local_name!("svg") {
let node = if root.namespace() == &ns!(svg) && root.local_name() == &local_name!("svg") {
let elem = root.upcast::<Node>().child_elements().find(|node| {
node.namespace() == &ns!(svg) && node.local_name() == &local_name!("title")
});
@ -5036,7 +5036,7 @@ impl DocumentMethods<crate::DomTypeHolder> for Document {
return;
};
elem.SetTextContent(Some(title), can_gc);
node.set_text_content_for_element(Some(title), can_gc);
}
// https://html.spec.whatwg.org/multipage/#dom-document-head