mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1660365: Fix a11y dialog role placement for the Print modal. r=Gijs
Previously, the browser dialogTemplate contained role="dialog" and the Print modal body had no role. This caused screen readers to extraneously report "dialog, Print grouping". Dialogs presented with commonDialog.xhtml (e.g. using Services.prompt.alertBC) did have the dialog role on the body, so screen readers would report "dialog, {dialogTitle} dialog". To fix this, remove role="dialog" from dialogTemplate. Instead, SubDialog now sets role="dialog" on the dialog document when it loads. Now, screen readers report just "Print dialog" and "{dialogTitle} dialog", respectively. Differential Revision: https://phabricator.services.mozilla.com/D87977
This commit is contained in:
parent
f30d80c39a
commit
4f869a9ad6
@ -382,8 +382,7 @@
|
||||
<html:template id="dialogStackTemplate">
|
||||
<stack class="dialogStack tab-dialog-box" hidden="true">
|
||||
<vbox class="dialogTemplate dialogOverlay" align="center" topmost="true" hidden="true">
|
||||
<hbox class="dialogBox"
|
||||
role="dialog">
|
||||
<hbox class="dialogBox">
|
||||
<browser class="dialogFrame"
|
||||
autoscroll="false"
|
||||
disablehistory="true"/>
|
||||
|
@ -381,6 +381,12 @@ SubDialog.prototype = {
|
||||
// the dialog's load event.
|
||||
this._overlay.style.visibility = "visible";
|
||||
this._overlay.style.opacity = "0.01";
|
||||
|
||||
// Ensure the document gets an a11y role of dialog.
|
||||
const a11yDoc =
|
||||
this._frame.contentDocument.body ||
|
||||
this._frame.contentDocument.documentElement;
|
||||
a11yDoc.setAttribute("role", "dialog");
|
||||
},
|
||||
|
||||
async _onLoad(aEvent) {
|
||||
|
Loading…
Reference in New Issue
Block a user