Truly independent web browser
// https://w3c.github.io/trusted-types/dist/spec/#typedefdef-trustedtype
typedef (TrustedHTML or TrustedScript or TrustedScriptURL) TrustedType;
// https://w3c.github.io/trusted-types/dist/spec/#trusted-type-policy
[Exposed=(Window,Worker), ImplementedIn=Rust]
interface TrustedTypePolicy {
readonly attribute DOMString name;
[NeedsCallerRealm] TrustedHTML createHTML(DOMString input, any... arguments);
[NeedsCallerRealm] TrustedScript createScript(DOMString input, any... arguments);
[NeedsCallerRealm] TrustedScriptURL createScriptURL(DOMString input, any... arguments);
[Exposed=Window] TrustedHTMLParserOptions createParserOptions(optional SetHTMLUnsafeOptions options = {}, any... arguments);
};
// https://w3c.github.io/trusted-types/dist/spec/#trusted-type-policy-options
dictionary TrustedTypePolicyOptions {
CreateHTMLCallback createHTML;
CreateScriptCallback createScript;
CreateScriptURLCallback createScriptURL;
CreateParserOptionsCallback createParserOptions;
};
callback CreateHTMLCallback = DOMString? (DOMString input, any... arguments);
callback CreateScriptCallback = DOMString? (DOMString input, any... arguments);
callback CreateScriptURLCallback = USVString? (DOMString input, any... arguments);
callback CreateParserOptionsCallback = SetHTMLUnsafeOptions? (SetHTMLUnsafeOptions options, any... arguments);