Closed Bug 43728 Opened 26 years ago Closed 26 years ago

Needs to be a way to scroll autoscrollable menus via keyboard

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P3)

defect

Tracking

()

VERIFIED FIXED
Future

People

(Reporter: bugzilla, Assigned: deanis74)

References

Details

(Keywords: access, helpwanted, Whiteboard: [nsbeta3-][rtm-])

Attachments

(5 files)

Build ID: 2000062408 As of now, using the arrow keys in a scrollable menu doesn't allow you to access the part of the menu that isn't visible on the screen. You can only get to the rest of the items by clicking on the down arrow. This is bad for accessibility; there needs to be some way to access the rest of the menu via keyboard. Should I throw this in XPMenus?
eric, this is the one where you were referring to doing 'EnsureVisible' to keep the active rows in the view.
Assignee: don → evaughan
QA Contact: sairuh → jrgm
targeting
Status: NEW → ASSIGNED
Target Milestone: --- → M21
*** Bug 46985 has been marked as a duplicate of this bug. ***
accessibility, needed for beta3
Keywords: nsbeta3
adding myself to CC list
[nsbeta3-], helpwanted.
Keywords: helpwanted
Whiteboard: [nsbeta3-]
Target Milestone: M21 → Future
Eh oh! This can't be [nsbeta3-], because it blocks the crasher bug 45728, which is [nsbeta3+].
Blocks: uaag
So, um, who added me to the CC: list? Was this someone's (Matt's?) way of suggesting that I may want to look at this? Anyway, I don't think that this is a blocker of bug 45278. In fact, I see very little that is similar between them.
Yes Dean, it was me, since this is helpwanted and you're Mister Menu Person, I thought you might be interested. (Sorry, I should have explained -- but people CC me on bugs without explanation all the time, so I didn't think of it.)
No problem. It looks like the next few days are going to be rainy, so I may have time one of these evenings.
Eric, sounds like you have a plan for this one. Can you share a bit of it, and then I'll look at getting it working?
Eric is away until mid-August sometime, so I'm not sure he will be responding before then :-]
Dean, would you mind holding on to this bug until Eric returns, if nothing more than just to look at it?
Not a problem. Didn't realize that Eric was away. With the luck I've been having lately trying to get this mutha to build, it will take me until then to get something that compiles.
thanks. reassigning to you for now.
Assignee: evaughan → dean_tessman
Status: ASSIGNED → NEW
Accepting, for now. I'll poke around a little bit in the next few days, but I'm also interested in what Eric has in mind.
Status: NEW → ASSIGNED
Just took a quick look before I head off for a day or two. It's got to be more than just calling nsScrollBoxFrame::PostScrollPortEvent doesn't it? Jan, was this what you were looking for over in bug 46985? I don't have time to try it, but it just might be...
Ok, but how I can call nsScrollBoxFrame::PostScrollPortEvent ?
Ummmm.... didn't get that far. I'll look at this a little more, but I'm tempted just to wait until Eric gets back, as I have other bugs that can keep me busy until then.
Keywords: access
Adding hyatt for any insight he may have.
notes to self-- - starting point: nsIScrollableFrame, nsMenuFrame.cpp, nsPopupSetFrame.cpp - ignore previous note about nsScrollBoxFrame::PostScrollPortEvent - ScrollTo example: http://lxr.mozilla.org/seamonkey/source/layout/xul/base/src/nsMenuFrame.cpp#528 Jan: You might want to see if that ScrollTo example is what you were looking for... Disclaimer: These are notes to myself before beddy-time. I may be completely off-track. Of course, if someone notices that I am, please tell me before I make too much of a fool of myself.
Attached patch proposed patch — — Splinter Review
I did some work and attached my patch. Thanks for pointers Dean!
Keywords: patch
Yippee. I love it when a plan comes together.
adding review kw so that this gets on the approval/checkin radar...
Marking rtm to get PDT attention - how come this bug with a patch and the "review" keyword has been lying idle for a month? Gerv
Keywords: rtm
Simple - PR3. Hopefully now that it's passed, someone will have a few spare cycles to check this out.
To be honest, chances are dim for the rtm branch (given what kind of bug is being cut as we speak). The only possibility (if any) would be to get r= and a=, get this on the trunk, and proven mac/linux/win32. And, of course, there will be life for the mozilla trunk long after the rtm branch is forgotten, so we still want this fix on the trunk.
Mike, could you please review this patch so we can get it in the trunk?
looks good to me. my only nit is to change the COMPtr inits from nsCOMPtr<nsIBox> itemBox=do_QueryInterface(aMenuItem); to nsCOMPtr<nsIBox> itemBox ( do_QueryInterface(aMenuItem) ); scc says bad compilers might make a temporary if you use the = form of initialization. other than that, r=pinkerton.
hmm...so I just tried applying this and it didn't seem to make any difference (the arrow keys didn't let me scroll my long, scrollable IE Favorites bookmarks menu) Any ideas?
Same here. Looks like assigning scrollFrame isn't working at: nsCOMPtr<nsIScrollableFrame> scrollFrame = do_QueryInterface(child); if (scrollFrame) { Not sure why.
it works only with classic skin, I'm going to find out why
...I tried it with the Classic skin originally..that's what it didn't work in.
ok, it only works with <menulist> in classic skin (like fonts in preferences) it doensn't work in other places because it depends on bad assumption that first child is scrollable frame. This is certainly not always true cause different XBL content. I think it would be better to check it in XBL, but I cannot get keypress events in popups. I think, keypress events are still prevented from bubble somewhere
Attached patch new patch — — Splinter Review
I attached new patch, which should work with all skins. I need review for this one again. Thanks
After I apply the patch, my compile fails. Before it worked fine. Blake, did it work for you? Maybe there's something funky with my setup. Anyway, here's the errors that were spit out: ..\..\..\..\dist\include\nsCOMPtr.h(174) : error C2876: 'nsIFrame::AddRef' : not all overloads are accessible ..\..\..\base\public\nsIFrame.h(455) : see declaration of 'nsIFrame' F:\mozsrc\mozilla\layout\xul\base\src\nsMenuPopupFrame.cpp(889) : see re ference to class template instantiation 'nsDerivedSafe<class nsIFrame>' being co mpiled ..\..\..\..\dist\include\nsCOMPtr.h(175) : error C2876: 'nsIFrame::Release' : no t all overloads are accessible ..\..\..\base\public\nsIFrame.h(455) : see declaration of 'nsIFrame' F:\mozsrc\mozilla\layout\xul\base\src\nsMenuPopupFrame.cpp(889) : see re ference to class template instantiation 'nsDerivedSafe<class nsIFrame>' being co mpiled ..\..\..\..\dist\include\nsCOMPtr.h(174) : error C2876: 'nsIView::AddRef' : not all overloads are accessible ..\..\..\..\dist\include\nsIView.h(78) : see declaration of 'nsIView' F:\mozsrc\mozilla\layout\xul\base\src\nsMenuPopupFrame.cpp(974) : see re ference to class template instantiation 'nsDerivedSafe<class nsIView>' being com piled ..\..\..\..\dist\include\nsCOMPtr.h(175) : error C2876: 'nsIView::Release' : not all overloads are accessible ..\..\..\..\dist\include\nsIView.h(78) : see declaration of 'nsIView' F:\mozsrc\mozilla\layout\xul\base\src\nsMenuPopupFrame.cpp(974) : see re ference to class template instantiation 'nsDerivedSafe<class nsIView>' being com piled NMAKE : fatal error U1077: 'cl' : return code '0x2' Stop. NMAKE : fatal error U1077: 'E:\PROGRA~1\MICROS~2\VC98\BIN\NMAKE.EXE' : return co de '0x2' Stop.
Attached patch new one — — Splinter Review
OK, the latest patch works absolutely perfectly for me for scrolling <menulist>'s and menus in Classic, Blue and Modern. Thanks a lot, Jan! Asking Mike to do the official review...
Patch looks good, although my stinkin' build crashes now. Just a couple of thoughts... 1. Should all of the code in SetCurrentMenuItem be split out into something along the line of the EnsureVisible() that was alluded to earlier? This may prove useful later on. 2. I thought we always used do_QueryInterface and not QueryInterface. Lines in question: view->QueryInterface(kScrollableViewIID, (void**)&scrollableView); aMenuItem->QueryInterface(kFrameIID, (void**)&frame); scrollableView->QueryInterface(kViewIID, (void**)&view);
>Patch looks good, although my stinkin' build crashes now. probably some NS_ADDREF is missing somewhere >1. Should all of the code in SetCurrentMenuItem be split out into something >along the line of the EnsureVisible() that was alluded to earlier? This may >prove useful later on. good idea >2. I thought we always used do_QueryInterface and not QueryInterface. I'm not expert, but I think do_QueryInterface is used only with nsCOMPtrs ?
Rebuilt from scratch and everything works swimmingly. I'm no expert on the xp interface design, either. Nice work, Jan. Do you want to do one more with the EnsureVisible(), or just leave it at this for now?
Works great for me. Stealing Blake's words and asking Mike to do an official review. Fairly simple and local fix - shouldn't affect anything outside of what it's supposed to touch.
rtm-, great for on the trunk though.
Whiteboard: [nsbeta3-] → [nsbeta3-][rtm-]
*** Bug 57611 has been marked as a duplicate of this bug. ***
*** Bug 59927 has been marked as a duplicate of this bug. ***
So this patch seems to work fine for me on win2k for a current trunk build. Mike, could you have a look at this patch and approve it, if it looks good.
working fine for me on a current linux trunk too. Would be nice if pgup/pgdn scrolled by a large chunk, but even as is it helps a lot....
instead of introducing the new static IID's, which are icky, use the following pattern: view->QueryInterface(nsIScrollableView::GetIID(), (void**)&scrollableView); If you make those changes to the QI's, r=pinkerton.
I'm curious why the GetScrollableView() needs to check siblings and children.
Because first child is not always scrollable view. It depends on content defined in XBL. Maybe there is efficient way ?
Attached patch newest patch — — Splinter Review
still looks good to me. r=pinkerton
Can you check it in for me with someones super review ?
a=hyatt
Fix checked in. Thanks to Jan for making the patch! Matthew, what do you think about the idea of pgup/pgdn working for scrolling autoscrollable menus in large amounts? Awkward for a menu? I agree that there needs to be some way to scroll these menus faster, or it can take too long to find items in the menu (e.g. a bookmark)
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
> Matthew, what do you think about the idea of pgup/pgdn working for scrolling > autoscrollable menus in large amounts? Awkward for a menu? No, that makes perfect sense to me. I'd expect them to scroll the menu by one menuful (== one screenful on Mac OS, or the distance between the menu and the farthest top/bottom of the screen on Windows), so that the selected item changed but the position of the selected item did not change (unless you were less than one menuful away from the top or bottom of the menu, in which case PgUp/PgDn would select the top/bottom item in the menu). Home and End should work too. Ideally, of course, we shouldn't have any menus long enough that that is necessary, but in some cases (like the font menus) we're at the mercy of the OS (e.g. font menus) or the page author (e.g. `Select your country:').
So we're talking about stepping away from standard UI conventions again...?
How so? How to handle overly long menus (if they must exist) doesn't even seem to have much of a convention.
Verified Win32 build 2000111508. Anyone else for the other platforms? (Blake, I guess you're right. It's not moving away from them, it's adding to them.)
Adding "verifyme" keyword, in hopes that someone will verify this on Mac and *nix.
Keywords: verifyme
Ooh. I love it when I suck this much. Anyways, this works fine for either menulists or for top-level menus in both Modern and Classic skins for linux 20001229. (verified). On Mac, though: 1) scrolling the system menu with the keyboard is something that is "just not done" on MacOS. Mozilla, with this code, performs just like other apps on Mac (including Nav4x and IE5) -- a keystroke of up or down arrow while the menu is up will immediately dismiss that menu. 2) For a menulist (e.g. Edit->Preferences->Fonts (or Languages)), in the Modern skin, this works fine -- when you get the menulist popup, you can navigate with up and down arrows (20001229 MacOS9.0). 3) With the Classic skin, using e.g. the font style menulist in Composer, I can also navigate that popup with the arrow keys. 4) But (you knew there was a but coming, didn't you) ... if I try to do this with Edit->Preferences->Fonts menulist, the left-hand tree remains the focussed element, so the up arrow causes the panel to switch. However, the popup from the previous panel remains popped-up over the new panel, and a click to dismiss that popup results in a crash. (Ooops -- filed bug 64022) All in all, though, that last bug is really something different, so marking this verified since it works correctly on Linux, and works "appropriately" on Mac (i.e., where it should work, it does work, modulo a bug). Thanks to Jan and Dean for this code (and for all those great surfer songs too)
Status: RESOLVED → VERIFIED
Keywords: verifyme
Component: Keyboard: Navigation → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: