Web Inspector: Hide child rows for filtered tasks in the Rendering Frames data grid
[WebKit-https.git] / Source / WebInspectorUI / UserInterface / Views / TimelineSidebarPanel.js
index ffa05e593ce7d48fe6416e0f52bedc288464f5f6..d5fbe2822f1ca8459b5b60234ada7a71cb108eb5 100644 (file)
@@ -395,23 +395,18 @@ WebInspector.TimelineSidebarPanel = class TimelineSidebarPanel extends WebInspec
             return true;
 
         if (this._viewMode === WebInspector.TimelineSidebarPanel.ViewMode.RenderingFrames && this._renderingFrameTaskFilter.size) {
-            while (treeElement && !(treeElement.record instanceof WebInspector.RenderingFrameTimelineRecord))
+            while (treeElement && !(treeElement.record instanceof WebInspector.TimelineRecord))
                 treeElement = treeElement.parent;
 
-            console.assert(treeElement, "Cannot apply task filter: no RenderingFrameTimelineRecord found.");
+            console.assert(treeElement, "Cannot apply task filter: no TimelineRecord found.");
             if (!treeElement)
                 return false;
 
             var visible = false;
-            for (var key in WebInspector.RenderingFrameTimelineRecord.TaskType) {
-                var taskType = WebInspector.RenderingFrameTimelineRecord.TaskType[key];
-                if (taskType === WebInspector.RenderingFrameTimelineRecord.TaskType.Other)
-                    continue;
-
-                if (!this._renderingFrameTaskFilter.has(taskType) && treeElement.record.durationForTask(taskType) > 0) {
+            if (!(treeElement.record instanceof WebInspector.RenderingFrameTimelineRecord)) {
+                var taskType = WebInspector.RenderingFrameTimelineRecord.taskTypeForTimelineRecord(treeElement.record);
+                if (!this._renderingFrameTaskFilter.has(taskType))
                     visible = true;
-                    break;
-                }
             }
 
             if (!visible)