diff --git a/source b/source index 9f6bfcc10b4..7f204ea3180 100644 --- a/source +++ b/source @@ -56410,7 +56410,7 @@ interface HTMLSelectElement : HTMLElement {
Run the selectedness setting algorithm given - selectElement.
If an option element in the list of
- options asks for a reset, then run that
- select element's selectedness setting algorithm.
To ask for a reset given an option element option:
If option's cached nearest ancestor select element is
+ null, then return.
Run the selectedness setting algorithm given option's cached
+ nearest ancestor select element and false.
The selectedness setting algorithm, given a select element
- element, is to run the following steps:
If element's multiple attribute is
- absent, and element's display size is 1,
- and no option elements in the element's list of options have their selectedness set to true, then set the selectedness of the first option
- element in the list of options in
- tree order that is not disabled,
- if any, to true, and return.
If element's multiple attribute is
- absent, and two or more option elements in element's list of options have their selectedness set to true, then set the selectedness of all but the last option
- element with its selectedness set to true in
- the list of options in tree order
- to false.
If element has the multiple attribute,
+ then return.
Let updateSelectedcontent be false.
Let firstEnabledOption be null.
Let lastSelectedOption be null.
For each option of element's list of options:
+ +If option's selectedness is + true:
+ +If lastSelectedOption is not null:
+ +Set lastSelectedOption's selectedness to false.
Set updateSelectedcontent to true.
Set lastSelectedOption to option.
If firstEnabledOption is null and option is not disabled, then set firstEnabledOption to + option.
If lastSelectedOption is null and firstEnabledOption is not null and + element's display size is 1:
+ +Set firstEnabledOption's selectedness to true.
Set updateSelectedcontent to true.
If updateSelectedcontent is true and skipSelectedcontentUpdate is
+ false, then run update a select's descendant selectedcontent
+ elements given element.
Run update a select's selectedcontent given
- element.
Run update a select's descendant selectedcontent
+ elements given element.
Run clone selected option into select button given
element.
Run update a select's selectedcontent given
- this.
Run update a select's descendant selectedcontent
+ elements given this.
Run update a select's selectedcontent given
- this.
Run update a select's descendant selectedcontent
+ elements given this.
Let newSelect be option's option element
nearest ancestor select.
Set option's cached nearest ancestor select
+ element to newSelect.
If oldSelect is not newSelect:
If oldSelect is not null, then run the selectedness setting - algorithm given oldSelect.
If newSelect is not null, then run the selectedness setting - algorithm given newSelect.
Set option's cached nearest ancestor select
- element to newSelect.
select given insertedOption.
+ The option HTML element post-connection steps, given
+ insertedOption, are:
If insertedOption's cached nearest ancestor select
+ element is not null and insertedOption is selected, then update a select's
+ descendant selectedcontent elements given insertedOption's
+ cached nearest ancestor select element.
The option HTML element removing steps, given
- removedNode, isSubtreeRoot, and oldAncestor are to run
- update an option's nearest ancestor select given
- removedNode.
Let select be removedNode's cached nearest ancestor
+ select element.
If removedNode is selected
+ and select is not null and select has at least one descendant
+ selectedcontent element, then queue a microtask to update a
+ select's descendant selectedcontent elements given
+ select.
Update an option's nearest ancestor select given
+ removedNode.
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.
To clone selected option into select button, given a
select element select:
When an option element is popped off the stack of open elements of an
- HTML parser or XML parser, the user agent must run maybe clone an
- option into selectedcontent given the option element.
When an option element option is popped off the stack of open
+ elements of an HTML parser or XML parser:
If option is not selected, + then return.
Let select be option's option element nearest
+ ancestor select.
If select is null, then return.
Update a select's descendant selectedcontent
+ elements given select.
To update a select's selectedcontent given a
- select element select:
To update a select's descendant selectedcontent elements
+ 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.
If select has the multiple
+ attribute, 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.
Let descendantSelectedcontents be select's descendant
+ selectedcontent elements which are not disabled, in tree order.
If option is null, then run clear a selectedcontent
- given selectedcontent.
For each selectedcontent of descendantSelectedcontents:
-Otherwise, run clone an option into a selectedcontent given
- option and selectedcontent.
Update a selectedcontent given select and
+ selectedcontent.
To get a select's enabled
- selectedcontent given a select element select:
To update a selectedcontent given a select element
+ select and a selectedcontent element selectedcontent:
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.
Let option be the first option in select's list of options whose selectedness is true, if any such option
+ exists; otherwise null.
If selectedcontent's disabled is - true, then return null.
If option is null, then run clear a selectedcontent
+ given selectedcontent.
Return selectedcontent.
Otherwise, run clone an option into a selectedcontent given
+ option and selectedcontent.
If selectedcontent's disabled is + true, then return.
Let documentFragment be a new DocumentFragment whose node
document is option's node document.
If selectedcontent's disabled is + true, then return.
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
+
The selectedcontent HTML element insertion steps, given
selectedcontent, are:
If nearestSelectAncestor is null, then set nearestSelectAncestor - to select and continue.
Set selectedcontent's disabled to true and break.
If selectedcontent's disabled is
- true, 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
- removedNode, isSubtreeRoot, and oldAncestor are:
The selectedcontent HTML element post-connection steps, given
+ selectedcontent, are:
If removedNode's disabled is - true, then return.
Let nearestSelectAncestor be null.
For each ancestor of removedNode's For each ancestor of selectedcontent's ancestors, in reverse tree order:
If ancestor is a select element, then return.
If ancestor is a select element:
If nearestSelectAncestor is null, then set nearestSelectAncestor + to ancestor and break.
For each ancestor of oldAncestor's inclusive ancestors, in reverse tree order:
+If selectedcontent's disabled is
+ true, nearestSelectAncestor is null, or nearestSelectAncestor has the
+ multiple attribute, then return.
If ancestor is a select element, then run update a
- select's selectedcontent given ancestor and
- return.
Update a selectedcontent given nearestSelectAncestor
+ and selectedcontent.