-
Notifications
You must be signed in to change notification settings - Fork 54
/
trusted-types.tentative.idl
53 lines (44 loc) · 1.52 KB
/
trusted-types.tentative.idl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// https://github.com/wicg/trusted-types
typedef (DOMString or TrustedHTML) HTMLString;
typedef (DOMString or TrustedScript) ScriptString;
typedef (DOMString or TrustedScriptURL) ScriptURLString;
typedef (USVString or TrustedURL) URLString;
[Exposed=(Window, Worker)]
interface TrustedHTML {
stringifier;
};
[Exposed=(Window, Worker)]
interface TrustedScript {
stringifier;
};
[Exposed=(Window, Worker)]
interface TrustedScriptURL {
stringifier;
};
[Exposed=(Window, Worker)]
interface TrustedURL {
stringifier;
};
[Exposed=(Window, Worker)]
interface TrustedTypePolicyFactory {
[Unforgeable] TrustedTypePolicy createPolicy(DOMString policyName, TrustedTypePolicyOptions policyOptions);
// All the policy object names that have been created
[Unforgeable] sequence<DOMString> getPolicyNames();
};
[Exposed=(Window, Worker)]
interface TrustedTypePolicy {
[Unforgeable] readonly attribute DOMString name;
[Unforgeable] TrustedHTML createHTML(DOMString input);
[Unforgeable] TrustedScript createScript(DOMString input);
[Unforgeable] TrustedScriptURL createScriptURL(DOMString input);
[Unforgeable] TrustedURL createURL(DOMString input);
};
dictionary TrustedTypePolicyOptions {
CreateHTMLCallback createHTML;
CreateScriptCallback createScript;
CreateURLCallback createScriptURL;
CreateURLCallback createURL;
};
callback CreateHTMLCallback = DOMString (DOMString input);
callback CreateScriptCallback = DOMString (DOMString input);
callback CreateURLCallback = USVString (DOMString input);