Closed Bug 316624 Opened 15 years ago Closed 15 years ago

a11y: range needs to support more keyboard shortcuts

Categories

(Core Graveyard :: XForms, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aaronr, Assigned: allan)

Details

(Keywords: fixed1.8.0.2, fixed1.8.1)

Attachments

(2 files, 1 obsolete file)

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.
Attached file testcase
(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.
Hardware: PC → All
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.
Attached patch Patch (obsolete) — Splinter Review
Assignee: aaronr → allan
Status: NEW → ASSIGNED
Attachment #203394 - Flags: review?(aaronr)
(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 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
Attachment #203394 - Flags: review?(aaronr) → review+
(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?
(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?

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.
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.
(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?
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.
Attachment #203394 - Attachment is obsolete: true
Attachment #204118 - Flags: review?(smaug)
Attachment #204118 - Flags: review?(smaug) → review+
Checked in on trunk
Whiteboard: xf-to-branch
(In reply to comment #14)
> Checked in on trunk

Why isn't it marked fixed, then?
(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.
checked into MOZILLA_1_8_BRANCH via bug 323691.  Leaving open for now until it gets into 1.8.0
Whiteboard: xf-to-branch
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Keywords: fixed1.8.0.2
Resolution: --- → FIXED
verfied fixed on MOZILLA_1_8_BRANCH
Keywords: fixed1.8.1
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.