Last Comment Bug 316624 - a11y: range needs to support more keyboard shortcuts
: a11y: range needs to support more keyboard shortcuts
Status: RESOLVED FIXED
: fixed1.8.0.2, fixed1.8.1
Product: Core
Classification: Components
Component: XForms (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Allan Beaufour
: Stephen Pride
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-15 16:37 PST by aaronr
Modified: 2006-07-07 09:59 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (1.32 KB, application/xhtml+xml)
2005-11-15 16:38 PST, aaronr
no flags Details
Patch (1.52 KB, patch)
2005-11-17 08:03 PST, Allan Beaufour
aaronr: review+
Details | Diff | Review
Switch pageup/down (1.36 KB, patch)
2005-11-24 06:29 PST, Allan Beaufour
bugs: review+
Details | Diff | Review

Description aaronr 2005-11-15 16:37:16 PST
as per http://www.mozilla.org/access/toolkit-checklist

"Keyboard support for moving slider: arrow keys, home, end, PgUp, PgDn".  Right now xf:range supports the left and right arrow keys.  So we need to support home, end, PgUp and PgDn

AaronL: Home and end seem pretty self-explaining.  But what about page up and page down?  I assume that those increment and decrement the slider like the left and right arrow keys, right?  That is what they do in XSmiles at least.
Comment 1 aaronr 2005-11-15 16:38:08 PST
Created attachment 203199 [details]
testcase
Comment 2 Allan Beaufour 2005-11-15 22:39:54 PST
(In reply to comment #0)
> AaronL: Home and end seem pretty self-explaining.  But what about page up and
> page down?  I assume that those increment and decrement the slider like the
> left and right arrow keys, right?  That is what they do in XSmiles at least.

I do not know the official guidelines (if there are any), but they should decrement/increment more than up and down in my world.
Comment 3 aaronr 2005-11-16 09:26:54 PST
Windows (i.e. the volume control and on the mouse speed panel) has PgUp and PgDn jump the thumb by double what left and right arrow keys do.
Comment 4 Allan Beaufour 2005-11-17 08:03:36 PST
Created attachment 203394 [details] [diff] [review]
Patch
Comment 5 Allan Beaufour 2005-11-17 08:06:04 PST
(In reply to comment #4)
> Created an attachment (id=203394) [edit]

Hmm, I do not do exactly what attachment id=203199 says, I move two steps on pageup/down, as comment 3 says and also what KDE does.
Comment 6 aaronr 2005-11-17 13:32:38 PST
Comment on attachment 203394 [details] [diff] [review]
Patch

>? .svn
>? range.patch
>? semantic.cache
>? content/.svn
>? package/.svn
>? resources/.svn
>? resources/content/.svn
>? resources/locale/.svn
>? resources/locale/en-US/.svn
>Index: resources/content/range.xml
>===================================================================
>RCS file: /cvsroot/mozilla/extensions/xforms/resources/content/range.xml,v
>retrieving revision 1.1
>diff -u -p -U8 -r1.1 range.xml
>--- resources/content/range.xml	14 Nov 2005 08:42:36 -0000	1.1
>+++ resources/content/range.xml	17 Nov 2005 16:02:34 -0000
>@@ -341,18 +341,26 @@
>           if (this.rStep) {
>             move = this.rStep;
>           } else {
>             move = (this.rEnd - this.rBegin) / 20;
>           }
> 
>           if (event.keyCode == event.DOM_VK_LEFT) {
>             this.setSlider(this.rVal - move);
>-          } else if (event.keyCode == event.DOM_VK_RIGHT) {        
>+          } else if (event.keyCode == event.DOM_VK_RIGHT) {
>             this.setSlider(this.rVal + move);
>+          } else if (event.keyCode == event.DOM_VK_PAGE_UP) {
>+            this.setSlider(this.rVal - move * 2);
>+          } else if (event.keyCode == event.DOM_VK_PAGE_DOWN) {
>+            this.setSlider(this.rVal + move * 2);
>+          } else if (event.keyCode == event.DOM_VK_HOME) {
>+            this.setSlider(this.rBegin);
>+          } else if (event.keyCode == event.DOM_VK_END) {
>+            this.setSlider(this.rEnd);
>  

You have PgUp and PgDn backwards.  PgDn should decrease the value and PgUp should increase the value, correct?.  With that fixed, r=me
Comment 7 Allan Beaufour 2005-11-17 22:09:44 PST
(In reply to comment #6)
> (From update of attachment 203394 [details] [diff] [review] [edit])
> You have PgUp and PgDn backwards.  PgDn should decrease the value and PgUp
> should increase the value, correct?.  With that fixed, r=me

I was really thinking about that. My intuitive use of the keys was how the patch is, while my logic was telling me the reverse (as you are). I tried a horisontal slider in KDE, and it behaved like the patch. Could you try a horisontal slider in Windows/MacOSX and see how it behaves?
Comment 8 aaronr 2005-11-18 11:27:20 PST
(In reply to comment #7)
> (In reply to comment #6)
> > (From update of attachment 203394 [details] [diff] [review] [edit] [edit])
> > You have PgUp and PgDn backwards.  PgDn should decrease the value and PgUp
> > should increase the value, correct?.  With that fixed, r=me
> 
> I was really thinking about that. My intuitive use of the keys was how the
> patch is, while my logic was telling me the reverse (as you are). I tried a
> horisontal slider in KDE, and it behaved like the patch. Could you try a
> horisontal slider in Windows/MacOSX and see how it behaves?
> 

The ones that I tried on Windows had PgUp as an increaser and PgDn as a decreaser.  XSmiles and the Novell Java processor both do it this way, too.  Javier, could you try on Mac, please?

Comment 9 jhp (no longer active) 2005-11-18 11:57:11 PST
On Mac OS X, testing on native sliders, PgUp goes to the max, PgDn goes to the min.  Home and End don't do anything.
Comment 10 Aaron Leventhal 2005-11-18 12:54:20 PST
From the "Accessible Toolkit Checklist"
http://www.mozilla.org/access/toolkit-checklist

Sliders
   1. Keyboard support for moving slider: arrow keys, home, end, PgUp, PgDn
   2. MSAA support including ROLE_SLIDER, accessible value, value change events

I recommend consulting the checklist whenever touching the keyboard UI for a widget, it will make life easier.
Comment 11 aaronr 2005-11-18 13:05:55 PST
(In reply to comment #10)
> From the "Accessible Toolkit Checklist"
> http://www.mozilla.org/access/toolkit-checklist
> 
> Sliders
>    1. Keyboard support for moving slider: arrow keys, home, end, PgUp, PgDn
>    2. MSAA support including ROLE_SLIDER, accessible value, value change events
> 
> I recommend consulting the checklist whenever touching the keyboard UI for a
> widget, it will make life easier.
> 


Right, that checklist gave rise to this bug.  But the checklist doesn't say what home, end, PgUp and PgDn are supposed to do.  It just says to 'support' them, which doesn't really help us.  We can't really afford to do platform specific checking so what we end up doing will be the same on all platforms.  So we are looking for the 'right' answer for all platforms.  What does Mozilla do when it is defining a custom control that is very similar to a native control?  Which platform's behavior wins?
Comment 12 Aaron Leventhal 2005-11-18 14:18:42 PST
Ok, home and end go to the beginning and end.

Page up and page down are usually defined by the widget itself, in terms of moving by a larger chunk. That's probably not in the semantics for range. I'd say make that move by 5 times the normal amount. The generaly idea is those keys help you move faster, and I wouldn't fuss over it more than that.
Comment 13 Allan Beaufour 2005-11-24 06:29:39 PST
Created attachment 204118 [details] [diff] [review]
Switch pageup/down
Comment 14 Allan Beaufour 2006-01-11 00:51:45 PST
Checked in on trunk
Comment 15 Aaron Leventhal 2006-01-25 19:30:13 PST
(In reply to comment #14)
> Checked in on trunk

Why isn't it marked fixed, then?
Comment 16 aaronr 2006-01-26 09:13:18 PST
(In reply to comment #15)
> (In reply to comment #14)
> > Checked in on trunk
> 
> Why isn't it marked fixed, then?
> 

We don't mark bugs fixed until they are in the branch.  We mark bugs fixed in trunk as xf-to-branch in the status whiteboard.
Comment 17 aaronr 2006-02-02 17:31:06 PST
checked into MOZILLA_1_8_BRANCH via bug 323691.  Leaving open for now until it gets into 1.8.0
Comment 18 aaronr 2006-07-07 09:59:12 PDT
verfied fixed on MOZILLA_1_8_BRANCH

Note You need to log in before you can comment on or make changes to this bug.