Chromium Code Reviews| 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 3b501d41f4da694a721af70f61887582eba29eea..1beef549b8cfb4576b2529b311023847f4fd2bf0 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/01 01:17:40
Thanks for the cleanup, but this entire class is p
|
| + return 0; |
| return breaks[lineIndex - 1] || this.node_.value.length; |
| }, |