Closed Bug 1883909 Opened 1 year ago Closed 1 year ago

Move logic from FormAutofillContent to FormAutofillChild

Categories

(Toolkit :: Form Autofill, task, P2)

task

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox125 --- fixed

People

(Reporter: dimi, Assigned: dimi)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxcm-iframe])

Attachments

(3 files)

We should maintain state based on frame, not based on process.
This is a prerequisite work needed for supporting autofill across iframe.

this._alreadyDOMContentLoaded variable is not needed in the logic.
Its purpose is already covered by doc.readyState

In this patch, we move most of the logic from FormAutofillContent to FormAutofillChild.
This is the first step in removing FormAutofillContent from the formautofill module.
The purpose is to eliminate per-process state and maintain per-frame state instead.
Doing so would allow us to support autofill across iframes.

However, given that the current autocomplete module (AutofillProfileAutoComplete.sys.mjs)
still requires per-process state, I added updateActiveAutofillChild so we don't have to
change how AutofillProfileAutoComplete.sys.mjs is implemented in this patch.

Depends on D203765

When a page navigation event is received in the top-level frame, the same-origin iframe
is able to know that because they are in the same process.

However, the plan is to remove FormAutofillContent, which means we
will not be able to use "per process" module to communicate directly.

So instead, we should solve the issue by the child talks to the parent,
and then the parent talks to its childern. But before implementing the
solution mentioned above, we still use FormAutofillContent to workaround it.

Depends on D203766

Pushed by dlee@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/02f7f4aac89a P1. Remove unused variables in FormAutofillChild r=credential-management-reviewers,sgalich https://hg.mozilla.org/integration/autoland/rev/aa8c9eb6b39b P2. Move logic from FormAutofillContent to FormAutofillChild r=credential-management-reviewers,sgalich https://hg.mozilla.org/integration/autoland/rev/b7875a84aa37 P3. Workaround to support detect page navigation for the same-origin iframe. r=credential-management-reviewers,jneuberger,sgalich
Regressions: 1885356
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: