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

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

Issue 2931893002: More precise use of multiline state (Closed)
Patch Set: Rebase Created 3 years, 5 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/editing_test.extjs » ('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/editing.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
index 199e4065051218e14740693862f0c68e14530339..64d2862d4bb695fbc2d33a71b7eed1fe6f1cbbc8 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
@@ -120,8 +120,6 @@ function AutomationEditableText(node) {
this.multiline = node.state[StateType.MULTILINE] || false;
/** @type {!AutomationNode} @private */
this.node_ = node;
- /** @type {Array<number>} @private */
- this.lineBreaks_ = [];
}
AutomationEditableText.prototype = {
@@ -133,9 +131,6 @@ AutomationEditableText.prototype = {
onUpdate: function() {
var newValue = this.node_.value || '';
- if (this.value != newValue)
- this.lineBreaks_ = [];
-
var textChangeEvent = new cvox.TextChangeEvent(
newValue, this.node_.textSelStart || 0, this.node_.textSelEnd || 0,
true /* triggered by user */);
@@ -159,6 +154,8 @@ AutomationEditableText.prototype = {
if (!this.multiline || lineIndex == 0)
return 0;
var breaks = this.getLineBreaks_();
+ if (breaks.length < 1)
David Tseng 2017/07/07 17:58:06 These changes should be unneeded now.
+ return 0;
return breaks[lineIndex - 1] || this.node_.value.length;
},
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698