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)
Core
DOM: UI Events & Focus Handling
Tracking
()
VERIFIED
FIXED
Future
People
(Reporter: bugzilla, Assigned: deanis74)
References
Details
(Keywords: access, helpwanted, Whiteboard: [nsbeta3-][rtm-])
Attachments
(5 files)
|
1.83 KB,
patch
|
Details | Diff | Splinter Review | |
|
4.20 KB,
patch
|
Details | Diff | Splinter Review | |
|
4.04 KB,
patch
|
Details | Diff | Splinter Review | |
|
4.29 KB,
patch
|
Details | Diff | Splinter Review | |
|
4.20 KB,
patch
|
Details | Diff | Splinter Review |
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?
Comment 1•26 years ago
|
||
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
Comment 5•26 years ago
|
||
adding myself to CC list
Comment 6•26 years ago
|
||
[nsbeta3-], helpwanted.
Comment 7•26 years ago
|
||
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.
Comment 9•26 years ago
|
||
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.)
| Assignee | ||
Comment 10•26 years ago
|
||
No problem. It looks like the next few days are going to be rainy, so I may
have time one of these evenings.
| Assignee | ||
Comment 11•26 years ago
|
||
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?
Comment 12•26 years ago
|
||
Eric is away until mid-August sometime, so I'm not sure he will be responding
before then :-]
| Reporter | ||
Comment 13•26 years ago
|
||
Dean, would you mind holding on to this bug until Eric returns, if nothing more
than just to look at it?
| Assignee | ||
Comment 14•26 years ago
|
||
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.
| Reporter | ||
Comment 15•26 years ago
|
||
thanks. reassigning to you for now.
Assignee: evaughan → dean_tessman
Status: ASSIGNED → NEW
| Assignee | ||
Comment 16•26 years ago
|
||
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
| Assignee | ||
Comment 17•26 years ago
|
||
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...
Comment 18•26 years ago
|
||
Ok, but how I can call nsScrollBoxFrame::PostScrollPortEvent ?
| Assignee | ||
Comment 19•26 years ago
|
||
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.
| Assignee | ||
Comment 20•26 years ago
|
||
Adding hyatt for any insight he may have.
| Assignee | ||
Comment 21•26 years ago
|
||
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.
Comment 22•26 years ago
|
||
Comment 23•26 years ago
|
||
I did some work and attached my patch.
Thanks for pointers Dean!
Keywords: patch
| Assignee | ||
Comment 24•26 years ago
|
||
Yippee. I love it when a plan comes together.
Comment 25•26 years ago
|
||
adding review kw so that this gets on the approval/checkin radar...
Comment 26•26 years ago
|
||
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
| Assignee | ||
Comment 27•26 years ago
|
||
Simple - PR3. Hopefully now that it's passed, someone will have a few spare
cycles to check this out.
Comment 28•26 years ago
|
||
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.
| Reporter | ||
Comment 29•26 years ago
|
||
Mike, could you please review this patch so we can get it in the trunk?
Comment 30•26 years ago
|
||
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.
| Reporter | ||
Comment 31•26 years ago
|
||
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?
| Assignee | ||
Comment 32•26 years ago
|
||
Same here. Looks like assigning scrollFrame isn't working at:
nsCOMPtr<nsIScrollableFrame> scrollFrame = do_QueryInterface(child);
if (scrollFrame) {
Not sure why.
Comment 33•26 years ago
|
||
it works only with classic skin, I'm going to find out why
| Reporter | ||
Comment 34•26 years ago
|
||
...I tried it with the Classic skin originally..that's what it didn't work in.
Comment 35•26 years ago
|
||
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
Comment 36•26 years ago
|
||
Comment 37•26 years ago
|
||
I attached new patch, which should work with all skins.
I need review for this one again.
Thanks
| Assignee | ||
Comment 38•26 years ago
|
||
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.
Comment 39•26 years ago
|
||
| Reporter | ||
Comment 40•26 years ago
|
||
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...
| Assignee | ||
Comment 41•26 years ago
|
||
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);
Comment 42•26 years ago
|
||
>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 ?
| Assignee | ||
Comment 43•26 years ago
|
||
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?
Comment 44•26 years ago
|
||
| Assignee | ||
Comment 45•26 years ago
|
||
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.
Comment 46•26 years ago
|
||
rtm-, great for on the trunk though.
Whiteboard: [nsbeta3-] → [nsbeta3-][rtm-]
Comment 47•26 years ago
|
||
*** Bug 57611 has been marked as a duplicate of this bug. ***
Comment 48•26 years ago
|
||
*** Bug 59927 has been marked as a duplicate of this bug. ***
Comment 49•26 years ago
|
||
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.
Comment 50•26 years ago
|
||
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....
Comment 51•26 years ago
|
||
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.
Comment 52•26 years ago
|
||
I'm curious why the GetScrollableView() needs to check siblings and children.
Comment 53•26 years ago
|
||
Because first child is not always scrollable view.
It depends on content defined in XBL.
Maybe there is efficient way ?
Comment 54•26 years ago
|
||
Comment 55•26 years ago
|
||
still looks good to me. r=pinkerton
Comment 56•26 years ago
|
||
Can you check it in for me with someones super review ?
Comment 57•26 years ago
|
||
a=hyatt
| Reporter | ||
Comment 58•26 years ago
|
||
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
Comment 59•26 years ago
|
||
> 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:').
| Assignee | ||
Comment 60•26 years ago
|
||
So we're talking about stepping away from standard UI conventions again...?
| Reporter | ||
Comment 61•26 years ago
|
||
How so? How to handle overly long menus (if they must exist) doesn't even seem
to have much of a convention.
| Assignee | ||
Comment 62•26 years ago
|
||
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.)
| Assignee | ||
Comment 63•25 years ago
|
||
Adding "verifyme" keyword, in hopes that someone will verify this on Mac and
*nix.
Keywords: verifyme
Comment 64•25 years ago
|
||
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
Updated•7 years ago
|
Component: Keyboard: Navigation → User events and focus handling
You need to log in
before you can comment on or make changes to this bug.
Description
•