Bug 67198 - Web Inspector: console view does a style recalculation per each addMessage call
Summary: Web Inspector: console view does a style recalculation per each addMessage call
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Ilya Tikhonovsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-30 05:44 PDT by Ilya Tikhonovsky
Modified: 2011-08-31 05:12 PDT (History)
10 users (show)

See Also:


Attachments
[patch] initial version (2.18 KB, patch)
2011-08-30 05:48 PDT, Ilya Tikhonovsky
yurys: review-
Details | Formatted Diff | Diff
[patch] second iteration (2.36 KB, patch)
2011-08-30 08:20 PDT, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.