From a9d0db46c1303e99837c33e54c59b3b8c2743f9a Mon Sep 17 00:00:00 2001 From: Alice Boxhall <95208+alice@users.noreply.github.com> Date: Tue, 4 Feb 2025 15:33:03 +1100 Subject: [PATCH 01/20] Begin exploring how to specify what effect referenceTarget has. --- source | 153 ++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 98 insertions(+), 55 deletions(-) diff --git a/source b/source index 213f90acbef..8db11ea396b 100644 --- a/source +++ b/source @@ -5187,6 +5187,85 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute +
+ Element reference attributes refer to one or more Elements in the document.
+ +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 doesn't have a referenceTarget
+ property, return element.
Let referenceTarget be the value of element's shadow
+ root's referenceTarget
property
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.
+ +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. +
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.
Let candidate be the result of running this's + get the attr-associated + element.
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.
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:
@@ -8817,10 +8860,10 @@ a.setAttribute('href', 'https://example.com/'); // change the content attributeFor 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
@@ -46424,11 +46467,11 @@ interface HTMLLabelElement : HTMLElement {
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.
label
element. If the attribute is specified, the for-associated element is not null, and the for-associated element is a labelable element, then that element is the label
+ element's labeled control.
HTMLCollection
interface, its
length
attribute, and its
@@ -64320,6 +64320,7 @@ not-slash = %x0000-002E / %x0030-10FFFF
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
@@ -130641,6 +130653,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:
@@ -134480,6 +134497,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 @@ -143628,6 +143648,11 @@ interface External {
open
";
"closed
"
+ shadowrootreferencetarget
+ template
+ shadowrootserializable
template
From cd247ab01c96b342dd890a7350c15c8b7723e40a Mon Sep 17 00:00:00 2001
From: Dan Clark If element does not have a shadow root, or element's
- shadow root doesn't have a referenceTarget
- property, return element.
Let referenceTarget be the value of element's shadow
- root's referenceTarget
property
Let candidate be the first element in element's shadow root whose ID matches referenceTarget.
From 30629787490993656e9cd9ccbde352ae5d8ccae5 Mon Sep 17 00:00:00 2001 From: Dan ClarkThe 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.
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 candidate of the
+ label
in tree order:
If the result of resolving the reference + target on candidate is a + labelable element, return candidate.
Return null.
label
element. If the attribute is specified, the for-associated element is not null, and the for-associated element is a labelable element, then that element is the label
- element's labeled control.
+ label
element.
For each descendant candidate of the
- label
in tree order:
For each descendant candidate of the
+ label
in tree order:
If the result of resolving the reference - target on candidate is a - labelable element, return candidate.
If the result of resolving the reference + target on candidate is a + labelable element, return candidate.
Return null.
For each descendant candidate of the +
For each descendant descendant of the
label
in tree order:
If the result of resolving the reference - target on candidate is a - labelable element, return candidate.
Let candidate be the result of + resolving the reference target on + descendant.
If candidate is a labelable element, + return candidate.
- Element reference attributes refer to one or more Elements in the document.
+ 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 @@ -5218,7 +5220,10 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Single element reference attributes refer to a single Element.
+ export>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 @@ -5266,6 +5271,99 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
+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 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:
+Let retargetedElement be the result of retargeting element against this.
If attrElement is not a descendant of any of - element's shadow-including - ancestors, then continue.
Append attrElement to - elements.
Append retargetedElement to retargetedElements.
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. +
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.
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.
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.
- 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.
++ 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:
+ target on an element element referred to by an + element reference attribute are:If element does not have a shadow root, or element's
From d6fbcfd621f28da035307e0c243765963006b6e2 Mon Sep 17 00:00:00 2001
From: Dan Clark
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.
The form
IDL
attribute must run the following steps:
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 be the ID of an element in the same
+ tree for which the result of resolving
+ the reference target is 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 list-associated element, if that element
+ is a datalist
element. If the
+ list-associated 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
the user agent is allowing the user to edit the The input
element's
list
IDL
- attribute must return the current suggestions source
- element, if any, or null otherwise.list
content attribute.
th
element taking part in the same table as the td
or th
element (as defined by the table model).
-
- A 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 taking part in the same table as
+ the td
or th
element (as defined by the
+ table model).
+
+ A th
element X is said to be directly targeted by a
+ td
or th
element Y in the same table if Y has a headers
attribute whose value includes as one of its tokens an
+ ID id such that resolving the reference target on any element
+ Z with ID id is X. 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.
A th
element must not be targeted by itself.
For each token in the id list, if the
- first element in the 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.
For each token in the id list, if the result of resolving the reference target on the first
+ element in the 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.
When a listed form-associated element has a
+ form
attribute and the reference target of the
+ shadow root of any shadow host element in the same flat
+ 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
@@ -56506,13 +56512,17 @@ interface HTMLLegendElement : HTMLElement {
data-x="attr-fae-form">form 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 result of resolving the reference target on 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.
If candidate is a form
element, then associate the element with that
+ form
element.
The steps to resolve the reference - target on an element element referred to by an - element reference attribute are:
+ target on an element element are:If element does not have a shadow root, or element's @@ -5282,7 +5284,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
The rules to get the attr-associated elements for a multiple element reference attribute attr and element - elementare:
+ element are:If the attribute is not specified on element, return null.
The 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 an element for which the result of
- resolving the reference target on that element
- is a th
element taking part in the same table as
- the td
or th
element (as defined by the
- table model).
headers
-associated elements:
+
+ each element in elements only appears once, and
each element in elements is a th
element taking part in the same
+ table as the td
or th
+ element (as defined by the table model).
A th
element X is said to be directly targeted by a
td
or th
element Y in the same table if Y has a headers
attribute whose value includes as one of its tokens an
- ID id such that resolving the reference target on any element
- Z with ID id is X. 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.
headers
-associated elements includes
+ X. 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.
A th
element must not be targeted by itself.
Take the value of the principal cell's headers
attribute and split it on ASCII whitespace, letting id list be the
- list of tokens obtained.
For each token in the id list, if the result of resolving the reference target on the first
- element in the 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.
For each element in the principal cell's
+
+ headers
-associated elements, if
+ element is a cell in the same table, and that
+ cell is not the principal cell, then add element to
+ header list.
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 an element in the same
- tree for which the result of resolving
- the reference target is a datalist
.
If present, its value must a valid single
+ element reference attribute such that the
+
+ list
-associated element is a
+ datalist
.
The steps to resolve the reference target on an element element are:
@@ -5220,17 +5217,22 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute -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.
+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 + if Y is the attr-associated + element for X.
The rules to get the - attr-associated element for an element reference attribute attr and - element element, are:
+ attr-associated element for a single element reference attribute + attr and element element, are:If the attribute is not specified on element, return null.
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.
-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.
+An unordered set of unique element + references is a set of element references where none of the element references + is repeated.
-The rules to get the attr-associated - elements for a multiple element reference attribute attr and element - element are:
+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 + if Y is one of the + attr-associated elements for + X.
+ +The rules to get the attr-associated elements for a set of + element references attribute attr and element element are:
If the attribute is not specified on element, return null.
The td
and th
element may have a headers
content attribute specified. The headers
attribute, if specified, must be a valid
- multiple element reference attribute
- such that, for the list elements of
- headers
-associated elements:
each element in elements only appears once, and
each element in elements is a th
element taking part in the same
- table as the td
or th
- element (as defined by the table model).
headers
-associated elements is a th
+ element taking part in the same table as the td
+ or th
element (as defined by the table model).
A th
element X is said to be directly targeted by a
td
or th
element Y in the same table if Y's
-
- headers
-associated elements includes
- X. 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.
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.
A th
element must not be targeted by itself.
The list
attribute is
used to identify an element that lists predefined options suggested to the user.
If present, its value must a valid single
- element reference attribute such that the
-
- list
-associated element is a
- datalist
.
If present, its value must a valid single element reference attribute referring to a datalist
.
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 HTMLLegendElement : HTMLElement {
form
attribute specified, then that attribute's value must be
- the ID of a form
element in the element's
- tree.form
+ element.
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 single element reference attribute
+ referring to an element with the
popovertarget
attribute.
The popovertargetaction
attribute is an
From c99b613ab7c6acff8915290efa77da09e648456e Mon Sep 17 00:00:00 2001
From: Dan Clark
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
+ itemref
-associated elements.
While pending is not empty:
From 89f72a40db5e5af1ba9aa649a6b19e7bc6deb7f0 Mon Sep 17 00:00:00 2001 From: Dan Clarkfor
output
form
button
;
@@ -143381,7 +143381,7 @@ interface External {
td
;
th
height
canvas
;
@@ -143499,7 +143499,7 @@ interface External {
itemref
itemscope
Otherwise, let candidate be null.
An element will only have an
+ explicitly-set attr-element if it has
+ an IDL attribute with a type derived from Element
which
+ reflects attr.
A label
element can use the for
attribute to
+ create an association with an input
element:
<label for="name">Name:</label>
+<input id="name">
+
+ In this example, the input
element is the
+ for
-associated element for the label
+ element.
An element with a shadow root may use a reference target to allow + attr-association to be created with 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
+ for
-associated 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 + references consists of a set of space-separated tokens, each of which shoulds completely match the ID of another element in the document.
An unordered set of unique element
@@ -5326,6 +5357,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
+
+
+ An element will only have
+ explicitly-set attr-elements if it
+ has an IDL attribute with type candidate's root is the same as element's
- root;FrozenArray<T>?
, where T is either
+ Element
or an interface that inherits from Element
, which
+ reflects attr.
candidate's ID is id; - and
candidate implements T.
candidate's ID is id.
+If no such element exists, then continue.
@@ -8709,10 +8746,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute -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
@@ -8731,7 +8766,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
Return the result of retargeting candidate
against this. The setter steps are:
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 @@ -8792,7 +8826,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute elements, which is a list of elements. It is initially « ».
Its reflected target has a cached attr-associated
- elements object, which is a FrozenArray<T>?
. It is
+ elements object, which is a FrozenArray<Element>?
. It is
initially null.
Let elementsAsFrozenArray be retargetedElements, converted to a FrozenArray<T>?
.
Set this's cached attr-associated elements to retargetedElements.
The 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 a valid single element
+ reference attribute.
To determine a label
element's labeled control, run these steps:
Return null.
The 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 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.
The label
element's exact default presentation and behavior, in particular what
its activation behavior might be, if anything, should match the platform's label
behavior. The activation behavior of a label
element for events targeted
@@ -52711,10 +52701,12 @@ You cannot submit this form when the field is incorrect.
The suggestions source element is the list-associated element, if that element
- is a datalist
element. If the
- list-associated element is null or is not a datalist
element, then there is
- no suggestions source element.
list
-associated
+ element, if that element is a datalist
element. If the
+
+ list
-associated 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
the user agent is allowing the user to edit the The input
element's
list
IDL
- attribute must reflect the list
content attribute.
When a listed form-associated element has a
- form
attribute and the reference target of the
- shadow root of any shadow host element in the same flat
- tree changes, then the user agent must reset the form owner of that
- form-associated element.
form
attribute and the reference target of any
+ shadow root of any shadow-including inclusive ancestor of the
+ form
-associated
+ element for the form-associated element 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 HTMLLegendElement : HTMLElement {
data-x="attr-fae-form">form content attribute, and is connected, then:
Let candidate be the result of resolving the reference target on 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.
Let candidate be the
+ form
-associated 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 shoulds + 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
From b179371cabdb416e5869c238e89ef80f3a26e5c7 Mon Sep 17 00:00:00 2001
From: Dan Clark
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 the reference target of any
- shadow root of any shadow-including inclusive ancestor of the
+ form
attribute and that element's
form
-associated
- element for the form-associated element 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
, then the user agent must reset the form owner of that
+ 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 Standard's