mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Add tagged annotations in the structure tree (bug 1850797)
This commit is contained in:
parent
92f7653cfb
commit
d185db2b70
10 changed files with 152 additions and 47 deletions
|
@ -100,14 +100,15 @@ class StructTreeLayerBuilder {
|
|||
}
|
||||
|
||||
#setAttributes(structElement, htmlElement) {
|
||||
if (structElement.alt !== undefined) {
|
||||
htmlElement.setAttribute("aria-label", structElement.alt);
|
||||
const { alt, id, lang } = structElement;
|
||||
if (alt !== undefined) {
|
||||
htmlElement.setAttribute("aria-label", alt);
|
||||
}
|
||||
if (structElement.id !== undefined) {
|
||||
htmlElement.setAttribute("aria-owns", structElement.id);
|
||||
if (id !== undefined) {
|
||||
htmlElement.setAttribute("aria-owns", id);
|
||||
}
|
||||
if (structElement.lang !== undefined) {
|
||||
htmlElement.setAttribute("lang", structElement.lang);
|
||||
if (lang !== undefined) {
|
||||
htmlElement.setAttribute("lang", lang);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue