LibWeb: Enumerate all injection sinks relevant to the TrustedTypes spec

This enables us to more strictly control the available sinks we support.
This commit is contained in:
Tete17 2025-08-09 02:11:32 +02:00 committed by Luke Wilde
parent af933c2721
commit 2083708897
Notes: github-actions[bot] 2025-09-01 15:21:11 +00:00
7 changed files with 60 additions and 12 deletions

View file

@ -637,14 +637,14 @@ GC::Ptr<Selection::Selection> Document::get_selection() const
WebIDL::ExceptionOr<void> Document::write(Vector<String> const& text)
{
// The document.write(...text) method steps are to run the document write steps with this, text, false, and "Document write".
return run_the_document_write_steps(text, AddLineFeed::No, TrustedTypes::InjectionSink::DocumentWrite);
return run_the_document_write_steps(text, AddLineFeed::No, TrustedTypes::InjectionSink::Documentwrite);
}
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-writeln
WebIDL::ExceptionOr<void> Document::writeln(Vector<String> const& text)
{
// The document.writeln(...text) method steps are to run the document write steps with this, text, true, and "Document writeln".
return run_the_document_write_steps(text, AddLineFeed::Yes, TrustedTypes::InjectionSink::DocumentWriteln);
return run_the_document_write_steps(text, AddLineFeed::Yes, TrustedTypes::InjectionSink::Documentwriteln);
}
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#document-write-steps