From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- .../tests/interfaces/sanitizer-api.idl | 61 +++++++++++++--------- 1 file changed, 37 insertions(+), 24 deletions(-) (limited to 'testing/web-platform/tests/interfaces/sanitizer-api.idl') diff --git a/testing/web-platform/tests/interfaces/sanitizer-api.idl b/testing/web-platform/tests/interfaces/sanitizer-api.idl index 117a55fdf7..599d8f82ea 100644 --- a/testing/web-platform/tests/interfaces/sanitizer-api.idl +++ b/testing/web-platform/tests/interfaces/sanitizer-api.idl @@ -3,36 +3,49 @@ // (https://github.com/w3c/webref) // Source: HTML Sanitizer API (https://wicg.github.io/sanitizer-api/) -[ - Exposed=(Window), - SecureContext -] interface Sanitizer { - constructor(optional SanitizerConfig config = {}); +partial interface Element { + [CEReactions] undefined setHTMLUnsafe__TO_BE_MERGED(DOMString html, optional SanitizerConfig config = {}); + [CEReactions] undefined setHTML(DOMString html, optional SanitizerConfig config = {}); +}; - DocumentFragment sanitize((Document or DocumentFragment) input); - Element? sanitizeFor(DOMString element, DOMString input); +partial interface ShadowRoot { + [CEReactions] undefined setHTMLUnsafe__TO_BE_MERGED(DOMString html, optional SanitizerConfig config = {}); + [CEReactions] undefined setHTML(DOMString html, optional SanitizerConfig config = {}); +}; - SanitizerConfig getConfiguration(); - static SanitizerConfig getDefaultConfiguration(); +partial interface Document { + static Document parseHTMLUnsafe__TO_BE_MERGED(DOMString html, optional SanitizerConfig config = {}); + static Document parseHTML(DOMString html, optional SanitizerConfig config = {}); }; -dictionary SetHTMLOptions { - Sanitizer sanitizer; +dictionary SanitizerElementNamespace { + required DOMString name; + DOMString? _namespace = "http://www.w3.org/1999/xhtml"; }; -[SecureContext] -partial interface Element { - undefined setHTML(DOMString input, optional SetHTMLOptions options = {}); + +// Used by "elements" +dictionary SanitizerElementNamespaceWithAttributes : SanitizerElementNamespace { + sequence attributes; + sequence removeAttributes; }; -dictionary SanitizerConfig { - sequence allowElements; - sequence blockElements; - sequence dropElements; - AttributeMatchList allowAttributes; - AttributeMatchList dropAttributes; - boolean allowCustomElements; - boolean allowUnknownMarkup; - boolean allowComments; +typedef (DOMString or SanitizerElementNamespace) SanitizerElement; +typedef (DOMString or SanitizerElementNamespaceWithAttributes) SanitizerElementWithAttributes; + +dictionary SanitizerAttributeNamespace { + required DOMString name; + DOMString? _namespace = null; }; +typedef (DOMString or SanitizerAttributeNamespace) SanitizerAttribute; + +dictionary SanitizerConfig { + sequence elements; + sequence removeElements; + sequence replaceWithChildrenElements; -typedef record> AttributeMatchList; + sequence attributes; + sequence removeAttributes; + + boolean comments; + boolean dataAttributes; +}; -- cgit v1.2.3