Bug 67198

Summary: Web Inspector: console view does a style recalculation per each addMessage call
Product: WebKit Reporter: Ilya Tikhonovsky <loislo>
Component: Web Inspector (Deprecated)Assignee: Ilya Tikhonovsky <loislo>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[patch] initial version
yurys: review-
[patch] second iteration none

Description Ilya Tikhonovsky 2011-08-30 05:44:43 PDT
it is bad from the performance point of view.
Comment 1 Ilya Tikhonovsky 2011-08-30 05:48:05 PDT
Created attachment 105620 [details]
[patch] initial version
Comment 2 Vsevolod Vlasov 2011-08-30 05:55:31 PDT
Comment on attachment 105620 [details]
[patch] initial version

View in context: https://bugs.webkit.org/attachment.cgi?id=105620&action=review

> Source/WebCore/inspector/front-end/ConsoleView.js:286
> +        if (!this._isScrollIntoViewScheduled() && ((msg instanceof WebInspector.ConsoleCommandResult) || this.messagesElement.isScrolledToBottom()))

this._scrollIntoViewTimer is already checked in _scheduleScrollIntoView(), isn't it?
Comment 3 Ilya Tikhonovsky 2011-08-30 06:00:25 PDT
Comment on attachment 105620 [details]
[patch] initial version

View in context: https://bugs.webkit.org/attachment.cgi?id=105620&action=review

>> Source/WebCore/inspector/front-end/ConsoleView.js:286
>> +        if (!this._isScrollIntoViewScheduled() && ((msg instanceof WebInspector.ConsoleCommandResult) || this.messagesElement.isScrolledToBottom()))
> 
> this._scrollIntoViewTimer is already checked in _scheduleScrollIntoView(), isn't it?

the problem is in this.messagesElement.isScrolledToBottom call. This call is forcing style recalculation. 
In the old code we do style recalculation even if we already scheduled the scroll action.
Comment 4 Yury Semikhatsky 2011-08-30 06:44:21 PDT
Comment on attachment 105620 [details]
[patch] initial version

View in context: https://bugs.webkit.org/attachment.cgi?id=105620&action=review

>>> Source/WebCore/inspector/front-end/ConsoleView.js:286
>>> +        if (!this._isScrollIntoViewScheduled() && ((msg instanceof WebInspector.ConsoleCommandResult) || this.messagesElement.isScrolledToBottom()))
>> 
>> this._scrollIntoViewTimer is already checked in _scheduleScrollIntoView(), isn't it?
> 
> the problem is in this.messagesElement.isScrolledToBottom call. This call is forcing style recalculation. 
> In the old code we do style recalculation even if we already scheduled the scroll action.

isScrolledToBottom() should be called *before* the new message has been added.
Comment 5 Ilya Tikhonovsky 2011-08-30 08:20:00 PDT
Created attachment 105632 [details]
[patch] second iteration
Comment 6 Ilya Tikhonovsky 2011-08-31 05:12:51 PDT
Comment on attachment 105632 [details]
[patch] second iteration

Clearing flags on attachment: 105632

Committed r94178: <http://trac.webkit.org/changeset/94178>
Comment 7 Ilya Tikhonovsky 2011-08-31 05:12:58 PDT
All reviewed patches have been landed.  Closing bug.