LibWeb: Amend Element interface to make it compatible with TrustedTypes

This commit is contained in:
Tete17 2025-08-10 23:49:19 +02:00 committed by Luke Wilde
parent 1368744d33
commit db41ea8117
Notes: github-actions[bot] 2025-10-27 16:16:02 +00:00
12 changed files with 93 additions and 61 deletions

View file

@ -573,7 +573,7 @@ WebIDL::ExceptionOr<void> XMLHttpRequest::send(Optional<DocumentOrXMLHttpRequest
// 2. If body is a Document, then set thiss request body to body, serialized, converted, and UTF-8 encoded.
if (body->has<GC::Root<DOM::Document>>()) {
auto string_serialized_document = TRY(body->get<GC::Root<DOM::Document>>().cell()->serialize_fragment(HTML::RequireWellFormed::No));
m_request_body = Fetch::Infrastructure::byte_sequence_as_body(realm, string_serialized_document.bytes());
m_request_body = Fetch::Infrastructure::byte_sequence_as_body(realm, string_serialized_document.to_utf8().bytes());
}
// 3. Otherwise:
else {