diff --git a/source b/source index dce024a305f..1b2b61b79f9 100644 --- a/source +++ b/source @@ -3230,12 +3230,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The child concept
  • The root and shadow-including root concepts
  • The inclusive ancestor, + ancestor, descendant, shadow-including ancestor, shadow-including descendant, shadow-including inclusive descendant, and shadow-including inclusive ancestor concepts
  • The first child, + last child, next sibling, previous sibling, and parent concepts
  • @@ -53506,10 +53508,25 @@ interface HTMLSelectElement : HTMLElement { -

    The list of options for a 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.

    +

    To get the list of options given a + select element select:

    + +
      +
    1. Let options be « ».

    2. + +
    3. +

      For each node of select's + descendants in tree order except the descendants + which are select elements and their subtrees:

      + +
        +
      1. If node is an option element, then append node to options.

      2. +
      +
    4. + +
    5. Return options.

    6. +

    The required attribute is a boolean attribute. When specified, the user will be required to select @@ -53608,34 +53625,6 @@ interface HTMLSelectElement : HTMLElement { to false.

    -

    The option HTML element insertion - steps, given insertedNode, are:

    - -
      -
    1. If insertedNode's parent is a 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.

    2. -
    - -

    The option HTML element removing - steps, given removedNode and oldParent, are:

    - -
      -
    1. If oldParent is a select element, or oldParent is an - optgroup element whose parent is a select element, then run that - select element's selectedness setting algorithm.

    2. -
    - -

    The optgroup HTML element removing - steps, given removedNode and oldParent, are:

    - -
      -
    1. If oldParent is a select element and removedNode has an - option child, then run oldParent's selectedness setting - algorithm.

    2. -
    -

    If an option element in the list of options asks for a reset, then run that select element's selectedness setting algorithm.

    @@ -54363,6 +54352,35 @@ interface HTMLOptionElement : HTMLElement { +

    The option HTML element insertion steps, given + insertedOption, are:

    + +
      +
    1. +

      For each ancestor of insertedOption's ancestors in reverse tree order:

      + +
        +
      1. If ancestor is a select element, then run the selectedness + setting algorithm given ancestor and return.

      2. +
      +
    2. +
    + +

    The option HTML element removing steps, given + removedOption and oldParent, are:

    + +
      +
    1. +

      For each ancestor of oldParent's inclusive ancestors in reverse tree order:

      + +
        +
      1. If ancestor is a select element, then run the selectedness + setting algorithm given ancestor and return.

      2. +
      +
    +
    option.selected
    @@ -125144,25 +125162,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.

    + cell", "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 @@ -125193,37 +125208,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:

    - -
      -
    1. If last is true, jump to the step below labeled - done.

    2. - -
    3. Let ancestor be node.

    4. - -
    5. Loop: If ancestor is the first node in the stack of - open elements, jump to the step below labeled done.

    6. - -
    7. Let ancestor be the node before ancestor in the - stack of open elements.

    8. - -
    9. If ancestor is a template node, jump to the step below - labeled done.

    10. - -
    11. If ancestor is a table node, switch the insertion - mode to "in select in table" - and return.

    12. - -
    13. Jump back to the step labeled loop.

    14. - -
    15. Done: Switch the insertion mode to "in select" and return.

    16. -
    -
  • -
  • If node is a td or th element and last is false, then switch the insertion mode to "in cell" and return.

  • @@ -125422,6 +125406,7 @@ dictionary StorageEventInit : EventInit {
  • th
  • marquee
  • object
  • +
  • select
  • template
  • MathML mi
  • MathML mo
  • @@ -125468,17 +125453,6 @@ dictionary StorageEventInit : EventInit {
  • template in the HTML namespace
  • -

    The stack of open elements is said to have a particular element in select scope when it has that element in the specific scope consisting of all element types - except the following:

    - - -

    Nothing happens if at any time any of the elements in the stack of open elements are moved to a new location in, or removed from, the Document tree. In particular, the stack is not changed in this situation. This can cause, amongst other strange effects, content @@ -130115,6 +130089,18 @@ document.body.appendChild(text); p element in button scope, then close a p element.

    +

    If the stack of open elements has a + select element in scope, then:

    + +
      +
    1. Generate implied end tags.

    2. + +
    3. If the stack of open elements has an + option element in scope or has an + optgroup element in scope, then this is a parse + error.

    4. +
    +

    Insert an HTML element for the token. Immediately pop the current node off the stack of open elements.

    @@ -130184,25 +130170,68 @@ document.body.appendChild(text);
    A start tag whose tag name is "select"
    -

    Reconstruct the active formatting elements, if any.

    +

    If the stack of open elements has a + select element in scope, then:

    -

    Insert an HTML element for the token.

    +
      +
    1. Parse error.

    2. -

      Set the frameset-ok flag to "not ok".

      +
    3. Pop elements from the stack of open elements until a select + element has been popped from the stack.

    4. +
    + +

    Otherwise:

    + +
      +
    1. Reconstruct the active formatting elements, if any.

    2. + +
    3. Insert an HTML element for the token.

    4. + +
    5. Set the frameset-ok flag to "not ok".

    6. +
    +
    + +
    A start tag whose tag name is "option"
    +
    +

    If the stack of open elements has a + select element in scope, then:

    + +
      +
    1. Generate implied end tags except for optgroup + elements.

    2. + +
    3. If the stack of open elements has an + option element in scope, then this is a parse error.

    4. +
    + +

    Otherwise:

    + +
      +
    1. If the current node is an option element, then pop the + current node off the stack of open elements.

    2. +
    -

    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.

    -
    A start tag whose tag name is one of: "optgroup", "option"
    +
    A start tag whose tag name is "optgroup"
    -

    If the current node is an option element, then pop the - current node off the stack of open elements.

    +

    If the stack of open elements has a + select element in scope, then:

    + +
      +
    1. Generate implied end tags.

    2. + +
    3. If the stack of open elements has an + option element in scope or has an + optgroup element in scope, then this is a parse + error.

    4. +
    + +

    Otherwise, if the current node is an option element, then pop the + current node from the stack of open elements.

    Reconstruct the active formatting elements, if any.

    @@ -131330,231 +131359,6 @@ document.body.appendChild(text); same time, nor can it have neither when the close the cell algorithm is invoked.

    -
    The "in select" insertion mode
    - -

    When the user agent is to apply the rules for the "in - select" insertion mode, the user agent must handle the token as follows:

    - -
    - -
    A character token that is U+0000 NULL
    -
    -

    Parse error. Ignore the token.

    -
    - -
    Any other character token
    -
    -

    Insert the token's character.

    -
    - -
    A comment token
    -
    -

    Insert a comment.

    -
    - -
    A DOCTYPE token
    -
    -

    Parse error. Ignore the token.

    -
    - -
    A start tag whose tag name is "html"
    -
    -

    Process the token using the rules for the "in body" insertion mode.

    -
    - -
    A start tag whose tag name is "option"
    -
    - -

    If the current node is an option element, pop that node from the - stack of open elements.

    - - -

    Insert an HTML element for the token.

    -
    - -
    A start tag whose tag name is "optgroup"
    -
    - -

    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.

    -
    - -
    A start tag whose tag name is "hr"
    -
    - -

    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.

    -
    - -
    An end tag whose tag name is "optgroup"
    -
    - -

    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.

    -
    - -
    An end tag whose tag name is "option"
    -
    -

    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.

    -
    - -
    An end tag whose tag name is "select"
    -
    -

    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.

    -
    - -
    A start tag whose tag name is "select"
    -
    -

    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.

    -
    - -
    A start tag whose tag name is one of: "input", "keygen", "textarea"
    -
    -

    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.

    -
    - -
    A start tag whose tag name is one of: "script", "template"
    -
    An end tag whose tag name is "template"
    -
    -

    Process the token using the rules for the "in head" insertion mode.

    -
    - -
    An end-of-file token
    -
    -

    Process the token using the rules for the "in body" insertion mode.

    -
    - -
    Anything else
    -
    -

    Parse error. Ignore the token.

    -
    -
    - - -
    The "in select in table" insertion mode
    - -

    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:

    - -
    - -
    A start tag whose tag name is one of: "caption", "table", "tbody", "tfoot", "thead", "tr", - "td", "th"
    -
    -

    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.

    -
    - -
    An end tag whose tag name is one of: "caption", "table", "tbody", "tfoot", "thead", "tr", - "td", "th"
    -
    -

    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.

    -
    - -
    Anything else
    -
    -

    Process the token using the rules for the "in select" insertion mode.

    -
    -
    - - -
    The "in template" insertion mode

    When the user agent is to apply the rules for the "in