mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 07:08:08 +02:00
Add presentation role to text layer spans. (#13278)
Keeps screen readers from pausing on every span so paragraphs are read more naturally. Note: this only seems to affect Firefox, Chrome automatically combines the spans.
This commit is contained in:
parent
b0d58efb6a
commit
5231d922ec
1 changed files with 3 additions and 0 deletions
|
@ -173,6 +173,9 @@ const renderTextLayer = (function renderTextLayerClosure() {
|
|||
textDiv.style.fontSize = `${fontHeight}px`;
|
||||
textDiv.style.fontFamily = style.fontFamily;
|
||||
|
||||
// Keeps screen readers from pausing on every new text span.
|
||||
textDiv.setAttribute("role", "presentation");
|
||||
|
||||
textDiv.textContent = geom.str;
|
||||
// geom.dir may be 'ttb' for vertical texts.
|
||||
textDiv.dir = geom.dir;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue