diff --git a/source b/source index 2f6d690e48d..062b98dd805 100644 --- a/source +++ b/source @@ -3203,7 +3203,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
HTMLCollection
interface, its
length
attribute, and its
@@ -5187,6 +5187,184 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
+ + Element reference attributes refer to one or more Elements in the document. 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 referred to by an + element reference attribute are:
+ +If element does not have a shadow root, or element's + shadow root's reference target is null, return element.
+Let referenceTarget 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 referenceTarget.
+If no such element exists, return null.
Return the result of resolving the reference + target on candidate. +
Single element reference attributes refer to a single Element. When specified as a + content attribute, a single element reference attribute consists of a single token + which should completely match the ID of another element in the + document.
+ +The rules to get the + attr-associated element for an 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 + candidate be element's + explicitly-set attr-element.
+Otherwise, let candidate be null.
Otherwise: + +
Let value be the attribute value.
Let candidate be the first element in element's tree, + in tree order whose ID is value.
+If no such element exists, let candidate be null.
+Return the result of resolving the reference + target on candidate. +
Multiple element reference attributes + refer to multiple Elements. When specified as a content attribute, a multiple element + reference attribute consists of space-separated tokens, each of which should completely + match the ID of another element in the document.
+ +The rules to get the attr-associated + elements for a multiple element reference attribute attr and element + elementare:
+ +If the attribute is not specified on element, return null.
Let candidates be an empty list.
If element's has an explicitly set attr-elements which + 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 + candidates.
Otherwise:
+ +Let value be the attribute value.
Let tokens be value, 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 + candidates.
Let resolvedCandidates be an empty list.
For each candidate in candidates: +
+ +Let resolvedCandidate be the result of + resolving the reference target on + candidate.
If resolvedCandidate is not null, append resolvedCandidate to + resolvedCandidates.
Return resolvedCandidates.
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 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:
+The getter steps are:
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.
+Let candidate be the result of running this's + get the attr-associated + element.
Return null.
Return the result of retargeting candidate + against this.
The getter steps are to return the result of running this's get the - attr-associated element.
The setter steps are:
@@ -8636,98 +8778,35 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute initially null.Its reflected target reflectedTarget has a get the - attr-associated elements algorithm, which runs these steps:
+The getter steps are:
Let elements be an empty list.
Let elements be the result of running this's get the + attr-associated elements.
Let element be the result of running reflectedTarget's get - the element.
Let retargetedElements be an empty list.
If reflectedTarget's explicitly set attr-elements is not - null:
+For each element in elements:
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.
-Let retargetedElement be the result of retargeting element against this.
Append candidate to - elements.
Append retargetedElement to retargetedElements.
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 retargetedElements is equal to the contents of + this's cached attr-associated elements, then return + this's cached attr-associated elements object.
Let elementsAsFrozenArray be elements, Let elementsAsFrozenArray be retargetedElements, converted to a FrozenArray<T>?
.
Set this's cached attr-associated elements to - elements.
Set this's cached attr-associated elements object to 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 - must not be used as they cannot be fully synchronized with the reflected IDL - attribute.
+ get the attr-associated element + and get the attr-associated 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
@@ -46409,14 +46488,45 @@ interface HTMLLabelElement : HTMLElement {
The 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 controlfor
attribute, or by putting the form control inside the
label
element itself.
Except where otherwise specified by the following rules, a label
element has no
- labeled control.
To determine a label
element's labeled control, run these steps:
If the label
's for
attribute is
+ specified, then:
If the for-associated element is not null, and the for-associated element is a labelable element, return that element.
Otherwise, return null.
For each descendant descendant of the
+ 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.
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.
+ label
element.
shadowrootdelegatesfocus
shadowrootclonable
shadowrootserializable
shadowrootreferencetarget
HTMLTemplateElement
.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.
shadowrootserializable
content attribute.
+ The shadowRootReferenceTarget
IDL
+ attribute must reflect the
+ shadowrootreferencetarget
content attribute.
The cloning steps for template
@@ -130715,6 +130833,10 @@ document.body.appendChild(text);
data-x="attr-template-shadowrootdelegatesfocus">shadowrootdelegatesfocus attribute;
otherwise false.
Let referenceTarget be the value of the template start tag's
+ shadowrootreferencetarget
+ attribute if it has one; otherwise null.
If declarative shadow host element is a shadow host, then insert an element at the adjusted insertion location with template.
Attach a shadow root with
declarative shadow host element, mode, clonable,
- serializable, delegatesFocus, and "named
".
named
",
+ and referenceTarget.
If an exception is thrown, then catch it and:
@@ -134554,6 +134677,9 @@ document.body.appendChild(text);If shadow's clonable is set, then append
" shadowrootclonable=""
".
If shadow's reference target is set, then append
+ " shadowrootreferencetarget=""
".
Append ">
".
Append the value of running the HTML fragment serialization algorithm with @@ -143702,6 +143828,11 @@ interface External {
open
";
"closed
"
+ shadowrootreferencetarget
+ template
+ shadowrootserializable
template