blob: 02fbefc46ff7b29db032f70177f61081e4bf3db6 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://github.com/wicg/trusted-types
[
Exposed=(Window, Worker),
RuntimeEnabled=TrustedDOMTypes,
SecureContext
] interface TrustedTypePolicyFactory {
[RaisesException] TrustedTypePolicy createPolicy(DOMString policyName, TrustedTypePolicyOptions policyOptions);
readonly attribute TrustedTypePolicy defaultPolicy;
// All the policy object names that have been created
[CallWith=ScriptState] boolean isHTML(any checkedObject);
[CallWith=ScriptState] boolean isScript(any checkedObject);
[CallWith=ScriptState] boolean isScriptURL(any checkedObject);
readonly attribute TrustedHTML emptyHTML;
readonly attribute TrustedScript emptyScript;
// Trusted Types metadata, following the proposal in:
// https://github.com/WICG/trusted-types/pull/149/commits/ecd9ab0b6993674951bfc7b44a04530fce7468a7
DOMString? getPropertyType(DOMString tagName, DOMString property,
optional DOMString elementNS);
DOMString? getAttributeType(DOMString tagName, DOMString attribute,
optional DOMString elementNS, optional DOMString attrNs);
[CallWith=ScriptState] object? getTypeMapping(optional DOMString ns);
};