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

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

Issue 2385343002: Make ChromeVox use child-index based offsets again for selection. (Closed)
Patch Set: Fix test 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 | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js
index 95cfc06d5c90cd2b20446cad1bd75a9acb619c8a..06e87b16a76c12d13eff0a00912d3dca40c9b905 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js
@@ -522,15 +522,17 @@ CommandHandler.onCommand = function(command) {
output.withString(target.docUrl || '').go();
return false;
case 'copy':
- var textarea = document.createElement('textarea');
- document.body.appendChild(textarea);
- textarea.focus();
- document.execCommand('paste');
- var clipboardContent = textarea.value;
- textarea.remove();
- cvox.ChromeVox.tts.speak(
- Msgs.getMsg('copy', [clipboardContent]), cvox.QueueMode.FLUSH);
- ChromeVoxState.instance.pageSel_ = null;
+ window.setTimeout(function() {
+ var textarea = document.createElement('textarea');
+ document.body.appendChild(textarea);
+ textarea.focus();
+ document.execCommand('paste');
+ var clipboardContent = textarea.value;
+ textarea.remove();
+ cvox.ChromeVox.tts.speak(
+ Msgs.getMsg('copy', [clipboardContent]), cvox.QueueMode.FLUSH);
+ ChromeVoxState.instance.pageSel_ = null;
+ }, 20);
return true;
case 'toggleSelection':
if (!ChromeVoxState.instance.pageSel_) {
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698