Ticket #47 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Link destination anchors should not be treated as links

Reported by: jteh Owned by:
Priority: minor Milestone: 2009.1
Component: Virtual buffers Version: development
Keywords: Cc:
Operating system: Blocked by:
Blocking:

Description (last modified by jteh) (diff)

In HTML, there are two uses for the <a> tag:

  1. The HREF attribute refers to a destination so that when the link is activated, the browser will jump to that destination.
  2. The NAME attribute creates a link destination which can be referenced elsewhere.

When there is no HREF attribute, the element is not a link (i.e. it does not jump to another destination).

Unfortunately, Firefox exposes A elements without an HREF attribute as links to accessibility APIs. Imho, this is a bug in Firefox; see  MozillaBug:423603. However, this has been done for a long time and IE apparently does it as well, so fixing the issue in Firefox may cause breakage. Thus, the change needs to be made in the NVDA gecko_ia2 backend.

Two methods can be used to determine whether there is no HREF attribute:

  • The link object will not have the linked state set.
  • The accessible value will be empty.

Either of these methods can be used. If no HREF is detected, the backend should ignore the link object (but still render everything below).

Change History

follow-up: ↓ 2   Changed 2 years ago by benjaminhawkeslewis

If no HREF is detected, the backend should ignore the link object (but still render everything below).

I'm not 100% clear what this suggestion entails. It might prove problematic if anchor elements are not announced at all, since even if an anchor has no HREF it might still have behaviour attached with scripting.

in reply to: ↑ 1   Changed 2 years ago by jteh

Replying to benjaminhawkeslewis:

I'm not 100% clear what this suggestion entails. It might prove problematic if anchor elements are not announced at all, since even if an anchor has no HREF it might still have behaviour attached with scripting.

True, but this is also true for spans, divs, etc. Basically, we will treat anchors without an HREF attribute as if they were spans. Clickables are currently not announced, but once they are, this will work for named anchors as well with no additional change.

  Changed 2 years ago by jteh

  • status changed from new to closed
  • resolution set to fixed

On further reflection, although it is a little confusing, it does make sense for named linked destinations to be exposed to accessibility APIs. As a screen reader, we don't want to report these as links to the user, but it might be useful for jumping to places of interest on a page, as these are often marked by named linked destinations/anchors. To allow for this functionality in future if it is desired, I have modified NVDA to simply not report these as links, rather than losing this information in the backend. Committed in r1846.

  Changed 2 years ago by jteh

Oops. Thought I had committed when i hadn't. Correct revision is r1858.

  Changed 2 years ago by jteh

  • description modified (diff)
Note: See TracTickets for help on using tickets.