RESOLVED FIXED 102688
Web Inspector: simplify? damaged region computation in the editor
https://bugs.webkit.org/show_bug.cgi?id=102688
Summary Web Inspector: simplify? damaged region computation in the editor
Pavel Feldman
Reported 2012-11-19 06:58:02 PST
This change simplifies the damaged region computation. Drive-by make _getSelection work properly.
Attachments
Patch (27.32 KB, patch)
2012-11-19 06:59 PST, Pavel Feldman
no flags
Patch (28.82 KB, patch)
2012-11-19 22:49 PST, Pavel Feldman
no flags
Patch (28.71 KB, patch)
2012-11-19 23:03 PST, Pavel Feldman
no flags
Patch (29.28 KB, patch)
2012-11-20 07:04 PST, Pavel Feldman
no flags
Patch (29.42 KB, patch)
2012-11-20 07:56 PST, Pavel Feldman
vsevik: review+
Pavel Feldman
Comment 1 2012-11-19 06:59:33 PST
Pavel Feldman
Comment 2 2012-11-19 22:49:21 PST
Pavel Feldman
Comment 3 2012-11-19 23:03:16 PST
Vsevolod Vlasov
Comment 4 2012-11-20 05:21:13 PST
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
Pavel Feldman
Comment 5 2012-11-20 07:04:43 PST
Pavel Feldman
Comment 6 2012-11-20 07:56:35 PST
Pavel Feldman
Comment 7 2012-11-20 08:32:32 PST
eustas.bug
Comment 8 2012-11-21 22:39:13 PST
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"
Note You need to log in before you can comment on or make changes to this bug.