UNCONFIRMED 70911
Access keys on non visible DOM elements can still be accessed
https://bugs.webkit.org/show_bug.cgi?id=70911
Summary Access keys on non visible DOM elements can still be accessed
Iain Farrell
Reported 2011-10-26 05:50:21 PDT
Created attachment 112491 [details] Showing unexpected access key behaviour SVN revision: 97675 1. a webpage contains multiple elements with the same access key 2. all but one of these elements will be hidden 3. press the access key 4. the last on the page will always be selected, whether it is hidden or not. It would be expected that the visible access key should be selected. A simple test page is attached to show this.
Attachments
Showing unexpected access key behaviour (291 bytes, text/html)
2011-10-26 05:50 PDT, Iain Farrell
no flags
proposed patch (5.02 KB, patch)
2011-11-24 03:01 PST, Vineet Chaudhary (vineetc)
ap: review-
ap: commit-queue-
Alexey Proskuryakov
Comment 1 2011-10-26 12:20:32 PDT
> It would be expected that the visible access key should be selected. Is this how it works in both IE and Firefox?
Iain Farrell
Comment 2 2011-10-26 12:47:08 PDT
(In reply to comment #1) > > It would be expected that the visible access key should be selected. > > Is this how it works in both IE and Firefox? Yes, it is - using the test page I attached, the pop up has the "visible div" text. In Safari and Chrome, it is "hidden div"
Vineet Chaudhary (vineetc)
Comment 3 2011-11-24 03:01:04 PST
Created attachment 116492 [details] proposed patch
Vineet Chaudhary (vineetc)
Comment 4 2011-11-24 03:02:58 PST
Comment on attachment 116492 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=116492&action=review > Source/WebCore/dom/Document.cpp:652 > + if (!accessKey.isEmpty() && ((element->renderStyle() && element->renderStyle()->display() != NONE) || element->hasTagName(areaTag) || element->hasTagName(mapTag))) Added specific checks for area and map tag as both doesn't have renderer.
Vineet Chaudhary (vineetc)
Comment 5 2011-11-24 03:27:19 PST
Actually https://bugs.webkit.org/attachment.cgi?id=112491 this test case is only style display : none, but we should check visibility : hidden too as those are also not visible to user. Please let me know your thoughts on this. I will upload the for the same.
Alexey Proskuryakov
Comment 6 2011-11-24 12:15:15 PST
Comment on attachment 116492 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=116492&action=review r- since this implements logic that's substantially different from Firefox. I did not test IE and did not check the spec - please feel free to re-nominate and explain why this is what we want. > Source/WebCore/ChangeLog:8 > + Access key should only work with visible(visually) elements. This is incorrect. Access keys work just fine with display:none elements in Firefox. The difference with WebKit is that Gecko does not immediately click an element with accesskey when there are multiple ones with the same assigned key. Firefox only focuses such elements, and it cycles over others as you repeatedly press the same access key combination.
Alexey Proskuryakov
Comment 7 2011-11-24 12:19:37 PST
Firefox behavior of course becomes weird when some of the elements are invisible - it cannot focus invisible ones, yet it behaves as if it could cycle over them.
Note You need to log in before you can comment on or make changes to this bug.