Bug 33587

Summary: Web Inspector: Scrolling editor to the 20Kth line is not smooth.
Product: WebKit Reporter: Pavel Feldman <pfeldman>
Component: Web Inspector (Deprecated)Assignee: Pavel Feldman <pfeldman>
Severity: Normal CC: bweinstein, joepeck, rik, timothy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Description Flags
[PATCH] Proposed change. timothy: review+

Description Pavel Feldman 2010-01-13 04:31:51 PST
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).
Comment 1 Pavel Feldman 2010-01-13 04:34:45 PST
Created attachment 46443 [details]
[PATCH] Proposed change.
Comment 2 Timothy Hatcher 2010-01-13 04:46:31 PST
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/
Comment 3 Pavel Feldman 2010-01-13 07:24:27 PST
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