Title: [199308] trunk/Source/WebInspectorUI
Revision
199308
Author
[email protected]
Date
2016-04-11 13:00:31 -0700 (Mon, 11 Apr 2016)

Log Message

Web Inspector: HeapSnapshot instance property path popover should include a descriptive header
https://bugs.webkit.org/show_bug.cgi?id=156431
<rdar://problem/25633594>

Reviewed by Timothy Hatcher.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendTitle):
Title for the popover. Because localization may change the location of the @1234
in the string, localize first with a placeholder, and then replace the placeholder
with the @1234 link.

(WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPath):
Give the table a container for extra padding.

(WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
Do not include the space before @1234 as part of the clickable link.

(WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler):
Include a title when the popover shows a root path.

* UserInterface/Views/HeapSnapshotInstancesContentView.css:
(.heap-snapshot-instance-popover-content > .title):
(.heap-snapshot-instance-popover-content):
(.heap-snapshot-instance-popover-content > .table-container):
(.heap-snapshot-instance-popover-content table):
Provide styles for the title. Let the title extend across the entire
popover horizontally, but pad the table so that it appears more
centered under the title. Because the table has border collapse we have
to wrap it in a container to give it back the padding we want.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (199307 => 199308)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-04-11 19:52:35 UTC (rev 199307)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-04-11 20:00:31 UTC (rev 199308)
@@ -1,3 +1,37 @@
+2016-04-11  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: HeapSnapshot instance property path popover should include a descriptive header
+        https://bugs.webkit.org/show_bug.cgi?id=156431
+        <rdar://problem/25633594>
+
+        Reviewed by Timothy Hatcher.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
+        (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendTitle):
+        Title for the popover. Because localization may change the location of the @1234
+        in the string, localize first with a placeholder, and then replace the placeholder
+        with the @1234 link.
+
+        (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPath):
+        Give the table a container for extra padding.
+
+        (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
+        Do not include the space before @1234 as part of the clickable link.
+
+        (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler):
+        Include a title when the popover shows a root path.
+
+        * UserInterface/Views/HeapSnapshotInstancesContentView.css:
+        (.heap-snapshot-instance-popover-content > .title):
+        (.heap-snapshot-instance-popover-content):
+        (.heap-snapshot-instance-popover-content > .table-container):
+        (.heap-snapshot-instance-popover-content table):
+        Provide styles for the title. Let the title extend across the entire
+        popover horizontally, but pad the table so that it appears more
+        centered under the title. Because the table has border collapse we have
+        to wrap it in a container to give it back the padding we want.
+
 2016-04-08  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: XHRs and Web Worker scripts are not searchable

Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (199307 => 199308)


--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2016-04-11 19:52:35 UTC (rev 199307)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2016-04-11 20:00:31 UTC (rev 199308)
@@ -638,6 +638,7 @@
 localizedStrings["Shadow"] = "Shadow";
 localizedStrings["Shadow Content"] = "Shadow Content";
 localizedStrings["Shared Focus"] = "Shared Focus";
+localizedStrings["Shortest property path to %s"] = "Shortest property path to %s";
 localizedStrings["Show %d More"] = "Show %d More";
 localizedStrings["Show All"] = "Show All";
 localizedStrings["Show All Nodes (%d More)"] = "Show All Nodes (%d More)";

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js (199307 => 199308)


--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js	2016-04-11 19:52:35 UTC (rev 199307)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js	2016-04-11 20:00:31 UTC (rev 199308)
@@ -206,10 +206,25 @@
         let popoverContentElement = document.createElement("div");
         popoverContentElement.classList.add("heap-snapshot", "heap-snapshot-instance-popover-content");
 
+        function appendTitle(node) {
+            let idElement = document.createElement("span");
+            idElement.classList.add("object-id");
+            idElement.textContent = "@" + node.id;
+            idElement.addEventListener("click", WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.bind(null, node));
+
+            let title = popoverContentElement.appendChild(document.createElement("div"));
+            title.classList.add("title");
+            let localizedString = WebInspector.UIString("Shortest property path to %s").format("@@@");
+            let [before, after] = localizedString.split(/\s*@@@\s*/);
+            title.append(before + " ", idElement, " " + after);
+        }
+
         function appendPath(path) {
-            let tableElement = popoverContentElement.appendChild(document.createElement("table"));
-            tableElement.classList.add("table");
+            let tableContainer = popoverContentElement.appendChild(document.createElement("div"));
+            tableContainer.classList.add("table-container");
 
+            let tableElement = tableContainer.appendChild(document.createElement("table"));
+
             path = path.slice().reverse();
             let windowIndex = path.findIndex((x) => {
                 return x instanceof WebInspector.HeapSnapshotNodeProxy && x.className === "Window";
@@ -256,11 +271,11 @@
             iconElement.classList.add("icon", WebInspector.HeapSnapshotClusterContentView.iconStyleClassNameForClassName(node.className, node.internal));
 
             let classNameElement = containerElement.appendChild(document.createElement("span"));
-            classNameElement.textContent = sanitizeClassName(node.className);
+            classNameElement.textContent = sanitizeClassName(node.className) + " ";
 
             let idElement = containerElement.appendChild(document.createElement("span"));
             idElement.classList.add("object-id");
-            idElement.textContent = " @" + node.id;
+            idElement.textContent = "@" + node.id;
             idElement.addEventListener("click", WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.bind(null, node));
         }
 
@@ -289,9 +304,10 @@
             if (!this._tree.visible)
                 return;
 
-            if (path.length)
+            if (path.length) {
+                appendTitle(this._node);
                 appendPath(path);
-            else if (this._node.gcRoot) {
+            } else if (this._node.gcRoot) {
                 let textElement = popoverContentElement.appendChild(document.createElement("div"));
                 textElement.textContent = WebInspector.UIString("This object is a root");
             } else {

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css (199307 => 199308)


--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css	2016-04-11 19:52:35 UTC (rev 199307)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css	2016-04-11 20:00:31 UTC (rev 199308)
@@ -126,11 +126,24 @@
     height: 16px;
 }
 
+.heap-snapshot-instance-popover-content > .title {
+    font-family: -apple-system, sans-serif;
+    text-align: center;
+    border-bottom: 1px solid var(--border-color);
+    padding: 0 5px 2px 5px;
+    margin-bottom: 3px;
+}
+
 .heap-snapshot-instance-popover-content {
     white-space: pre;
-    padding: 5px 10px;
+    padding: 5px 0px;
 }
 
+.heap-snapshot-instance-popover-content > .table-container {
+    padding-left: 10px;
+    padding-right: 10px;
+}
+
 .heap-snapshot-instance-popover-content table {
     border-collapse: collapse;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to