Skip to content

Describe HTMLOptionsCollection's length tree mutation in terms of DOM #3652

@annevk

Description

@annevk

If the new value is greater, then n new option elements with no attributes and no child nodes must be appended to the select element on which the HTMLOptionsCollection is rooted, where n is the difference between the two numbers (new value minus old value). Mutation events must be fired as if a DocumentFragment containing the new option elements had been inserted.

Instead we should create a DocumentFragment, create and append n new option elements to it, and then append that DocumentFragment to the select element.

That avoids having to talk about mutation events altogether here. We should also have a test to ensure this is actually what happens in terms of mutation observers.

Note that a little bit below:

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:

This is already done so basically the wording in that algorithm should be used here as well (possibly shared).

Metadata

Metadata

Assignees

No one assigned

    Labels

    clarificationStandard could be clearergood first issueIdeal for someone new to a WHATWG standard or software projecttopic: forms

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions