script: make Node::xml_serialize fallible. (#38532)

Testing: [Try run][1] did not reveal any test failures. There doesn't
seem to be any straightforward failure scenarios that can be triggered
in `xml5ever` that are not IO errors and the xml_serialize method simply
serializes to a String buffer.

[1]:
https://github.com/servo/servo/actions/runs/16824267959/job/47657275606l

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Mukilan Thiyagarajan 2025-08-08 17:22:59 +05:30 committed by GitHub
parent 8f52e28225
commit 23c0947072
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 8 deletions

View file

@ -3830,7 +3830,7 @@ impl ElementMethods<crate::DomTypeHolder> for Element {
.html_serialize(ChildrenOnly(Some(qname)), false, vec![], can_gc)
} else {
self.upcast::<Node>()
.xml_serialize(XmlChildrenOnly(Some(qname)))
.xml_serialize(XmlChildrenOnly(Some(qname)))?
};
Ok(TrustedHTMLOrNullIsEmptyString::NullIsEmptyString(result))
@ -3888,7 +3888,7 @@ impl ElementMethods<crate::DomTypeHolder> for Element {
self.upcast::<Node>()
.html_serialize(IncludeNode, false, vec![], can_gc)
} else {
self.upcast::<Node>().xml_serialize(XmlIncludeNode)
self.upcast::<Node>().xml_serialize(XmlIncludeNode)?
};
Ok(TrustedHTMLOrNullIsEmptyString::NullIsEmptyString(result))