diff --git a/source b/source index b8a0cef9a14..5c6020d70fb 100644 --- a/source +++ b/source @@ -3236,6 +3236,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
The following features are defined in UI Events: UIEVENTS
@@ -53388,7 +53391,8 @@ You cannot submit this form when the field is incorrect.tabindex
attribute
- specified.select
element, then it may also
+ have zero or one selectedcontent
element.
disabled
select
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
@@ -54070,13 +54077,22 @@ 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.
On setting, the selectedIndex
attribute must run
+ the following steps:
Set the selectedness of all the
+ option
elements in the list of
+ options to false.
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.
Run update a select
's selectedcontent
given this
+ select
.
This can result in no element having a selectedness set to true even in the case of the @@ -54090,14 +54106,23 @@ 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.
On setting, the value
attribute must run the following
+ steps:
Set the selectedness of all the
+ option
elements in the list of
+ options to false.
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.
Run update a select
's selectedcontent
given this
+ select
.
This can result in no element having a selectedness set to true even in the case of the @@ -54554,6 +54579,52 @@ interface HTMLOptionElement : HTMLElement { +
To get the option
element nearest ancestor select
given an
+ option
option:
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;
select does not have the multiple
+ attribute;
option's selectedness + is true;
select's enabled
+ selectedcontent
is not null,
then run clone an option
into a selectedcontent
given
+ option and select's enabled
+ selectedcontent
.
option.selected
selectedcontent
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 button
element.
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 cloned copy of the DOM structure of the select
's selected
+ option
element.
selectedcontent
elements become associated with a select
element when
+ the selectedcontent
is a descendant of the select
's first
+ child button
.
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 nodes be « ».
For each child of option's children:
+ +Let childClone be the result of running clone given child, null, true.
Append childClone to + nodes.
Let documentFragment be the result of running convert nodes into a + node given nodes and option's node document.
Ensure pre-insertion validity of documentFragment into + selectedContent before null.
Replace all with + documentFragment within selectedcontent.
To clear a selectedcontent
given a selectedcontent
element
+ selectedcontent:
Remove all children of selectedcontent, in tree + order.
To clear a select
's non-primary selectedcontent
elements,
+ given a select
element select:
Let passedFirstSelectedcontent be false.
For each descendant of select in tree order:
+ +If descendant is a selectedcontent
element, then:
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, then:
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.
If the current node is an option
element, then pop that node from
- the stack of open elements. Otherwise, this is a parse error; ignore
- the token.
If the current node is an option
element, then:
Let option be the current node.
Pop option from the stack of open elements.
Run maybe clone an option into selectedcontent given + option.
Otherwise, this is a parse error; ignore the token.
HTMLSelectElement
selectedcontent
option
button
HTMLSelectedContentElement
slot
select
HTMLSelectElement
: HTMLElement
+ selectedcontent
+ HTMLSelectedContentElement
: HTMLElement
+
slot
HTMLSlotElement
: HTMLElement