Title: [171679] branches/safari-600.1-branch/Source/WebInspectorUI

Diff

Modified: branches/safari-600.1-branch/Source/WebInspectorUI/ChangeLog (171678 => 171679)


--- branches/safari-600.1-branch/Source/WebInspectorUI/ChangeLog	2014-07-28 16:02:03 UTC (rev 171678)
+++ branches/safari-600.1-branch/Source/WebInspectorUI/ChangeLog	2014-07-28 16:09:19 UTC (rev 171679)
@@ -1,3 +1,50 @@
+2014-07-28  Matthew Hanson  <matthew_han...@apple.com>
+
+        Merge r171645. <rdar://problem/17818693>
+
+    2014-07-26  Joseph Pecoraro  <pecor...@apple.com>
+    
+            Web Inspector: Timelines performance is very slow, has many forced layouts
+            https://bugs.webkit.org/show_bug.cgi?id=135313
+    
+            Reviewed by Timothy Hatcher.
+    
+            * UserInterface/Views/NavigationItem.js:
+            (WebInspector.NavigationItem):
+            (WebInspector.NavigationItem.prototype.get hidden):
+            (WebInspector.NavigationItem.prototype.set hidden):
+            Don't have the parent navigation bar update layout if the hidden state did not change.
+            This greatly reduces the number of forced layouts as timeline nodes are added.
+    
+            * UserInterface/Views/NavigationSidebarPanel.js:
+            (WebInspector.NavigationSidebarPanel.prototype.showEmptyContentPlaceholder):
+            (WebInspector.NavigationSidebarPanel.prototype.hideEmptyContentPlaceholder):
+            Don't do any work if this is not changing the view.
+    
+            (WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibilitySoon):
+            (WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibility):
+            (WebInspector.NavigationSidebarPanel.prototype._treeElementAddedOrChanged):
+            When first selecting a specific timeline (Layout / Scripts) we would have a very long hang
+            updating the content. Most of this was time spent updating the overflow shadow visibility
+            because every single tree element addition was causing a layout invalidation and forced layout.
+            Coalesce all of the tree element adds into a single update at the end.
+    
+            * UserInterface/Views/TimelineOverview.js:
+            (WebInspector.TimelineOverview.prototype.updateLayout):
+            Calculating the visible duration checks offsetLeft. Calculate this once, outside
+            of a loop down below, to prevent or reduce possible forced layouts.
+    
+            * UserInterface/Views/TreeOutline.js:
+            (TreeElement.prototype.revealed):
+            Prevent doing any work for timeline tree elements outside of the selected time range.
+            Previously they were considered revealed if a parent was expanded, even though that
+            parent was hidden. This greatly reduces the amount of work during a recording, since
+            previously we were potentially doing a forced layout for hidden nodes.
+    
+            * UserInterface/Views/TimelineSidebarPanel.js:
+            (WebInspector.TimelineSidebarPanel.prototype.treeElementForRepresentedObject.looselyCompareRepresentedObjects):
+            Ignore ProfileNode, which may happen here in the Script timeline.
+    
 2014-07-22  Dana Burkart  <dburk...@apple.com>
 
         Merge r171312.

Modified: branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/NavigationItem.js (171678 => 171679)


--- branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/NavigationItem.js	2014-07-28 16:02:03 UTC (rev 171678)
+++ branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/NavigationItem.js	2014-07-28 16:09:19 UTC (rev 171679)
@@ -29,6 +29,7 @@
     this._identifier = identifier || null;
 
     this._element = document.createElement("div");
+    this._hidden = false;
     
     if (role) 
         this._element.setAttribute("role", role);
@@ -73,11 +74,16 @@
 
     get hidden()
     {
-        return this._element.classList.contains(WebInspector.NavigationItem.HiddenStyleClassName);
+        return this._hidden;
     },
 
     set hidden(flag)
     {
+        if (this._hidden === flag)
+            return;
+
+        this._hidden = flag;
+
         if (flag)
             this._element.classList.add(WebInspector.NavigationItem.HiddenStyleClassName);
         else

Modified: branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js (171678 => 171679)


--- branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js	2014-07-28 16:02:03 UTC (rev 171678)
+++ branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js	2014-07-28 16:09:19 UTC (rev 171679)
@@ -261,6 +261,9 @@
     {
         console.assert(message);
 
+        if (this._emptyContentPlaceholderMessageElement.parentNode && this._emptyContentPlaceholderMessageElement.textContent === message)
+            return;
+
         this._emptyContentPlaceholderMessageElement.textContent = message;
         this.element.appendChild(this._emptyContentPlaceholderElement);
 
@@ -271,9 +274,11 @@
 
     hideEmptyContentPlaceholder: function()
     {
-        if (this._emptyContentPlaceholderElement.parentNode)
-            this._emptyContentPlaceholderElement.parentNode.removeChild(this._emptyContentPlaceholderElement);
+        if (!this._emptyContentPlaceholderElement.parentNode)
+            return;
 
+        this._emptyContentPlaceholderElement.parentNode.removeChild(this._emptyContentPlaceholderElement);
+
         this._hideToolbarItemWhenEmpty = false;
         this._updateToolbarItemVisibility();
         this._updateContentOverflowShadowVisibility();
@@ -423,9 +428,19 @@
     },
 
     // Private
+    
+    _updateContentOverflowShadowVisibilitySoon: function()
+    {
+        if (this._updateContentOverflowShadowVisibilityIdentifier)
+            return;
 
+        this._updateContentOverflowShadowVisibilityIdentifier = setTimeout(this._updateContentOverflowShadowVisibility.bind(this), 0);
+    },
+
     _updateContentOverflowShadowVisibility: function()
     {
+        delete this._updateContentOverflowShadowVisibilityIdentifier;
+
         this.updateCustomContentOverflow();
 
         var scrollHeight = this._contentElement.scrollHeight;
@@ -520,7 +535,7 @@
         }
 
         this._checkForEmptyFilterResults();
-        this._updateContentOverflowShadowVisibility();
+        this._updateContentOverflowShadowVisibilitySoon();
         this._checkElementsForPendingViewStateCookie(treeElement);
     },
 

Modified: branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js (171678 => 171679)


--- branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2014-07-28 16:02:03 UTC (rev 171678)
+++ branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js	2014-07-28 16:09:19 UTC (rev 171679)
@@ -234,8 +234,10 @@
             delete this._revealCurrentTime;
         }
 
+        const visibleDuration = this.visibleDuration;
+
         // Clamp the scroll start time to match what the scroll bar would allow.
-        var scrollStartTime = Math.min(this._scrollStartTime, this._endTime - this.visibleDuration);
+        var scrollStartTime = Math.min(this._scrollStartTime, this._endTime - visibleDuration);
         scrollStartTime = Math.max(this._startTime, scrollStartTime);
 
         this._timelineRuler.zeroTime = this._startTime;
@@ -253,7 +255,7 @@
             timelineOverviewGraph.zeroTime = this._startTime;
             timelineOverviewGraph.startTime = scrollStartTime;
             timelineOverviewGraph.currentTime = this._currentTime;
-            timelineOverviewGraph.endTime = scrollStartTime + this.visibleDuration;
+            timelineOverviewGraph.endTime = scrollStartTime + visibleDuration;
             timelineOverviewGraph.updateLayout();
         }
     },

Modified: branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js (171678 => 171679)


--- branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js	2014-07-28 16:02:03 UTC (rev 171678)
+++ branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TimelineSidebarPanel.js	2014-07-28 16:09:19 UTC (rev 171679)
@@ -197,6 +197,9 @@
                 return false;
             }
 
+            if (candidateRepresentedObject instanceof WebInspector.ProfileNode)
+                return false;
+
             console.error("Unknown TreeElement");
             return false;
         }

Modified: branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js (171678 => 171679)


--- branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2014-07-28 16:02:03 UTC (rev 171678)
+++ branches/safari-600.1-branch/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js	2014-07-28 16:09:19 UTC (rev 171679)
@@ -909,10 +909,15 @@
 
 TreeElement.prototype.revealed = function()
 {
+    if (this.hidden)
+        return false;
+
     var currentAncestor = this.parent;
     while (currentAncestor && !currentAncestor.root) {
         if (!currentAncestor.expanded)
             return false;
+        if (!currentAncestor.hidden)
+            return false;
         currentAncestor = currentAncestor.parent;
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to