Commit 2dd1593f authored by Anubha Mathur's avatar Anubha Mathur Committed by Commit Bot

DevTools: Add alert to read out updates to device orientation in sensors tool

Fix accessibility bug: In the sensors tool, when the reset button under Device orientation was clicked, the screen reader did not read anything out to inform user that the orientation was changed.

Now whenever the device orientation updates, the new setting is read out. If the update was only read out when reset button was pressed, the experience would not be consistent, and the alert wouldn't be read out for subsequent resets, which is why the update is read out on every change.

Gif: https://imgur.com/a/1YeTX2l

Bug: 963183
Change-Id: Id4f82c4af8db1857af832d4b221d60cd1eea578c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1750194
Commit-Queue: Anubha Mathur <anubmat@microsoft.com>
Reviewed-by: default avatarLorne Mitchell <lomitch@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#707069}
parent 6b275ec9
...@@ -339,6 +339,11 @@ Emulation.SensorsView = class extends UI.VBox { ...@@ -339,6 +339,11 @@ Emulation.SensorsView = class extends UI.VBox {
this._deviceOrientation = deviceOrientation; this._deviceOrientation = deviceOrientation;
this._applyDeviceOrientation(); this._applyDeviceOrientation();
UI.ARIAUtils.alert(
ls`Device orientation set to alpha: ${deviceOrientation.alpha}, beta: ${deviceOrientation.beta}, gamma: ${
deviceOrientation.gamma}`,
this._orientationSelectElement);
} }
/** /**
......
...@@ -147,6 +147,9 @@ ...@@ -147,6 +147,9 @@
<message name="IDS_DEVTOOLS_673a7b89eb57bf2bf891306c98cbecc3" desc="Error message in the Geolocations settings pane that declares that the value for the latitude input must be a number"> <message name="IDS_DEVTOOLS_673a7b89eb57bf2bf891306c98cbecc3" desc="Error message in the Geolocations settings pane that declares that the value for the latitude input must be a number">
Latitude must be a number Latitude must be a number
</message> </message>
<message name="IDS_DEVTOOLS_6bdb3457630d1a73c9cdc3a7db7062b9" desc="Message in the Sensors tool that is alerted (for screen readers) when the device orientation setting is changed">
Device orientation set to alpha: <ph name="DEVICEORIENTATION_ALPHA">$1s<ex>180</ex></ph>, beta: <ph name="DEVICEORIENTATION_BETA">$2s<ex>-90</ex></ph>, gamma: <ph name="DEVICEORIENTATION_GAMMA">$3s<ex>0</ex></ph>
</message>
<message name="IDS_DEVTOOLS_6e641146898080ed83f3007cd712f58f" desc="Error message in the Devices settings pane that declares the maximum value for the device pixel ratio input"> <message name="IDS_DEVTOOLS_6e641146898080ed83f3007cd712f58f" desc="Error message in the Devices settings pane that declares the maximum value for the device pixel ratio input">
Device pixel ratio must be less than or equal to <ph name="EMULATION_DEVICEMODEMODEL_MAXDEVICESCALEFACTOR">$1s<ex>10</ex></ph>. Device pixel ratio must be less than or equal to <ph name="EMULATION_DEVICEMODEMODEL_MAXDEVICESCALEFACTOR">$1s<ex>10</ex></ph>.
</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