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 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; |
| }, |