Closed Bug 2092987 Opened 20 days ago Closed 16 days ago

[wpt-sync] Sync PR 64666 - Preserve autofill state on no-op option.selected assignments

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Attachments

(1 file)

Sync web-platform-tests PR 64666 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/64666
Details from upstream follow.

Joey Arhar <jarhar@chromium.org> wrote:

Preserve autofill state on no-op option.selected assignments

In crrev.com/c/8300572, HTMLOptionElement::setSelectedForBinding was
changed to call SetSelectedState and OptionSelectionStateChanged
directly when SelectedcontentSpec2 is enabled instead of calling
SetSelected. Because SetSelected returns early when the option's
selectedness does not change, bypassing it caused no-op assignments
(such as re-assigning option.selected = true on an already-selected
option or option.selected = false on an unselected option) to call
SelectOption with WebAutofillState::kNotFilled, clearing the \<select>
element's autofilled state and notifying AutofillAgent of a user edit.
Fix this by restoring the SetSelected call in setSelectedForBinding.

This change aligns with https://github.com/whatwg/html/pull/13005, where
setting the selected IDL attribute on an \<option> element only updates
\<selectedcontent> elements when selectedness changes. There is another
patch coming soon to implement the changes from that spec pr.

Fixed: 580550670
Change-Id: I9b6208cfceb4593c3c4ec21336d227685d4614ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8700606
Reviewed-by: Joey Arhar \<jarhar@chromium.org>
Commit-Queue: Joey Arhar \<jarhar@chromium.org>
Reviewed-by: Mason Freed \<masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1734083}

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Attached file Notable wpt changes —

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 182 tests

Status Summary

Firefox

OK : 1[GitHub] 88[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 11[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 213[Gecko-windows11-32-25h2-opt] 214[Gecko-windows11-32-25h2-debug] 220[Gecko-android-em-14-x86_64-opt-geckoview] 221[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview] 244[Gecko-windows11-64-25h2-opt] 245[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug]
FAIL: 11[GitHub] 105[Gecko-windows11-32-25h2-debug] 106[Gecko-windows11-32-25h2-opt] 131[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview] 132[Gecko-android-em-14-x86_64-opt-geckoview] 157[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug] 158[Gecko-windows11-64-25h2-opt]

Chrome

OK : 1
PASS: 10
FAIL: 1

Safari

OK : 1
PASS: 10
FAIL: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

(See attachment for full changes)

Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/0a1a3344e5f1 https://hg.mozilla.org/integration/autoland/rev/e56a65870bff [wpt PR 64666] - Preserve autofill state on no-op option.selected assignments, a=testonly
Status: NEW → RESOLVED
Closed: 16 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: