Commit 72ff353c authored by Michael Liao (WPT)'s avatar Michael Liao (WPT) Committed by Commit Bot

DevTools [Network Conditions]: making network throttling options read optgroup label

Problem:
- NVDA does not currently support reading <optgroup> elements in Chromium
- Optgroup labels are inaccessible in Network throttling select element in Network Conditions tab

Changes:
- Select options are given a new accessible name that prefaces the option title with the optgroup title.

Bug: 963183
Change-Id: Id9a71997c96d3646c7cf35de94213bccf5e68912
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1730863Reviewed-by: default avatarJohn Emau <johnemau@microsoft.com>
Reviewed-by: default avatarPeter Marshall <petermarshall@chromium.org>
Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Michael Liao <michael.liao@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#701660}
parent 1a6a602c
...@@ -54,11 +54,14 @@ MobileThrottling.ThrottlingManager = class extends Common.Object { ...@@ -54,11 +54,14 @@ MobileThrottling.ThrottlingManager = class extends Common.Object {
for (const conditions of group.items) { for (const conditions of group.items) {
const title = conditions.title; const title = conditions.title;
const option = new Option(title, title); const option = new Option(title, title);
UI.ARIAUtils.setAccessibleName(option, ls`${group.title}: ${title}`);
groupElement.appendChild(option); groupElement.appendChild(option);
options.push(conditions); options.push(conditions);
} }
if (i === groups.length - 1) { if (i === groups.length - 1) {
groupElement.appendChild(new Option(Common.UIString('Add\u2026'), Common.UIString('Add\u2026'))); const option = new Option(ls`Add\u2026`, ls`Add\u2026`);
UI.ARIAUtils.setAccessibleName(option, ls`Add ${group.title}`);
groupElement.appendChild(option);
options.push(null); options.push(null);
} }
} }
......
...@@ -63,6 +63,9 @@ ...@@ -63,6 +63,9 @@
<message name="IDS_DEVTOOLS_b27fdc01c81857f96f3d5d37d323bcb6" desc="Title of an action in the network conditions tool to network mid tier mobile"> <message name="IDS_DEVTOOLS_b27fdc01c81857f96f3d5d37d323bcb6" desc="Title of an action in the network conditions tool to network mid tier mobile">
Enable fast 3G throttling Enable fast 3G throttling
</message> </message>
<message name="IDS_DEVTOOLS_b95c09fb28e80cc672fd533a62252d70" desc="Accessibility label for custom add network throttling option">
Add <ph name="GROUP_TITLE">$1s<ex>Custom</ex></ph>
</message>
<message name="IDS_DEVTOOLS_c47c85f963782364d32f428fcf7631ff" desc="Text in Throttling Presets of the Network panel"> <message name="IDS_DEVTOOLS_c47c85f963782364d32f428fcf7631ff" desc="Text in Throttling Presets of the Network panel">
No internet connectivity No internet connectivity
</message> </message>
......
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