Closed Bug 1708041 Opened 5 years ago Closed 11 months ago

Internal links in PDF do not work with screen reader

Categories

(Firefox :: PDF Viewer, defect, P1)

defect

Tracking

()

RESOLVED FIXED
143 Branch
Accessibility Severity s3

People

(Reporter: bdahl, Assigned: calixte)

References

Details

(Keywords: access, Whiteboard: [pdfjs-accessibility])

Attachments

(1 file)

When a document has links to sections (e.g. a table of contents), activating the links doesn't move the screen reader cursor to the page or section. This can be seen in the PDF specification.

The way this is handled on the web normally is that the page URL gets "#target" appended, the a11y engine gets notified that the page is scrolling to the element with id target and the a11y engine notifies a11y clients. I notice that activating an internal link doesn't append a "#target" to the page location. However, I see the links do have suffixes like "#G4.776894", though the id "G4.776894" doesn't exist in the document. In order for this to work, there would need to be an element with that id to which the screen reader should scroll.

From https://bugzilla.mozilla.org/show_bug.cgi?id=1705139#c1

Whiteboard: [pdfjs-accessibility]
Keywords: access
Type: enhancement → defect
Severity: -- → S3
Priority: -- → P3
Accessibility Severity: --- → s3

:Jamie, do you remember if the links were announced when you tried ?
I just tested with NVDA and they aren't but I've a fix for that.

Anyway, there are a lot of difficulties here.

An internal link is associated with a page and some coordinates within the targeted page.
Right now, when the user clicks on a link, we scroll the viewer to the targeted page + a certain amount depending on the coordinates.
Potentially the page isn't rendered: neither the canvas nor the text layer are.
We know for sure that there's a link on Page X to Page Y but Page Y isn't "aware" that it's the target of a link. So the only way to add an id we could target would be necessarily asynchronous and we'd have to guess from the coordinates what's the target element.

So the imperfect solution I have for now:

  • guess the text under a link in order to correctly announce what's the text we've under the rectangle corresponding to the link annotation
  • when the user clicks, we scroll the reader to the right location
  • once the text on the page is rendered in the text layer we focus this layer, this way the first element in the text layer will be announced.

It should be better than the current situation and in general I think it makes sense to focus the targeted page (even if I tries as much as possible to avoid to call element.focus...).

Assignee: nobody → cdenizet
Status: NEW → ASSIGNED
Priority: P3 → P1
No longer depends on: 1979423
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: