| // 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 |
| ] interface TrustedTypePolicyFactory : EventTarget { |
| [RaisesException] TrustedTypePolicy createPolicy(DOMString policyName, optional TrustedTypePolicyOptions policyOptions); |
| // 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? getAttributeType(DOMString tagName, DOMString attribute, |
| optional DOMString elementNS, optional DOMString attrNs); |
| DOMString? getPropertyType(DOMString tagName, DOMString property, |
| optional DOMString elementNS); |
| |
| readonly attribute TrustedTypePolicy defaultPolicy; |
| [CallWith=ScriptState] object? getTypeMapping(optional DOMString ns); |
| |
| [RuntimeEnabled=TrustedTypeBeforePolicyCreationEvent] attribute EventHandler onbeforecreatepolicy; |
| }; |