2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2013-12-02 14:26:11 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
|
|
|
* https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html
|
|
|
|
*
|
|
|
|
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
|
|
|
* liability, trademark and document use rules apply.
|
|
|
|
*/
|
|
|
|
|
2017-10-19 09:44:35 +03:00
|
|
|
// https://dom.spec.whatwg.org/#enumdef-shadowrootmode
|
|
|
|
enum ShadowRootMode {
|
|
|
|
"open",
|
|
|
|
"closed"
|
|
|
|
};
|
|
|
|
|
|
|
|
// https://dom.spec.whatwg.org/#shadowroot
|
2019-09-27 18:26:14 +03:00
|
|
|
[Exposed=Window]
|
2013-12-02 14:26:11 +04:00
|
|
|
interface ShadowRoot : DocumentFragment
|
|
|
|
{
|
2017-10-19 09:44:35 +03:00
|
|
|
// Shadow DOM v1
|
|
|
|
readonly attribute ShadowRootMode mode;
|
|
|
|
readonly attribute Element host;
|
|
|
|
|
2013-12-02 14:26:11 +04:00
|
|
|
Element? getElementById(DOMString elementId);
|
2019-03-16 03:14:57 +03:00
|
|
|
|
2019-11-15 15:45:40 +03:00
|
|
|
// https://w3c.github.io/DOM-Parsing/#the-innerhtml-mixin
|
2019-03-02 07:22:05 +03:00
|
|
|
[CEReactions, SetterThrows]
|
|
|
|
attribute [TreatNullAs=EmptyString] DOMString innerHTML;
|
2018-06-29 23:39:46 +03:00
|
|
|
|
|
|
|
// When JS invokes importNode or createElement, the binding code needs to
|
|
|
|
// create a reflector, and so invoking those methods directly on the content
|
|
|
|
// document would cause the reflector to be created in the content scope,
|
|
|
|
// at which point it would be difficult to move into the UA Widget scope.
|
|
|
|
// As such, these methods allow UA widget code to simultaneously create nodes
|
|
|
|
// and associate them with the UA widget tree, so that the reflectors get
|
|
|
|
// created in the right scope.
|
2020-02-05 00:28:57 +03:00
|
|
|
[CEReactions, Throws, Func="IsChromeOrUAWidget"]
|
2018-06-29 23:39:46 +03:00
|
|
|
Node importNodeAndAppendChildAt(Node parentNode, Node node, optional boolean deep = false);
|
|
|
|
|
2020-02-05 00:28:57 +03:00
|
|
|
[CEReactions, Throws, Func="IsChromeOrUAWidget"]
|
2018-06-29 23:39:46 +03:00
|
|
|
Node createElementAndAppendChildAt(Node parentNode, DOMString localName);
|
|
|
|
|
|
|
|
// For triggering UA Widget scope in tests.
|
|
|
|
[ChromeOnly]
|
2018-08-19 00:32:38 +03:00
|
|
|
void setIsUAWidget();
|
2018-11-02 11:12:21 +03:00
|
|
|
[ChromeOnly]
|
|
|
|
boolean isUAWidget();
|
2013-12-02 14:26:11 +04:00
|
|
|
};
|
|
|
|
|
2019-09-24 18:22:26 +03:00
|
|
|
ShadowRoot includes DocumentOrShadowRoot;
|