RESOLVED WONTFIX 94707
Cannot render focus on the anchor when its child has style "position: absolute"
https://bugs.webkit.org/show_bug.cgi?id=94707
Summary Cannot render focus on the anchor when its child has style "position: absolute"
wf
Reported 2012-08-22 07:02:55 PDT
In the test page below, the node "llinker0" cannot be focused. If delete "position: absolute;" ,the focus can be rendered. ============================================== <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>test</title> </head> <body> <br> <br> <a name="llinker0" href="#"><img src="nav_up.png" style="position: absolute;top:140px;width: 132px;height: 40px;border: 0"></a> </body> </html>
Attachments
the test page (542 bytes, text/html)
2012-08-22 07:04 PDT, wf
no flags
the test page (33.47 KB, image/png)
2012-08-22 07:05 PDT, wf
no flags
wf
Comment 1 2012-08-22 07:04:31 PDT
Created attachment 159925 [details] the test page
wf
Comment 2 2012-08-22 07:05:02 PDT
Created attachment 159926 [details] the test page
wf
Comment 3 2012-08-22 07:14:25 PDT
The node "llinker0" cannot display the focus when press Tab. (In reply to comment #0) > In the test page below, the node "llinker0" cannot be focused. > If delete "position: absolute;" ,the focus can be rendered. > ============================================== > > <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> > <title>test</title> > </head> > > <body> > <br> > <br> > <a name="llinker0" href="#"><img src="nav_up.png" style="position: absolute;top:140px;width: 132px;height: 40px;border: 0"></a> > </body> > </html>
Martin Leutelt
Comment 4 2012-09-10 08:28:02 PDT
I think this is intended behavior. Absolute positioning will remove your image element from the page flow, as a result the a element will have a 0-size and as a result of that the focus outline will not be shown. Firefox shows the same behavior.
wf
Comment 5 2012-09-10 18:09:45 PDT
(In reply to comment #4) > I think this is intended behavior. Absolute positioning will remove your image element from the page flow, as a result the a element will have a 0-size and as a result of that the focus outline will not be shown. Firefox shows the same behavior. Do you have any suggestion to fix this bug? I traced the code,but haven't found any solution. https://bugs.webkit.org/show_bug.cgi?id=90717 may have the same issue.
Bruno Abinader (history only)
Comment 6 2012-09-11 05:20:14 PDT
Please have a look at what w3schools says about absolute positioning: "Absolutely positioned elements are removed from the normal flow. The document and other elements behave like the absolutely positioned element does not exist." http://www.w3schools.com/Css/css_positioning.asp That said, the current behavior is correct (since elements with absolute positioning are removed from the normal flow). You can achieve the intended behavior by removing the "position: absolute" style and adding some JavaScript to fix the object on a specific spot of the screen, for example. If you all agree, shall we mark it as WONTFIX (same for bug 90717)? (In reply to comment #5) > (In reply to comment #4) > > I think this is intended behavior. Absolute positioning will remove your image element from the page flow, as a result the a element will have a 0-size and as a result of that the focus outline will not be shown. Firefox shows the same behavior. > > Do you have any suggestion to fix this bug? > I traced the code,but haven't found any solution. > > https://bugs.webkit.org/show_bug.cgi?id=90717 > may have the same issue.
wf
Comment 7 2012-09-11 18:46:38 PDT
OK,I agree to mark it as WONTFIX (same for bug 90717). Thanks. (In reply to comment #6) > Please have a look at what w3schools says about absolute positioning: > > "Absolutely positioned elements are removed from the normal flow. The document and other elements behave like the absolutely positioned element does not exist." > http://www.w3schools.com/Css/css_positioning.asp > > That said, the current behavior is correct (since elements with absolute positioning are removed from the normal flow). You can achieve the intended behavior by removing the "position: absolute" style and adding some JavaScript to fix the object on a specific spot of the screen, for example. > > If you all agree, shall we mark it as WONTFIX (same for bug 90717)? > > (In reply to comment #5) > > (In reply to comment #4) > > > I think this is intended behavior. Absolute positioning will remove your image element from the page flow, as a result the a element will have a 0-size and as a result of that the focus outline will not be shown. Firefox shows the same behavior. > > > > Do you have any suggestion to fix this bug? > > I traced the code,but haven't found any solution. > > > > https://bugs.webkit.org/show_bug.cgi?id=90717 > > may have the same issue.
Bruno Abinader (history only)
Comment 8 2012-09-12 05:58:38 PDT
Marking as WONTFIX (see commment 6 for details).
Note You need to log in before you can comment on or make changes to this bug.