Title: [202011] trunk/Source/WebInspectorUI
Revision
202011
Author
[email protected]
Date
2016-06-13 15:44:26 -0700 (Mon, 13 Jun 2016)

Log Message

Web Inspector: Filter Records not applying to new records
https://bugs.webkit.org/show_bug.cgi?id=158213
<rdar://problem/26543912>

Reviewed by Timothy Hatcher.

This patch makes the following improvements to timeline grid filtering:

    - Records are filtered as they are added to the grid.
    - Timeline view no longer triggers a filter refresh while the
      current time changes while recording.
    - Filters are refreshed whenever the current timeline view changes.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid.prototype.hasFilters):
Helper function to check for custom and text filters.

(WebInspector.DataGrid.prototype._applyFiltersToNodeAndDispatchEvent):
Encapsulate node state change and event dispatch, which was previously
done in multiple places.

(WebInspector.DataGrid.prototype.insertChild):
Filter incoming node if needed.

(WebInspector.DataGrid.prototype._updateFilter.createIteratorForNodesToBeFiltered):
(WebInspector.DataGrid.prototype._updateFilter):
(WebInspector.DataGrid.prototype.yieldableTaskWillProcessItem):
Use new convenience functions.

(WebInspector.DataGrid.prototype.hasCustomFilters): Deleted.
Renamed `hasFilters`.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype._currentContentViewDidChange):
Refresh grid filters on view change.

* UserInterface/Views/TimelineView.js:
(WebInspector.TimelineView.prototype.set startTime):
(WebInspector.TimelineView.prototype.set endTime):
Schedule filter change notification when selection bounds changes.

(WebInspector.TimelineView.prototype._timesDidChange):
(WebInspector.TimelineView.prototype._scheduleFilterDidChange):
(WebInspector.TimelineView):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (202010 => 202011)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-06-13 22:43:20 UTC (rev 202010)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-06-13 22:44:26 UTC (rev 202011)
@@ -1,3 +1,50 @@
+2016-06-13  Matt Baker  <[email protected]>
+
+        Web Inspector: Filter Records not applying to new records
+        https://bugs.webkit.org/show_bug.cgi?id=158213
+        <rdar://problem/26543912>
+
+        Reviewed by Timothy Hatcher.
+
+        This patch makes the following improvements to timeline grid filtering:
+
+            - Records are filtered as they are added to the grid.
+            - Timeline view no longer triggers a filter refresh while the
+              current time changes while recording.
+            - Filters are refreshed whenever the current timeline view changes.
+
+        * UserInterface/Views/DataGrid.js:
+        (WebInspector.DataGrid.prototype.hasFilters):
+        Helper function to check for custom and text filters.
+
+        (WebInspector.DataGrid.prototype._applyFiltersToNodeAndDispatchEvent):
+        Encapsulate node state change and event dispatch, which was previously
+        done in multiple places.
+
+        (WebInspector.DataGrid.prototype.insertChild):
+        Filter incoming node if needed.
+
+        (WebInspector.DataGrid.prototype._updateFilter.createIteratorForNodesToBeFiltered):
+        (WebInspector.DataGrid.prototype._updateFilter):
+        (WebInspector.DataGrid.prototype.yieldableTaskWillProcessItem):
+        Use new convenience functions.
+
+        (WebInspector.DataGrid.prototype.hasCustomFilters): Deleted.
+        Renamed `hasFilters`.
+
+        * UserInterface/Views/TimelineRecordingContentView.js:
+        (WebInspector.TimelineRecordingContentView.prototype._currentContentViewDidChange):
+        Refresh grid filters on view change.
+
+        * UserInterface/Views/TimelineView.js:
+        (WebInspector.TimelineView.prototype.set startTime):
+        (WebInspector.TimelineView.prototype.set endTime):
+        Schedule filter change notification when selection bounds changes.
+
+        (WebInspector.TimelineView.prototype._timesDidChange):
+        (WebInspector.TimelineView.prototype._scheduleFilterDidChange):
+        (WebInspector.TimelineView):
+
 2016-06-13  Saam Barati  <[email protected]>
 
         Web Inspector: Call Trees view should have a 'Top Functions'-like mode

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js (202010 => 202011)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js	2016-06-13 22:43:20 UTC (rev 202010)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js	2016-06-13 22:44:26 UTC (rev 202011)
@@ -364,9 +364,9 @@
         this._scheduledFilterUpdateIdentifier = requestAnimationFrame(this._updateFilter.bind(this));
     }
 
-    hasCustomFilters()
+    hasFilters()
     {
-        return this._hasFilterDelegate();
+        return this._textFilterRegex || this._hasFilterDelegate();
     }
 
     matchNodeAgainstCustomFilters(node)
@@ -387,9 +387,19 @@
         }
     }
 
+    _applyFiltersToNodeAndDispatchEvent(node)
+    {
+        const nodeWasHidden = node.hidden;
+        this._applyFiltersToNode(node);
+        if (nodeWasHidden !== node.hidden)
+            this.dispatchEventToListeners(WebInspector.DataGrid.Event.NodeWasFiltered, {node});
+
+        return nodeWasHidden !== node.hidden;
+    }
+
     _applyFiltersToNode(node)
     {
-        if (!this._textFilterRegex && !this.hasCustomFilters()) {
+        if (!this.hasFilters()) {
             // No filters, so make everything visible.
             node.hidden = false;
 
@@ -1195,6 +1205,11 @@
 
         if (this.expanded)
             child._attach();
+
+        if (!this.dataGrid.hasFilters())
+            return;
+
+        this.dataGrid._applyFiltersToNodeAndDispatchEvent(child);
     }
 
     removeChild(child)
@@ -1843,7 +1858,7 @@
         {
             // Don't populate if we don't have any active filters.
             // We only need to populate when a filter needs to reveal.
-            let dontPopulate = !this._textFilterRegex && !this.hasCustomFilters();
+            let dontPopulate = !this.hasFilters();
 
             let currentNode = this._rows[0];
             while (currentNode && !currentNode.root) {
@@ -1864,13 +1879,9 @@
 
     yieldableTaskWillProcessItem(task, node)
     {
-        const nodeWasHidden = node.hidden;
-        this._applyFiltersToNode(node);
-        if (nodeWasHidden === node.hidden)
-            return;
-
-        this.dispatchEventToListeners(WebInspector.DataGrid.Event.NodeWasFiltered, {node});
-        this._filterDidModifyNodeWhileProcessingItems = true;
+        let nodeWasModified = this._applyFiltersToNodeAndDispatchEvent(node);
+        if (nodeWasModified)
+            this._filterDidModifyNodeWhileProcessingItems = true;
     }
 
     yieldableTaskDidYield(task, processedItems, elapsedTime)

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js (202010 => 202011)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js	2016-06-13 22:43:20 UTC (rev 202010)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js	2016-06-13 22:44:26 UTC (rev 202011)
@@ -282,6 +282,7 @@
 
         if (timelineView) {
             this._updateTimelineViewTimes(timelineView);
+            this._filterDidChange();
 
             let timeline = null;
             if (timelineView.representedObject instanceof WebInspector.Timeline)

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js (202010 => 202011)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js	2016-06-13 22:43:20 UTC (rev 202010)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineView.js	2016-06-13 22:44:26 UTC (rev 202011)
@@ -105,6 +105,7 @@
         this._startTime = x;
 
         this._timesDidChange();
+        this._scheduleFilterDidChange();
     }
 
     get endTime()
@@ -122,6 +123,7 @@
         this._endTime = x;
 
         this._timesDidChange();
+        this._scheduleFilterDidChange();
     }
 
     get currentTime()
@@ -323,7 +325,10 @@
     {
         if (!WebInspector.timelineManager.isCapturing() || this.showsLiveRecordingData)
             this.needsLayout();
+    }
 
+    _scheduleFilterDidChange()
+    {
         if (!this._timelineDataGrid || this._updateFilterTimeout)
             return;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to