Open Bug 421933 Opened 16 years ago Updated 2 years ago

Map Enter to click as per HTML 5 spec

Categories

(Core :: DOM: Core & HTML, defect, P5)

defect

Tracking

()

People

(Reporter: aaronlev, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: access)

Attachments

(3 files)

Now that tabindex="0" can be used on any element to make it focusable, it makes sense that it should be possible to trigger a click on those elements with the keyboard.

Matt May from UAAG suggested this as a best practice, and Opera already does it.
Attached file Testcase
Attachment #308445 - Flags: superreview?(neil)
Attachment #308445 - Flags: review?(mats.palmgren)
Attachment #308444 - Attachment is patch: false
Attachment #308444 - Attachment mime type: text/plain → text/html
Attached file Testcase #2
Comment on attachment 308445 [details] [diff] [review]
Map unmodifed enter to click when not already consumed

This patch does not work well with form controls (Testcase #2),
causing double click/submit events.

I think this needs to be fixed:
1. add "&& !keyEvent->isMeta"
2. check if the target element is disabled
   (and possibly -moz-user-input:none as well?)
3. to avoid the duplicate events we need to add in all places that
   already handles VK_RETURN:
     "aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault".
   I did this for nsHTMLInputElement::PostHandleEvent() and it seemed
   to fix the problems with Testcase #2, but there might be more places
   that needs to be fixed.
4. I'd like to see some regressions tests.
Attachment #308445 - Flags: review?(mats.palmgren) → review-
FWIW, I think this new feature makes sense, but I'd like to hear
what others think.  Only Opera implements it, not Safari or IE8
as far as I can tell.
If we can do it in a web-compatible way, this makes sense to me.

But if we do go with this, we should get it standardized.
I'll check with Hixie && WhatWG folks.
Hixie put it in -- paragraph 3 here:
http://www.w3.org/html/wg/html5/#interactive0

When activation is performed via some method other than clicking the pointing device, the default action of the event that triggers the activation must, instead of being activating the element directly, be to fire a click event on the same element. 
If someone else could take and finish this up that would be great.
Assignee: aaronleventhal → nobody
Component: Disability Access APIs → DOM: Core & HTML
Flags: wanted1.9.2?
QA Contact: accessibility-apis → general
Summary: Map Enter to click → Map Enter to click as per HTML 5 spec
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: