Bug 72359 - Access key should work on focusable element.
Summary: Access key should work on focusable element.
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 71854
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-15 00:30 PST by Vineet Chaudhary (vineetc)
Modified: 2011-11-15 12:17 PST (History)
3 users (show)

See Also:


Attachments
Test Case (524 bytes, text/html)
2011-11-15 00:30 PST, Vineet Chaudhary (vineetc)
no flags Details
proposed patch (4.42 KB, patch)
2011-11-15 01:55 PST, Vineet Chaudhary (vineetc)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vineet Chaudhary (vineetc) 2011-11-15 00:30:56 PST
Created attachment 115113 [details]
Test Case

As per the specification http://dev.w3.org/html5/spec/Overview.html#the-accesskey-attribute all the elements can have the accesskey content attribute set.
In attached test case DIV element can support focus and should be focused with "accesssKey" attribute.

IE(7) : Is able to focus DIV.
Comment 1 Vineet Chaudhary (vineetc) 2011-11-15 01:55:10 PST
Created attachment 115127 [details]
proposed patch

Elements those can support focus should be focused on respective accessKey pressed.
Comment 2 Alexey Proskuryakov 2011-11-15 10:29:06 PST
Comment on attachment 115127 [details]
proposed patch

Implementing this in HTMLElement::accessKeyAction() means that elements are either focused, or get a simulated click (because HTMLAnchorElement and other subclasses override this method). This seems inconsistent.
Comment 3 Vineet Chaudhary (vineetc) 2011-11-15 12:17:33 PST
(In reply to comment #2)
> (From update of attachment 115127 [details])
> Implementing this in HTMLElement::accessKeyAction() means that elements are either focused, or get a simulated click (because HTMLAnchorElement and other subclasses override this method).

Thanks Alexey, for comments.

> This seems inconsistent.

I tried to make this generic behavior so that any element is focused, only if it supports focus. 
For other subclasses those overrides this method like
HTMLButtonElement/HTMLAnchorElement ==> Sends simulated click as these are click-able.
And For HTMLInputElement ==> Sets focus only as these are focusable.

Please correct me if I am getting this wrong.