diff --git a/dom.bs b/dom.bs index 09595a60..491e2691 100644 --- a/dom.bs +++ b/dom.bs @@ -42,8 +42,9 @@ urlPrefix: https://w3c.github.io/hr-time/#; spec: HR-TIME
spec:html; type:element - text: title + text: head text: script + text: title@@ -2829,10 +2830,24 @@ before a child, with an optional suppress observers flag, run
Run the insertion steps with inclusiveDescendant. +
If inclusiveDescendant is connected: +
If inclusiveDescendant 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 « ».
@@ -2845,9 +2860,27 @@ 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 a shadow root: + +
If inclusiveDescendant's custom element registry is + null and inclusiveDescendant's + keep custom element registry null is false, then set + inclusiveDescendant's custom element registry to the result + of looking up a custom element registry given inclusiveDescendant's + host. + +
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 @@ -3267,12 +3300,31 @@ otherwise, if there is no such element, null.
interface mixin DocumentOrShadowRoot { + readonly attribute CustomElementRegistry? customElementRegistry; }; Document includes DocumentOrShadowRoot; ShadowRoot includes DocumentOrShadowRoot;-
The {{DocumentOrShadowRoot}} mixin is expected to be used by other +
registry = documentOrShadowRoot . {{DocumentOrShadowRoot/customElementRegistry}}
+ Returns documentOrShadowRoot's {{CustomElementRegistry}} object, if any; + otherwise null. +
The customElementRegistry
getter steps
+are:
+
+
If this is a document, then return this's + custom element registry. + +
Return this's custom element registry. +
The {{DocumentOrShadowRoot}} mixin is also expected to be used by other standards that want to define APIs shared between documents and shadow roots. @@ -4703,15 +4755,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
@@ -4723,8 +4777,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
@@ -4734,20 +4789,28 @@ and an optional document docume
Assert: copy is not a shadow host.
+ Let shadowRootRegistry be node's shadow root's
+ custom element registry.
+
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.
- 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.
+ 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.
+
+ This intentionally does not pass the
+ fallbackRegistry argument.
Return copy.
@@ -4755,8 +4818,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.
@@ -4765,10 +4829,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
@@ -4776,7 +4845,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.
Set copy's encoding, content type,
- URL, origin, type, and
- mode to those of node.
+ URL, origin, type,
+ mode, and custom element registry to those of
+ node.
+
Set copy's name, public ID, and
@@ -5306,7 +5377,7 @@ interface Document : Node {
[NewObject] Comment createComment(DOMString data);
[NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
- [CEReactions, NewObject] Node importNode(Node node, optional boolean subtree = false);
+ [CEReactions, NewObject] Node importNode(Node node, optional (boolean or ImportNodeOptions) options = false);
[CEReactions] Node adoptNode(Node node);
[NewObject] Attr createAttribute(DOMString localName);
@@ -5325,8 +5396,14 @@ interface Document : Node {
interface XMLDocument : Document {};
dictionary ElementCreationOptions {
+ CustomElementRegistry customElementRegistry;
DOMString is;
};
+
+dictionary ImportNodeOptions {
+ CustomElementRegistry customElementRegistry;
+ boolean selfOnly = false;
+};
{{Document}} nodes are simply
@@ -5340,8 +5417,9 @@ known as documents.
URL (a URL),
origin (an origin),
type (" A document is said to be an XML document if its
type is " If localName does not match the When supplied, options's {{ElementCreationOptions/customElementRegistry}} can be
+ used to set the {{CustomElementRegistry}}.
When supplied, options's {{ElementCreationOptions/is}} can be used to create a
customized built-in element.
+ If localName does not match the When both options's {{ElementCreationOptions/customElementRegistry}} and
+ options's {{ElementCreationOptions/is}} are supplied, a
+ "{{NotSupportedError!!exception}}" {{DOMException}} will be thrown.
+
When supplied, options's {{ElementCreationOptions/customElementRegistry}} can be
+ used to set the {{CustomElementRegistry}}.
+
+ When supplied, options's {{ElementCreationOptions/is}} can be used to create a
+ customized built-in element.
+
If qualifiedName does not match the When supplied, options's {{ElementCreationOptions/is}} can be used to create a
- customized built-in element.
+ When both options's {{ElementCreationOptions/customElementRegistry}} and
+ options's {{ElementCreationOptions/is}} are supplied, a
+ "{{NotSupportedError!!exception}}" {{DOMException}} will be thrown.
If this is an HTML document, then set localName to
localName in ASCII lowercase.
- Let is be null.
-
- If options is a dictionary and
- options["{{ElementCreationOptions/is}}"] exists, then set is
- to it.
+ Let registry and is be the result of
+ flattening element creation options given options and this.
Let namespace be the HTML namespace, if this is an
HTML document or this's content type is
" Return the result of creating an element given this, localName,
- namespace, null, is, and true.
+ namespace, null, is, true, and registry.
The internal Let namespace, prefix, and localName be the result of
passing namespace and qualifiedName to validate and extract.
- Let is be null.
-
- If options is a dictionary and
- options["{{ElementCreationOptions/is}}"] exists, then set is
- to it.
+ Let registry and is be the result of
+ flattening element creation options given options and this.
Return the result of creating an element given document,
- localName, namespace, prefix, is, and true.
+ localName, namespace, prefix, is, true, and
+ registry.
The
@@ -5668,6 +5756,34 @@ method steps are to return the result of running the
internal To flatten element creation options, given a string or {{ElementCreationOptions}}
+dictionary options and a document document:
+
+ Let registry be null.
+
+ Let is be null.
+
+ If options is a dictionary:
+
+ If registry is null, then set registry to the result of
+ looking up a custom element registry given document.
+
+ Return registry and is.
+ {{Document/createElement()}} and {{Document/createElementNS()}}'s options
parameter is allowed to be a string for web compatibility.
@@ -5733,11 +5849,15 @@ method steps are:
Returns a copy of node. If subtree is true, the copy also includes the
+ Returns a copy of node. If options is true or options is a
+ dictionary whose {{ImportNodeOptions/selfOnly}} is false, the copy also includes the
node's descendants.
+ options's {{ImportNodeOptions/customElementRegistry}} can be used to set the
+ {{CustomElementRegistry}} of elements that have none.
+
If node is a document or a shadow root, throws a
"{{NotSupportedError!!exception}}" {{DOMException}}.
@@ -5753,16 +5873,37 @@ method steps are:
The The If node is a document or shadow root, then throw
a "{{NotSupportedError!!exception}}" {{DOMException}}.
+ Let subtree be false.
+
+ Let registry be null.
+
+ If options is a boolean, then set subtree to options.
+
+ Otherwise:
+
+ Set subtree to the negation of
+ options["{{ImportNodeOptions/selfOnly}}"].
+
+ If options["{{ImportNodeOptions/customElementRegistry}}"]
+ exists, then set registry to it.
+ If registry is null, then set registry to the result of
+ looking up a custom element registry given this.
+
Return the result of cloning a node given node with
- document set to this and
- subtree set to subtree.
+ document set to this,
+ subtree set to subtree, and
+ fallbackRegistry set to registry.
{{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). It is initially null. 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 {{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
@@ -6490,14 +6669,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 " Let result be null.
+ If registry is " Let definition be the result of
- looking up a custom element definition given
- document, namespace, localName, and is.
+ looking up a custom element definition given registry,
+ namespace, localName, and is.
If definition is non-null, and definition's
@@ -6509,13 +6692,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
@@ -6547,74 +6726,81 @@ 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'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].
- 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 " 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.
@@ -6630,13 +6816,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
@@ -6647,6 +6829,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
@@ -7217,12 +7419,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:
@@ -7253,11 +7455,16 @@ are:
The Let registry be this's custom element registry.
+
+ If init["{{ShadowRootInit/customElementRegistry}}"] 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,
@@ -7282,10 +7489,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
@@ -7341,6 +7548,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.
@@ -4790,8 +4859,10 @@ and an optional document docume
xml
" or "html
"),
-mode ("no-quirks
", "quirks
", or "limited-quirks
"), and
-allow declarative shadow roots (a boolean).
+mode ("no-quirks
", "quirks
", or "limited-quirks
"),
+allow declarative shadow roots (a boolean), and
+custom element registry (null or a {{CustomElementRegistry}} object).
[[!ENCODING]]
[[!URL]]
[[!HTML]]
@@ -5351,7 +5429,8 @@ known as documents.
"application/xml
", URL is "about:blank
",
origin is an opaque origin,
type is "xml
", mode is
-"no-quirks
", and its allow declarative shadow roots is false.
+"no-quirks
", allow declarative shadow roots is false, and
+custom element registry is null.
xml
"; otherwise an HTML document.
@@ -5548,12 +5627,19 @@ method steps are to return the list of elements with class names classNa
document is an HTML document or document's
content type is "application/xhtml+xml
"; otherwise null.
- Name
production an
- "{{InvalidCharacterError!!exception}}" {{DOMException}} will be thrown.
+ Name
production an
+ "{{InvalidCharacterError!!exception}}" {{DOMException}} will be thrown.
+
+ element = document . createElementNS(namespace, qualifiedName [, options])
QName
production an
"{{InvalidCharacterError!!exception}}" {{DOMException}} will be thrown.
@@ -5584,8 +5676,9 @@ method steps are to return the list of elements with class names classNa
is "xmlns
".
- documentFragment = document . {{createDocumentFragment()}}
application/xhtml+xml
"; otherwise null.
createElementNS
steps, given document,
@@ -5652,14 +5742,12 @@ method steps are:
createElementNS
steps, given this, namespace,
qualifiedName, and options.
+
+
+
-
importNode(node, subtree)
+importNode(node, options)
method steps are:
+
+
+ open
"
or "closed
").manual
" or "named
").
@@ -6242,12 +6385,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.
+
+
onslotchange
attribute is an
event handler IDL attribute for the
onslotchange
event handler, whose
@@ -6378,6 +6537,8 @@ interface Element : Node {
ShadowRoot attachShadow(ShadowRootInit init);
readonly attribute ShadowRoot? shadowRoot;
+ readonly attribute CustomElementRegistry? customElementRegistry;
+
Element? closest(DOMString selectors);
boolean matches(DOMString selectors);
boolean webkitMatchesSelector(DOMString selectors); // legacy alias of .matches
@@ -6396,28 +6557,46 @@ dictionary ShadowRootInit {
SlotAssignmentMode slotAssignment = "named";
boolean clonable = false;
boolean serializable = false;
+ CustomElementRegistry customElementRegistry;
};
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.
default
",
+null, or a {{CustomElementRegistry}} object registry (default "default
"):
default
", then set registry to the result
+ of looking up a custom element registry given document.
+
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
", null, and registry.
+ failed
",
- custom element definition set to null,
- is
value set to null, and node document set to
- document.
+
-
+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:
+
@@ -7266,8 +7473,8 @@ are:
is
value is non-null:
-
is
value.
+ is
value.
+
+
+
+registry = element . {{Element/customElementRegistry}}
+ customElementRegistry
getter steps are to
+return this's custom element registry.
+
+
element . {{closest(selectors)}}