vpat 31 and 33 - aria tweaks for Tools > Plugins (#4560)
Some checks are pending
CI / Build, Upload, Test (push) Waiting to run

- vpat 31: mark which menuitems' button is checked,
otherwise selected options (e.g. Update plugins automatically)
are not announced as such
- vpat 33: when plugin details pane appears, remove
a misleading role="tabpanel" from its section because
it is not structured as a collection of tabs
This commit is contained in:
abaevbog 2024-08-13 13:46:46 -07:00 committed by GitHub
parent ed311cacb9
commit 53ad856ef4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -715,6 +715,24 @@ const ZoteroStandalone = new function() {
);
return { remove: result === 0, report: null };
};
// A11y: when a popup appears, mark which buttons are checked for screen readers
doc.addEventListener("shown", (event) => {
for (let item of [...event.target.querySelectorAll("panel-item")]) {
item.button.setAttribute("role", "menuitemcheckbox");
item.button.setAttribute("aria-checked", item.checked);
}
}, true);
// A11y: after a click, check if the panel with plugin details appeared.
// If so, delete a misleading role=tabpanel because default firefox tabs
// ("Details" and "Permissions") are explicitly hidden in fetch_xulrunner
doc.addEventListener("click", (_) => {
setTimeout(() => {
let details = doc.querySelector("#details-deck section[role='tabpanel']");
if (!details) return;
details.removeAttribute("role");
});
}, true);
}
/**