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

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

Issue 2007183002: Make ChromeVox cursor robust to deleted nodes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 description['Reproduction Steps'] = '%0a1.%0a2.%0a3.'; 762 description['Reproduction Steps'] = '%0a1.%0a2.%0a3.';
763 for (var key in description) 763 for (var key in description)
764 url += key + ':%20' + description[key] + '%0a'; 764 url += key + ':%20' + description[key] + '%0a';
765 chrome.tabs.create({url: url}); 765 chrome.tabs.create({url: url});
766 return false; 766 return false;
767 default: 767 default:
768 return true; 768 return true;
769 } 769 }
770 770
771 if (pred) { 771 if (pred) {
772 var node = AutomationUtil.findNextNode( 772 var bound = current.getBound(dir).node;
773 current.getBound(dir).node, dir, pred, {skipInitialAncestry: true}); 773 if (bound) {
774 var node = AutomationUtil.findNextNode(
775 bound, dir, pred, {skipInitialAncestry: true});
774 776
775 if (node) { 777 if (node) {
776 node = AutomationUtil.findNodePre( 778 node = AutomationUtil.findNodePre(
777 node, dir, AutomationPredicate.object) || node; 779 node, dir, AutomationPredicate.object) || node;
778 } 780 }
779 781
780 if (node) { 782 if (node) {
781 current = cursors.Range.fromNode(node); 783 current = cursors.Range.fromNode(node);
782 } else { 784 } else {
783 if (predErrorMsg) { 785 if (predErrorMsg) {
784 cvox.ChromeVox.tts.speak(Msgs.getMsg(predErrorMsg), 786 cvox.ChromeVox.tts.speak(Msgs.getMsg(predErrorMsg),
785 cvox.QueueMode.FLUSH); 787 cvox.QueueMode.FLUSH);
788 }
789 return false;
786 } 790 }
787 return false;
788 } 791 }
789 } 792 }
790 793
791 if (current) 794 if (current)
792 this.navigateToRange_(current); 795 this.navigateToRange_(current);
793 796
794 return false; 797 return false;
795 }, 798 },
796 799
797 /** 800 /**
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') 1146 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&')
1144 .replace(/\*/g, '.*') 1147 .replace(/\*/g, '.*')
1145 .replace(/\?/g, '.'); 1148 .replace(/\?/g, '.');
1146 }).join('|') + ')$'); 1149 }).join('|') + ')$');
1147 }; 1150 };
1148 1151
1149 /** @type {Background} */ 1152 /** @type {Background} */
1150 global.backgroundObj = new Background(); 1153 global.backgroundObj = new Background();
1151 1154
1152 }); // goog.scope 1155 }); // 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