Closed Bug 1837161 Opened 2 years ago Closed 5 months ago

Dynamic Form Support

Categories

(Toolkit :: Form Autofill, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
138 Branch
Tracking Status
relnote-firefox --- 138+
firefox138 --- fixed

People

(Reporter: dimi, Assigned: janika)

References

(Blocks 10 open bugs, Regressed 3 open bugs)

Details

Attachments

(7 files)

No description provided.
Blocks: 1873003
Blocks: 1835644
Blocks: 1819837
Blocks: 1861499
Blocks: 1849042
Depends on: 1880340
Depends on: 1880341
Depends on: 1880052
Blocks: 1825318
Depends on: 1880282
Blocks: 1883042
Summary: Handle form elements are changed after autofilling → Handle dynamic forms
Summary: Handle dynamic forms → [META] Handle dynamic forms
Blocks: 1928367
No longer blocks: 1861499
Blocks: 1861499
Blocks: 1934830
Blocks: 1935644
Blocks: 1937076
Blocks: 1937093

Sets up two observer types in order to detect dynamic form changes:
1. MutationObserver for an address/cc form (document if form-less),
observing node additions or removals in the form's node subtree
2. IntersectionObserver for each invisible elements in an address/cc form (document if form-less),
observing intersections (threshold 1) between the invisible element and the form/document

A "form-changed" event gets dispatched in the observers' callback functions when the fields that were added/removed (MutationObserver)
or became visible (IntersectionObserver) are of address or cc type. When the FormAutofillChild receives a "form-change" event it
compares the previous formDetails with the formDetails after the form change. If they differ, the FormAutofillChild sends the message
"FormAutofill:onFieldsDetected" to the FormAutofillParent, which triggers the form detection process in all children.
In onFieldsDetectedComplete the form handler's elements are updated accordingly to the new set of elements.

Blocks: 1937142
Blocks: 1928446
Attachment #9446258 - Attachment description: WIP: Bug 1837161: P1. Detect dynamic form changes and track address/cc field changes r=dimi! → Bug 1837161: P1. Detect dynamic form changes and track address/cc field changes r=dimi!
No longer blocks: 1928367
Attachment #9446258 - Attachment description: Bug 1837161: P1. Detect dynamic form changes and track address/cc field changes r=dimi! → Bug 1837161 - P1. Detect dynamic form changes and update address/cc fieldDetail changes r=dimi!
Attachment #9446258 - Attachment description: Bug 1837161 - P1. Detect dynamic form changes and update address/cc fieldDetail changes r=dimi! → Bug 1837161 - P1. Detect dynamic form changes r=dimi!
Attachment #9446258 - Attachment description: Bug 1837161 - P1. Detect dynamic form changes r=dimi! → Bug 1837161 - P1. Detect dynamic form changes r=#credential-management-reviewers,dimi
Summary: [META] Handle dynamic forms → Handle dynamic forms
Assignee: dlee → jneuberger
Summary: Handle dynamic forms → [meta] Handle dynamic forms

Hey @owlish, my patch is currently blocked by geckoview-reviewers group. I'd appreciate if you or someone from your team could give a quick review on patch P1. It's only adding a new event to FormAutofillChild in mobile/shared/chrome/geckoview/geckoview.js. Thank you!

Flags: needinfo?(bugzeeeeee)

If a form change occurs immediately after an initial autocompletion process, the FormAutofillChild notifies the
parent to re-trigger another filling process in all children to fill the fields that were added or became
visible on form change. Only form changes occuring within the threshold FormAutofill.fillOnDynamicFormChangesTimeout
(default is 500ms) also lead to another filling process.

Whiteboard: [fxcm-addr-compatibility]
Keywords: meta
Summary: [meta] Handle dynamic forms → Handle dynamic forms

@owlish, thank you for the review on P1!

Flags: needinfo?(bugzeeeeee)
Attachment #9465110 - Attachment description: Bug 1837161 - P3. Integrate dynamic form change detection into autocompletion process r=#credential-management-reviewers,dimi → Bug 1837161 - P4. Integrate dynamic form change detection into autocompletion process r=#credential-management-reviewers,dimi
Attachment #9466582 - Attachment description: Bug 1837161 - P3. Cache filled fields that become invisible and clear them on next user initiated clearing process r=#credential-management-reviewers,dimi → Bug 1837161 - P3. Keep track of autocompleted but invisible elements for form clearing r=#credential-management-reviewers,dimi
No longer depends on: 1880052, 1880282, 1880340, 1880341
No longer blocks: 1873003
No longer blocks: 1935644
Summary: Handle dynamic forms → Dynamic Form Support
No longer blocks: 1937093
No longer blocks: 1934830
Blocks: 1937093
Blocks: 1928594
Pushed by jneuberger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/796fef1449fe P1. Detect dynamic form changes r=dimi,geckoview-reviewers,credential-management-reviewers,owlish https://hg.mozilla.org/integration/autoland/rev/e51320546694 P2. Add tests for dynamic form change detection r=dimi,credential-management-reviewers https://hg.mozilla.org/integration/autoland/rev/cb0cbbcfd115 P3. Keep track of autocompleted but invisible elements for form clearing r=dimi,credential-management-reviewers https://hg.mozilla.org/integration/autoland/rev/8ec455a9ba81 P4. Integrate dynamic form change detection into autocompletion process r=dimi,credential-management-reviewers https://hg.mozilla.org/integration/autoland/rev/163b0ced2c77 P5. Add tests for filling on form change r=dimi,credential-management-reviewers

Backed out for causing bc failures

Backout link

Push with failures

Failure log

Flags: needinfo?(jneuberger)

The problem is that when calling triggerAutofillActionInChildren in onFillOnFormChange we need to pass the fieldDetails of section.getAutofillFields() instead of the section.

Flags: needinfo?(jneuberger)
Pushed by jneuberger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9863ec556d84 P1. Detect dynamic form changes r=dimi,geckoview-reviewers,credential-management-reviewers,owlish https://hg.mozilla.org/integration/autoland/rev/ff1bbda0856d P2. Add tests for dynamic form change detection r=dimi,credential-management-reviewers https://hg.mozilla.org/integration/autoland/rev/45e37689e00e P3. Keep track of autocompleted but invisible elements for form clearing r=dimi,credential-management-reviewers https://hg.mozilla.org/integration/autoland/rev/f87e28b48c2c P4. Integrate dynamic form change detection into autocompletion process r=dimi,credential-management-reviewers https://hg.mozilla.org/integration/autoland/rev/f27c8ecd8ed6 P5. Add tests for filling on form change r=dimi,credential-management-reviewers
No longer blocks: 1880052
Blocks: 1849032
Blocks: 1884164
No longer blocks: 1844375

Updated the patches and fixed failures for browser_form_changes.js.

Try run without failures: https://treeherder.mozilla.org/jobs?revision=e7c7a8bc0c2861aaf4bfbd5bfc86c8c251a94f73&repo=try

Flags: needinfo?(jneuberger)
Pushed by jneuberger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8ec644ecbdc4 P1. Detect dynamic form changes r=dimi,geckoview-reviewers,credential-management-reviewers,owlish https://hg.mozilla.org/integration/autoland/rev/730834404aec P2. Add tests for dynamic form change detection r=dimi,credential-management-reviewers https://hg.mozilla.org/integration/autoland/rev/1cad27d93ad4 P3. Keep track of autocompleted but invisible elements for form clearing r=dimi,credential-management-reviewers https://hg.mozilla.org/integration/autoland/rev/3a970dd4c57e P4. Integrate dynamic form change detection into autocompletion process r=dimi,credential-management-reviewers https://hg.mozilla.org/integration/autoland/rev/e88442d8bd32 P5. Add tests for filling on form change r=dimi,credential-management-reviewers

This lead to a 5.6KB regression in installer size on Windows. This small increase is below any alertable threshold, so consider this comment only as a FYI

  • Adds two events in formautofill/metrical.yaml: filledOnFieldsUpdateAddressForm and filledOnFieldsUpdateCcFormV2
    that record the filling state of a form after the second autofill action and which fields were filled after the update.
  • Adds test cases in browser_dynamic_form_telemetry.js
  • Renaming all dynamic form related test files to follow the same name pattern
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Pushed by jneuberger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/08f4a2a84c19 P6. Add form interaction event filled-on-fields-update for the categories creditcard and address r=dimi,credential-management-reviewers
Regressions: 1951890
No longer blocks: 1884164
Status: REOPENED → RESOLVED
Closed: 5 months ago5 months ago
Resolution: --- → FIXED
No longer blocks: 1952487
Regressions: 1954086
Blocks: 1883038

:janika did you want to include this in the 138 release notes?
Also, should we change this to an enhancement instead of a task?

Flags: needinfo?(jneuberger)

Yes, I changed it from task to enhancement.

:janika did you want to include this in the 138 release notes?

I'll get back to you on this tomorrow! Thanks for asking!

Type: task → enhancement
Flags: needinfo?(jneuberger)
Attachment #9473050 - Attachment description: Bug 1837161 - Remove Nightly restriction from Dynamic Form Support preferences r=#credential-management-reviewers,dimi → Bug 1837161 - P7. Remove Nightly restriction from Dynamic Form Support preferences r=#credential-management-reviewers,dimi

A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)

Pushed by jneuberger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a4b81f339d44 P7. Remove Nightly restriction from Dynamic Form Support preferences r=dimi,credential-management-reviewers

Release Note Request (optional, but appreciated)
[Why is this notable]: Increases user convenience when autofilling address and credit card forms
[Affects Firefox for Android]: Yes
[Suggested wording]: Improves Address Autofill and Credit Card Autofill experience by ensuring that forms adjusting dynamically as users fill them are properly supported. This includes cases where fields appear or change based on input - such as selecting a country - so that newly revealed fields are now filled as expected.

relnote-firefox: --- → ?

Added to the 138 release notes with slightly altered wording.
https://www.mozilla.org/en-US/firefox/138.0a1/releasenotes/

See Also: → 1958269
See Also: → 1960190
Blocks: 1956747
Blocks: 1955629
See Also: → 1960395
See Also: → 1955252
Regressions: 1956797
No longer regressions: 1956797
Blocks: 1956464
Blocks: 1957361
Blocks: 1956031
Blocks: 1956492
Blocks: 1957365
Blocks: 1956561
Blocks: 1956802
Blocks: 1957030
See Also: → 1962034
No longer blocks: 1956802
Blocks: 1957358
Blocks: 1962156
See Also: → 1963078
Blocks: 1962034
See Also: 1962034
Blocks: 1957391
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: