Title: [106245] trunk/Source/WebCore
Revision
106245
Author
[email protected]
Date
2012-01-30 08:17:01 -0800 (Mon, 30 Jan 2012)

Log Message

Web Inspector: keyboard navigation through comparison view in heap profiler should update retainers view
https://bugs.webkit.org/show_bug.cgi?id=77326

Keyboard navigation in the detailed heap snapshot view now updates retainers view.

Reviewed by Pavel Feldman.

* inspector/front-end/DataGrid.js: Added SelectedNode/DeselectedNode events to DataGrid.
(WebInspector.DataGridNode.prototype.select):
(WebInspector.DataGridNode.prototype.deselect):
* inspector/front-end/DetailedHeapshotView.js:
(WebInspector.DetailedHeapshotView.prototype._selectionChanged):
(WebInspector.DetailedHeapshotView.prototype._setRetainmentDataGridSource):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (106244 => 106245)


--- trunk/Source/WebCore/ChangeLog	2012-01-30 15:49:23 UTC (rev 106244)
+++ trunk/Source/WebCore/ChangeLog	2012-01-30 16:17:01 UTC (rev 106245)
@@ -1,5 +1,21 @@
 2012-01-30  Yury Semikhatsky  <[email protected]>
 
+        Web Inspector: keyboard navigation through comparison view in heap profiler should update retainers view
+        https://bugs.webkit.org/show_bug.cgi?id=77326
+
+        Keyboard navigation in the detailed heap snapshot view now updates retainers view.
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/front-end/DataGrid.js: Added SelectedNode/DeselectedNode events to DataGrid.
+        (WebInspector.DataGridNode.prototype.select):
+        (WebInspector.DataGridNode.prototype.deselect):
+        * inspector/front-end/DetailedHeapshotView.js:
+        (WebInspector.DetailedHeapshotView.prototype._selectionChanged):
+        (WebInspector.DetailedHeapshotView.prototype._setRetainmentDataGridSource):
+
+2012-01-30  Yury Semikhatsky  <[email protected]>
+
         Unreviewed. Fix inspector front-end compilation.
 
         * inspector/front-end/RemoteObject.js:

Modified: trunk/Source/WebCore/inspector/front-end/DataGrid.js (106244 => 106245)


--- trunk/Source/WebCore/inspector/front-end/DataGrid.js	2012-01-30 15:49:23 UTC (rev 106244)
+++ trunk/Source/WebCore/inspector/front-end/DataGrid.js	2012-01-30 16:17:01 UTC (rev 106245)
@@ -162,6 +162,11 @@
     this._columnWidthsInitialized = false;
 }
 
+WebInspector.DataGrid.Events = {
+    SelectedNode: "SelectedNode",
+    DeselectedNode: "DeselectedNode"
+}
+
 /**
  * @param {Array.<string>} columnNames
  * @param {Array.<string>} values
@@ -1464,8 +1469,10 @@
         if (this._element)
             this._element.addStyleClass("selected");
 
-        if (!supressSelectedEvent)
+        if (!supressSelectedEvent) {
             this.dispatchEventToListeners("selected");
+            this.dataGrid.dispatchEventToListeners(WebInspector.DataGrid.Events.SelectedNode);
+        }
     },
 
     revealAndSelect: function()
@@ -1488,8 +1495,10 @@
         if (this._element)
             this._element.removeStyleClass("selected");
 
-        if (!supressDeselectedEvent)
+        if (!supressDeselectedEvent) {
             this.dispatchEventToListeners("deselected");
+            this.dataGrid.dispatchEventToListeners(WebInspector.DataGrid.Events.DeselectedNode);
+        }
     },
 
     traverseNextNode: function(skipHidden, stayWithin, dontPopulate, info)

Modified: trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js (106244 => 106245)


--- trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js	2012-01-30 15:49:23 UTC (rev 106244)
+++ trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js	2012-01-30 16:17:01 UTC (rev 106245)
@@ -429,29 +429,29 @@
     this.containmentView = new WebInspector.View();
     this.containmentView.element.addStyleClass("view");
     this.containmentDataGrid = new WebInspector.HeapSnapshotContainmentDataGrid();
-    this.containmentDataGrid.element.addEventListener("click", this._mouseClickInContentsGrid.bind(this), true);
     this.containmentDataGrid.element.addEventListener("mousedown", this._mouseDownInContentsGrid.bind(this), true);
     this.containmentDataGrid.show(this.containmentView.element);
+    this.containmentDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this);
 
     this.constructorsView = new WebInspector.View();
     this.constructorsView.element.addStyleClass("view");
     this.constructorsDataGrid = new WebInspector.HeapSnapshotConstructorsDataGrid();
-    this.constructorsDataGrid.element.addEventListener("click", this._mouseClickInContentsGrid.bind(this), true);
     this.constructorsDataGrid.element.addEventListener("mousedown", this._mouseDownInContentsGrid.bind(this), true);
     this.constructorsDataGrid.show(this.constructorsView.element);
+    this.constructorsDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this);
 
     this.diffView = new WebInspector.View();
     this.diffView.element.addStyleClass("view");
     this.diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid();
-    this.diffDataGrid.element.addEventListener("click", this._mouseClickInContentsGrid.bind(this), true);
     this.diffDataGrid.show(this.diffView.element);
+    this.diffDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this);
 
     this.dominatorView = new WebInspector.View();
     this.dominatorView.element.addStyleClass("view");
     this.dominatorDataGrid = new WebInspector.HeapSnapshotDominatorsDataGrid();
-    this.dominatorDataGrid.element.addEventListener("click", this._mouseClickInContentsGrid.bind(this), true);
     this.dominatorDataGrid.element.addEventListener("mousedown", this._mouseDownInContentsGrid.bind(this), true);
     this.dominatorDataGrid.show(this.dominatorView.element);
+    this.dominatorDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this);
 
     this.retainmentViewHeader = document.createElement("div");
     this.retainmentViewHeader.addStyleClass("retainers-view-header");
@@ -809,18 +809,15 @@
         profile.sidebarElement.subtitle = Number.bytesToString(s.totalSize);
     },
 
-    _mouseClickInContentsGrid: function(event)
+    _selectionChanged: function(event)
     {
-        var cell = event.target.enclosingNodeOrSelfWithNodeName("td");
-        if (!cell || (!cell.hasStyleClass("object-column")))
-            return;
-        var row = event.target.enclosingNodeOrSelfWithNodeName("tr");
-        if (!row)
-            return;
-        var nodeItem = row._dataGridNode;
-        if (!nodeItem || nodeItem.isEventWithinDisclosureTriangle(event))
-            return;
-        if (nodeItem.snapshotNodeIndex)
+        var selectedNode = event.target.selectedNode;
+        this._setRetainmentDataGridSource(selectedNode);
+    },
+
+    _setRetainmentDataGridSource: function(nodeItem)
+    {
+        if (nodeItem && nodeItem.snapshotNodeIndex)
             this.retainmentDataGrid.setDataSource(this, nodeItem.isDeletedNode ? nodeItem.dataGrid.baseSnapshot : nodeItem.dataGrid.snapshot, nodeItem.snapshotNodeIndex, nodeItem.isDeletedNode ? this.baseSelectElement.childNodes[this.baseSelectElement.selectedIndex].label + " | " : "");
         else
             this.retainmentDataGrid.reset();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to