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
@ -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…
Reference in New Issue
Block a user