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

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

Issue 1948213002: Add a |skipInitialAncestry| option to tree walking. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 for (var key in description) 672 for (var key in description)
673 url += key + ':%20' + description[key] + '%0a'; 673 url += key + ':%20' + description[key] + '%0a';
674 chrome.tabs.create({url: url}); 674 chrome.tabs.create({url: url});
675 return false; 675 return false;
676 default: 676 default:
677 return true; 677 return true;
678 } 678 }
679 679
680 if (pred) { 680 if (pred) {
681 var node = AutomationUtil.findNextNode( 681 var node = AutomationUtil.findNextNode(
682 current.getBound(dir).node, dir, pred); 682 current.getBound(dir).node, dir, pred, {skipInitialAncestry: true});
683
684 if (node) {
685 node = AutomationUtil.findNodePre(
686 node, dir, AutomationPredicate.element) || node;
687 }
683 688
684 if (node) { 689 if (node) {
685 current = cursors.Range.fromNode(node); 690 current = cursors.Range.fromNode(node);
686 } else { 691 } else {
687 if (predErrorMsg) { 692 if (predErrorMsg) {
688 cvox.ChromeVox.tts.speak(Msgs.getMsg(predErrorMsg), 693 cvox.ChromeVox.tts.speak(Msgs.getMsg(predErrorMsg),
689 cvox.QueueMode.FLUSH); 694 cvox.QueueMode.FLUSH);
690 } 695 }
691 return false; 696 return false;
692 } 697 }
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') 1011 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&')
1007 .replace(/\*/g, '.*') 1012 .replace(/\*/g, '.*')
1008 .replace(/\?/g, '.'); 1013 .replace(/\?/g, '.');
1009 }).join('|') + ')$'); 1014 }).join('|') + ')$');
1010 }; 1015 };
1011 1016
1012 /** @type {Background} */ 1017 /** @type {Background} */
1013 global.backgroundObj = new Background(); 1018 global.backgroundObj = new Background();
1014 1019
1015 }); // goog.scope 1020 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698