[wpt-sync] Sync PR 24247 - SELECT element: Fix a regression on adding multiple selected OPTIONs to a single-selection SELECT
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox79 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 24247 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/24247
Details from upstream follow.
Kent Tamura <tkent@chromium.org> wrote:
SELECT element: Fix a regression on adding multiple selected OPTIONs to a single-selection SELECT
This CL fixes a regression caused by crrev.com/745230.
Bug details:
Suppose that |select.innerHTML = '\<option selected>Option1' +
'\<option selected>Option2'| runs.Before crrev.com/745230,
- Option1 is appended to the SELECT.
- HTMLOptionElement::InsertedInto() and |HTMLSelectElement::
OptionInserted()| are called for Option1.- SelectOption(Option1) is called.
- DeselectItemsWithoutValidation(Option1) is called
- Option2 is appended to the SELECT.
- HTMLOptionElement::InsertedInto() and |HTMLSelectElement::
OptionInserted()| are called for Option2.- SelectOption(Option2) is called.
- DeselectItemsWithoutValidation(Option2) is called. Option1's
selected state is cleared.Since crrev.com/745230,
- Option1 is appended to the SELECT.
- Option2 is appended to the SELECT.
- HTMLSelectElement::ChildrenChanged() and |HTMLSelectElement::
OptionInserted()| are called for Option1.- SelectOption(Option1) is called.
- DeselectItemsWithoutValidation(Option1) is called. Option2's
selected state is cleared.- HTMLSelectElement::ChildrenChanged() and |HTMLSelectElement::
OptionInserted()| are called for Option2.- SelectOption(Option2) is NOT called because Option2's selected
state was cleared.Fix:
DeselectItemsWithoutValidation() should not update 'selected' state of
OPTIONs for which OptionInserted() is not called yet. This CL adds a
boolean flag to HTMLOptionElement, it represents whether
OptionInserted() is called or not, and DeselectItemsWithoutValidation()
checks the flag before updating 'selected' state.Bug: 1095725
Change-Id: If19b28c3edb877549ca498b661647466d03e6d1dReviewed-on: https://chromium-review.googlesource.com/2253260
WPT-Export-Revision: f899b3cc002f1d5243462d484bfd18554072a9e3
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 1•5 years ago
|
||
| Assignee | ||
Comment 2•5 years ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 1 tests and 3 subtests
Status Summary
Firefox
OK : 1
PASS: 3
Chrome
OK : 1
PASS: 1
FAIL: 2
Safari
OK : 1
PASS: 2
FAIL: 1
Links
Comment 4•5 years ago
|
||
| bugherder | ||
Description
•