From afb732d0515d6cd763a0aa322d3762895ad1ae5e Mon Sep 17 00:00:00 2001
From: Joey Arhar
For each descendant of insertedNode's inclusive descendants in tree order:
+ +If descendant is an option
element, then run the option
+ insertion steps given descendant and insertedNode's
+ parent.
The removing steps for the HTML Standard, given @@ -1838,6 +1849,16 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
If removedNode's popover
attribute is not in
the no popover state, then run the hide
popover algorithm given removedNode, false, false, and false.
For each descendant of removedNode's inclusive descendants in tree order:
+ +If descendant is an option
element, then run the option
+ removal steps given descendant and oldParent.
A The child concept
The list of options for a To get the list of options given a
+ Let options be « ». For each node of select's
+ descendants in tree order: If node is an If node is an Return options. The The The option insertion steps, given option and insertionPoint,
+ are: If insertedNode's parent is a Let passedInsertionPoint be false. The For each ancestor of option's ancestors: If oldParent is a If ancestor is insertionPoint, then set
+ passedInsertionPoint to true. If ancestor is a If passedInsertionPoint is true, then run the selectedness setting
+ algorithm given select. Return. The The option removal steps, given option and oldParent, are: If oldParent is a If there is an ancestor of option which is a For each ancestor of oldParent's inclusive ancestors: If ancestor is a Run the selectedness setting algorithm given select. Return. If an select
- element consists of all the option
element children of the select
- element, and all the option
element children of all the optgroup
element
- children of the select
element, in tree order.select
element select:
+
+
+ option
element, then append node to options.option
or select
element, and
+ node's last child is not null, then set node to
+ node's last child.required
attribute is a boolean attribute. When specified, the user will be required to select
@@ -53401,32 +53447,56 @@ interface HTMLSelectElement : HTMLElement {
to false.option
HTML element insertion
- steps, given insertedNode, are:
-
+ select
element, or
- insertedNode's parent is an optgroup
element whose parent is a
- select
element, then run that select
element's selectedness
- setting algorithm.option
HTML element removing
- steps, given removedNode and oldParent, are:
-
select
element, or oldParent is an
- optgroup
element whose parent is a select
element, then run that
- select
element's selectedness setting algorithm.
+
+ select
element, then:
+
+ optgroup
HTML element removing
- steps, given removedNode and oldParent, are:
-
select
element and removedNode has an
- option child, then run oldParent's selectedness setting
- algorithm.select
+ element, then return.
+
+ select
element, then:
+
+ option
element in the list of
@@ -124353,25 +124423,22 @@ dictionary StorageEventInit : EventInit {
caption">in caption", "in column
group", "in table body", "in row", "in
- cell", "in select", "in select in table", "in template", "after body",
- "in frameset", "after frameset", "after
- after body", and "after after
- frameset" during the course of the parsing, as described in the tree
- construction stage. The insertion mode affects how tokens are processed and whether CDATA
- sections are supported.
Several of these modes, namely "in head", "in body", "in - table", and "in select", are special, in - that the other modes defer to them at various times. When the algorithm below says that the user - agent is to do something "using the rules for the m insertion - mode", where m is one of these modes, the user agent must use the rules - described under the m insertion mode's section, but must leave - the insertion mode unchanged unless the rules in m themselves - switch the insertion mode to a new value.
+ data-x="insertion mode: in body">in body", and "in + table", are special, in that the other modes defer to them at various times. When the + algorithm below says that the user agent is to do something "using the rules for the + m insertion mode", where m is one of these modes, the user agent must use + the rules described under the m insertion mode's section, but must leave + the insertion mode unchanged unless the rules in m themselves switch the + insertion mode to a new value.When the insertion mode is switched to "text" or "in table text", the original insertion @@ -124402,37 +124469,6 @@ dictionary StorageEventInit : EventInit { parsing algorithm (fragment case), set node to the context element passed to that algorithm.
-If node is a select
element, run these substeps:
If last is true, jump to the step below labeled - done.
Let ancestor be node.
Loop: If ancestor is the first node in the stack of - open elements, jump to the step below labeled done.
Let ancestor be the node before ancestor in the - stack of open elements.
If ancestor is a template
node, jump to the step below
- labeled done.
If ancestor is a table
node, switch the insertion
- mode to "in select in table"
- and return.
Jump back to the step labeled loop.
Done: Switch the insertion mode to "in select" and return.
If node is a td
or th
element and last is
false, then switch the insertion mode to "in
cell" and return.
p
element in button scope, then close a p
element.
+ While the stack of open elements has an option
element in select scope or has an optgroup
element in select scope, pop an element
+ from the stack of open elements.
Insert an HTML element for the token. Immediately pop the current node off the stack of open elements.
@@ -129393,25 +129434,40 @@ document.body.appendChild(text);If the stack of open elements has a
+ select
element in scope, then run these substeps:
Parse error.
Pop elements from the stack of open elements until a select
+ element has been popped from the stack.
Reconstruct the active formatting elements, if any.
Insert an HTML element for the token.
Set the frameset-ok flag to "not ok".
+While the stack of open elements has an option
element in select scope, pop an element from the
+ stack of open elements.
If the insertion mode is one of "in - table", "in caption", "in table body", "in row", or "in cell", then switch the - insertion mode to "in select in - table". Otherwise, switch the insertion mode to "in select".
+Reconstruct the active formatting elements, if any.
+ +Insert an HTML element for the token.
If the current node is an option
element, then pop the
- current node off the stack of open elements.
While the stack of open elements has an option
element in select scope or has an optgroup
element in select scope, pop an element
+ from the stack of open elements.
Reconstruct the active formatting elements, if any.
@@ -130539,231 +130595,6 @@ document.body.appendChild(text); same time, nor can it have neither when the close the cell algorithm is invoked. -When the user agent is to apply the rules for the "in - select" insertion mode, the user agent must handle the token as follows:
- -Parse error. Ignore the token.
-Insert the token's character.
-Insert a comment.
-Parse error. Ignore the token.
-Process the token using the rules for the "in body" insertion mode.
-If the current node is an option
element, pop that node from the
- stack of open elements.
Insert an HTML element for the token.
-If the current node is an option
element, pop that node from the
- stack of open elements.
If the current node is an optgroup
element, pop that node from the
- stack of open elements.
Insert an HTML element for the token.
-If the current node is an option
element, pop that node from the
- stack of open elements.
If the current node is an optgroup
element, pop that node from the
- stack of open elements.
Insert an HTML element for the token. Immediately pop the current - node off the stack of open elements.
- -Acknowledge the token's self-closing flag, if it is set.
-First, if the current node is an option
element, and the node
- immediately before it in the stack of open elements is an optgroup
- element, then pop the current node from the stack of open
- elements.
If the current node is an optgroup
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 pop that node from
- the stack of open elements. Otherwise, this is a parse error; ignore
- the token.
If the stack of open elements does not have a select
element in select scope, this is a parse
- error; ignore the token. (fragment case)
Otherwise:
- -Pop elements from the stack of open elements until a select
element
- has been popped from the stack.
Reset the insertion mode appropriately.
-Parse error.
- - -If the stack of open elements does not have a select
element in select scope, ignore the token.
- (fragment case)
Otherwise:
- -Pop elements from the stack of open elements until a select
element
- has been popped from the stack.
Reset the insertion mode appropriately.
- - -It just gets treated like an end tag.
-Parse error.
- - -If the stack of open elements does not have a select
element in select scope, ignore the token.
- (fragment case)
Otherwise:
- -Pop elements from the stack of open elements until a select
element
- has been popped from the stack.
Reset the insertion mode appropriately.
- - -Reprocess the token.
-Process the token using the rules for the "in head" insertion mode.
-Process the token using the rules for the "in body" insertion mode.
-Parse error. Ignore the token.
-When the user agent is to apply the rules for the "in select in table" insertion mode, the user agent must handle the - token as follows:
- -Parse error.
- - -Pop elements from the stack of open elements until a select
element
- has been popped from the stack.
Reset the insertion mode appropriately.
- - -Reprocess the token.
-Parse error.
- -If the stack of open elements does not have an element in table scope that is an HTML - element with the same tag name as that of the token, then ignore the token.
- -Otherwise:
- - -Pop elements from the stack of open elements until a select
element
- has been popped from the stack.
Reset the insertion mode appropriately.
- - -Reprocess the token.
-Process the token using the rules for the "in select" insertion mode.
-When the user agent is to apply the rules for the "in