Title: [200476] trunk/Source/WebInspectorUI
Revision
200476
Author
[email protected]
Date
2016-05-05 14:00:27 -0700 (Thu, 05 May 2016)

Log Message

Web Inspector: Provide go-to links next to Functions in GC Root Path popover
https://bugs.webkit.org/show_bug.cgi?id=157381
<rdar://problem/26122531>

Patch by Joseph Pecoraro <[email protected]> on 2016-05-05
Reviewed by Timothy Hatcher.

* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
For functions, create a go-to-link. Insert a placeholder to replace
so that the popover sizes itself with a potential go-to arrow, as
it won't resize when the go-to arrows get inserted.

* UserInterface/Views/HeapSnapshotInstancesContentView.css:
(.heap-snapshot-instance-popover-content .node .go-to-link):
Move down 1px to align better with the text.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (200475 => 200476)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-05-05 20:40:01 UTC (rev 200475)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-05-05 21:00:27 UTC (rev 200476)
@@ -1,5 +1,23 @@
 2016-05-05  Joseph Pecoraro  <[email protected]>
 
+        Web Inspector: Provide go-to links next to Functions in GC Root Path popover
+        https://bugs.webkit.org/show_bug.cgi?id=157381
+        <rdar://problem/26122531>
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
+        (WebInspector.HeapSnapshotInstanceDataGridNode.prototype._mouseoverHandler.appendPathRow):
+        For functions, create a go-to-link. Insert a placeholder to replace
+        so that the popover sizes itself with a potential go-to arrow, as
+        it won't resize when the go-to arrows get inserted.
+
+        * UserInterface/Views/HeapSnapshotInstancesContentView.css:
+        (.heap-snapshot-instance-popover-content .node .go-to-link):
+        Move down 1px to align better with the text.
+
+2016-05-05  Joseph Pecoraro  <[email protected]>
+
         Web Inspector: HeapSnapshot should exploratory Object Graph view
         https://bugs.webkit.org/show_bug.cgi?id=157371
         <rdar://problem/26107304>

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js (200475 => 200476)


--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js	2016-05-05 20:40:01 UTC (rev 200475)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js	2016-05-05 21:00:27 UTC (rev 200476)
@@ -399,6 +399,26 @@
             idElement.classList.add("object-id");
             idElement.textContent = "@" + node.id;
             idElement.addEventListener("click", WebInspector.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode.bind(null, node));
+
+            // Extra.
+            if (node.className === "Function") {
+                let goToArrowPlaceHolderElement = containerElement.appendChild(document.createElement("span"));
+                goToArrowPlaceHolderElement.style.display = "inline-block";
+                goToArrowPlaceHolderElement.style.width = "10px";
+                HeapAgent.getPreview(node.id, function(error, string, functionDetails, objectPreviewPayload) {
+                    if (functionDetails) {
+                        let location = functionDetails.location;
+                        let sourceCode = WebInspector.debuggerManager.scriptForIdentifier(location.scriptId);
+                        if (sourceCode) {
+                            const dontFloat = true;
+                            const useGoToArrowButton = true;
+                            let sourceCodeLocation = sourceCode.createSourceCodeLocation(location.lineNumber, location.columnNumber);
+                            let goToArrowButtonLink = WebInspector.createSourceCodeLocationLink(sourceCodeLocation, dontFloat, useGoToArrowButton);
+                            containerElement.replaceChild(goToArrowButtonLink, goToArrowPlaceHolderElement);
+                        }
+                    }
+                });
+            }
         }
 
         function sanitizeClassName(className) {

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css (200475 => 200476)


--- trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css	2016-05-05 20:40:01 UTC (rev 200475)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstancesContentView.css	2016-05-05 21:00:27 UTC (rev 200476)
@@ -178,3 +178,8 @@
     display: inline-block;
     vertical-align: top;
 }
+
+.heap-snapshot-instance-popover-content .node .go-to-link {
+    position: relative;
+    top: 1px;
+}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to