The reason is that highlighter is synchronous. It is fast, but when it is about 20K lines, it still takes seconds. Hence scrolling is not smooth. This change: 1) Simplifies TextModel so that it stores only per-line attributes, no per-char ones 2) Splits highlight() call into updateHighlight (called upon edits) and highlight (called form paint). 3) Invalidates highlight tail using flag instead of clearing it (so that highlight could recover and quit fast).
Created attachment 46443 [details] [PATCH] Proposed change.
Comment on attachment 46443 [details] [PATCH] Proposed change. > + // User keeps updating the job in between of our timer ticks. Just reschedule self, don't eat CPU (he must be scrolling). s/he must/they must/ > + // Highlight 1K lines chunk. > + var toLine = Math.min(startLine + 500, this._requestedEndLine); s/1K lines/500 lines/
Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebCore/ChangeLog M WebCore/inspector/front-end/TextEditor.js M WebCore/inspector/front-end/TextEditorHighlighter.js M WebCore/inspector/front-end/TextEditorModel.js Committed r53184