diff --git a/dom.bs b/dom.bs index 44de9d21..f6f7588a 100644 --- a/dom.bs +++ b/dom.bs @@ -2821,9 +2821,22 @@ before a child, with an optional suppress observers flag, run
Run the insertion steps with inclusiveDescendant.
If inclusiveDescendant is connected: +
If inclusiveDescendant is connected and is an element:
If inclusiveDescendant's custom element registry is + null, then set inclusiveDescendant's custom element registry to + the result of looking up a custom element registry given + inclusiveDescendant's parent. + + +
Otherwise, if inclusiveDescendant's + custom element registry's is scoped is true, append + inclusiveDescendant's node document to + inclusiveDescendant's custom element registry's + scoped document set. + +
If inclusiveDescendant is custom, then
enqueue a custom element callback reaction with inclusiveDescendant,
callback name "connectedCallback
", and « ».
@@ -2836,9 +2849,29 @@ before a child, with an optional suppress observers flag, run
connectedCallback
will be enqueued automatically during the
upgrade an element algorithm.
Otherwise, if inclusiveDescendant is connected and is a + shadow root: + +
If
Otherwise, if inclusiveDescendant's + custom element registry is non-null and + inclusiveDescendant's custom element registry's + is scoped is true, append inclusiveDescendant's + node document to inclusiveDescendant's + custom element registry's scoped document set. + +
If suppress observers flag is unset, then queue a tree mutation record for @@ -4547,15 +4580,17 @@ and <{template}>. SVG ought to do the same for its <{script}> elements, but does
To clone a node given a node node and an optional document document (default node's node document), boolean -subtree (default false), and -node-or-null parent (default null): +subtree (default false), node-or-null +parent (default null), and null or a +{{CustomElementRegistry}} object fallbackRegistry +(default null):
Let copy be the result of cloning a single node given node and - document. +
Let copy be the result of cloning a single node given node, + document, and fallbackRegistry.
Run any cloning steps defined for node in
other applicable specifications and pass node, copy, and
@@ -4567,8 +4602,9 @@ and an optional document docume
If subtree is true, then for each child of node's
children, in tree order: clone a node given child with
document set to document,
- subtree set to subtree, and
- parent set to copy.
+ subtree set to subtree,
+ parent set to copy, and
+ fallbackRegistry set to fallbackRegistry.
If node is an element, node is a
@@ -4578,11 +4614,18 @@ and an optional document docume
Assert: copy is not a shadow host.
+ Let shadowRootRegistry be node's shadow root's
+ custom element registry.
+
+ If shadowRootRegistry is null, then set shadowRootRegistry to
+ fallbackRegistry.
+
Attach a shadow root with copy, node's
shadow root's mode, true, node's
shadow root's serializable, node's
- shadow root's delegates focus, and node's
- shadow root's slot assignment.
+ shadow root's delegates focus, node's
+ shadow root's slot assignment, and
+ shadowRootRegistry.
Set copy's shadow root's declarative
to node's shadow root's declarative.
@@ -4590,8 +4633,9 @@ and an optional document docume
For each child of node's shadow root's
children, in tree order: clone a node given child with
document set to document,
- subtree set to subtree, and
- parent set to copy's shadow root.
+ subtree set to subtree,
+ parent set to copy's shadow root,
+ and fallbackRegistry set to fallbackRegistry.
Return copy.
@@ -4599,8 +4643,9 @@ and an optional document docume
To clone a single node given a node node and
-document document:
+ To clone a single node given a node node,
+document document, and null or a {{CustomElementRegistry}} object
+fallbackRegistry:
Let copy be null.
@@ -4609,10 +4654,15 @@ and an optional document docume
If node is an element:
Let registry be node's custom element registry.
+
+ If registry is null, then set registry to
+ fallbackRegistry.
+
Set copy to the result of creating an element, given
document, node's local name, node's
- namespace, node's namespace prefix, and
- node's For each attribute of node's
@@ -4620,7 +4670,7 @@ and an optional document docume
Let copyAttribute be the result of cloning a single node given
- attribute and document.
+ attribute, document, and null.
Append copyAttribute to copy.
{{ShadowRoot}} nodes are simply known as
shadow roots.
+ Shadow roots's associated host is never null. Shadow roots have an associated mode (" Shadow roots have an associated delegates focus.
-It is initially set to false. Shadow roots have an associated delegates focus
+(a boolean). 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. Shadow roots have an associated slot assignment
(" Shadow roots have an associated serializable (a boolean).
It is initially set to false. Shadow roots have an associated custom element registry
+(null or a {{CustomElementRegistry}} object). Shadow roots have an associated
+keep custom element registry null (a boolean). It is initially false.
+
+ This can only ever be true in combination with declarative shadow roots. And it only
+matters for as long as the shadow root's custom element registry
+is null.
+
+ 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
invocation target; otherwise shadow root's
host.
+ The The The The {{Element}} nodes are simply known as
elements.
- Elements have an associated
-namespace,
-namespace prefix,
-local name,
-custom element state,
-custom element definition,
- Elements have an associated:
+
+ When an element is created, all of these values are
initialized.
- An element's custom element state is one of
-" An element whose custom element state is
+" Whether or not an element is defined is used to determine the
@@ -6334,14 +6430,18 @@ value of these steps:
To create an element, given a document
document, string localName, string-or-null namespace, and
optionally a string-or-null prefix (default null), string-or-null is (default
-null), and boolean synchronousCustomElements (default false):
+null), boolean synchronousCustomElements (default false), and null or a
+{{CustomElementRegistry}} object registry:
Let result be null.
- Let definition be the result of
- looking up a custom element definition given
- document, namespace, localName, and is.
+ If registry is not given, then set registry to the result of
+ looking up a custom element registry given document.
+
+
+ Let definition be the result of looking up a custom element definition
+ given registry, namespace, localName, and is.
If definition is non-null, and definition's
@@ -6353,13 +6453,9 @@ null), and boolean synchronousCustomElements (default false):
Let interface be the element interface for localName and the
HTML namespace.
- Set result to a new element that implements interface,
- with no attributes, namespace set to the HTML namespace,
- namespace prefix set to prefix, local name set
- to localName, custom element state set to " Set result to the result of creating an element internal given
+ document, interface, localName, the HTML namespace,
+ prefix, " If synchronousCustomElements is true, then run this step while catching any
@@ -6391,74 +6487,82 @@ null), and boolean synchronousCustomElements (default false):
If synchronousCustomElements is true, then run these steps while catching any
- exceptions:
+ If synchronousCustomElements is true:
Let C be definition's
constructor.
- Set result to the result of constructing C, with no
- arguments.
-
- Assert: result's custom element state and
- custom element definition are initialized.
+ Set the surrounding agent's
+ active custom element constructor map[C] to registry.
+
Assert: result's namespace is the HTML namespace.
+ Run these steps while catching any exceptions:
- IDL enforces that result is an {{HTMLElement}} object, which all use
- the HTML namespace.
+ Set result to the result of constructing C, with no
+ arguments.
- If result's attribute list is not empty,
- then throw a "{{NotSupportedError!!exception}}" {{DOMException}}.
+ Assert: result's custom element state and
+ custom element definition are initialized.
- If result has children, then throw a
- "{{NotSupportedError!!exception}}" {{DOMException}}.
+ Assert: result's namespace is the HTML namespace.
- If result's parent is not null, then throw a
- "{{NotSupportedError!!exception}}" {{DOMException}}.
+ IDL enforces that result is an {{HTMLElement}} object, which all
+ use the HTML namespace.
- If result's node document is not document, then
- throw a "{{NotSupportedError!!exception}}" {{DOMException}}.
+ If result's attribute list is not empty,
+ then throw a "{{NotSupportedError!!exception}}" {{DOMException}}.
- If result's local name is not equal to
- localName, then throw a "{{NotSupportedError!!exception}}" {{DOMException}}.
+ If result has children, then throw a
+ "{{NotSupportedError!!exception}}" {{DOMException}}.
- Set result's namespace prefix to prefix.
+ If result's parent is not null, then throw a
+ "{{NotSupportedError!!exception}}" {{DOMException}}.
- Set result's If result's node document is not document, then
+ throw a "{{NotSupportedError!!exception}}" {{DOMException}}.
- If any of these steps threw an exception exception:
+ If result's local name is not equal to
+ localName, then throw a "{{NotSupportedError!!exception}}" {{DOMException}}.
- Report exception for definition's
- constructor's corresponding JavaScript object's
- associated realm's global object.
+ Set result's namespace prefix to prefix.
+
+ Set result's Set result to a new element that implements the
- {{HTMLUnknownElement}} interface, with no attributes, namespace set to the
- HTML namespace, namespace prefix set to prefix,
- local name set to localName,
- custom element state set to " Set result's custom element registry to
+ registry.
+ If any of these steps threw an exception exception:
+
+ Report exception for
+ definition's constructor's corresponding
+ JavaScript object's associated realm's global object.
+
+ Set result to the result of creating an element internal given
+ document, {{HTMLUnknownElement}}, localName, the HTML namespace,
+ prefix, " Remove the surrounding agent's
+ active custom element constructor map[C].
+
+
+ Under normal circumstances it will already have been removed at this point.
Otherwise:
Set result to a new element that implements the {{HTMLElement}}
- interface, with no attributes, namespace set to the HTML namespace,
- namespace prefix set to prefix, local name set
- to localName, custom element state set to
- " Set result to the result of creating an element internal given
+ document, {{HTMLElement}}, localName, the HTML namespace,
+ prefix, " Enqueue a custom element upgrade reaction given result and
definition.
@@ -6474,13 +6578,9 @@ null), and boolean synchronousCustomElements (default false):
Let interface be the element interface for localName and
namespace.
- Set result to a new element that implements interface,
- with no attributes, namespace set to namespace,
- namespace prefix set to prefix, local name set
- to localName, custom element state set to
- " Set result to the result of creating an element internal given
+ document, interface, localName, namespace,
+ prefix, " If namespace is the HTML namespace, and either localName is a
valid custom element name or is is non-null, then set result's
@@ -6491,6 +6591,26 @@ null), and boolean synchronousCustomElements (default false):
Return result.
To create an element internal given a document document, an
+interface interface a string localName, a string-or-null namespace,
+a string-or-null prefix, a string state, a string-or-null is, and
+null or a {{CustomElementRegistry}} object registry:
+
+ Let element be a new element that implements interface,
+ with namespace set to namespace, namespace prefix
+ set to prefix, local name set to localName,
+ custom element registry set to registry,
+ custom element state set to state,
+ custom element definition set to null, Assert: element's attribute list
+ is empty.
+
+ Return element.
+ Elements also have an
attribute list, which is a
list exposed through a {{NamedNodeMap}}. Unless explicitly given when an
@@ -7054,12 +7174,12 @@ are:
Creates a shadow root for element and returns it.
- Returns element's shadow root, if any, and if
- shadow root's mode is " A valid shadow host name is:
@@ -7090,11 +7210,16 @@ are:
The Let registry be this's custom element registry.
+
+ If init["{{ShadowRootInit/customElements}}"] exists, then set
+ registry to it.
+
Run attach a shadow root with this,
init["{{ShadowRootInit/mode}}"], init["{{ShadowRootInit/clonable}}"],
init["{{ShadowRootInit/serializable}}"],
- init["{{ShadowRootInit/delegatesFocus}}"], and
- init["{{ShadowRootInit/slotAssignment}}"].
+ init["{{ShadowRootInit/delegatesFocus}}"],
+ init["{{ShadowRootInit/slotAssignment}}"], and registry.
Return this's shadow root.
To attach a shadow root, given an
element element, a string mode, a boolean clonable,
-a boolean serializable, a boolean delegatesFocus, and a string
-slotAssignment:
+a boolean serializable, a boolean delegatesFocus, a string
+slotAssignment, and null or a {{CustomElementRegistry}} object registry:
If element's namespace is not the HTML namespace,
@@ -7119,10 +7244,10 @@ a boolean serializable, a boolean delegatesFocus, and a st
element's Let definition be the result of
- looking up a custom element definition given
- element's node document, its namespace, its
- local name, and its Let definition be the result of looking up a custom element definition
+ given element's custom element registry, its
+ namespace, its local name, and its
+ If definition is not null and definition's
disable shadow is true, then throw a
@@ -7178,6 +7303,9 @@ a boolean serializable, a boolean delegatesFocus, and a st
Set shadow's serializable to serializable.
+ Set shadow's custom element registry to
+ registry.
+
Set element's shadow root to shadow.
Returns element's {{CustomElementRegistry}} object, if any; otherwise null.
+ The
+
is
value.
+ namespace, node's namespace prefix,
+ node's is
value, false, and registry.
@@ -6051,6 +6101,9 @@ interface ShadowRoot : DocumentFragment {
readonly attribute boolean clonable;
readonly attribute boolean serializable;
readonly attribute Element host;
+
+ readonly attribute CustomElementRegistry? customElements;
+
attribute EventHandler onslotchange;
};
@@ -6061,22 +6114,23 @@ enum SlotAssignmentMode { "manual", "named" };
open
"
or "closed
").manual
" or "named
").
@@ -6086,12 +6140,26 @@ It is initially set to false.
+
+
mode
getter steps are to return
this's mode.host
getter steps are to return
this's host.
+
+
+customElements
getter steps are to return
+this's custom element registry.
+
+
+
onslotchange
attribute is an
event handler IDL attribute for the
onslotchange
event handler, whose
@@ -6222,6 +6297,8 @@ interface Element : Node {
ShadowRoot attachShadow(ShadowRootInit init);
readonly attribute ShadowRoot? shadowRoot;
+ readonly attribute CustomElementRegistry? customElements;
+
Element? closest(DOMString selectors);
boolean matches(DOMString selectors);
boolean webkitMatchesSelector(DOMString selectors); // legacy alias of .matches
@@ -6240,28 +6317,47 @@ dictionary ShadowRootInit {
SlotAssignmentMode slotAssignment = "named";
boolean clonable = false;
boolean serializable = false;
+ CustomElementRegistry customElements;
};
is
value. When an
-element is created, all of these values are
+
+
+
+undefined
", "failed
", "uncustomized
",
+ "precustomized
", or "custom
".
+
+ is
value
+ undefined
", "failed
", "uncustomized
",
-"precustomized
", or "custom
". An element whose
-custom element state is "uncustomized
" or "custom
" is
-said to be defined. An element
-whose custom element state is "custom
" is said to be
+uncustomized
" or "custom
" is said to be
+defined. An element whose
+custom element state is "custom
" is said to be
custom.
undefined
",
- custom element definition set to null,
- is
value set to is, and node document set to
- document.
+ undefined
", is, and registry.
-
+
+ is
value to null.
-
-
+
+ is
value to null.
- failed
",
- custom element definition set to null,
- is
value set to null, and node document set to
- document.
+
+
+
+ failed
", null, and registry.
+
-
+undefined
", custom element definition set to null,
- is
value set to null, and node document set to
- document.
+ undefined
", null, and registry.
uncustomized
", custom element definition set to null,
- is
value set to is, and node document set to
- document.
+ uncustomized
", is, and registry.
+
+
is
value
+ set to is, and node document set to document.
+
+
-
var shadow = element . {{attachShadow(init)}}
+ shadow = element . {{attachShadow(init)}}
var shadow = element . {{shadowRoot}}
+ shadow = element . {{shadowRoot}}
open
", and null otherwise.
+ shadow root's mode is "open
"; otherwise null.
attachShadow(init)
method steps are:
+
@@ -7103,8 +7228,8 @@ are:
is
value is non-null:
-
is
value.
+ is
value.
+
+
+
+registry = element . {{Element/customElements}}
+ customElements
getter steps are to return
+this's custom element registry.
+
+
element . {{closest(selectors)}}