mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1482025: Don't set aria-label on hbox page action nodes. r=Gijs
This change means that the #pocket-button-box hbox is pruned from the accessibility tree as it should be. Normally, hbox elements aren't exposed to accessibility, as they are semantically meaningless. However, this code was previously setting aria-label on hbox elements, which forces the hbox to be exposed to accessibility. Differential Revision: https://phabricator.services.mozilla.com/D2987 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
2a8cad4bfc
commit
598f267168
@ -575,7 +575,14 @@ var BrowserPageActions = {
|
||||
panelNode.setAttribute("label", title);
|
||||
}
|
||||
if (urlbarNode) {
|
||||
urlbarNode.setAttribute("aria-label", title);
|
||||
// Some actions (e.g. Save Page to Pocket) have a wrapper node with the
|
||||
// actual controls inside that wrapper. The wrapper is semantically
|
||||
// meaningless, so it doesn't get reflected in the accessibility tree.
|
||||
// In these cases, we don't want to set aria-label because that will
|
||||
// force the element to be exposed to accessibility.
|
||||
if (urlbarNode.nodeName != "hbox") {
|
||||
urlbarNode.setAttribute("aria-label", title);
|
||||
}
|
||||
// tooltiptext falls back to the title, so update it too if necessary.
|
||||
let tooltip = action.getTooltip(window);
|
||||
if (!tooltip && title) {
|
||||
|
Loading…
Reference in New Issue
Block a user