Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating ...
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2019 19:53:09 +0000 (19:53 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2019 19:53:09 +0000 (19:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196936
<rdar://problem/49917789>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView.prototype.showHeapSnapshotTimelineRecord):
(WI.HeapAllocationsTimelineView.prototype.get navigationItems):
(WI.HeapAllocationsTimelineView.prototype.get selectionPathComponents):
Drive-by: when selecting a record, force it to be visible before selecting it, as otherwise
the selection events won't be fired.

* UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
(WI.HeapAllocationsTimelineOverviewGraph.prototype.layout):
Drive-by: ensure that clicking on a [S] heap snapshot record icon actually selects the record.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244354 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js
Source/WebInspectorUI/UserInterface/Views/HeapAllocationsTimelineView.js

index 7b0e4bd..d9583c2 100644 (file)
@@ -1,5 +1,24 @@
 2019-04-16  Devin Rousso  <drousso@apple.com>
 
+        Web Inspector: Uncaught Exception: TypeError: null is not an object (evaluating 'this._contentViewContainer.currentContentView.selectionPathComponents')
+        https://bugs.webkit.org/show_bug.cgi?id=196936
+        <rdar://problem/49917789>
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/HeapAllocationsTimelineView.js:
+        (WI.HeapAllocationsTimelineView.prototype.showHeapSnapshotTimelineRecord):
+        (WI.HeapAllocationsTimelineView.prototype.get navigationItems):
+        (WI.HeapAllocationsTimelineView.prototype.get selectionPathComponents):
+        Drive-by: when selecting a record, force it to be visible before selecting it, as otherwise
+        the selection events won't be fired.
+
+        * UserInterface/Views/HeapAllocationsTimelineOverviewGraph.js:
+        (WI.HeapAllocationsTimelineOverviewGraph.prototype.layout):
+        Drive-by: ensure that clicking on a [S] heap snapshot record icon actually selects the record.
+
+2019-04-16  Devin Rousso  <drousso@apple.com>
+
         Unprefix -webkit-sticky
         https://bugs.webkit.org/show_bug.cgi?id=196962
         <rdar://problem/40903458>
index 6d3e2fc..4594ab4 100644 (file)
@@ -85,9 +85,13 @@ WI.HeapAllocationsTimelineOverviewGraph = class HeapAllocationsTimelineOverviewG
             if (!imageElement) {
                 imageElement = record[WI.HeapAllocationsTimelineOverviewGraph.RecordElementAssociationSymbol] = document.createElement("img");
                 imageElement.classList.add("snapshot");
-                imageElement.addEventListener("click", () => {
+                imageElement.addEventListener("click", (event) => {
                     if (record.heapSnapshot.invalid)
                         return;
+
+                    // Ensure that the container "click" listener added by `WI.TimelineOverview` isn't called.
+                    event.__timelineRecordClickEventHandled = true;
+
                     this.selectedRecord = record;
                 });
             }
index ca2267d..323395f 100644 (file)
@@ -153,6 +153,7 @@ WI.HeapAllocationsTimelineView = class HeapAllocationsTimelineView extends WI.Ti
 
         for (let dataGridNode of this._dataGrid.children) {
             if (dataGridNode.record === heapSnapshotTimelineRecord) {
+                dataGridNode.hidden = false;
                 dataGridNode.select();
                 break;
             }
@@ -194,7 +195,10 @@ WI.HeapAllocationsTimelineView = class HeapAllocationsTimelineView extends WI.Ti
             return items;
         }
 
-        return this._contentViewContainer.currentContentView.navigationItems;
+        if (this._contentViewContainer.currentContentView)
+            return this._contentViewContainer.currentContentView.navigationItems;
+
+        return [];
     }
 
     get selectionPathComponents()
@@ -215,7 +219,10 @@ WI.HeapAllocationsTimelineView = class HeapAllocationsTimelineView extends WI.Ti
             components.push(heapSnapshotPathComponent);
         }
 
-        return components.concat(this._contentViewContainer.currentContentView.selectionPathComponents);
+        if (this._contentViewContainer.currentContentView)
+            components = components.concat(this._contentViewContainer.currentContentView.selectionPathComponents);
+
+        return components;
     }
 
     selectRecord(record)