Bug 363714 - Need to be able to traverse out of editor with keyboard
Summary: Need to be able to traverse out of editor with keyboard
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Editor (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 0.5 M2   Edit
Assignee: Max Li CLA
QA Contact:
URL:
Whiteboard:
Keywords: accessibility
: 368850 (view as bug list)
Depends on:
Blocks: 365361
  Show dependency tree
 
Reported: 2011-11-14 10:56 EST by Carolyn MacLeod CLA
Modified: 2012-04-24 12:05 EDT (History)
3 users (show)

See Also:
maxli: review? (Silenio_Quarti)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carolyn MacLeod CLA 2011-11-14 10:56:23 EST
In order to be accessible for keyboard-only users, the user needs to be able to traverse out of the editor. Almost all other web controls can be traversed using Tab and Shift+Tab. However the editor consumes Tab keys for the purpose of:
- entering Tab characters into the text (or equivalent spaces)
- indenting, if the selection includes a line break when Tab is typed
- outdenting, if Shift+Tab is typed

We need to determine what the "correct" keystrokes should be, and then we need to implement them.

See "Bug 362347 - Shift+Tab in editor changing focus instead of unindent"
for more background info.
Comment 1 Carolyn MacLeod CLA 2011-11-14 16:33:47 EST
Say, this sounds interesting. From the ARIA Authoring Practices doc:

Optionally, if the developer wishes to provide the ability to insert a tab into the document, it is recommended one of the following methods be used.

- Provide indent and outdent buttons in the menu. Keyboard shortcuts to the buttons should be Ctrl+M for indent and Ctrl+Shift+M for outdent.
- Provide a button in the menu to toggle the use of Tab between the two modes. If this button is used, then Ctrl+M is recommended as a keyboard shortcut to toggle the button. 

http://www.w3.org/TR/wai-aria-practices/#richtext
Comment 2 Felipe Heidrich CLA 2012-01-17 14:22:21 EST
*** Bug 368850 has been marked as a duplicate of this bug. ***
Comment 3 David Bolter CLA 2012-01-24 16:35:01 EST
We use [F6] in Firefox and Chatzilla for this kind of thing.
Comment 4 Max Li CLA 2012-03-06 12:30:18 EST
I've implemented the method to allow Ctrl+M switch between the usage of tabs.

I've put this in the following commit in the bug363714 branch.

https://github.com/max-li/orion.client/commit/84b7f10ae03894993430e1813ada0bccdf886645
Comment 5 Max Li CLA 2012-04-19 16:35:35 EDT
I've modified the above patch to fix an inconsistency. 

Silenio, could you please review?

The commit is in the bug363714newer branch.
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?h=bug363714newer
Comment 6 Silenio Quarti CLA 2012-04-20 10:36:44 EDT
Max, we need some changes to make it consistent with the current API:

1) Remove isConsumingTabs() and make tabMode an option that can be set/get with getOptions()/setOptions().
2) rename changeTabMode to toggleTabMode
3) Why do you need this change?

return typeof(a.defaultHandler()) === "boolean";

It seems wrong. Shouldn't it be:

return a.defaultHandler();
Comment 7 Silenio Quarti CLA 2012-04-20 10:45:52 EDT
One more:

For consistency, maybe textView.js should add the shiftTab action and consume the key depending on the tabMode.
Comment 8 Max Li CLA 2012-04-22 21:12:59 EDT
(In reply to comment #6)
> 3) Why do you need this change?
> 
> return typeof(a.defaultHandler()) === "boolean";
> 
> It seems wrong. Shouldn't it be:
> 
> return a.defaultHandler();

Correct me if I'm wrong, but I think it needs to be like that so that if the defaultHandler returns false, _doAction() still returns true as it did before (note that when _tabMode is false, _doTab (and equivalent) doesn't return a boolean)

I've made the other changes and put them into the bug363714new branch.
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?h=bug363714new&id=9bd5785f865bbfa02fb34fa6450b82b0d3c2627a
Comment 9 Silenio Quarti CLA 2012-04-24 10:42:14 EDT
(In reply to comment #8)
> Correct me if I'm wrong, but I think it needs to be like that so that if the
> defaultHandler returns false, _doAction() still returns true as it did before
> (note that when _tabMode is false, _doTab (and equivalent) doesn't return a
> boolean)

Ok.

> 
> I've made the other changes and put them into the bug363714new branch.
> http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?h=bug363714new&id=9bd5785f865bbfa02fb34fa6450b82b0d3c2627a


The shiftTab action cannot consume Shift+Tab all the time, it has to check tabMode. Other then that the patch is fine to be merged into master.