RESOLVED FIXED 12999
Invisible <A> element inside a <div> does not receive focus
https://bugs.webkit.org/show_bug.cgi?id=12999
Summary Invisible <A> element inside a <div> does not receive focus
Raul Hudea
Reported 2007-03-07 02:23:26 PST
Test case attached. Clicking on the left div does not dispatch the keydown event because the invisible <a> element does not receive focus. Adding a border to the <a> element (div in the right) will make it to receive focus, hence it will dispatch keydown event.
Attachments
Testcase for both visible and invisible <a> element (121.67 KB, application/zip)
2007-03-07 02:25 PST, Raul Hudea
no flags
Raul Hudea
Comment 1 2007-03-07 02:25:13 PST
Created attachment 13512 [details] Testcase for both visible and invisible <a> element
Alexey Proskuryakov
Comment 2 2007-06-22 05:51:34 PDT
WebKit behavior is different from Firefox, but seems more sensible to me - why focus an invisible element? Could you please describe why such technique is necessary?
Alexey Proskuryakov
Comment 3 2007-07-19 05:11:17 PDT
See also: bug 10614.
Daniel Bates
Comment 4 2010-10-24 15:21:42 PDT
As far as I can tell, the test case works as of Mac Safari version 5.0.2 (6533.18.5) and matches the behavior observed in Mac Firefox 3.6.8. Marking this as Resolved Fixed. If this is not the case, then please re-open this bug.
Daniel Bates
Comment 5 2010-10-24 15:42:48 PDT
(In reply to comment #2) > WebKit behavior is different from Firefox, but seems more sensible to me - why focus an invisible element? Notice, the test case defines the <a> to be "visible" if it has a red border and "invisible" if it does not have a red border. This terminology differs from the terminology used in the HTML5 spec, which talks about elements "being rendered" <http://www.w3.org/TR/html5/rendering.html#being-rendered> or not. By the definition of "being rendered", the <a> is "being rendered" (since it doesn't specify "display: none" or "visibility: collapse" or any other styling that would exclude its rendering). Note, the <a> in the "invisible" case does not have an visible styling. For completeness, section 7.4.2 of the HTML5 spec <http://www.w3.org/TR/html5/editing.html#focus-management>, defines a focusable element.
Daniel Bates
Comment 6 2010-10-24 15:46:28 PDT
(In reply to comment #5) > (In reply to comment #2) > > WebKit behavior is different from Firefox, but seems more sensible to me - why focus an invisible element? > > ... Note, the <a> in the "invisible" case does not have an visible styling. I meant to say: Note, the <a> in the "invisible" case does not have any visible traits or markings.
Note You need to log in before you can comment on or make changes to this bug.