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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js

Issue 2273373002: Ensure focus() gets called when navigating to text fields (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview The entry point for all ChromeVox2 related code for the 6 * @fileoverview The entry point for all ChromeVox2 related code for the
7 * background page. 7 * background page.
8 */ 8 */
9 9
10 goog.provide('Background'); 10 goog.provide('Background');
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 374
375 if (opt_focus) { 375 if (opt_focus) {
376 // TODO(dtseng): Figure out what it means to focus a range. 376 // TODO(dtseng): Figure out what it means to focus a range.
377 var actionNode = range.start.node; 377 var actionNode = range.start.node;
378 if (actionNode.role == RoleType.inlineTextBox) 378 if (actionNode.role == RoleType.inlineTextBox)
379 actionNode = actionNode.parent; 379 actionNode = actionNode.parent;
380 380
381 // Iframes, when focused, causes the child webArea to fire focus event. 381 // Iframes, when focused, causes the child webArea to fire focus event.
382 // This can result in getting stuck when navigating backward. 382 // This can result in getting stuck when navigating backward.
383 if (actionNode.role != RoleType.iframe && !actionNode.state.focused && 383 if (actionNode.role != RoleType.iframe && !actionNode.state.focused &&
384 !AutomationPredicate.container(actionNode)) 384 !AutomationPredicate.structuralContainer(actionNode))
385 actionNode.focus(); 385 actionNode.focus();
386 } 386 }
387 var prevRange = this.currentRange_; 387 var prevRange = this.currentRange_;
388 this.setCurrentRange(range); 388 this.setCurrentRange(range);
389 389
390 var o = new Output(); 390 var o = new Output();
391 var selectedRange; 391 var selectedRange;
392 if (this.pageSel_ && 392 if (this.pageSel_ &&
393 this.pageSel_.isValid() && 393 this.pageSel_.isValid() &&
394 range.isValid()) { 394 range.isValid()) {
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 return new RegExp('^(' + globs.map(function(glob) { 748 return new RegExp('^(' + globs.map(function(glob) {
749 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') 749 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&')
750 .replace(/\*/g, '.*') 750 .replace(/\*/g, '.*')
751 .replace(/\?/g, '.'); 751 .replace(/\?/g, '.');
752 }).join('|') + ')$'); 752 }).join('|') + ')$');
753 }; 753 };
754 754
755 new Background(); 755 new Background();
756 756
757 }); // goog.scope 757 }); // goog.scope
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698