diff --git a/dom.bs b/dom.bs index b4c0abd3..bbd155dc 100644 --- a/dom.bs +++ b/dom.bs @@ -4465,15 +4465,36 @@ dom-Range-extractContents, dom-Range-cloneContents --> copy, if copy is a document, and set copy's node document to document otherwise. -
Run any cloning steps defined for node in other applicable specifications and pass copy, node, - document and the clone children flag if set, as parameters. + document, and the clone children flag if set, as parameters. -
If the clone children flag is set, then for each child + child of node, in tree order: append the result of + cloning child with document and the + clone children flag set, to copy. -
If node is a shadow host whose shadow root's + clonable is true: + +
Run attach a shadow root with copy, node's + shadow root's mode, true, node's + shadow root's delegates focus, and node's + shadow root's slot assignment. + +
Set copy's shadow root's declarative + to node's shadow root's declarative. + +
If the clone children flag is set, then for each child + child of node's shadow root, in tree order: + append the result of cloning child with + document and the clone children flag set, to copy's + shadow root. +
Return copy.
The cloneNode(deep)
method steps are:
@@ -4973,8 +4994,9 @@ known as documents.
content type (a string),
URL (a URL),
origin (an origin),
-type ("xml
" or "html
"), and
-mode ("no-quirks
", "quirks
", or "limited-quirks
").
+type ("xml
" or "html
"),
+mode ("no-quirks
", "quirks
", or "limited-quirks
"), and
+allow declarative shadow roots (a boolean).
[[!ENCODING]]
[[!URL]]
[[!HTML]]
@@ -4983,8 +5005,8 @@ known as documents.
encoding, content type is
"application/xml
", URL is "about:blank
",
origin is an opaque origin,
-type is "xml
", and its
-mode is "no-quirks
".
+type is "xml
", mode is
+"no-quirks
", and its allow declarative shadow roots is false.
A document is said to be an XML document if its type
is "xml
"; otherwise an HTML document. Whether a document is an
@@ -5857,6 +5879,9 @@ It is initially set to false.
Shadow roots have an associated available to element internals. It is initially set to false.
+Shadow roots have an associated declarative +(a boolean). It is initially set to false.
+Shadow roots's associated host is never null.
@@ -5864,6 +5889,9 @@ It is initially set to false.Shadow roots have an associated slot assignment
("manual
" or "named
").
+
Shadow roots have an associated clonable (a boolean). +It is initially set to false.
+A shadow root's get the parent algorithm, given an event, returns
null if event's composed flag is unset and shadow root is the
root of event's path's first struct's
@@ -6010,6 +6038,7 @@ dictionary ShadowRootInit {
required ShadowRootMode mode;
boolean delegatesFocus = false;
SlotAssignmentMode slotAssignment = "named";
+ boolean clonable = false;
};
@@ -6857,23 +6886,39 @@ are:
"span
"
+
The attachShadow(init)
method steps are:
If this's namespace is not the HTML namespace, +
Run attach a shadow root with this, + init["{{ShadowRootInit/mode}}"], init["{{ShadowRootInit/clonable}}"], + init["{{ShadowRootInit/delegatesFocus}}"], and + init["{{ShadowRootInit/slotAssignment}}"]. + +
Return this's shadow root. +
To attach a shadow root, given an +element element, a string mode, a boolean clonable, +a boolean delegatesFocus, and a boolean slotAssignment: + +
If element's namespace is not the HTML namespace, then throw a "{{NotSupportedError!!exception}}" {{DOMException}}. -
If this's local name is not a valid shadow host name, then - throw a "{{NotSupportedError!!exception}}" {{DOMException}}. +
If element's is not a valid shadow host name, then throw a + "{{NotSupportedError!!exception}}" {{DOMException}}.
If this's local name is a valid custom element name, or
- this's is
value is not null, then:
+
If element's local name is a valid custom element name, or
+ element's is
value is non-null, then:
Let definition be the result of
looking up a custom element definition given
- this's node document, its namespace, its
+ element's node document, its namespace, its
local name, and its is
value.
If definition is not null and definition's @@ -6882,38 +6927,53 @@ are:
If this is a shadow host, then throw an - "{{NotSupportedError!!exception}}" {{DOMException}}. +
If element is a shadow host, then: + +
If element's shadow root's declarative + is false, then throw an "{{NotSupportedError!!exception}}" {{DOMException}}. + +
Otherwise, remove all of element's shadow root's + children, in tree order, and return. + +
This means that if multiple declarative shadow roots are contained within a single + shadow host, only the last one will remain. +
Let shadow be a new shadow root whose node document - is this's node document, host is this, - and mode is init["{{ShadowRootInit/mode}}"]. + is element's node document, host is + element, and mode is mode. -
Set shadow's delegates focus to - init["{{ShadowRootInit/delegatesFocus}}"]. +
Set shadow's delegates focus to delegatesFocus. -
If this's custom element state is "precustomized
" or
- "custom
", then set shadow's
+
If element's custom element state is
+ "precustomized
" or "custom
", then set shadow's
available to element internals to true.
-
Set shadow's slot assignment to - init["{{ShadowRootInit/slotAssignment}}"]. +
Set shadow's slot assignment to slotAssignment. -
Set this's shadow root to shadow. +
Set shadow's declarative to false. -
Return shadow. +
Set shadow's clonable to clonable. + +
Set element's shadow root to shadow.
The shadowRoot
getter steps are:
Let shadow be this's shadow root.
If shadow is null or its mode is "closed
",
- then return null.
Return shadow.