Title: [93861] trunk/Source/WebCore
Revision
93861
Author
mnaga...@chromium.org
Date
2011-08-26 02:56:17 -0700 (Fri, 26 Aug 2011)

Log Message

Web Inspector: [Chromium] Double clicking on numbers in Count & size columns doesn't toggle between values and percents in the Heap Snapshot.
https://bugs.webkit.org/show_bug.cgi?id=66988

Reviewed by Pavel Feldman.

* inspector/front-end/DetailedHeapshotView.js:
(WebInspector.DetailedHeapshotView.prototype._mouseClickInContentsGrid):
(WebInspector.DetailedHeapshotView.prototype._mouseDownInContentsGrid):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (93860 => 93861)


--- trunk/Source/WebCore/ChangeLog	2011-08-26 09:06:56 UTC (rev 93860)
+++ trunk/Source/WebCore/ChangeLog	2011-08-26 09:56:17 UTC (rev 93861)
@@ -1,3 +1,14 @@
+2011-08-26  Mikhail Naganov  <mnaga...@chromium.org>
+
+        Web Inspector: [Chromium] Double clicking on numbers in Count & size columns doesn't toggle between values and percents in the Heap Snapshot.
+        https://bugs.webkit.org/show_bug.cgi?id=66988
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/front-end/DetailedHeapshotView.js:
+        (WebInspector.DetailedHeapshotView.prototype._mouseClickInContentsGrid):
+        (WebInspector.DetailedHeapshotView.prototype._mouseDownInContentsGrid):
+
 2011-08-26  Shinya Kawanaka  <shin...@google.com>
 
         REGRESSION(r93390): Empty or invalid maxlength of an input tag should be ignored.

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


--- trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js	2011-08-26 09:06:56 UTC (rev 93860)
+++ trunk/Source/WebCore/inspector/front-end/DetailedHeapshotView.js	2011-08-26 09:56:17 UTC (rev 93861)
@@ -531,28 +531,31 @@
     this.containmentView = new WebInspector.View();
     this.containmentView.element.addStyleClass("view");
     this.containmentDataGrid = new WebInspector.HeapSnapshotContainmentDataGrid();
-    this.containmentDataGrid.element.addEventListener("click", this._mouseClickInContainmentGrid.bind(this), true);
+    this.containmentDataGrid.element.addEventListener("click", this._mouseClickInContentsGrid.bind(this), true);
+    this.containmentDataGrid.element.addEventListener("mousedown", this._mouseDownInContentsGrid.bind(this), true);
     this.containmentView.element.appendChild(this.containmentDataGrid.element);
     this.viewsContainer.appendChild(this.containmentView.element);
 
     this.constructorsView = new WebInspector.View();
     this.constructorsView.element.addStyleClass("view");
     this.constructorsDataGrid = new WebInspector.HeapSnapshotConstructorsDataGrid();
-    this.constructorsDataGrid.element.addEventListener("click", this._mouseClickInContainmentGrid.bind(this), true);
+    this.constructorsDataGrid.element.addEventListener("click", this._mouseClickInContentsGrid.bind(this), true);
+    this.constructorsDataGrid.element.addEventListener("mousedown", this._mouseDownInContentsGrid.bind(this), true);
     this.constructorsView.element.appendChild(this.constructorsDataGrid.element);
     this.viewsContainer.appendChild(this.constructorsView.element);
 
     this.diffView = new WebInspector.View();
     this.diffView.element.addStyleClass("view");
     this.diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid();
-    this.diffDataGrid.element.addEventListener("click", this._mouseClickInContainmentGrid.bind(this), true);
+    this.diffDataGrid.element.addEventListener("click", this._mouseClickInContentsGrid.bind(this), true);
     this.diffView.element.appendChild(this.diffDataGrid.element);
     this.viewsContainer.appendChild(this.diffView.element);
 
     this.dominatorView = new WebInspector.View();
     this.dominatorView.element.addStyleClass("view");
     this.dominatorDataGrid = new WebInspector.HeapSnapshotDominatorsDataGrid();
-    this.dominatorDataGrid.element.addEventListener("click", this._mouseClickInContainmentGrid.bind(this), true);
+    this.dominatorDataGrid.element.addEventListener("click", this._mouseClickInContentsGrid.bind(this), true);
+    this.dominatorDataGrid.element.addEventListener("mousedown", this._mouseDownInContentsGrid.bind(this), true);
     this.dominatorView.element.appendChild(this.dominatorDataGrid.element);
     this.viewsContainer.appendChild(this.dominatorView.element);
 
@@ -908,10 +911,10 @@
         profile.sidebarElement.subtitle = Number.bytesToString(s.totalSize);
     },
 
-    _mouseClickInContainmentGrid: function(event)
+    _mouseClickInContentsGrid: function(event)
     {
         var cell = event.target.enclosingNodeOrSelfWithNodeName("td");
-        if (!cell || (!cell.hasStyleClass("object-column") && !cell.hasStyleClass("shallowSize-column") && !cell.hasStyleClass("retainedSize-column")))
+        if (!cell || (!cell.hasStyleClass("object-column")))
             return;
         var row = event.target.enclosingNodeOrSelfWithNodeName("tr");
         if (!row)
@@ -925,6 +928,27 @@
             this.retainmentDataGrid.reset();
     },
 
+    _mouseDownInContentsGrid: function(event)
+    {
+        if (event.detail < 2)
+            return;
+
+        var cell = event.target.enclosingNodeOrSelfWithNodeName("td");
+        if (!cell || (!cell.hasStyleClass("count-column") && !cell.hasStyleClass("shallowSize-column") && !cell.hasStyleClass("retainedSize-column")))
+            return;
+
+        if (cell.hasStyleClass("count-column"))
+            this.showCountAsPercent = !this.showCountAsPercent;
+        else if (cell.hasStyleClass("shallowSize-column"))
+            this.showShallowSizeAsPercent = !this.showShallowSizeAsPercent;
+        else if (cell.hasStyleClass("retainedSize-column"))
+            this.showRetainedSizeAsPercent = !this.showRetainedSizeAsPercent;
+        this.refreshShowAsPercents();
+
+        event.preventDefault();
+        event.stopPropagation();
+    },
+
     _mouseClickInRetainmentGrid: function(event)
     {
         var cell = event.target.enclosingNodeOrSelfWithNodeName("td");
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to