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

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

Issue 2450093002: Read the selected text explicitly when focusing a texdt field (Closed)
Patch Set: Created 4 years, 1 month 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 selectedRange = prevRange; 482 selectedRange = prevRange;
483 } 483 }
484 this.pageSel_ = new cursors.Range( 484 this.pageSel_ = new cursors.Range(
485 this.pageSel_.start, 485 this.pageSel_.start,
486 range.end 486 range.end
487 ); 487 );
488 if (this.pageSel_) 488 if (this.pageSel_)
489 this.pageSel_.select(); 489 this.pageSel_.select();
490 } 490 }
491 } else { 491 } else {
492 range.select(); 492 // Ensure we don't select the editable when we first encounter it.
493 var lca = null;
494 if (range.start.node && prevRange.start.node) {
495 lca = AutomationUtil.getLeastCommonAncestor(prevRange.start.node,
496 range.start.node);
497 }
498 if (!lca || lca.state.editable || !range.start.node.state.editable)
499 range.select();
493 } 500 }
494 501
495 o.withRichSpeechAndBraille( 502 o.withRichSpeechAndBraille(
496 selectedRange || range, prevRange, Output.EventType.NAVIGATE) 503 selectedRange || range, prevRange, Output.EventType.NAVIGATE)
497 .withQueueMode(cvox.QueueMode.FLUSH); 504 .withQueueMode(cvox.QueueMode.FLUSH);
498 505
499 if (msg) 506 if (msg)
500 o.format(msg); 507 o.format(msg);
501 508
502 for (var prop in opt_speechProps) 509 for (var prop in opt_speechProps)
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 return new RegExp('^(' + globs.map(function(glob) { 776 return new RegExp('^(' + globs.map(function(glob) {
770 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') 777 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&')
771 .replace(/\*/g, '.*') 778 .replace(/\*/g, '.*')
772 .replace(/\?/g, '.'); 779 .replace(/\?/g, '.');
773 }).join('|') + ')$'); 780 }).join('|') + ')$');
774 }; 781 };
775 782
776 new Background(); 783 new Background();
777 784
778 }); // goog.scope 785 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698