Bug 94707 - Cannot render focus on the anchor when its child has style "position: absolute"
Summary: Cannot render focus on the anchor when its child has style "position: absolute"
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: AdobeTracked
Depends on:
Blocks:
 
Reported: 2012-08-22 07:02 PDT by wf
Modified: 2012-11-23 00:11 PST (History)
3 users (show)

See Also:


Attachments
the test page (542 bytes, text/html)
2012-08-22 07:04 PDT, wf
no flags Details
the test page (33.47 KB, image/png)
2012-08-22 07:05 PDT, wf
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description wf 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>
Comment 1 wf 2012-08-22 07:04:31 PDT
Created attachment 159925 [details]
the test page
Comment 2 wf 2012-08-22 07:05:02 PDT
Created attachment 159926 [details]
the test page
Comment 3 wf 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>
Comment 4 Martin Leutelt 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.
Comment 5 wf 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.
Comment 6 Bruno Abinader (history only) 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.
Comment 7 wf 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.
Comment 8 Bruno Abinader (history only) 2012-09-12 05:58:38 PDT
Marking as WONTFIX (see commment 6 for details).