Implement trusted HTML sinks for Element (#36941)

Also implements a conversion for `TrustedHTMLOrNullIsEmptyString`
to `TrustedHTMLOrString` to avoid introducing a separate
`get_trusted_script_compliant_string` for the new type.

Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
Tim van der Lippe 2025-05-12 12:53:03 +02:00 committed by GitHub
parent a0dd2c1beb
commit d780fb7695
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 118 additions and 212 deletions

View file

@ -902,7 +902,7 @@ pub(crate) fn handle_get_page_source(
.find_document(pipeline)
.ok_or(ErrorStatus::UnknownError)
.and_then(|document| match document.GetDocumentElement() {
Some(element) => match element.GetOuterHTML(can_gc) {
Some(element) => match element.outer_html(can_gc) {
Ok(source) => Ok(source.to_string()),
Err(_) => {
match XMLSerializer::new(document.window(), None, can_gc)