-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
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).