Now we highlight all lines in the visible area synchronously. It takes noticeable time on source files that have many long lines (for example, obfuscated JavaScript code of GMail). Thus, scrolling and navigation via keys is not smooth on such cases. We should paint lines asynchronously. Tested on a file with 2K lines, 1M of bytes.
Created attachment 86053 [details] Patch
Created attachment 86055 [details] Patch
FYI. Diff between the first and the second patches: --- a/Source/WebCore/inspector/front-end/TextViewer.js +++ b/Source/WebCore/inspector/front-end/TextViewer.js @@ -844,9 +844,9 @@ WebInspector.TextEditorMainPanel.prototype = { if (!this._scheduledPaintLines) return; - if (this._dirtyLines) { - // Reschedule the timer. - this._paintScheduledLinesTimer = setTimeout(this._paintScheduledLines.bind(this), 10); + // Reschedule the timer if we still can not paint the lines, or the user is scrolling. + if (this._dirtyLines || this._repaintAllTimer) { + this._paintScheduledLinesTimer = setTimeout(this._paintScheduledLines.bind(this), 50); return; }
Comment on attachment 86055 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=86055&action=review > Source/WebCore/inspector/front-end/TextViewer.js:838 > + _paintScheduledLines: function(opt_skipRestoreSelection) We don't use opt_ prefix in the inspector code. > Source/WebCore/inspector/front-end/TextViewer.js:899 > + if (this._dirtyLines || this._scheduledPaintLines || this._paintLinesOperationsCredit < 0) { You should check for this._paintLinesOperationsCredit < 0 at line 891 after painting next line and if the credit is exceeded schedule painting of all rest lines in the chunk.
Comment on attachment 86055 [details] Patch Please address the comments before landing.
Comment on attachment 86055 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=86055&action=review >> Source/WebCore/inspector/front-end/TextViewer.js:838 >> + _paintScheduledLines: function(opt_skipRestoreSelection) > > We don't use opt_ prefix in the inspector code. done >> Source/WebCore/inspector/front-end/TextViewer.js:899 >> + if (this._dirtyLines || this._scheduledPaintLines || this._paintLinesOperationsCredit < 0) { > > You should check for this._paintLinesOperationsCredit < 0 at line 891 after painting next line and if the credit is exceeded schedule painting of all rest lines in the chunk. done
Committed r81760: <http://trac.webkit.org/changeset/81760>