mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Avoid to aria-hide the structure tree (bug 1894849)
If one ancestor of the structure tree has the attribute aria-hidden then it's invisible for screen readers.
This commit is contained in:
parent
1b811ac113
commit
7742c3eb63
2 changed files with 12 additions and 1 deletions
|
@ -31,6 +31,18 @@ describe("accessibility", () => {
|
|||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
await page.waitForSelector(".structTree");
|
||||
const isVisible = await page.evaluate(() => {
|
||||
let elem = document.querySelector(".structTree");
|
||||
while (elem) {
|
||||
if (elem.getAttribute("aria-hidden") === "true") {
|
||||
return false;
|
||||
}
|
||||
elem = elem.parentElement;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
expect(isVisible).withContext(`In ${browserName}`).toBeTrue();
|
||||
|
||||
// Check the headings match up.
|
||||
const head1 = await page.$eval(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue