Open Bug 1885505 Opened 8 months ago Updated 8 hours ago

Screen readers will not read highlighted text inside a PDF

Categories

(Firefox :: PDF Viewer, defect, P3)

defect

Tracking

()

Accessibility Severity s2

People

(Reporter: marco, Unassigned)

Details

(Keywords: access)

Open a PDF with highlights, the screen reader will read the text behind the highlight but will not say that the text is highlighted.

Adobe Reader, Edge, and Preview are also affected by this bug.

Looks like an S2 from an accessibility perspective, unless there's another way for blind users to tell that the text is highlighted.

Accessibility Severity: --- → s2

The severity field is not set for this bug.
:calixte, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(cdenizet)
Severity: -- → S2
Flags: needinfo?(cdenizet)
Priority: -- → P3

This bug is a an uneasy one.
On the pdf side, the highlight annotation should (I'd prefer must) contain the the boxes used to highlight.
So if we want to know what is the text behind the highlight we must compute the intersection of the glyphes bounding boxes with the ones used for highlighting and then we can know what is the exact highlighted text.
That said, some pdf producers (like Acrobat) are adding the highlighted text in the struct tree when it's existing
So there are two things we can do right now to slightly improve the situation:

  • add the highlighted text in the struct tree.
  • use the one we've in the struct tree and link it to the text layer (if it's possible).

What is the expected behavior here?
Should we read the whole text, and then say which part is highlighted?

Flags: needinfo?(nlapre)

The section of text that's highlighted should have attached formatting information in a way that screen readers can report. For instance, if you load a text fragments URL like data:text/html,abc<div>def</div>ghi#:~:text=def, and navigate with a screen reader to the highlighted text "def", you should be able to get it to report the formatting. In VoiceOver, the shortcut is VO+T. On my machine, it reports "highlighted" as you'd expect. (Side note: the same should work for the <mark> element, but that's slightly bugged in Firefox on macOS currently.) You could give a section of highlighted text the ARIA mark role to communicate the highlighted state.

Usually, screen readers won't report that something is highlighted unless you ask them to. In VO and NVDA, it's a special keyboard shortcut. Ultimately, it may not be hugely important to users to know about highlights, but it's good to make it possible to access for SR users.

Flags: needinfo?(nlapre)
You need to log in before you can comment on or make changes to this bug.