Title: [94178] trunk/Source/WebCore
Revision
94178
Author
[email protected]
Date
2011-08-31 05:13:47 -0700 (Wed, 31 Aug 2011)

Log Message

Web Inspector: console view does a style recalculation per each addMessage call.
https://bugs.webkit.org/show_bug.cgi?id=67198

It is bad from the performance point of view.

Reviewed by Yury Semikhatsky.

* inspector/front-end/ConsoleView.js:
(WebInspector.ConsoleView.prototype._isScrollIntoViewScheduled):
(WebInspector.ConsoleView.prototype._appendConsoleMessage):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (94177 => 94178)


--- trunk/Source/WebCore/ChangeLog	2011-08-31 12:07:26 UTC (rev 94177)
+++ trunk/Source/WebCore/ChangeLog	2011-08-31 12:13:47 UTC (rev 94178)
@@ -1,3 +1,16 @@
+2011-08-31  Ilya Tikhonovsky  <[email protected]>
+
+        Web Inspector: console view does a style recalculation per each addMessage call.
+        https://bugs.webkit.org/show_bug.cgi?id=67198
+
+        It is bad from the performance point of view.
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype._isScrollIntoViewScheduled):
+        (WebInspector.ConsoleView.prototype._appendConsoleMessage):
+
 2011-08-31  Alexander Pavlov  <[email protected]>
 
         [Chromium] Unreviewed build fix. Restore debugger_script_source target dependency

Modified: trunk/Source/WebCore/inspector/front-end/ConsoleView.js (94177 => 94178)


--- trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2011-08-31 12:07:26 UTC (rev 94177)
+++ trunk/Source/WebCore/inspector/front-end/ConsoleView.js	2011-08-31 12:13:47 UTC (rev 94178)
@@ -241,6 +241,11 @@
         this.toggleConsoleButton.title = WebInspector.UIString("Show console.");
     },
 
+    _isScrollIntoViewScheduled: function()
+    {
+        return !!this._scrollIntoViewTimer;
+    },
+
     _scheduleScrollIntoView: function()
     {
         if (this._scrollIntoViewTimer)
@@ -261,7 +266,10 @@
 
     _appendConsoleMessage: function(msg)
     {
-        var shouldScrollToLastMessage = this.messagesElement.isScrolledToBottom();
+        // this.messagesElement.isScrolledToBottom() is forcing style recalculation.
+        // We just skip it if the scroll action has been scheduled.
+        if (!this._isScrollIntoViewScheduled() && ((msg instanceof WebInspector.ConsoleCommandResult) || this.messagesElement.isScrolledToBottom()))
+            this._scheduleScrollIntoView();
 
         this.messages.push(msg);
 
@@ -279,10 +287,6 @@
             this.currentGroup.addMessage(msg);
         }
 
-        // Always scroll when command result arrives.
-        if (shouldScrollToLastMessage || (msg instanceof WebInspector.ConsoleCommandResult))
-            this._scheduleScrollIntoView();
-
         this.dispatchEventToListeners(WebInspector.ConsoleView.Events.EntryAdded, msg);
     },
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to