Web Inspector: Timeline: when Network Requests view is selected, in progress requests...
authorjonowells@apple.com <jonowells@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Jan 2015 05:18:01 +0000 (05:18 +0000)
committerjonowells@apple.com <jonowells@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Jan 2015 05:18:01 +0000 (05:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140090

Reviewed by Timothy Hatcher.

TimelineContentView#_updateTimes() changed to call WebInspector.timelineSidebarPanel.updateFilter() in addition
to updating the layout of the current timeline view. TimelineSidebarPanel.updateFilter() now responsible for
updating filtered resources in a TimelineView.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype._updateFilter):
Now handles updating the UI associated with filtering of navigation sidebar tree elements.

* UserInterface/Views/OverviewTimelineView.js:
(WebInspector.OverviewTimelineView.prototype.updateLayout):
No longer handles updating other UI along with the navigation sidebar tree elements. That is now handled by
WebInspector.TimelineView.prototype.filterUpdated.
(WebInspector.OverviewTimelineView.prototype._compareTreeElementsByDetails): Drive-by fix. Missing vars.

* UserInterface/Views/TimelineContentView.js:
(WebInspector.TimelineContentView.prototype._updateTimes): Add call to updateFilter().

* UserInterface/Views/TimelineView.js:
(WebInspector.TimelineView.prototype.filterUpdated):
Function added to dispatch a SelectionPathComponentsDidChange event.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178315 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js
Source/WebInspectorUI/UserInterface/Views/TimelineContentView.js
Source/WebInspectorUI/UserInterface/Views/TimelineView.js

index 6ff866c..ebcf826 100644 (file)
@@ -1,3 +1,31 @@
+2015-01-12  Jonathan Wells  <jonowells@apple.com>
+
+        Web Inspector: Timeline: when Network Requests view is selected, in progress requests are absent.
+        https://bugs.webkit.org/show_bug.cgi?id=140090
+
+        Reviewed by Timothy Hatcher.
+
+        TimelineContentView#_updateTimes() changed to call WebInspector.timelineSidebarPanel.updateFilter() in addition
+        to updating the layout of the current timeline view. TimelineSidebarPanel.updateFilter() now responsible for
+        updating filtered resources in a TimelineView.
+
+        * UserInterface/Views/NavigationSidebarPanel.js:
+        (WebInspector.NavigationSidebarPanel.prototype._updateFilter):
+        Now handles updating the UI associated with filtering of navigation sidebar tree elements.
+
+        * UserInterface/Views/OverviewTimelineView.js:
+        (WebInspector.OverviewTimelineView.prototype.updateLayout):
+        No longer handles updating other UI along with the navigation sidebar tree elements. That is now handled by
+        WebInspector.TimelineView.prototype.filterUpdated.
+        (WebInspector.OverviewTimelineView.prototype._compareTreeElementsByDetails): Drive-by fix. Missing vars.
+
+        * UserInterface/Views/TimelineContentView.js:
+        (WebInspector.TimelineContentView.prototype._updateTimes): Add call to updateFilter().
+
+        * UserInterface/Views/TimelineView.js:
+        (WebInspector.TimelineView.prototype.filterUpdated):
+        Function added to dispatch a SelectionPathComponentsDidChange event.
+
 2015-01-09  Enrica Casucci  <enrica@apple.com>
 
         [iOS] Support additional text styles.
index 10bf736..e8e1528 100644 (file)
@@ -497,6 +497,9 @@ WebInspector.NavigationSidebarPanel.prototype = {
 
     _updateFilter: function()
     {
+        var selectedTreeElement = this._contentTreeOutline.selectedTreeElement;
+        var selectionWasHidden = selectedTreeElement && selectedTreeElement.hidden;
+
         var filters = this._filterBar.filters;
         this._textFilterRegex = simpleGlobStringToRegExp(filters.text, "i");
         this._filtersSetting.value = filters;
@@ -514,6 +517,13 @@ WebInspector.NavigationSidebarPanel.prototype = {
 
         this._checkForEmptyFilterResults();
         this._updateContentOverflowShadowVisibility();
+
+        // Filter may have hidden the selected resource in the timeline view, which should now notify its listeners.
+        if (selectedTreeElement && selectedTreeElement.hidden !== selectionWasHidden) {
+            var currentContentView = WebInspector.contentBrowser.currentContentView;
+            if (currentContentView instanceof WebInspector.TimelineContentView && typeof currentContentView.currentTimelineView.filterUpdated === "function")
+                currentContentView.currentTimelineView.filterUpdated();
+        }
     },
 
     _treeElementAddedOrChanged: function(treeElement)
index 1c49dfb..392d337 100644 (file)
@@ -112,17 +112,6 @@ WebInspector.OverviewTimelineView.prototype = {
             }
         }
 
-        if (this.currentTime !== oldCurrentTime) {
-            var selectedTreeElement = this.navigationSidebarTreeOutline.selectedTreeElement;
-            var selectionWasHidden = selectedTreeElement && selectedTreeElement.hidden;
-
-            // Check the filters again since the current time change might have revealed this node. Start and end time changes are handled by TimelineContentView.
-            WebInspector.timelineSidebarPanel.updateFilter();
-
-            if (selectedTreeElement && selectedTreeElement.hidden !== selectionWasHidden)
-                this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
-        }
-
         this._timelineRuler.updateLayout();
 
         this._processPendingRepresentedObjects();
@@ -175,8 +164,8 @@ WebInspector.OverviewTimelineView.prototype = {
             return 1;
 
         if (a instanceof WebInspector.SourceCodeTimelineTreeElement && b instanceof WebInspector.SourceCodeTimelineTreeElement) {
-            aTimeline = a.sourceCodeTimeline;
-            bTimeline = b.sourceCodeTimeline;
+            var aTimeline = a.sourceCodeTimeline;
+            var bTimeline = b.sourceCodeTimeline;
 
             if (!aTimeline.sourceCodeLocation && !bTimeline.sourceCodeLocation) {
                 if (aTimeline.recordType !== bTimeline.recordType)
index 2283209..37f3e02 100644 (file)
@@ -362,6 +362,8 @@ WebInspector.TimelineContentView.prototype = {
         this._timelineOverview.currentTime = currentTime;
         this._currentTimelineView.currentTime = currentTime;
 
+        WebInspector.timelineSidebarPanel.updateFilter();
+
         // Force a layout now since we are already in an animation frame and don't need to delay it until the next.
         this._timelineOverview.updateLayoutIfNeeded();
         this._currentTimelineView.updateLayoutIfNeeded();
index 66c1141..79feb17 100644 (file)
@@ -217,6 +217,11 @@ WebInspector.TimelineView.prototype = {
         this.updateLayout();
     },
 
+    filterUpdated: function()
+    {
+        this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
+    },
+
     // Protected
 
     treeElementPathComponentSelected: function(event)