Web Inspector: Redesign summary view / retaining tree contents
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Feb 2012 16:20:23 +0000 (16:20 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Feb 2012 16:20:23 +0000 (16:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77870

Patch by Alexei Filippov <alexeif@chromium.org> on 2012-02-06
Reviewed by Pavel Feldman.

1. Make object IDs less contrast.
2. Put array indices in [].
3. Do not write type if it's just "Object".

Source/WebCore:

* inspector/front-end/DetailedHeapshotGridNodes.js:
(WebInspector.HeapSnapshotGenericObjectNode.prototype._createObjectCell):
(WebInspector.HeapSnapshotGenericObjectNode.prototype.get data):
(WebInspector.HeapSnapshotObjectNode.prototype._emptyData):
(WebInspector.HeapSnapshotObjectNode.prototype._enhanceData):
(WebInspector.HeapSnapshotObjectNode.prototype._prefixObjectCell):
(WebInspector.HeapSnapshotConstructorNode.prototype.get data):
* inspector/front-end/heapProfiler.css:
(.detailed-heapshot-view .console-formatted-id):
(.detailed-heapshot-view td.object-column span.grayed):

LayoutTests:

* inspector/profiler/detailed-heapshots-test.js:
(initialize_DetailedHeapshotTest.):
(initialize_DetailedHeapshotTest):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106808 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/inspector/profiler/detailed-heapshots-test.js
Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/DetailedHeapshotGridNodes.js
Source/WebCore/inspector/front-end/heapProfiler.css

index 4b616b128ff26ef9cfa7bc9ce7facb8151fa1ac0..ef95f81a33e6aced583b352d7ae60046a27b224f 100644 (file)
@@ -1,3 +1,18 @@
+2012-02-06  Alexei Filippov  <alexeif@chromium.org>
+
+        Web Inspector: Redesign summary view / retaining tree contents
+        https://bugs.webkit.org/show_bug.cgi?id=77870
+
+        Reviewed by Pavel Feldman.
+
+        1. Make object IDs less contrast.
+        2. Put array indices in [].
+        3. Do not write type if it's just "Object".
+
+        * inspector/profiler/detailed-heapshots-test.js:
+        (initialize_DetailedHeapshotTest.):
+        (initialize_DetailedHeapshotTest):
+
 2012-02-03  Hans Wennborg  <hans@chromium.org>
 
         Speech input: fix fast/speech/bubble-position.html
index 5370226c5dcee01e701bd68c8465975dccd61b6e..84aa48f16e5727262be62442220d576652baab4a 100644 (file)
@@ -122,12 +122,9 @@ InspectorTest.checkArrayIsSorted = function(contents, sortType, sortOrder)
     function extractId(data)
     {
         data = JSON.parse(data);
-        if (!data.value)
-            InspectorTest.addResult("No value field in " + JSON.stringify(data));
-        var indexOfAt = data.value.indexOf("@");
-        if (indexOfAt === -1)
-            InspectorTest.addResult("Can't find @ in " + data.value);
-        return parseInt(data.value.substring(indexOfAt + 1), 10);
+        if (!data.nodeId)
+            InspectorTest.addResult("No nodeId field in " + JSON.stringify(data));
+        return parseInt(data.nodeId, 10);
     }
     var comparator = {
         text: simpleComparator,
@@ -305,7 +302,7 @@ InspectorTest.findAndExpandGCRoots = function(callback)
     callback = InspectorTest.safeWrap(callback);
     function propertyMatcher(data)
     {
-        return data.value === "(GC roots): @3";
+        return data.value === "(GC roots)";
     }
     var gcRoots = InspectorTest.findRow("object", propertyMatcher);
     InspectorTest.assertEquals(true, !!gcRoots, "GC roots row");
index 331ab71190b5f0a613343a1870a9e24c343ae0c7..49fee67bade5fafd2387a313416b093038bbdb9c 100644 (file)
@@ -1,3 +1,25 @@
+2012-02-06  Alexei Filippov  <alexeif@chromium.org>
+
+        Web Inspector: Redesign summary view / retaining tree contents
+        https://bugs.webkit.org/show_bug.cgi?id=77870
+
+        Reviewed by Pavel Feldman.
+
+        1. Make object IDs less contrast.
+        2. Put array indices in [].
+        3. Do not write type if it's just "Object".
+
+        * inspector/front-end/DetailedHeapshotGridNodes.js:
+        (WebInspector.HeapSnapshotGenericObjectNode.prototype._createObjectCell):
+        (WebInspector.HeapSnapshotGenericObjectNode.prototype.get data):
+        (WebInspector.HeapSnapshotObjectNode.prototype._emptyData):
+        (WebInspector.HeapSnapshotObjectNode.prototype._enhanceData):
+        (WebInspector.HeapSnapshotObjectNode.prototype._prefixObjectCell):
+        (WebInspector.HeapSnapshotConstructorNode.prototype.get data):
+        * inspector/front-end/heapProfiler.css:
+        (.detailed-heapshot-view .console-formatted-id):
+        (.detailed-heapshot-view td.object-column span.grayed):
+
 2012-02-06  No'am Rosenthal  <noam.rosenthal@nokia.com>
 
         [Texmap][Qt] Avoid an image copy when uploading textures in WebKit1
index a771ec42f2cac3d4f3dee3c4443a2168ed06d487..6a7b6ca33e4c8f19675bdbaf30823907ba5b8aa1 100644 (file)
@@ -239,6 +239,12 @@ WebInspector.HeapSnapshotGenericObjectNode.prototype = {
         valueSpan.className = "value console-formatted-" + data.valueStyle;
         valueSpan.textContent = data.value;
         div.appendChild(valueSpan);
+        var idSpan = document.createElement("span");
+        idSpan.className = "console-formatted-id";
+        idSpan.textContent = " @" + data["nodeId"];
+        div.appendChild(idSpan);
+        if (this._postfixObjectCell)
+            this._postfixObjectCell(div, data);
         cell.appendChild(div);
         cell.addStyleClass("disclosure");
         if (this.depth)
@@ -267,7 +273,7 @@ WebInspector.HeapSnapshotGenericObjectNode.prototype = {
             valueStyle = "string";
             break;
         case "closure":
-            value = "function " + value + "()";
+            value = "function" + (value ? " " : "") + value + "()";
             valueStyle = "function";
             break;
         case "number":
@@ -280,14 +286,16 @@ WebInspector.HeapSnapshotGenericObjectNode.prototype = {
             if (!value)
                 value = "[]";
             else
-                value += " []";
+                value += "[]";
             break;
         };
         if (this.hasHoverMessage)
             valueStyle += " highlight";
+        if (value === "Object")
+            value = "";
         if (this.detachedDOMTreeNode)
             valueStyle += " detached-dom-tree-node";
-        data["object"] = { valueStyle: valueStyle, value: value + ": @" + this.snapshotNodeId };
+        data["object"] = { valueStyle: valueStyle, value: value, nodeId: this.snapshotNodeId };
 
         var view = this.dataGrid.snapshotView;
         data["shallowSize"] = Number.withThousandsSeparator(this._shallowSize);
@@ -430,7 +438,7 @@ WebInspector.HeapSnapshotObjectNode.prototype = {
 
     _emptyData: function()
     {
-        return {count:"", addedCount: "", removedCount: "", countDelta:"", addedSize: "", removedSize: "", sizeDelta: ""};
+        return { count: "", addedCount: "", removedCount: "", countDelta: "", addedSize: "", removedSize: "", sizeDelta: "" };
     },
 
     _enhanceData: function(data)
@@ -446,6 +454,9 @@ WebInspector.HeapSnapshotObjectNode.prototype = {
         case "hidden":
             nameClass = "console-formatted-null";
             break;
+        case "element":
+            name = "[" + name + "]";
+            break;
         }
         data["object"].nameClass = nameClass;
         data["object"].name = name;
@@ -454,21 +465,8 @@ WebInspector.HeapSnapshotObjectNode.prototype = {
 
     _prefixObjectCell: function(div, data)
     {
-        if (this.showRetainingEdges) {
-            if (this._cycledWithAncestorGridNode)
-                div.className += " cycled-ancessor-node";
-            var referenceNameSpan = document.createElement("span");
-            referenceNameSpan.className = "name";
-            referenceNameSpan.textContent = this._referenceName + " ";
-            div.appendChild(referenceNameSpan);
-
-            var separatorSpan = document.createElement("span");
-            separatorSpan.className = "separator";
-            separatorSpan.textContent = " of ";
-            div.appendChild(separatorSpan);
-
-            return;
-        }
+        if (this.showRetainingEdges && this._cycledWithAncestorGridNode)
+            div.className += " cycled-ancessor-node";
 
         var nameSpan = document.createElement("span");
         nameSpan.className = data.nameClass;
@@ -476,8 +474,8 @@ WebInspector.HeapSnapshotObjectNode.prototype = {
         div.appendChild(nameSpan);
 
         var separatorSpan = document.createElement("span");
-        separatorSpan.className = "separator";
-        separatorSpan.textContent = ": ";
+        separatorSpan.className = "grayed";
+        separatorSpan.textContent = this.showRetainingEdges ? " in " : " :: ";
         div.appendChild(separatorSpan);
     }
 }
@@ -617,7 +615,7 @@ WebInspector.HeapSnapshotConstructorNode.prototype = {
 
     get data()
     {
-        var data = {object: this._name};
+        var data = { object: this._name };
         var view = this.dataGrid.snapshotView;
         data["count"] =  Number.withThousandsSeparator(this._count);
         data["shallowSize"] = Number.withThousandsSeparator(this._shallowSize);
index 69b88664c9a7639fc0647240952a3b77a2147320..643fe7ecbb5da4a304851bb58d5dabe77e101abc 100644 (file)
@@ -134,6 +134,10 @@ body.inactive .heap-snapshot-sidebar-tree-item.wait.selected .icon {
     white-space: nowrap;
 }
 
+.detailed-heapshot-view .console-formatted-id {
+    color: grey;
+}
+
 .detailed-heapshot-view .data-grid tr.selected * {
     color: inherit;
 }
@@ -208,6 +212,10 @@ body.inactive .heap-snapshot-sidebar-tree-item.wait.selected .icon {
     background-color: rgb(255, 255, 200);
 }
 
+.detailed-heapshot-view td.object-column span.grayed {
+    color: gray;
+}
+
 .heapshot-help-status-bar-item .glyph {
     -webkit-mask-position: -160px 0;
 }