Closed Bug 261707 Opened 20 years ago Closed 20 years ago

Links with empty href don't get a focus outline when they are focused

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: martijn.martijn, Assigned: bzbarsky)

Details

(Keywords: regression, testcase)

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a4) Gecko/20040925 Firefox/0.9.1+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a4) Gecko/20040925 Firefox/0.9.1+

A link like this:
<a href="">Link</a>
doesn't get a focus outline anymore, when you focus it.

This is a regression.
This used to work in:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a3) Gecko/20040724
Firefox/0.9.1+
But it doesn't work anymore as of:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a3) Gecko/20040726
Firefox/0.9.1+

Also when you tab through to the link, normally you get to be shown the link
href in the status bar. This is also not happening with the empty href testcase.
This might sound a bit strange, but an empty href 'gets' automatically the
current location.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Attached file Testcase
It could be a regression from bug 250006, but I'm not sure.
Keywords: regression, testcase
I've tried adding this style rule to the testcase:
<style>a[href=""]:focus{-moz-outline:1px dotted black;}
</style>
But the style rule somehow doesn't get applied (no focus outline when focusing
the link) 
This is absolutely a regression from bug 250006.   The check
nsHTMLAnchorElement::IsFocusable does for an empty URI is totally bogus.  It
should be getting the HrefURI and checking whether that's null.
Oh, and that bug broke tabbing to and focusing of XLinks too.
Attached file Testcase for XLink
Attached patch Proposed patchSplinter Review
Attachment #160598 - Flags: superreview?(jst)
Attachment #160598 - Flags: review?(aaronleventhal)
Attachment #160598 - Flags: review?(aaronleventhal) → review+
Comment on attachment 160598 [details] [diff] [review]
Proposed patch

sr=jst
Attachment #160598 - Flags: superreview?(jst) → superreview+
Assignee: aaronleventhal → bzbarsky
Fixed.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Note:  When I checked this in, two bits of the bug 263200 patch made it in too
(the nsHTMLAnchorElement.cpp and nsXMLElement.cpp bits).
Verified FIXED; focus ring is now present in build 2004-11-17-04 using testcase
https://bugzilla.mozilla.org/attachment.cgi?id=160187&action=view on Windows XP
with Seamonkey trunk.
Status: RESOLVED → VERIFIED
Component: Keyboard: Navigation → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: