diff --git a/source b/source index 820de145209..7de9a817904 100644 --- a/source +++ b/source @@ -3255,7 +3255,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
HTMLCollection interface, its
length attribute, and its
@@ -5296,6 +5303,277 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
+ Element reference + attributes refer to one or more elements in the document as their target(s). When specified + as content attributes, element reference + attributes refer to other elements via their IDs.
+ +The steps to resolve the reference + target on an element element are:
+ +If element is not a shadow host, or element's + shadow root's reference target is null, then return + element.
+Let referenceTargetValue be the value of element's shadow + root's reference target.
Let candidate be the first element in element's shadow + root whose ID matches + referenceTargetValue.
+If no such element exists, return null.
Return the result of resolving the reference + target on candidate.
A single-element reference attribute represents a reference to a single element. + When specified as a content attribute, a single-element reference consists of a + single token which should completely match the ID of another + element in the document.
+ +A single-element reference attribute attr on an element X + refers to an element Y as its + target if Y is the resolved + attr target element for X.
+The rules to get the resolved + attr target element for a single-element reference attribute + attr and element element are:
+ +Let unresolvedTarget be the + unresolved attr target + element.
If unresolvedTarget is null, return null.
Return the result of resolving the reference + target on unresolvedTarget.
The rules to get the unresolved + attr target element for a single-element reference attribute + attr and element element are:
+ +If the attribute is not specified on element, return null.
If element has an explicitly-set + attr-element which is not null:
+ +If element's explicitly-set + attr-element is a descendant of any of element's + shadow-including ancestors, then let + unresolvedTarget be element's + explicitly-set attr-element.
+Otherwise, let unresolvedTarget be null.
An element will only have an
+ explicitly-set attr-element if it
+ has an IDL attribute with a type of Element which
+ reflects attr.
Otherwise:
+ +Let value be the attribute value.
Let unresolvedTarget be the first element in element's + tree, in tree order whose ID is + value. If no such element exists, let unresolvedTarget be null.
+Return unresolvedTarget.
A label element can use the for attribute to
+ refer to an input element as its target:
<label for="name">Name:</label>
+<input id="name">
+
+ In this example, the input element is the resolved
+ for target element for the label
+ element.
An element with a shadow root may use a reference target to allow
+ for to refer to an element inside of its shadow root:
+
+
<label for="name">Name:</label>
+<fancy-input id="name">
+ <template shadowrootmode="closed"
+ shadowrootreferencetarget="real-input">
+ <input id="real-input">
+ </template>
+</fancy-input>
+
+
+ In this second example, the input inside of the shadow root is the resolved
+ for target element.
A set of element references attribute represents + a set of references to elements. When specified as a content attribute, a set of element + references consists of a set of space-separated tokens, each of which should + completely match the ID of another element in the document.
+ +An unordered set of unique element + references is a set of element references where none of the element references + is repeated.
+ +An ordered set of unique element + references is a set of element references where none of the element references + is repeated, and the order of the elements is meaningful.
+ +A set of element references attribute attr on an element X + refers to an element Y + as a target if Y is one of the + resolved attr target + elements for X.
+The rules to get the resolved attrtarget elements for a + set of element references attribute attr and element element + are:
+ +Let unresolvedTargets be the + unresolved attr target + elements.
Let resolvedTargets be « ».
For each unresolvedTarget of + unresolvedTargets: +
+ +Let resolvedTarget be the result of + resolving the reference target on + unresolvedTarget.
If resolvedTarget is not null, then append resolvedTarget to + resolvedTargets.
Return resolvedTargets.
The rules to get the unresolved attrtarget elements for a + set of element references attribute attr and element element + are:
+ +If the attribute is not specified on element, return null.
Let unresolvedTargets be « ».
If element has an explicitly set attr-elements:
+ +For each attrElement of + element's explicitly set attr-elements:
+ +If attrElement is not a descendant of any of + element's shadow-including + ancestors, then continue.
Append attrElement to + unresolvedTargets.
An element will only have
+ explicitly-set attr-elements if it
+ has an IDL attribute with type FrozenArray<T>?, where T is either
+ Element or an interface that inherits from Element, which
+ reflects attr.
Otherwise:
+ +Let value be the attribute value.
Let tokens be value, split on ASCII whitespace. + +
For each id of tokens:
+ +Let unresolvedTarget be the first element, in tree order, that + meets the following criteria:
+ +unresolvedTarget's root is the same as element's + root; and
unresolvedTarget's ID is + id.
If no such element exists, then continue.
+Append unresolvedTarget to + unresolvedTargets.
Return unresolvedTargets.
If a reflected IDL attribute has the type T?,
- where T is either Element or an interface that inherits from
- Element, then with attr being the reflected content attribute
- name:
If a reflected IDL attribute has the type Element, then with
+ attr being the reflected content attribute name:
Its reflected target has an explicitly set attr-element, which is a weak reference to an element or null. It is initially null.
Its reflected target reflectedTarget has a get the - attr-associated element algorithm, that runs these steps:
- -Let element be the result of running reflectedTarget's get - the element.
Let contentAttributeValue be the result of running - reflectedTarget's get the content attribute.
If reflectedTarget's explicitly set attr-element is not - null:
- -If reflectedTarget's explicitly set attr-element is - a descendant of any of element's shadow-including ancestors, then return - reflectedTarget's explicitly set attr-element.
Return null.
Otherwise, if contentAttributeValue is not null, return the first element - candidate, in tree order, that meets the following criteria:
- -candidate's root is the same as element's - root;
candidate's ID is - contentAttributeValue; and
candidate implements T.
If no such element exists, then return null.
-Return null.
The getter steps are to return the result of running this's get the - attr-associated element.
+ unresolved attr target element.If a reflected IDL attribute has the type FrozenArray<T>?, where T is either
- Element or an interface that inherits from Element, then with
- attr being the reflected content attribute name:
Its reflected target has an explicitly set attr-elements, which is either a list of weak references to elements or null. It is initially null.
Its reflected target has a cached attr-associated
+ Its reflected target has a cached unresolved attr target
elements, which is a list of elements. It is initially « ». Its reflected target has a cached attr-associated
- elements object, which is a Its reflected target has a cached unresolved attr target
+ elements object, which is a Its reflected target reflectedTarget has a get the
- attr-associated elements algorithm, which runs these steps: Let elements be an empty list. Let element be the result of running reflectedTarget's get
- the element. If reflectedTarget's explicitly set attr-elements is not
- null: For each attrElement in
- reflectedTarget's explicitly set attr-elements: If attrElement is not a descendant of any of
- element's shadow-including
- ancestors, then continue. Append attrElement to
- elements. Otherwise: Let contentAttributeValue be the result of running
- reflectedTarget's get the content attribute.
-
- If contentAttributeValue is null, then return null. Let tokens be contentAttributeValue, split on ASCII whitespace.
-
- For each id of tokens: Let candidate be the first element, in tree order, that meets
- the following criteria: candidate's root is the same as element's
- root; candidate's ID is id;
- and candidate implements T. If no such element exists, then continue. Append candidate to
- elements. Return elements. The getter steps are: Let elements be the result of running this's get the
- attr-associated elements. If the contents of elements is equal to the contents of this's
- cached attr-associated elements, then return this's
- cached attr-associated elements object. If the contents of elements is equal to the contents of
+ this's cached unresolved attr target elements, then return
+ this's cached unresolved attr target elements
+ object. Let elementsAsFrozenArray be elements, converted to a Set this's cached attr-associated elements to
- elements. Set this's cached unresolved attr target elements
+ to elements. Set this's cached attr-associated elements object
- to elementsAsFrozenArray. Set this's cached unresolved attr target elements
+ object to elementsAsFrozenArray. Return elementsAsFrozenArray. For those, specification authors must use the reflected target's
- get the attr-associated element and get the
- attr-associated elements, respectively. The content attribute presence and value
+ get the resolved attr target element and get the resolved
+ attr target elements, respectively. The content attribute presence and value
must not be used as they cannot be fully synchronized with the reflected IDL
- attribute. A reflected target's explicitly set attr-element,
- explicitly set attr-elements, cached attr-associated
- elements, and cached attr-associated elements object are to be
- treated as internal implementation details and not to be built upon. If element's attached internals is non-null: If element's attached internals's get the stateOrProperty-associated element exists,
- then return the result of running it. If element's attached internals's get the resolved stateOrProperty
+ target element exists, then return the result of running it. If element's attached internals's get the stateOrProperty-associated elements exists,
- then return the result of running it. If element's attached internals's get the resolved stateOrProperty
+ target elements exists, then return the result of running it. The A A A Take the value of the principal cell's For each token in the id list, if the
- first element in the For each element in the principal cell's
+ resolved
+ The The FrozenArray<T>?. It is
+ FrozenArray<Element>?. It is
initially null.
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -9275,15 +9424,15 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
FrozenArray<T>?.
-
@@ -35851,7 +36000,7 @@ interface HTMLObjectElement : HTMLElement {
[CEReactions, ReflectURL] attribute USVString data;
[CEReactions, Reflect] attribute DOMString type;
[CEReactions, Reflect] attribute DOMString name;
- readonly attribute HTMLFormElement? form;
+ readonly attribute HTMLElement? form;
[CEReactions, Reflect] attribute DOMString width;
[CEReactions, Reflect] attribute DOMString height;
readonly attribute Document? contentDocument;
@@ -45861,24 +46010,27 @@ interface HTMLTableCellElement : HTMLElement {
+ td and th element may have a headers content attribute specified. The headers attribute, if specified, must contain a string
- consisting of an unordered set of unique space-separated tokens, none of which are
- identical to another token and each of which must have the value of an ID of a th element taking part in the same table as the td or th element (as defined by the table model).headers target elements is a th
+ element taking part in the same table as the td
+ or th element (as defined by the table model).
+ th element with ID id is
- said to be directly targeted by all td and th elements in the
- same table that have headers attributes whose values include as one of their tokens
- the ID id. A th element A is said to be targeted by a th or td element
- B if either A is directly targeted by B or if there exists an element C that is itself
- targeted by the element B and A is directly
- targeted by C.th element X is said to be directly targeted by a
+ td or th element Y in the same table if X is referred to by Y's
+ headers attribute.
+ A th element A is said to be targeted by a th or
+ td element B if either A is directly targeted by
+ B or if there exists an element C that is itself targeted by the
+ element B and A is directly targeted by C.th element must not be targeted by itself.
-
headers attribute and split it on ASCII whitespace, letting id list be the
- list of tokens obtained.Document with an ID equal to
- the token is a cell in the same table, and that cell is not the
- principal cell, then add that cell to header list.headers target elements, if
+ element is a cell in the same table, and that
+ cell is not the principal cell, then add element to header
+ list.label element represents a caption in a user interface. The
caption can be associated with a specific form control, known as the
- label element's labeled control, either using the label element's labeled control, either using the for attribute, or by putting the form control inside the
label element itself.for attribute may
be specified to indicate a form control with which the caption is to be associated. If the
- attribute is specified, the attribute's value must be the ID of a
- labelable element in the same tree as the
- label element. If the attribute is specified and there is an element in
- the tree whose ID is equal to the value of the for attribute, and the first such element in tree
- order is a labelable element, then that element is the
- label element's labeled control.
If the for attribute is not specified, but the
- label element has a labelable element descendant,
- then the first such descendant in tree order is the label element's
- labeled control.
To determine a label element label's labeled control, run
+ these steps:
If label's for attribute is specified,
+ then:
If the resolved for
+ target element is not null, and the resolved for
+ target element is a labelable element, return that
+ element.
Otherwise, return null.
For each descendant descendant of + label in tree order:
+ +Let candidate be the result of + resolving the reference target on + descendant.
If candidate is a labelable element, + return candidate.
Return null.
The control
- IDL attribute must return the label element's labeled control, if any,
- or null if there isn't one.
If the label element has no labeled control, then return
+ null.
Return the result of retargeting the label
+ element's labeled control against the label element.
If the label element's labeled control is not a
form-associated element, then return null.
Return the label element's labeled control's form
- owner (which can still be null).
If the label element's labeled control's form
+ owner is null, return null.
Return the result of retargeting the
+ label element's labeled control's form owner against the
+ label element.
The list attribute is
used to identify an element that lists predefined options suggested to the user.
If present, its value must be the ID of a datalist
- element in the same tree.
If present, its value must a valid single-element reference attribute referring to a datalist.
The suggestions source element is the first element in
- the tree in tree order to have an ID
- equal to the value of the list attribute, if that element
- is a datalist element. If there is no list
- attribute, or if there is no element with that ID, or if the
- first element with that ID is not a datalist
- element, then there is no suggestions source
- element.
The suggestions source element is the resolved list
+ target element, if that element is a datalist element. If the
+ resolved
+ list target element is null or is not a
+ datalist element, then there is no suggestions
+ source element.
If there is a suggestions source element, then, when @@ -55169,7 +55353,8 @@ You cannot submit this form when the field is incorrect.
The list IDL
attribute must return the current suggestions source
- element, if any, or null otherwise.
Let target be the result of running element's get the commandfor-associated
- element.
Let target be element's
+ resolved commandfor
+ target element.
If target is not null:
@@ -56010,7 +56195,7 @@ interface HTMLSelectElement : HTMLElement { [CEReactions, ReflectSetter] attribute DOMString autocomplete; [CEReactions, Reflect] attribute boolean disabled; - readonly attribute HTMLFormElement? form; + readonly attribute HTMLElement? form; [CEReactions, Reflect] attribute boolean multiple; [CEReactions, Reflect] attribute DOMString name; [CEReactions, Reflect] attribute boolean required; @@ -57077,7 +57262,7 @@ interface HTMLOptionElement : HTMLElement { [HTMLConstructor] constructor(); [CEReactions, Reflect] attribute boolean disabled; - readonly attribute HTMLFormElement? form; + readonly attribute HTMLElement? form; [CEReactions, ReflectSetter] attribute DOMString label; [CEReactions, Reflect="selected"] attribute boolean defaultSelected; attribute boolean selected; @@ -57587,7 +57772,7 @@ interface HTMLTextAreaElement : HTMLElement { [CEReactions, ReflectPositiveWithFallback, ReflectDefault=20] attribute unsigned long cols; [CEReactions, Reflect] attribute DOMString dirName; [CEReactions, Reflect] attribute boolean disabled; - readonly attribute HTMLFormElement? form; + readonly attribute HTMLElement? form; [CEReactions, ReflectNonNegative] attribute long maxLength; [CEReactions, ReflectNonNegative] attribute long minLength; [CEReactions, Reflect] attribute DOMString name; @@ -58105,7 +58290,7 @@ interface HTMLOutputElement : HTMLElement { [HTMLConstructor] constructor(); [SameObject, PutForwards=value, Reflect="for"] readonly attribute DOMTokenList htmlFor; - readonly attribute HTMLFormElement? form; + readonly attribute HTMLElement? form; [CEReactions, Reflect] attribute DOMString name; readonly attribute DOMString type; @@ -58134,10 +58319,8 @@ interface HTMLOutputElement : HTMLElement {The for content
attribute allows an explicit relationship to be made between the result of a calculation and the
elements that represent the values that went into the calculation or that otherwise influenced the
- calculation. The for attribute, if specified, must contain a
- string consisting of an unordered set of unique space-separated tokens, none of which
- are identical to another token and each of which must have the value of an ID of an element in the same tree.
for attribute, if specified, must be a
+ valid unordered set of unique element references.
The If a listed form-associated element has a
form attribute is used to explicitly associate the
output element with its form owner. The HTMLFieldSetElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions, Reflect] attribute boolean disabled;
- readonly attribute HTMLFormElement? form;
+ readonly attribute HTMLElement? form;
[CEReactions, Reflect] attribute DOMString name;
readonly attribute DOMString type;
@@ -59087,7 +59270,7 @@ interface HTMLFieldSetElement : HTMLElement {
interface HTMLLegendElement : HTMLElement {
[HTMLConstructor] constructor();
- readonly attribute HTMLFormElement? form;
+ readonly attribute HTMLElement? form;
// also has obsolete members
};
@@ -59427,8 +59610,9 @@ interface HTMLSelectedContentElement : HTMLElement
form attribute specified, then that attribute's value must be
- the ID of a form element in the element's
- tree.form
+ element.
When a listed form-associated element has a
- form attribute and the ID of
- any of the elements in the tree changes, then the user agent must reset the
- form owner of that form-associated element.
When a listed form-associated element has a
- form attribute and an element with an ID is inserted
- into or removed from the
- Document, or its HTML element moving steps are run, then the user agent
- must reset the form owner of that form-associated element.
form attribute and that element's
+ resolved
+ form target element changes, then the user agent must
+ reset the form owner of the form-associated element.
The form owner is also reset by the HTML element insertion steps, @@ -59506,13 +59682,14 @@ interface HTMLSelectedContentElement : HTMLElementform content attribute, and is connected, then:
If the first element in element's tree, in tree
- order, to have an ID that is identical to
- element's form content attribute's value, is a
- form element, then associate the
- element with that form element.
Let candidate be the
+ resolved form target element.
If candidate is a form element, then associate the element with that
+ form element.
form IDL attribute, which, on getting, must return the
- element's form owner, or null if there isn't one.
+ data-x="dom-fae-form">form IDL attribute, which, on getting, must return the result
+ of retargeting the element's form owner against
+ the element, or null if there isn't a form owner.
NotSupportedError" DOMException if the target element is not a form-associated custom
- element. Otherwise, it must return the element's form owner, or null if there
- isn't one.
+ element. Otherwise, it must return the result of retargeting the form owner against the element, or null
+ if there isn't a form owner.
shadowrootclonableshadowrootserializableshadowrootcustomelementregistryshadowrootreferencetargetHTMLTemplateElement.The shadowrootreferencetarget content
+ attribute can be set to create a declarative shadow root with the given
+ reference target.
The template contents of a template element are not children of the element itself.
The itemref attribute, if specified, must have a value that
- is an unordered set of unique space-separated tokens none of which are
- identical to another token and consisting of IDs of
- elements in the same tree.
The itemref attribute, if specified, must be a valid
+ unordered set of unique element references attribute.
The itemref attribute must not be specified on elements that
do not have an itemscope attribute specified.
Add the child elements of root, if any, to pending.
If root has an itemref attribute, split the value of that itemref attribute on ASCII whitespace. For each resulting
- token ID, if there is an element in the tree of root with the
- ID ID, then add the first such element to
- pending.
If root has an itemref attribute, set
+ pending to the resolved
+ itemref target elements.
While pending is not empty:
@@ -91656,10 +91837,9 @@ dictionary DragEventInit : MouseEventInit {If specified, the popovertarget attribute value must
- be the ID of an element with a popover attribute in the same tree as the button with the popovertarget attribute.
popover attribute.
The popovertargetaction attribute is an
enumerated attribute with the following keywords and states:
If node has a form owner and node is a submit button, then return null.
Let popoverElement be the result of running node's get the popovertarget-associated
- element.
Let popoverElement be node's resolved popovertarget
+ target element.
If popoverElement is null, then return null.
Let referenceTarget be the value of templateStartTag's
+ shadowrootreferencetarget
+ attribute if it has one; otherwise null.
If declarativeShadowHostElement is a shadow host, then insert an element at the adjusted insertion location with template.
Attach a shadow root with
declarativeShadowHostElement, mode, clonable,
- serializable, delegatesFocus, "named", and
- registry.
named",
+ referenceTarget, and registry.
If an exception is thrown, then catch it and:
@@ -144477,6 +144661,19 @@ document.body.appendChild(text);If shouldAppendRegistryAttribute is true, then append " shadowrootcustomelementregistry=""".
If shadow's reference target is non-null:
+ +Append "
+ shadowrootreferencetarget="".
Append shadow's reference target.
Append """.
Append ">".
Append the value of running the HTML fragment serialization algorithm with @@ -153376,7 +153573,7 @@ interface External {
for
output
form
button;
@@ -153426,7 +153623,7 @@ interface External {
td;
th
headingoffset
itemref
itemscope
open";
"closed"
+ shadowrootreferencetarget
+ template
+ shadowrootserializable
template