diff --git a/source b/source index d928222a11e..62cdd5a2644 100644 --- a/source +++ b/source @@ -3289,7 +3289,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
HTMLCollection interface, its
length attribute, and its
item() and
- namedItem() methodsnamedItem() methods, and its
+ find a named element algorithm
DOMTokenList interface, and its
@@ -9971,37 +9972,45 @@ interface HTMLOptionsCollection : HTMLCollection
The length setter steps are:
To set the number of options of a select element select to a
+ value value:
Let current be the number of nodes represented by the - collection.
Let current be the size of select's + list of options.
If the given value is greater than current:
+If value is greater than current:
If the given value is greater than 100,000, then return.
If value is greater than 100,000, then return.
Let n be value − current.
Append new option elements to the select element on which
- this is rooted given n.
Append new option elements to select given + n.
If the given value is less than current:
+If value is less than current:
Let n be current − value.
Remove the last n nodes in the collection from their parent nodes.
Remove the last n nodes in select's list of options from their parent nodes.
The length setter steps are to
+ set the number of options of the select element on which
+ this is rooted to the given value.
Setting length never removes
or adds any optgroup elements, and never adds new children to existing
optgroup elements (though it can remove children from them).
To set the value of a new indexed property
- or set the value of an existing indexed property for an
- HTMLOptionsCollection collection, given a property index index
- and a new value value:
To set the value of an option in a select element select,
+ given a property index index and a new value value:
If value is null, then remove - an option from collection given index and return.
Let length be the number of nodes represented by collection.
Let length be the size of select's + list of options.
Let delta be index − length.
If delta is greater than 0, then append new option elements to
- the select element on which collection is rooted given
- delta.
If delta is greater than or equal to 0, then append value to the select element
- on which collection is rooted. Otherwise, replace the indexth element in
- collection by value.
The add(element, before)
- method steps are:
To set the value of a new indexed property
+ or set the value of an existing indexed property for an
+ HTMLOptionsCollection collection, given a property index index
+ and a new value value, set the value of an option in the select
+ element on which collection is rooted, given index and value.
To add an element element to a
+ select element select given a before:
If element is an ancestor of the select element on which
- this is rooted, then throw a "HierarchyRequestError"
- DOMException.
If element is an ancestor of select, then throw a
+ "HierarchyRequestError" DOMException.
If before is an element, but that element isn't a descendant of the
- select element on which this is rooted, then throw a
- "NotFoundError" DOMException.
If before is an element, but that element isn't a descendant of
+ select, then throw a "NotFoundError"
+ DOMException.
If element and before are the same element, then return.
Let reference be null.
If before is a node, then set reference to before. - Otherwise, if before is an integer and there is a beforeth node in - this, then set reference to that node.
Let parent be reference's parent node if reference is
- not null; otherwise the select element on which this is rooted.
Pre-insert element into parent node before reference.
To remove an option from an
- HTMLOptionsCollection collection given an integer index:
The add(element, before)
+ method steps are to add element to the
+ select element on which this is rooted given before.
To remove an option from a
+ select element select given an integer index:
If the number of nodes represented by - collection is 0, then return.
If the size of select's list of options is 0, then return.
If index is not a number greater than or equal to 0 and less than the number - of nodes represented by collection, - then return.
If index is not a number greater than or equal to 0 and less than the size of select's list of options, then return.
Let element be the indexth element in - collection.
Let element be the indexth element in select's list of options.
Remove element from its parent node.
The remove(index) method steps are
- to remove an option from
- this given index.
select element on which this is rooted given index.
The type IDL
- attribute, on getting, must return the string "select-one" if the multiple attribute is absent, and the string "select-multiple" if the multiple
- attribute is present.
The type
+ getter steps are to return "select-one" if this's multiple attribute is absent; otherwise "select-multiple".
The options IDL attribute must return an
- HTMLOptionsCollection rooted at the select node, whose filter matches
- the elements in the list of options.
HTMLOptionsCollection rooted at this, whose filter matches the elements
+ in the list of options.
+ A select element's supported property indices are the numbers in the
+ range 0 to one less than its list of options's
+ size. If its list of
+ options is empty, then there are no supported
+ property indices.
The options collection is also mirrored on the
- HTMLSelectElement object. The supported property indices at any instant
- are the indices supported by the object returned by the options attribute at that instant.
The length getter steps are to return the size of this's list of options.
The length
- IDL attribute must return the number of nodes represented by the options collection.
- On setting, it must act like the attribute of the same name on the options collection.
The length setter steps are to set the number of
+ options of this to the given value.
The item(index) method must return the value returned
- by the method of the same name on the options collection, when invoked with the same argument.
The namedItem(name) method must return the value
- returned by the method of the same name on the
- options collection, when invoked with the same
- argument.
When the user agent is to set the value of a new indexed
- property or set the value of an existing indexed property for a
- select element, it must instead run the
- corresponding algorithm on the select element's options collection.
To set the value of a new indexed property or set the
+ value of an existing indexed property for a select element select,
+ given a property index index and a new value value, set the value of
+ an option in select given index and value.
Similarly, the add(element, before) method must act
- like its namesake method on that same options
- collection.
The add(element, before) method steps are
+ to add element to this given
+ before.
The remove()
- method must act like its namesake method on that same options collection when it has arguments, and like its namesake
- method on the ChildNode interface implemented by the HTMLSelectElement
- ancestor interface Element when it has no arguments.
ChildNode interface implemented by the
+ HTMLSelectElement ancestor interface Element when it has no
+ arguments.
The selectedOptions IDL attribute must return an
- HTMLCollection rooted at the select node, whose filter matches the
- elements in the list of options that have their
- selectedness set to true.
HTMLCollection rooted at this, whose filter matches the elements in the
+ list of options that have their selectedness set to true.
A select element's selected index is