Closed
Bug 695444
Opened 13 years ago
Closed 13 years ago
Form history
Categories
(Firefox for Android Graveyard :: General, defect, P3)
Tracking
(firefox11 fixed, fennec11+)
VERIFIED
FIXED
People
(Reporter: elan, Assigned: sriram)
References
Details
(Whiteboard: [QA+])
Attachments
(2 files, 5 obsolete files)
(deleted),
image/png
|
Details | |
(deleted),
patch
|
Details | Diff | Splinter Review |
* UI popup needed for auto-file
Updated•13 years ago
|
Priority: -- → P3
Updated•13 years ago
|
OS: Mac OS X → Android
Hardware: x86 → ARM
Whiteboard: [QA+]
Comment 1•13 years ago
|
||
I started to look into this today, but I got a little overwhelmed/confused by trying to figure out what XUL fennec was doing and what changes we would need to make to get this to work on native fennec.
Mark, do you have a general idea of what needs to be done here? I think I could get rolling once I have some more guidance.
Comment 2•13 years ago
|
||
Margaret, the biggest issue with form history on mobile has always been the UI. We don't want to use the autocomplete popup that desktop uses. We ended up making our own "touch friendly" XUL arrowbox UI.
In XUL Fennec, you should see the Form Assistant (spread across some chrome JS and forms.js content script) trying to determine if history is available for a textbox and if so, displaying the history in a popup list.
Looking at the core FormHistory component, I see we need to instaniate the service to loadFrameScript. We do this for e10s and non-e10s:
http://mxr.mozilla.org/mozilla-central/source/toolkit/components/satchel/nsFormHistory.js#139
The frame script hooks up a listener, so we can save data when forms are submitted.
The UI used for desktop Firefox comes from a <panel id="PopupAutoComplete"/> in browser.xul that is eventually attached to a <browser> when created. Then a FormFillController is created and attached:
http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/browser.xml#508
Since mobile doesn't use the panel approach and Java UI in particular won't use XUL, we handle things differently. We basically wait for a text field to become focused, then we use the nsIFormAutoComplete service to manually build a list of "suggestions" and show those in a popup UI:
http://mxr.mozilla.org/mozilla-central/source/mobile/chrome/content/common-ui.js#811
We update the list on "keypress" (doesn't work well with IME) and "text" (works well with IME). I guess we could use some kind of list widget to show the list.
First things first, let's see if we can:
* Get the service started so we save data on submit
* Track accessing autocomplete-able textboxes (see forms.js)
* Get a list of suggestions for a textbox, updated as well type
Once we have this, we can work with UX to get a way to display the list. Sound OK?
Comment 3•13 years ago
|
||
(In reply to Mark Finkle (:mfinkle) from comment #2)
> Once we have this, we can work with UX to get a way to display the list.
> Sound OK?
Sounds like a plan! Thanks for the detailed comment.
Assignee: nobody → margaret.leibovic
Comment 4•13 years ago
|
||
This patch does the basic first steps outlined in comment 2. I just tested with the google search box, but the dump statement shows we're getting autocomplete results like we should.
I just took the bare minimum from forms.js and common-ui.js to make this work. I figure we can add more functionality back in one piece at a time.
Attachment #571481 -
Flags: feedback?(mark.finkle)
Comment 5•13 years ago
|
||
Comment on attachment 571481 [details] [diff] [review]
wip
> var FormAssistant = {
>+ init: function() {
>+ addEventListener("text", this, false);
BrowserApp.deck.addEventListener(...)
just to be more explicit
Looks good. I think we also need to handle the case of when a textbox gets focus. We usually "show" the suggestions, just to minimize user typing if suggestions exist.
Attachment #571481 -
Flags: feedback?(mark.finkle) → feedback+
Comment 6•13 years ago
|
||
example of what stock browser on gingerbread does for UI
Comment 7•13 years ago
|
||
That example (of the native browser) is kind of minimum good UX, but it would do.
Comment 8•13 years ago
|
||
Assigning to Sriram, since he's graciously taken over my work on this :)
Assignee: margaret.leibovic → sriram
Assignee | ||
Comment 9•13 years ago
|
||
This WIP has the logic for showing the autocomplete list -- positioned relative to the textbox.
The width adjusts based on the size of the textbox
- if the textbox extends outside the screen, the list uses a "fill_parent" mode
- if not, the list's width is shrunk to the size of the textbox
The height is constant now (100dp) which needs some cleanup.
If the list might be hidden by the keyboard, the list is tried to be show above the textbox. In case it can't be shown about the textbox, it default to be hidden box the keyboard. -- This could be fixed by playing with height more.
There needs some cleanup in showing. I need to take a look at it to optimize few bits there.
Todo:
1. Fixing the height
2. Sending event back to Gecko
3. Updating textbox with the string from Java
4. Cleaning up browser.js
Attachment #579419 -
Flags: feedback?(mark.finkle)
Comment 10•13 years ago
|
||
I'm still seeing a few issues with the element value not being set correctly in the "FormAssist:AutoComplete" observer in FormAssistant, but this looks like it's most of the way there.
Attachment #571481 -
Attachment is obsolete: true
Attachment #579419 -
Attachment is obsolete: true
Attachment #579419 -
Flags: feedback?(mark.finkle)
Attachment #579504 -
Flags: feedback?(mark.finkle)
Assignee | ||
Comment 11•13 years ago
|
||
Added some optimization to AutoCompletePopup.java. If it is already shown, the width and height are not calculated again for every event received from Gecko.
Also added a bit of animation ;)
Attachment #579504 -
Attachment is obsolete: true
Attachment #579504 -
Flags: feedback?(mark.finkle)
Attachment #579524 -
Flags: review?
Attachment #579524 -
Flags: feedback?(mark.finkle)
Comment 12•13 years ago
|
||
This patch uses .blur() to remove focus from the input box before trying to set its value, and it appears to solve our problem.
A few minor changes from the last WIP:
-I renamed showPopup to show to be consistent with hide
-I got rid of our own isShowing method, since isShown is already a View method
Attachment #579524 -
Attachment is obsolete: true
Attachment #579524 -
Flags: review?
Attachment #579524 -
Flags: feedback?(mark.finkle)
Attachment #579938 -
Flags: review?(mark.finkle)
Comment 13•13 years ago
|
||
Comment on attachment 579938 [details] [diff] [review]
patch
I am running with this patch for a bit and will review soon.
Comment 14•13 years ago
|
||
Comment on attachment 579938 [details] [diff] [review]
patch
This seems to work OK for a first pass. I think we can look into a few things as followups:
* I can see the popup list flicker as I type. I mean it will briefly appear then disappear because there is no match based on what is in the editbox
* Bluring might not be the best solution. We should ask around to see if anyone (alexp or lucasr) have ideas for other ways to fix setting the value.
Sorry for taking too long on this
Attachment #579938 -
Flags: review?(mark.finkle) → review+
Comment 15•13 years ago
|
||
Attachment #579938 -
Attachment is obsolete: true
Comment 16•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
Flags: in-litmus?(martijn.martijn)
Updated•13 years ago
|
Updated•13 years ago
|
Updated•13 years ago
|
tracking-fennec: --- → 11+
Updated•13 years ago
|
status-firefox11:
--- → fixed
Comment 17•13 years ago
|
||
Verified as the form autocomplete feature is working now.
Status: RESOLVED → VERIFIED
Updated•10 years ago
|
Flags: in-litmus?(martijn.martijn)
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•