Commit 8fad84ee authored by John Emau's avatar John Emau Committed by Commit Bot

DevTools: Make all dialogs modals

Because all dialogs already fit the definition of dialog modals and all
use-cases of dialogs in the DevTools require a modal dialog.

This meets success criteria for WCAG 1.3.1 Info and Relationships
https://www.w3.org/WAI/WCAG21/quickref/#info-and-relationships

See the Dialog (Modal) design pattern for reference
https://www.w3.org/TR/wai-aria-practices-1.1/#dialog_modal

Bug: 963183
Change-Id: I9ebfeb8e54f51835351df32214512d8f5f88324b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1703029Reviewed-by: default avatarJoel Einbinder <einbinder@chromium.org>
Commit-Queue: John Emau <johnemau@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#678038}
parent 3a76c140
...@@ -71,7 +71,7 @@ Settings.SettingsScreen = class extends UI.VBox { ...@@ -71,7 +71,7 @@ Settings.SettingsScreen = class extends UI.VBox {
/** @type {!Settings.SettingsScreen} */ (self.runtime.sharedInstance(Settings.SettingsScreen)); /** @type {!Settings.SettingsScreen} */ (self.runtime.sharedInstance(Settings.SettingsScreen));
if (settingsScreen.isShowing()) if (settingsScreen.isShowing())
return; return;
const dialog = new UI.Dialog(/* modal=*/ true); const dialog = new UI.Dialog();
dialog.addCloseButton(); dialog.addCloseButton();
settingsScreen.show(dialog.contentElement); settingsScreen.show(dialog.contentElement);
dialog.show(); dialog.show();
......
...@@ -29,10 +29,8 @@ ...@@ -29,10 +29,8 @@
*/ */
UI.Dialog = class extends UI.GlassPane { UI.Dialog = class extends UI.GlassPane {
/**
* @param {boolean=} modal constructor() {
*/
constructor(modal) {
super(); super();
this.registerRequiredCSS('ui/dialog.css'); this.registerRequiredCSS('ui/dialog.css');
this.contentElement.tabIndex = 0; this.contentElement.tabIndex = 0;
...@@ -44,7 +42,7 @@ UI.Dialog = class extends UI.GlassPane { ...@@ -44,7 +42,7 @@ UI.Dialog = class extends UI.GlassPane {
this.hide(); this.hide();
event.consume(true); event.consume(true);
}); });
UI.ARIAUtils.markAsDialog(this.contentElement, modal); UI.ARIAUtils.markAsDialog(this.contentElement, true);
/** @type {!Map<!HTMLElement, number>} */ /** @type {!Map<!HTMLElement, number>} */
this._tabIndexMap = new Map(); this._tabIndexMap = new Map();
/** @type {?UI.WidgetFocusRestorer} */ /** @type {?UI.WidgetFocusRestorer} */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment