+2015-08-04 Matt Baker <mattbaker@apple.com>
+
+ Web Inspector: Layout & Rendering timeline grid should show TimelineRecord parent/child relationships
+ https://bugs.webkit.org/show_bug.cgi?id=147468
+
+ Reviewed by Brian Burg.
+
+ Layout timeline data grid now shows record nesting for Layout and Composite events.
+
+ * UserInterface/Controllers/TimelineManager.js:
+ (WebInspector.TimelineManager.prototype.eventRecorded):
+ * UserInterface/Models/TimelineRecord.js:
+ (WebInspector.TimelineRecord.prototype.get parent):
+ (WebInspector.TimelineRecord.prototype.set parent):
+ Preserve timeline record parent/child relationship.
+
+ * UserInterface/Views/LayoutTimelineView.js:
+ (WebInspector.LayoutTimelineView):
+ Style change for disclosure triangle support.
+ (WebInspector.LayoutTimelineView.prototype._layoutTimelineRecordAdded):
+ Only process immediate children of the rendering frame record.
+
2015-08-04 Devin Rousso <drousso@apple.com>
Web Inspector: "No Filter Results" overlaps other UI elements when docked Inspector is small
console.assert(timeline.type === WebInspector.TimelineRecord.Type.Layout, timeline);
- this.navigationSidebarTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName);
this.navigationSidebarTreeOutline.element.classList.add("layout");
var columns = {eventType: {}, location: {}, width: {}, height: {}, startTime: {}, totalTime: {}};
var dataGridNode = new WebInspector.LayoutTimelineDataGridNode(layoutTimelineRecord, this.zeroTime);
this._dataGrid.addRowInSortOrder(treeElement, dataGridNode);
+
+ var stack = [{children: layoutTimelineRecord.children, parentTreeElement: treeElement, index: 0}];
+ while (stack.length) {
+ var entry = stack.lastValue;
+ if (entry.index >= entry.children.length) {
+ stack.pop();
+ continue;
+ }
+
+ var childRecord = entry.children[entry.index];
+ console.assert(childRecord.type === WebInspector.TimelineRecord.Type.Layout, childRecord);
+
+ var childTreeElement = new WebInspector.TimelineRecordTreeElement(childRecord, WebInspector.SourceCodeLocation.NameStyle.Short);
+ var layoutDataGridNode = new WebInspector.LayoutTimelineDataGridNode(childRecord, this.zeroTime);
+ console.assert(entry.parentTreeElement, "entry without parent!");
+ this._dataGrid.addRowInSortOrder(childTreeElement, layoutDataGridNode, entry.parentTreeElement);
+
+ if (childTreeElement && childRecord.children.length)
+ stack.push({children: childRecord.children, parentTreeElement: childTreeElement, index: 0});
+ ++entry.index;
+ }
}
this._pendingRecords = [];
var layoutTimelineRecord = event.data.record;
console.assert(layoutTimelineRecord instanceof WebInspector.LayoutTimelineRecord);
+ // Only add top-level records, to avoid processing child records multiple times.
+ if (!(layoutTimelineRecord.parent instanceof WebInspector.RenderingFrameTimelineRecord))
+ return;
+
this._pendingRecords.push(layoutTimelineRecord);
this.needsLayout();