Closed Bug 1847687 Opened 1 year ago Closed 11 months ago

Consider using isFocusable instead of isVisible when determing whether a field is eligible for address and credit card autofill

Categories

(Toolkit :: Form Autofill, task, P3)

task

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: dimi, Assigned: janika)

References

(Regressed 1 open bug)

Details

(Whiteboard: [fxcm-cc-new-geo])

Attachments

(1 file)

We have seen in some cases, a field is not visible but should still be autofilled (state field in Bug 1835852, expiry month/year in Bug 1845321).

Maybe we should use "isFocusable" instead of "isVisible"? If this is the right thing to do, can we use elementIsFocusable[1]?

[1] https://searchfox.org/mozilla-central/rev/e4d8451468be3a0f8a9faa3d37cadf07200821ec/dom/interfaces/base/nsIFocusManager.idl#171

See Also: → 1845455
Whiteboard: [fxcm-cc-new-geo]
Blocks: 1845453

Maybe we should use "isFocusable" instead of "isVisible"? If this is the right thing to do, can we use elementIsFocusable[1]?

@edgar, we had chatted about this during the AllHands, but could you help confirm again that elementIsFocusable is the right API to use for our use cases, thank you!

Flags: needinfo?(echen)

Yes, you can use elementIsFocusable with flag=0 to check whether a element is focusable, i.e. does the focus can be moved to a element either by mouse clicking or calling element.focus(). And if I read code correctly, you can also use FLAG_BYMOUSE to check whether a element is focusable by mouse clicking.

Flags: needinfo?(echen)
Assignee: nobody → jneuberger
Attachment #9354785 - Attachment description: WIP: Bug 1847687 - Enable checking a credit card or address field's focusability by calling Services.focus.elementIsFocusable before autofilling - r?#credential-management-reviewers! → Bug 1847687 - Enable checking a credit card or address field's focusability by calling Services.focus.elementIsFocusable before autofilling - r?#credential-management-reviewers!
Pushed by jneuberger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8370540453d9 Enable checking a credit card or address field's focusability by calling Services.focus.elementIsFocusable before autofilling - r=credential-management-reviewers,dimi

Backed out for causing bc failures on browser_HomeDepot.js

Backout link

Push with failures

Failure log

Flags: needinfo?(jneuberger)
No longer blocks: 1845453

Hi @Norisz, thank you for pinging me! I checked the failures and updated and fixed the patch (see try push).

Flags: needinfo?(jneuberger)
See Also: → 1392944
Pushed by jneuberger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9e7e8bd8a196 Enable checking a credit card or address field's focusability by calling Services.focus.elementIsFocusable before autofilling - r=credential-management-reviewers,dimi
Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
Blocks: 1835852
Regressions: 1873202
Duplicate of this bug: 1845321
Regressions: 1836036
Regressions: 1887730
No longer regressions: 1887730
See Also: → 1783962
See Also: → 1247245
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: