Commit 71d9b7d6 authored by Jack Lynch's avatar Jack Lynch Committed by Commit Bot

DevTools: Fix ExpandableContainerWidget Screen Reader Text

Expandable container widgets with toolbar buttons, such as the Global
listeners pane [1], are being read out incorrectly by screen readers.
For example, the Global listeners header is read by NVDA as
>  Refresh global listeners Global Listeners  link  expanded
when it should really just be "Global Listeners link expanded."

This CL sets an aria-label on each ExpandableContainerWidget so that
child buttons are not read out.

[1] https://gyazo.com/3f9d3131f050c924eab597618ee50230

Bug: 963183
Change-Id: I11aab756c787406c7ce786a009f78caa7da12e2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864567Reviewed-by: default avatarLorne Mitchell <lomitch@microsoft.com>
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#706997}
parent 1f49b02f
......@@ -228,7 +228,9 @@ export class _ExpandableContainerWidget extends UI.VBox {
UI.ARIAUtils.markAsLink(this._titleElement);
this._titleExpandIcon = UI.Icon.create('smallicon-triangle-right', 'title-expand-icon');
this._titleElement.appendChild(this._titleExpandIcon);
this._titleElement.createTextChild(view.title());
const titleText = view.title();
this._titleElement.createTextChild(titleText);
UI.ARIAUtils.setAccessibleName(this._titleElement, titleText);
this._titleElement.tabIndex = 0;
this._titleElement.addEventListener('click', this._toggleExpanded.bind(this), false);
this._titleElement.addEventListener('keydown', this._onTitleKeyDown.bind(this), false);
......
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