Closed Bug 2069515 Opened 24 days ago Closed 17 days ago

Use documentGlobal instead of the removed ownerGlobal in FormAutofillPreferences

Categories

(Toolkit :: Form Autofill, defect)

defect

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox-esr153 --- wontfix
firefox155 --- wontfix
firefox156 --- wontfix
firefox157 --- wontfix
firefox158 --- fixed

People

(Reporter: dao, Assigned: xz.ganbaruibro, Mentored)

References

(Regression)

Details

(Keywords: good-first-bug, regression, Whiteboard: [lang=js])

Attachments

(1 file)

Filing as a good first bug to learn workflows.

Node.ownerGlobal was removed from JS in bug 2033243, which renamed it to documentGlobal. Reading .ownerGlobal now returns undefined instead of throwing, so a call site left behind is silent rather than broken.

FormAutofillPreferences.createPreferenceGroup still has one:

const win = document.ownerGlobal;
Services.obs.notifyObservers(win, "formautofill-preferences-initialized");

Replace document.ownerGlobal with document.documentGlobal.

The notification still fires, and both observers of it (in browser/components/preferences/config/passwords-autofill.mjs) take no arguments and ignore the subject, so nothing is broken today. The subject is simply undefined for anything that starts reading it.

This one is a landing race rather than an oversight: bug 2033243 converted this exact line on 2026-05-02, and bug 2022042 — written before the rename and landed five days after it — brought the old spelling back.

Link to the code:
https://searchfox.org/firefox-main/rev/298cf786229591e2159a3933605df11e07709d6f/toolkit/components/formautofill/FormAutofillPreferences.sys.mjs#55

To verify the fix:

./mach lint -l eslint toolkit/components/formautofill/FormAutofillPreferences.sys.mjs
./mach test browser/components/preferences/tests

Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/contributing/stack_quickref.html

Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.

Set release status flags based on info from the regressing bug 2033243

:emilio, since you are the author of the regressor, bug 2033243, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)
Regressed by: 2022042
No longer regressed by: 2033243
Assignee: nobody → xz.ganbaruibro
Status: NEW → ASSIGNED

Set release status flags based on info from the regressing bug 2022042

Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/bc3360c732ba https://hg.mozilla.org/integration/autoland/rev/c51d907c468a Use documentGlobal instead of the removed ownerGlobal in FormAutofillPreferences r=credential-management-reviewers,dimi
Status: ASSIGNED → RESOLVED
Closed: 17 days ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch

The patch landed in nightly and beta is affected, along with ESR.
:xz.ganbaruibro, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(xz.ganbaruibro)

(In reply to BugBot [:suhaib / :marco] from comment #7)

The patch landed in nightly and beta is affected, along with ESR.
:xz.ganbaruibro, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

This is a no-user-impact cleanup (observers ignore the notification subject), so I don't think an uplift to beta/ESR is needed.

Flags: needinfo?(xz.ganbaruibro)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: