Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: chrome/browser/resources/hotword_audio_verification/flow.js

Issue 842083004: Hotword: Fix the order in which screen readers will read the error alerts and retry buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/hotword_audio_verification/flow.js
diff --git a/chrome/browser/resources/hotword_audio_verification/flow.js b/chrome/browser/resources/hotword_audio_verification/flow.js
index 1fbb14eaf3523de639c706dc480383d95e7d937d..8a7632698ee99e8d1054d024d626ead2b926fc04 100644
--- a/chrome/browser/resources/hotword_audio_verification/flow.js
+++ b/chrome/browser/resources/hotword_audio_verification/flow.js
@@ -210,7 +210,11 @@
$('audio-history-wait').hidden = true;
$('audio-history-error').hidden = false;
- $('audio-history-agree').focus();
+ // Set a timeout before focusing the Enable button so that screenreaders
+ // have time to announce the error first.
+ this.setTimeout_(function() {
+ $('audio-history-agree').focus();
+ }.bind(this), 50);
};
/**
@@ -441,7 +445,12 @@
curStep.classList.remove('listening');
curStep.classList.add('not-started');
}
- $(this.trainingPagePrefix_ + '-toast').children[1].focus();
+
+ // Set a timeout before focusing the Retry button so that screenreaders
+ // have time to announce the timeout first.
+ this.setTimeout_(function() {
+ $(this.trainingPagePrefix_ + '-toast').children[1].focus();
+ }.bind(this), 50);
} else if (this.trainingState_ == TrainingState.ERROR) {
// Update the buttonbar.
$(this.trainingPagePrefix_ + '-wait').hidden = true;
@@ -449,8 +458,11 @@
$(this.trainingPagePrefix_ + '-retry').hidden = false;
$(this.trainingPagePrefix_ + '-processing').hidden = false;
- // Focus the retry button.
- $(this.trainingPagePrefix_ + '-retry').children[0].focus();
+ // Set a timeout before focusing the Retry button so that screenreaders
+ // have time to announce the error first.
+ this.setTimeout_(function() {
+ $(this.trainingPagePrefix_ + '-retry').children[0].focus();
+ }.bind(this), 50);
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698