| 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 5f08eee38b33590a08e1ae424614ff611791f3cd..cb44417a5d6fa9772e31ba5bf59d0a1070ee00bb 100644
|
| --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
|
| +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/editing.js
|
| @@ -133,7 +133,7 @@ AutomationEditableText.prototype = {
|
| getLineIndex: function(charIndex) {
|
| if (!this.multiline)
|
| return 0;
|
| - var breaks = this.node_.lineStartOffsets || [];
|
| + var breaks = this.getLineBreaks_();
|
| var index = 0;
|
| while (index < breaks.length && breaks[index] <= charIndex)
|
| ++index;
|
| @@ -168,7 +168,11 @@ AutomationEditableText.prototype = {
|
| getLineBreaks_: function() {
|
| // node.lineStartOffsets is undefined when the multiline field has no line
|
| // breaks.
|
| - return this.node_.lineStartOffsets || [];
|
| + // The line break calculation is fuzzy because the last offset doesn't
|
| + // correspond with the actual text selection data, so let's just ignore it
|
| + // here...
|
| + var breaks = this.node_.lineStartOffsets || [];
|
| + return breaks.slice(0, breaks.length - 1);
|
| },
|
|
|
| /** @private */
|
|
|