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

Unified Diff: chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher.js

Issue 1137403003: Fix ChromeVox's detection of whether the current document has focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
Index: chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher.js
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher.js b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher.js
index 5d28cec8248c538abcbabce9709b133f80a13654..ce40d25c99042254225b01392b234b9c68320a78 100644
--- a/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher.js
+++ b/chrome/browser/resources/chromeos/chromevox/chromevox/injected/event_watcher.js
@@ -255,8 +255,14 @@ cvox.ChromeVoxEventWatcher.readFrom = function(store) {
*/
cvox.ChromeVoxEventWatcher.addEvent = function(evt) {
// Don't add any events to the events queue if ChromeVox is inactive or the
- // page is hidden.
- if (!cvox.ChromeVox.isActive || document.webkitHidden) {
+ // document isn't focused.
David Tseng 2015/05/14 19:00:33 nit: D
+ if (!cvox.ChromeVox.isActive || !cvox.ChromeVox.documentHasFocus()) {
+ if (evt.type == 'focus') {
+ // If it's a focus event, update the active indicator so that it
+ // properly shows and hides as focus moves to iframe and webview
+ // elements.
+ cvox.ChromeVox.navigationManager.activeIndicator.syncToNode(evt.target);
+ }
return;
}
cvox.ChromeVoxEventWatcher.events_.push(evt);
@@ -871,7 +877,7 @@ cvox.ChromeVoxEventWatcher.clipboardEventWatcher = function(evt) {
// Don't announce anything unless this document has focus and the
// editable element that's the target of the clipboard event is visible.
var targetNode = /** @type {Node} */(evt.target);
- if (!document.hasFocus() ||
+ if (!cvox.ChromeVox.documentHasFocus() ||
!targetNode ||
!cvox.DomUtil.isVisible(targetNode) ||
cvox.AriaUtil.isHidden(targetNode)) {

Powered by Google App Engine
This is Rietveld 408576698