Non-parser created select element might not reflect selected option in .selectedOptions
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox157 | --- | fixed |
People
(Reporter: emilio, Assigned: keithamus)
Details
Attachments
(2 files)
Sorry for the claude test-case.
Anyway, this seems to be because a non-parser-inserted select never sets mDefaultSelectionSet. Haven't bisected yet:
| Assignee | ||
Updated•2 days ago
|
Updated•2 days ago
|
| Assignee | ||
Comment 1•2 days ago
|
||
Bug 2038588, replaced TrySelectSomething, so that option selectedness is only
dirty via OnSelectionChanged. OnSelectionChanged returns early unless
mDefaultSelectionSet is set, and only DoneAddingChildren sets it.
This means it never runs for a select built by script. Removing the last
unselected option from such a combobox, or resetting its form, re-selects the
first enabled option but leaves selectedOptions stale.
This change moves to initialise mIsDoneAddingChildren in the constructor. It's
already set when the select is not parser-created. The result is that the early
return is skipped, allowing the selected option list to become dirty.
Comment 3•1 day ago
|
||
| bugherder | ||
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/62446 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Description
•