Implement Trusted Types for ShadowRoot (#38595)

Also make TrustedHTML work the same as TrustedScript by
only taking 1 `&str` to make things easier.

Part of #36258

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
Tim van der Lippe 2025-08-11 15:39:55 +02:00 committed by GitHub
parent abc549eff7
commit 3976fa77bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 38 additions and 52 deletions

View file

@ -25,9 +25,8 @@ ShadowRoot includes DocumentOrShadowRoot;
// https://html.spec.whatwg.org/multipage/#dom-parsing-and-serialization
partial interface ShadowRoot {
[CEReactions] undefined setHTMLUnsafe(DOMString html);
[CEReactions, Throws] undefined setHTMLUnsafe((TrustedHTML or DOMString) html);
DOMString getHTML(optional GetHTMLOptions options = {});
// [CEReactions] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML;
[CEReactions, Throws] attribute [LegacyNullToEmptyString] DOMString innerHTML;
[CEReactions, Throws] attribute (TrustedHTML or [LegacyNullToEmptyString] DOMString) innerHTML;
};