From a5666e60ee13e568581e11f6437b6517c461649c Mon Sep 17 00:00:00 2001
From: Anne van Kesteren Let n be value − current. Append n new Append new option elements to the 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 given
- property index index to a new value value, it must run the following
- algorithm: To append new option elements to a If value is null, invoke the steps for the Let fragment be a new Let length be the number of nodes represented by the
- collection. Append count new Append fragment to
+ select. To set the value of a new indexed property
+ or set the value of an existing indexed property for an
+ 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 delta be index minus length. Let delta be index − length. If delta is greater than zero, then append a If delta is greater than 0, then append new option elements to
+ the If delta is greater than or equal to zero, append value to the If delta is greater than or equal to 0, then append value to the The If element is an ancestor of the If before is an element, but that element isn't a descendant of the
- If element and before are the same element, then return. If element and before are the same element, then
- return. Let reference be null. If before is a node, then let reference be that
- node. Otherwise, if before is an integer, and there is a beforeth node in the collection, let reference be that node.
- Otherwise, 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. If reference is not null, let parent be the parent
- node of reference. Otherwise, let parent be the
- Let parent be reference's parent node if reference is
+ not null; otherwise the Pre-insert element into parent node before
- reference. The To remove an option from an
+ If the number of nodes represented by the collection is zero, return. If the number of nodes represented by
+ collection 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 the collection, 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. Let element be the indexth element in the
- collection. Let element be the indexth element in
+ collection. Remove element from its parent node. The The The option elements with no attributes and no child
- nodes to the select element on which this is rooted.select element on which
+ this is rooted given n.select element
+ select given a non-negative integer count:
-
+ remove method with index as
- the argument, and return.DocumentFragment whose node
+ document is select's node document.option elements to fragment.HTMLOptionsCollection collection, given a property index index
+ and a new value value:
+
DocumentFragment consisting of
- delta new option elements with no attributes and
- no child nodes to the select element on which the HTMLOptionsCollection
- is rooted.select element on which collection is rooted given
+ delta.select
- element. Otherwise, replace the indexth element in the collection by value.select element
+ on which collection is rooted. Otherwise, replace the indexth element in
+ collection by value.add(element, before)
- method must act according to the following algorithm:
select element on which
- the HTMLOptionsCollection is rooted, then throw a
- "HierarchyRequestError" DOMException.HierarchyRequestError"
+ DOMException.
select element on which the HTMLOptionsCollection is rooted, then throw
- a "NotFoundError" DOMException.select element on which this is rooted, then throw a
+ "NotFoundError" DOMException.
+
+ select element on which the HTMLOptionsCollection is rooted.select element on which this is rooted.remove(index) method must act
- according to the following algorithm:HTMLOptionsCollection collection given an integer index:
-
remove(index) method steps are
+ to remove an option from
+ this given index.selectedIndex IDL attribute must act
- like the identically named attribute on the select element on which the
- HTMLOptionsCollection is rootedselect
+ element on which this is rooted.
+ selectedIndex setter steps
+ are to set the selected index of the select element on which
+ this is rooted to the given value.
The selectedIndex getter steps are to return the index of the first option element in
- this's list of options in tree
- order that has its selectedness set to
- true, if any. If there isn't one, then return −1.
A select element's selected index is
+ the index of the first option element in
+ its list of options in tree order
+ that has its selectedness set to true. If there
+ isn't one, then it is −1.
The selectedIndex setter steps are:
To set the selected index of a select element
+ select to a value value:
Let firstMatchingOption be null.
For each option of this's For each option of select's list of options:
If firstMatchingOption is null and option's index is equal to the given value, then set + data-x="concept-option-index">index is equal to value, then set firstMatchingOption to option.
Run update a select's selectedcontent given
- this.
select element having no multiple
attribute and a display size of 1.
+ The selectedIndex getter steps are to return
+ this's selected index.
The selectedIndex setter steps are to set
+ the selected index of this to the given value.
The value
getter steps are to return the value of the