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

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: 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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 description['Reproduction Steps'] = '%0a1.%0a2.%0a3.'; 737 description['Reproduction Steps'] = '%0a1.%0a2.%0a3.';
738 for (var key in description) 738 for (var key in description)
739 url += key + ':%20' + description[key] + '%0a'; 739 url += key + ':%20' + description[key] + '%0a';
740 chrome.tabs.create({url: url}); 740 chrome.tabs.create({url: url});
741 return false; 741 return false;
742 default: 742 default:
743 return true; 743 return true;
744 } 744 }
745 745
746 if (pred) { 746 if (pred) {
747 var node = AutomationUtil.findNextNode( 747 var bound = current.getBound(dir).node;
748 current.getBound(dir).node, dir, pred, {skipInitialAncestry: true}); 748 if (bound) {
749 var node = AutomationUtil.findNextNode(
750 bound, dir, pred, {skipInitialAncestry: true});
751 if (node) {
752 node = AutomationUtil.findNodePre(
753 node, dir, AutomationPredicate.element) || node;
754 }
749 755
750 if (node) { 756 if (node) {
751 node = AutomationUtil.findNodePre( 757 current = cursors.Range.fromNode(node);
752 node, dir, AutomationPredicate.element) || node; 758 } else {
753 } 759 if (predErrorMsg) {
754 760 cvox.ChromeVox.tts.speak(Msgs.getMsg(predErrorMsg),
755 if (node) { 761 cvox.QueueMode.FLUSH);
756 current = cursors.Range.fromNode(node); 762 }
757 } else { 763 return false;
758 if (predErrorMsg) {
759 cvox.ChromeVox.tts.speak(Msgs.getMsg(predErrorMsg),
760 cvox.QueueMode.FLUSH);
761 } 764 }
762 return false;
763 } 765 }
764 } 766 }
765 767
766 if (current) 768 if (current)
767 this.navigateToRange_(current); 769 this.navigateToRange_(current);
768 770
769 return false; 771 return false;
770 }, 772 },
771 773
772 /** 774 /**
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') 1120 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&')
1119 .replace(/\*/g, '.*') 1121 .replace(/\*/g, '.*')
1120 .replace(/\?/g, '.'); 1122 .replace(/\?/g, '.');
1121 }).join('|') + ')$'); 1123 }).join('|') + ')$');
1122 }; 1124 };
1123 1125
1124 /** @type {Background} */ 1126 /** @type {Background} */
1125 global.backgroundObj = new Background(); 1127 global.backgroundObj = new Background();
1126 1128
1127 }); // goog.scope 1129 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698