Closed Bug 635827 Opened 13 years ago Closed 13 years ago

Fix supplemental keyboard navigation in autocomplete window and location bar

Categories

(Camino Graveyard :: Location Bar & Autocomplete, defect)

All
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Camino2.1

People

(Reporter: alqahira, Assigned: alqahira)

Details

(Keywords: polish, regression)

Attachments

(2 files)

When Dan added URL autocomplete in bug 166288 (after changing the appearance), he removed AutoCompleteTextField's selector mappings for Page Up and Page Down (since we no longer returned a scrollable window post-appearance change) but left selectors for Home/End: http://hg.mozilla.org/camino/diff/d81070ade302/src/browser/AutoCompleteTextField.mm#l1.473

Unless Chris's fix for bug 506733 will make Home/End do something when hovering, I think moveToBeginningOfDocument: and moveToEndOfDocument: are dead code and should be removed.  Or unless the password autocomplete uses them; I'm not sure what its suggestion window uses, code-wise.
My autocomplete highlight patch does not affect the Home/End keys. I double-checked to make sure. :)
It occurred to me later that instead maybe we really should make them (and the removed Page Up/Page Down) work properly again.  After more thought, given that we're faking an NSMenu, and NSMenus respond properly to all four, we ought to do so, too.

Also (and this dates from before the new window), Cmd-Up and Cmd-Down both move the cursor, as expected, but they also select the first (2.0)/second (2.1) and last autocomplete item.  These ought to be fixed to only act on the text field, like they do in other single-line text fields.

So, I'm going to morph this bug into fixing things, some of which are regressions from 2.0:

In summary:

1) Restore Page Up/Page Down and make them actually select the first/last item
2) Make Home/End actually select the first/last item
3) Make Cmd-Up/Cmd-Down *not* select items, but only move the cursor in the text field.

Also, 1 & 2 should work whenever there are results available, regardless of whether you've manually arrowed/tabbed into the autocomplete window or not.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: camino2.1?
Keywords: polish, regression
Summary: Selectors for Home and End in AutoCompleteTextField are non-functional/dead code → Fix supplemental keyboard navigation in autocomplete window and location bar
I had a couple minutes this afternoon between yard tasks, so I fixed this bug.

This first patch is style cleanup in the method, since it was a rat's nest :P
Assignee: nobody → alqahira
Status: NEW → ASSIGNED
Attachment #515389 - Flags: superreview?(stuart.morgan+bugzilla)
This implements the fixes described in comment 2.

I realized last night as I was brushing my teeth that Home/End didn't work because the selectors I though were for them were the "move" selectors, which instead were producing the bogus Cmd-L/R Arrow behavior, and instead we needed "scroll" selectors.  It also fixes the left-over off-by-1 bug in the "beginningOfDocument" selector caused by the heading-less table.

(Also, the Keychain autocomplete window is run via FormFillPopup, so this has no effect, deleterious or other, on it.)
Attachment #515390 - Flags: superreview?(stuart.morgan+bugzilla)
Comment on attachment 515389 [details] [diff] [review]
Part 1: Fix style in the method

sr=smorgan
Attachment #515389 - Flags: superreview?(stuart.morgan+bugzilla) → superreview+
Comment on attachment 515390 [details] [diff] [review]
Part 2: Implement comment 2

sr=smorgan
Attachment #515390 - Flags: superreview?(stuart.morgan+bugzilla) → superreview+
http://hg.mozilla.org/camino/rev/94773235ffe2
http://hg.mozilla.org/camino/rev/708f65a59c79
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: camino2.1? → camino2.1+
Resolution: --- → FIXED
Target Milestone: --- → Camino2.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: