https://bugs.webkit.org/show_bug.cgi?id=147960
Reviewed by Timothy Hatcher.
* UserInterface/Models/RenderingFrameTimelineRecord.js:
(WebInspector.RenderingFrameTimelineRecord.taskTypeForTimelineRecord):
New static method for mapping TimelineRecords to rendering frame tasks.
(WebInspector.RenderingFrameTimelineRecord.prototype.durationForTask):
Refactored to use taskTypeForTimelineRecord.
* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel.prototype.matchTreeElementAgainstCustomFilters):
Task filtering is applied to children of the frame record only. Parent frame
record is hidden by default, and visible by virtue of having unfiltered children.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188398
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-08-13 Matt Baker <mattbaker@apple.com>
+
+ Web Inspector: Hide child rows for filtered tasks in the Rendering Frames data grid
+ https://bugs.webkit.org/show_bug.cgi?id=147960
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Models/RenderingFrameTimelineRecord.js:
+ (WebInspector.RenderingFrameTimelineRecord.taskTypeForTimelineRecord):
+ New static method for mapping TimelineRecords to rendering frame tasks.
+ (WebInspector.RenderingFrameTimelineRecord.prototype.durationForTask):
+ Refactored to use taskTypeForTimelineRecord.
+
+ * UserInterface/Views/TimelineSidebarPanel.js:
+ (WebInspector.TimelineSidebarPanel.prototype.matchTreeElementAgainstCustomFilters):
+ Task filtering is applied to children of the frame record only. Parent frame
+ record is hidden by default, and visible by virtue of having unfiltered children.
+
2015-08-13 Matt Baker <mattbaker@apple.com>
Web Inspector: Clearing frames timeline doesn't remove current time marker
}
}
+ static taskTypeForTimelineRecord(record)
+ {
+ switch(record.type) {
+ case WebInspector.TimelineRecord.Type.Script:
+ return WebInspector.RenderingFrameTimelineRecord.TaskType.Script;
+ case WebInspector.TimelineRecord.Type.Layout:
+ if (record.eventType === WebInspector.LayoutTimelineRecord.EventType.Paint || record.eventType === WebInspector.LayoutTimelineRecord.EventType.Composite)
+ return WebInspector.RenderingFrameTimelineRecord.TaskType.Paint;
+ return WebInspector.RenderingFrameTimelineRecord.TaskType.Layout;
+ default:
+ console.error("Unsupported timeline record type: " + record.type);
+ return null;
+ }
+ }
+
// Public
get frameIndex()
if (this._durationByTaskType.has(taskType))
return this._durationByTaskType.get(taskType);
- function validRecordForTaskType(record)
- {
- switch(taskType) {
- case WebInspector.RenderingFrameTimelineRecord.TaskType.Script:
- return record.type === WebInspector.TimelineRecord.Type.Script;
- case WebInspector.RenderingFrameTimelineRecord.TaskType.Layout:
- return record.type === WebInspector.TimelineRecord.Type.Layout && record.eventType !== WebInspector.LayoutTimelineRecord.EventType.Paint && record.eventType !== WebInspector.LayoutTimelineRecord.EventType.Composite;
- case WebInspector.RenderingFrameTimelineRecord.TaskType.Paint:
- return record.eventType === WebInspector.LayoutTimelineRecord.EventType.Paint || record.eventType === WebInspector.LayoutTimelineRecord.EventType.Composite;
- default:
- console.error("Unsupported task type: " + taskType);
- return false;
- }
- }
-
var duration;
if (taskType === WebInspector.RenderingFrameTimelineRecord.TaskType.Other)
duration = this._calculateDurationRemainder();
else {
duration = this.children.reduce(function(previousValue, currentValue) {
- if (!validRecordForTaskType(currentValue))
+ if (taskType !== WebInspector.RenderingFrameTimelineRecord.taskTypeForTimelineRecord(currentValue))
return previousValue;
var currentDuration = currentValue.duration;
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)