Skip to content

Selectedcontent post-connection steps define unused “ancestor” variable #11963

@F3n67u

Description

@F3n67u

What is the issue with the HTML Standard?

In the selectedcontent HTML element post-connection steps, the algorithm currently reads:

The selectedcontent HTML element post-connection steps, given selectedcontent, are:

  1. Let nearestSelectAncestor be null.
  2. Let ancestor be selectedcontent’s parent.
  3. Set selectedcontent’s disabled state to false.
  4. For each of selectedcontent’s ancestors, in reverse tree order:
    1. If ancestor is a select element:
      1. If nearestSelectAncestor is null, then set nearestSelectAncestor to select.
      2. Otherwise, set selectedcontent's disabled state to true.
    2. If ancestor is an option element or a selectedcontent element, then set selectedcontent's disabled state to true.

Step 2 is a dead step: the ancestor variable is never used because step 4 walks the ancestor chain directly. Suggest removing step 2 to eliminate the unused step.

Spec section: https://html.spec.whatwg.org/multipage/form-elements.html#the-selectedcontent-element

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions