diff --git a/source b/source index f1ceb847a67..82a5ab2f03c 100644 --- a/source +++ b/source @@ -3234,6 +3234,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
tabindex attribute
- specified.select element, then it may also
+ have zero or one selectedcontent element.
commandselect element's user validity to true.Run update a select's selectedcontent given the
+ select element.
Fire an event named input at the select element, with the bubbles and composed
@@ -54456,13 +54461,33 @@ interface HTMLSelectElement : HTMLElement {
order that has its selectedness set to
true, if any. If there isn't one, then it must return −1.
On setting, the selectedIndex attribute must set
- the selectedness of all the option
- elements in the list of options to false, and
- then the option element in the list of
- options whose index is the given new value, if
- any, must have its selectedness set to true and
- its dirtiness set to true.
The selectedIndex setter steps are:
Let firstMatchingOption be null.
For each option of this's list of options:
+ +Set option's selectedness + to false.
If firstMatchingOption is null and option's index is equal to the given value, then set + firstMatchingOption to option.
If firstMatchingOption is not null, then set firstMatchingOption's + selectedness to true and set + firstMatchingOption's dirtiness to + true.
Run update a select's selectedcontent given
+ this.
This can result in no element having a selectedness set to true even in the case of the @@ -54476,14 +54501,33 @@ interface HTMLSelectElement : HTMLElement { data-x="concept-option-selectedness">selectedness set to true, if any. If there isn't one, then it must return the empty string.
-On setting, the value attribute must set the selectedness of all the option elements
- in the list of options to false, and then the
- first option element in the list of
- options, in tree order, whose value
- is equal to the given new value, if any, must have its selectedness set to true and its dirtiness set to true.
The value setter steps are:
Let firstMatchingOption be null.
For each option of this's list of options:
+ +Set option's selectedness + to false.
If firstMatchingOption is null and option's value is equal to the given value, then set + firstMatchingOption to option.
If firstMatchingOption is not null, then set firstMatchingOption's + selectedness to true and set + firstMatchingOption's dirtiness to + true.
Run update a select's selectedcontent given
+ this.
This can result in no element having a selectedness set to true even in the case of the @@ -54940,6 +54984,50 @@ interface HTMLOptionElement : HTMLElement { +
To get the option element nearest ancestor select given an
+ option option, run these steps. They return a select or
+ null.
For each ancestor of option's ancestors, + in reverse tree order:
+ +If ancestor is a select, then return
+ ancestor.
Return null.
To maybe clone an option into selectedcontent, given an
+ option option:
Let select be option's option element nearest
+ ancestor select.
If all of the following conditions are true:
+ +select is not null;
option's selectedness is + true; and
select's enabled
+ selectedcontent is not null,
then run clone an option into a selectedcontent given
+ option and select's enabled
+ selectedcontent.
option.selectedselectedcontent elementbutton element which is a child of a select
+ element.[Exposed=Window]
+interface HTMLSelectedContentElement : HTMLElement {
+ [HTMLConstructor] constructor();
+};
+ HTMLSelectedContentElement.The selectedcontent element reflects the contents of a select
+ element's currently selected option element. selectedcontent elements
+ can be used to declaratively show the selected option element's contents within the
+ select element's first child button element.
The option element's label
+ attribute can be used to render a visible label for the option, but the
+ selectedcontent element will not reflect the content of the label attribute.
Every time the selected option of a select switches from one
+ option to another, the selectedcontent element removes all of its children and
+ replaces them with a new copy of the DOM structure of the select's selected
+ option element.
Every selectedcontent element has a disabled state, which is a boolean, initially set to
+ false.
To update a select's selectedcontent given a
+ select element select:
Let selectedcontent be the result of get a select's enabled
+ selectedcontent given select.
If selectedcontent is null, then return.
Let option be the first option in select's list of options whose selectedness is true, if any such option
+ exists, otherwise null.
If option is null, then run clear a selectedcontent
+ given selectedcontent.
Otherwise, run clone an option into a selectedcontent given
+ option and selectedcontent.
To get a select's enabled
+ selectedcontent given a select element select:
If select has the multiple
+ attribute, then return null.
Let selectedcontent be the first selectedcontent element
+ descendant of select in tree order if any such element
+ exists; otherwise return null.
If selectedcontent is disabled, + then return null.
Return selectedcontent.
To clone an option into a selectedcontent, given an
+ option element option and a selectedcontent element
+ selectedcontent:
Let documentFragment be a new DocumentFragment whose node
+ document is option's node document.
For each child of option's children:
+ +Let childClone be the result of running clone given child with subtree set to true.
Append childClone to + documentFragment.
Replace all with + documentFragment within selectedcontent.
To clear a selectedcontent given a selectedcontent element
+ selectedcontent:
Replace all with null within + selectedcontent.
To clear a select's non-primary selectedcontent elements,
+ given a select element select:
Let passedFirstSelectedcontent be false.
For each descendant of select's descendants in tree order that is a
+ selectedcontent element:
If passedFirstSelectedcontent is false, then set + passedFirstSelectedcontent to true.
Otherwise, run clear a selectedcontent given
+ descendant.
The selectedcontent HTML element post-connection steps, given
+ selectedcontent, are:
Let nearestSelectAncestor be null.
Let ancestor be selectedcontent's parent.
Set selectedcontent's disabled + state to false.
For each ancestor of selectedcontent's ancestors, in reverse tree order:
+ +If ancestor is a select element:
If nearestSelectAncestor is null, then set nearestSelectAncestor + to select.
Otherwise, set selectedcontent's disabled state to true.
If ancestor is an option element or a
+ selectedcontent element, then set selectedcontent's disabled state to true.
If nearestSelectAncestor is null or nearestSelectAncestor has the
+ multiple attribute, then return.
Run update a select's selectedcontent given
+ nearestSelectAncestor.
Run clear a select's non-primary selectedcontent
+ elements given nearestSelectAncestor.
The selectedcontent HTML element removing steps, given
+ selectedcontent and oldParent, are:
For each ancestor of selectedcontent's ancestors, in reverse tree order:
+ +If ancestor is a select element, then return.
For each ancestor of oldParent's inclusive ancestors, in reverse tree order:
+ +If ancestor is a select element, then run update a
+ select's selectedcontent given ancestor and
+ return.
Insert an HTML element for the token.
+Let option be the first option element in the stack of open
+ elements.
Run the steps for "any other end tag."
+ +If option is no longer in the stack of open elements, then run + maybe clone an option into selectedcontent given option.
+If the stack of open elements has a @@ -142931,6 +143237,16 @@ interface External {
HTMLSelectElementselectedcontentoptionbuttonHTMLSelectedContentElementslotselect
HTMLSelectElement : HTMLElement
+ selectedcontent
+ HTMLSelectedContentElement : HTMLElement
+
slot
HTMLSlotElement : HTMLElement