Add preferences to control form fill assistant behavior

VERIFIED FIXED

Status

Fennec Graveyard
General
VERIFIED FIXED
8 years ago
8 years ago

People

(Reporter: blassey, Assigned: vingtetun)

Tracking

Bug Flags:
in-litmus -

Details

(Whiteboard: formfill)

Attachments

(2 attachments, 1 obsolete attachment)

users or addons may want to tweak the behavior of our form fill assistant and we should allow them to do so.
(Reporter)

Updated

8 years ago
tracking-fennec: --- → ?
Right now the proposed prefs are :
 * formhelper.enabled
 * formhelper.autozoom.enabled
 * formhelper.restorezoom.enabled
How about firing an event "FormUI", before and after. That way add-ons could save and restore zoom and scroll too.
(In reply to comment #2)
> How about firing an event "FormUI", before and after. That way add-ons could
> save and restore zoom and scroll too.

Agreed with that.
Created attachment 421047 [details] [diff] [review]
wip-1

This wip handle autozoom.enabled, restorezoom.enabled, and forhelper.enabled but performs badly on the last one (because of select elements).
Assignee: nobody → 21
Comment on attachment 421047 [details] [diff] [review]
wip-1

>diff -r ad500c60b355 app/mobile.js

>+/* form helper */
>+pref("formhelper.enabled", true);
>+pref("formhelper.autozoom.enabled", true);
>+pref("formhelper.restorezoom.enabled", true);
>+

Sorry, I want to change the names a bit. And change restorezoom to false (current behavior)

  pref("formhelper.autozoom", true);
  pref("formhelper.restorezoom", false);

>diff -r ad500c60b355 chrome/content/browser-ui.js

>   _isValidElement: function(aElement) {
>     if (aElement.disabled)
>       return false;
> 
>+    if (this._isValidSelectElement(aElement) || aElement instanceof HTMLTextAreaElement)
>+      return this._isElementVisible(aElement);
>+
>+    if (!gPrefService.getBoolPref("formhelper.enabled"))
>+      return false;
>+

A comment above the select check would be helpful. Basically, that we need to handle select elements regardless of the "formhelper.enabled" setting.
Attachment #421047 - Flags: review-
Created attachment 421058 [details] [diff] [review]
Patch

I've rename restorezoom to restore because it also restore the scroll position.
Attachment #421047 - Attachment is obsolete: true
Attachment #421058 - Flags: review?(mark.finkle)
Comment on attachment 421058 [details] [diff] [review]
Patch

Looks pretty good. Note to others: This patch should not change the current FormHelper behavior at all. It just provides some preferences and events for add-ons to tweak FormHelper.
Attachment #421058 - Flags: review?(mark.finkle) → review+
Whiteboard: [fennec-checkin-post1.0]
Whiteboard: [fennec-checkin-post1.0] → [fennec-checkin-post1.0] formfill

Comment 8

8 years ago
+ for preference adding, not for UI adding :)
tracking-fennec: ? → 1.1+
Created attachment 435512 [details] [diff] [review]
Updated patch on the trunk

The same but updated on the current trunk
Attachment #435512 - Flags: review?(mark.finkle)
Flags: in-litmus?
pushed:
http://hg.mozilla.org/mobile-browser/rev/8a7d5492acda
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Whiteboard: [fennec-checkin-post1.0] formfill → formfill
Flags: in-litmus? → in-litmus-
how is formhelper.enabled different from browser.formfill.enable?
(In reply to comment #11)
> how is formhelper.enabled different from browser.formfill.enable?

formhelper.enabled == the UI
browser.formfill.enable == the platform will save text to the DB
verified FIXED on builds:

Mozilla/5.0 (X11; U; Linux armv7l; Nokia N900; en-US; rv:1.9.2.3pre) Gecko/20100331 Namoroka/3.6.3pre Fennec/1.1a2pre

and

Mozilla/5.0 (X11; U; Linux armv7l; Nokia N900; en-US; rv:1.9.3a4pre) Gecko/20100331 Namoroka/3.7a4pre Fennec/1.1a2pre
Status: RESOLVED → VERIFIED
Comment on attachment 435512 [details] [diff] [review]
Updated patch on the trunk

because this patch has landed
Attachment #435512 - Flags: review?(mark.finkle) → review+
You need to log in before you can comment on or make changes to this bug.