diff --git a/source b/source index 7190aebdceb..ff0a0f618c1 100644 --- a/source +++ b/source @@ -57336,7 +57336,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 update a select's descendant selectedcontent
+ elements given element.
Run update a select's selectedcontent given
- element.
Update a select's descendant selectedcontent
+ elements given element.
Run clone selected option into select button given
+
Clone selected option into select button given
element.
Fire an event named HTMLSelectElement : HTMLElement {
firstMatchingOption's dirtiness to
true.
Run update a select's selectedcontent given
- select.
Update a select's descendant selectedcontent
+ elements given select.
Run update a select's selectedcontent given
- this.
Update a select's descendant selectedcontent
+ elements given this.
To update an option's nearest ancestor select, given an
- option option:
option option, run these steps. They return a select element
+ or null.
Let oldSelect be option's cached nearest ancestor
@@ -58430,40 +58475,84 @@ interface HTMLOptionElement : HTMLElement {
Let newSelect be option's Set option's cached nearest ancestor If oldSelect is not newSelect: If oldSelect is not null, then run the selectedness setting
- algorithm given oldSelect.option element
nearest ancestor select.select
+ element to newSelect.
If newSelect is not null, then run the selectedness setting - algorithm given newSelect.
Set option's cached nearest ancestor select
- element to newSelect.
Return newSelect.
The option HTML element insertion steps, given
- insertedOption, are to run update an option's nearest ancestor
- select given insertedOption.
Let select be the result of update an option's nearest
+ ancestor select given insertedOption.
If select is null or insertedOption's selectedness is false, or select doesn't
+ have any descendant selectedcontent elements, then return.
Queue a microtask to update a select's descendant
+ selectedcontent elements given select.
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's selectedness is true, 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.
The option HTML element moving steps, given movedNode,
- isSubtreeRoot, and oldAncestor are to run update an
- option's nearest ancestor select given movedNode.
Let oldSelect be movedNode's cached nearest ancestor
+ select element.
If oldSelect is not null, movedNode's selectedness is true, and oldSelect has
+ at least one descendant selectedcontent element, then queue a
+ microtask to update a select's descendant
+ selectedcontent elements given oldSelect.
Let newSelect be the result of update an option's nearest
+ ancestor select given movedNode.
If newSelect is not null, movedNode's selectedness is true, and newSelect has
+ at least one descendant selectedcontent element, then queue a
+ microtask to update a select's descendant
+ selectedcontent elements given newSelect.
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.
option.selectedTo 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.
Let descendantSelectedcontents be select's descendant
+ selectedcontent elements which are not disabled, in tree order.
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.
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 selectedOptions be « ».
Let selectedcontent be the first selectedcontent element
- descendant of select in tree order if any such element
- exists; otherwise return null.
For each option in select's list of options:
-If selectedcontent's disabled is - true, then return null.
If option is selected, then + append option to + selectedOptions.
If select has the multiple
+ attribute, then clone multiple options into a selectedcontent given
+ selectedOptions and selectedcontent.
Return selectedcontent.
Otherwise, if selectedOptions is empty, then clear a
+ selectedcontent given selectedcontent.
Otherwise, clone an option into a selectedcontent given
+ the first item in selectedOptions and selectedcontent.
If selectedcontent's disabled is + true, then return.
Let documentFragment be a new DocumentFragment whose node
document is option's node document.
To clone multiple options into a selectedcontent, given a
+ list of option elements selectedOptions and a selectedcontent
+ element selectedcontent:
If selectedcontent is disabled, + then return.
Let documentFragment be a new DocumentFragment whose node
+ document is selectedcontent's node document.
For each option of selectedOptions:
+ +Let container be the result of create an element given
+ selectedcontent's node document and "div".
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 + container.
Append container to + documentFragment.
Replace all with + documentFragment within selectedcontent.
To clear a selectedcontent given a selectedcontent element
selectedcontent:
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:
The selectedcontent HTML element insertion steps, given
+ selectedcontent, are:
Let passedFirstSelectedcontent be false.
Let select be the result of recalculate a selectedcontent
+ element's disabledness given selectedcontent.
For each descendant of select's descendants in tree order that is a
- selectedcontent element:
If selectedcontent's disabled is + true or select is null, then return.
If passedFirstSelectedcontent is false, then set - passedFirstSelectedcontent to true.
Queue a microtask to update a selectedcontent given
+ select and selectedcontent.
Otherwise, run clear a selectedcontent given
- descendant.
The selectedcontent HTML element moving steps, given
+ selectedcontent, isSubtreeRoot, and oldAncestor, are:
Let select be the result of recalculate a selectedcontent
+ element's disabledness given selectedcontent.
If selectedcontent's disabled is
+ true, select is null, or select has the multiple attribute, then return.
Queue a microtask to update a selectedcontent given
+ select and selectedcontent.
The selectedcontent HTML element post-connection steps, given
- selectedcontent, are:
To recalculate a selectedcontent element's disabledness, given a
+ selectedcontent element selectedcontent, run these steps. They return a
+ select element or null.
Let nearestSelectAncestor be null.
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:
If removedNode's disabled is - true, then return.
For each ancestor of removedNode's ancestors, in reverse tree order:
- -If ancestor is a select element, then return.
For each ancestor of oldAncestor's inclusive ancestors, in reverse tree order:
- -If ancestor is a select element, then run update a
- select's selectedcontent given ancestor and
- return.
Return nearestSelectAncestor.