Closed Bug 1761493 Opened 2 years ago Closed 2 years ago

<a href=""> is not tabbable / activatable via keyboard

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(1 file)

data:text/html,<a href="javascript:void 0" onclick="alert('click')">Foo</a> <a href="" onclick="alert('click')">Bar</a>

You can tab through Foo and activate it with the keyboard, but not through Bar, which seems wrong.

Ah, it only happens on data: (and maybe other similar schemes), because we fail to parse "" with a base URI.

See Also: → 1757156

This is mostly edge-casey, but see bug 1757156 for an example where it's
causing some issues (granted, they could use href="#" or something
instead of an empty href).

It feels weird if a link looks like a link (because the CSS definition
of a link matches, which is "has an href") but then mostly doesn't
behave as a link.

We can't navigate anywhere if we don't have a valid URI but maybe JS
handles the relevant events as in bug 1757156.

Use the CSS definition (has href) since that's interoperable across
browsers. This should also make some stuff much faster (since checking
'is link' is now just a bit check instead of a virtual call).

(Awaiting try results, if no tests need adjustments then I need to write
some)

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9ac70698c0e9
Make Gecko internally consistent wrt what a link is. r=smaug
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: