This change simplifies the damaged region computation. Drive-by make _getSelection work properly.
Created attachment 174972 [details] Patch
Created attachment 175144 [details] Patch
Created attachment 175147 [details] Patch
Comment on attachment 175147 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=175147&action=review > Source/WebCore/inspector/front-end/DefaultTextEditor.js:1891 > + node = this._enclosingLineRowOrSelf(container); This if branch should precede previous one. We should make sure that the enclosing line row of container is preceding lastUndamaged line row. > Source/WebCore/inspector/front-end/DefaultTextEditor.js:2128 > + var lastUndamagedChunk = lastUndamagedLineNumber < this._textModel.linesCount ? this._textChunks[this._chunkNumberForLine(lastUndamagedLineNumber)] : null; lastUndamagedLineChunk > Source/WebCore/inspector/front-end/DefaultTextEditor.js:2129 > + var firstUndamagedChunk = firstUndamagedLineNumber >= 0 ? this._textChunks[this._chunkNumberForLine(firstUndamagedLineNumber)] : null; I think you should invert checks for these two lines. > Source/WebCore/inspector/front-end/DefaultTextEditor.js:2131 > + var collectLinesFromNode = lastUndamagedChunk ? lastUndamagedChunk.lineRowContainingLine(lastUndamagedLineNumber) : null; lastUndamagedLineRow > Source/WebCore/inspector/front-end/DefaultTextEditor.js:2202 > + var cloneToLine = Math.min(Math.max(endLine, range.endLine) + lineCountDelta + 1, this._textModel.linesCount); replace endLine with startLine + lines.length. > Source/WebCore/inspector/front-end/DefaultTextEditor.js:2681 > +WebInspector.debugDefaultTextEditor = true; Please remove
Created attachment 175211 [details] Patch
Created attachment 175221 [details] Patch
Committed r135285: <http://trac.webkit.org/changeset/135285>
Comment on attachment 175221 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=175221&action=review > Source/WebCore/inspector/front-end/DefaultTextEditor.js:1989 > + if (false) // For paint debugging. This makes compiler unhappy: "WARNING - unreachable code"