Title: [121112] trunk/Source/WebCore
Revision
121112
Author
[email protected]
Date
2012-06-24 00:27:03 -0700 (Sun, 24 Jun 2012)

Log Message

Web Inspector: speed up Timeline and Elements panel rendering
https://bugs.webkit.org/show_bug.cgi?id=89771

Reviewed by Yury Semikhatsky.

I used timeline panel to find unnecessary style operations.

* inspector/front-end/ElementsTreeOutline.js:
(WebInspector.ElementsTreeElement.prototype.updateTitle):
* inspector/front-end/TimelinePanel.js:
(WebInspector.TimelinePanel.prototype._updateEventDividers):
(WebInspector.TimelinePanel.prototype._updateFrames):
(WebInspector.TimelinePanel.prototype.sidebarResized):
(WebInspector.TimelinePanel.prototype.onResize):
(WebInspector.TimelinePanel.prototype._onScroll):
(WebInspector.TimelinePanel.prototype._refresh):
(WebInspector.TimelinePanel.prototype._refreshRecords):
(WebInspector.TimelinePanel.prototype._adjustScrollPosition):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (121111 => 121112)


--- trunk/Source/WebCore/ChangeLog	2012-06-24 06:49:50 UTC (rev 121111)
+++ trunk/Source/WebCore/ChangeLog	2012-06-24 07:27:03 UTC (rev 121112)
@@ -1,3 +1,24 @@
+2012-06-24  Pavel Feldman  <[email protected]>
+
+        Web Inspector: speed up Timeline and Elements panel rendering
+        https://bugs.webkit.org/show_bug.cgi?id=89771
+
+        Reviewed by Yury Semikhatsky.
+
+        I used timeline panel to find unnecessary style operations.
+
+        * inspector/front-end/ElementsTreeOutline.js:
+        (WebInspector.ElementsTreeElement.prototype.updateTitle):
+        * inspector/front-end/TimelinePanel.js:
+        (WebInspector.TimelinePanel.prototype._updateEventDividers):
+        (WebInspector.TimelinePanel.prototype._updateFrames):
+        (WebInspector.TimelinePanel.prototype.sidebarResized):
+        (WebInspector.TimelinePanel.prototype.onResize):
+        (WebInspector.TimelinePanel.prototype._onScroll):
+        (WebInspector.TimelinePanel.prototype._refresh):
+        (WebInspector.TimelinePanel.prototype._refreshRecords):
+        (WebInspector.TimelinePanel.prototype._adjustScrollPosition):
+
 2012-06-23  Ryosuke Niwa  <[email protected]>
 
         Inserting nodes is slow due to Node::notifyNodeListsAttributeChanged (20%+)

Modified: trunk/Source/WebCore/inspector/front-end/ElementsTreeOutline.js (121111 => 121112)


--- trunk/Source/WebCore/inspector/front-end/ElementsTreeOutline.js	2012-06-24 06:49:50 UTC (rev 121111)
+++ trunk/Source/WebCore/inspector/front-end/ElementsTreeOutline.js	2012-06-24 07:27:03 UTC (rev 121112)
@@ -1470,7 +1470,8 @@
         }
 
         delete this.selectionElement;
-        this.updateSelection();
+        if (this.selected)
+            this.updateSelection();
         this._preventFollowingLinksOnDoubleClick();
         this._highlightSearchResults();
     },
@@ -1845,6 +1846,9 @@
         }
 
         var updatedParentTreeElements = [];
+        var treeOutlineContainerElement = this._treeOutline.element.parentNode;
+        var originalScrollTop = treeOutlineContainerElement ? treeOutlineContainerElement.scrollTop : 0;
+        this._treeOutline.element.addStyleClass("hidden");
 
         for (var i = 0; i < this._recentlyModifiedNodes.length; ++i) {
             var parent = this._recentlyModifiedNodes[i].parent;
@@ -1852,6 +1856,7 @@
             if (parent === this._treeOutline._rootDOMNode) {
                 // Document's children have changed, perform total update.
                 this._treeOutline.update();
+                this._treeOutline.element.removeStyleClass("hidden");
                 return;
             }
 
@@ -1878,6 +1883,9 @@
         for (var i = 0; i < updatedParentTreeElements.length; ++i)
             delete updatedParentTreeElements[i].alreadyUpdatedChildren;
 
+        this._treeOutline.element.removeStyleClass("hidden");
+        if (originalScrollTop)
+            treeOutlineContainerElement.scrollTop = originalScrollTop;
         this._recentlyModifiedNodes = [];
     },
 

Modified: trunk/Source/WebCore/inspector/front-end/TimelinePanel.js (121111 => 121112)


--- trunk/Source/WebCore/inspector/front-end/TimelinePanel.js	2012-06-24 06:49:50 UTC (rev 121111)
+++ trunk/Source/WebCore/inspector/front-end/TimelinePanel.js	2012-06-24 07:27:03 UTC (rev 121112)
@@ -53,6 +53,8 @@
     this.element.appendChild(this._sidebarBackgroundElement);
 
     this.createSplitViewWithSidebarTree();
+    this.element.appendChild(this.splitView.sidebarResizerElement);
+
     this._containerElement = this.splitView.element;
     this._containerElement.id = "timeline-container";
     this._containerElement.addEventListener("scroll", this._onScroll.bind(this), false);
@@ -332,7 +334,7 @@
     _updateEventDividers: function()
     {
         this._timelineGrid.removeEventDividers();
-        var clientWidth = this._graphRowsElement.offsetWidth;
+        var clientWidth = this._graphRowsElementWidth;
         var dividers = [];
 
         for (var i = 0; i < this._timeStampRecords.length; ++i) {
@@ -356,7 +358,7 @@
     _updateFrames: function()
     {
         var frames = this._presentationModel.frames();
-        var clientWidth = this._graphRowsElement.offsetWidth;
+        var clientWidth = this._graphRowsElementWidth;
         if (this._frameContainer)
             this._frameContainer.removeChildren();
         else {
@@ -514,20 +516,21 @@
     {
         var width = event.data;
         this._sidebarBackgroundElement.style.width = width + "px";
-        this._scheduleRefresh(false);
+        this.onResize();
         this._overviewPane.sidebarResized(width);
         // Min width = <number of buttons on the left> * 31
         this.statusBarFilters.style.left = Math.max((this.statusBarItems.length + 2) * 31, width) + "px";
         this._memoryStatistics.setSidebarWidth(width);
         this._timelineGrid.gridHeaderElement.style.left = width + "px";
-        this._timelineGrid.gridHeaderElement.style.width = this._itemsGraphsElement.offsetWidth + "px";
     },
 
     onResize: function()
     {
         this._closeRecordDetails();
         this._scheduleRefresh(false);
+        this._graphRowsElementWidth = this._graphRowsElement.offsetWidth;
         this._timelineGrid.gridHeaderElement.style.width = this._itemsGraphsElement.offsetWidth + "px";
+        this._containerElementHeight = this._containerElement.clientHeight;
     },
 
     _clearPanel: function()
@@ -579,9 +582,9 @@
     _onScroll: function(event)
     {
         this._closeRecordDetails();
-        var scrollTop = this._containerElement.scrollTop;
-        var dividersTop = Math.max(0, scrollTop);
-        this._timelineGrid.setScrollAndDividerTop(scrollTop, dividersTop);
+        this._scrollTop = this._containerElement.scrollTop;
+        var dividersTop = Math.max(0, this._scrollTop);
+        this._timelineGrid.setScrollAndDividerTop(this._scrollTop, dividersTop);
         this._scheduleRefresh(true);
     },
 
@@ -609,7 +612,7 @@
         }
 
         this._calculator.setWindow(this._overviewPane.windowStartTime(), this._overviewPane.windowEndTime());
-        this._calculator.setDisplayWindow(!this._overviewPane.windowLeft() ? this._expandOffset : 0, this._graphRowsElement.clientWidth);
+        this._calculator.setDisplayWindow(!this._overviewPane.windowLeft() ? this._expandOffset : 0, this._graphRowsElementWidth);
 
         var recordsInWindowCount = this._refreshRecords();
         this._updateRecordsCounter(recordsInWindowCount);
@@ -660,9 +663,8 @@
         var recordsInWindow = this._presentationModel.filteredRecords();
 
         // Calculate the visible area.
-        this._scrollTop = this._containerElement.scrollTop;
         var visibleTop = this._scrollTop;
-        var visibleBottom = visibleTop + this._containerElement.clientHeight;
+        var visibleBottom = visibleTop + this._containerElementHeight;
 
         const rowHeight = WebInspector.TimelinePanel.rowHeight;
 
@@ -683,12 +685,11 @@
         const top = (startIndex * rowHeight) + "px";
         this._topGapElement.style.height = top;
         this.sidebarElement.style.top = top;
-        this.splitView.sidebarResizerElement.style.top = top;
         this._bottomGapElement.style.height = (recordsInWindow.length - endIndex) * rowHeight + "px";
 
         // Update visible rows.
         var listRowElement = this._sidebarListElement.firstChild;
-        var width = this._graphRowsElement.offsetWidth;
+        var width = this._graphRowsElementWidth;
         this._itemsGraphsElement.removeChild(this._graphRowsElement);
         var graphRowElement = this._graphRowsElement.firstChild;
         var scheduleRefreshCallback = this._scheduleRefresh.bind(this, true);
@@ -738,7 +739,6 @@
 
         this._itemsGraphsElement.insertBefore(this._graphRowsElement, this._bottomGapElement);
         this._itemsGraphsElement.appendChild(this._expandElements);
-        this.splitView.sidebarResizerElement.style.height = this.sidebarElement.clientHeight + "px";
         this._adjustScrollPosition((recordsInWindow.length + 1) * rowHeight);
 
         return recordsInWindow.length;
@@ -747,7 +747,7 @@
     _adjustScrollPosition: function(totalHeight)
     {
         // Prevent the container from being scrolled off the end.
-        if ((this._containerElement.scrollTop + this._containerElement.offsetHeight) > totalHeight + 1)
+        if ((this._scrollTop + this._containerElementHeight) > totalHeight + 1)
             this._containerElement.scrollTop = (totalHeight - this._containerElement.offsetHeight);
     },
 

Modified: trunk/Source/WebCore/inspector/front-end/timelinePanel.css (121111 => 121112)


--- trunk/Source/WebCore/inspector/front-end/timelinePanel.css	2012-06-24 06:49:50 UTC (rev 121111)
+++ trunk/Source/WebCore/inspector/front-end/timelinePanel.css	2012-06-24 07:27:03 UTC (rev 121112)
@@ -45,6 +45,10 @@
     bottom: auto;
 }
 
+.timeline .split-view-resizer {
+    top: 20px;
+}
+
 .timeline-sidebar-background {
     top: 90px;
     bottom: 0;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to