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

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js

Issue 2450093002: Read the selected text explicitly when focusing a texdt field (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
index 86174b675228552c723c24c8d0cc400d3a5e0f0b..64a60801199f2be2bb0798689f419e33a7391fae 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
@@ -1068,15 +1068,25 @@ Output.prototype = {
var text = node.value;
if (!node.state.editable && node.name == text)
return;
+
+ var selectedText = '';
if (text !== undefined) {
if (node.textSelStart !== undefined) {
options.annotation.push(new Output.SelectionSpan(
node.textSelStart,
node.textSelEnd));
+
+ selectedText =
+ node.value.substring(node.textSelStart, node.textSelEnd);
}
}
options.annotation.push(token);
- this.append_(buff, text, options);
+ if (selectedText) {
+ this.append_(buff, selectedText, options);
+ this.append_(buff, Msgs.getMsg('selected'), options);
+ } else {
+ this.append_(buff, text, options);
+ }
} else if (token == 'name') {
options.annotation.push(token);
var earcon = node ? this.findEarcon_(node, opt_prevNode) : null;
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698