Title: [213765] trunk/Source/WebInspectorUI
Revision
213765
Author
[email protected]
Date
2017-03-11 21:02:25 -0800 (Sat, 11 Mar 2017)

Log Message

Web Inspector: Add "goto arrow" to DOMNodeTreeElements in the Debugger tab
https://bugs.webkit.org/show_bug.cgi?id=168752

Reviewed by Devin Rousso.

* UserInterface/Base/DOMUtilities.js:
(WebInspector.linkifyNodeReference):
(WebInspector.linkifyNodeReferenceElement):
Expose linkifying an existing element.

* UserInterface/Views/DOMNodeTreeElement.js:
(WebInspector.DOMNodeTreeElement):
(WebInspector.DOMNodeTreeElement.prototype.populateContextMenu):
Add "Reveal in DOM Tree" context menu item.

* UserInterface/Views/DebuggerSidebarPanel.css:
(.sidebar > .panel.navigation.debugger .details-section.dom-breakpoints .item.dom-node:not(:hover, .selected) .status .go-to-arrow):
Hide the go-to arrow unless hovering or selected.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (213764 => 213765)


--- trunk/Source/WebInspectorUI/ChangeLog	2017-03-12 03:00:46 UTC (rev 213764)
+++ trunk/Source/WebInspectorUI/ChangeLog	2017-03-12 05:02:25 UTC (rev 213765)
@@ -1,5 +1,26 @@
 2017-03-11  Matt Baker  <[email protected]>
 
+        Web Inspector: Add "goto arrow" to DOMNodeTreeElements in the Debugger tab
+        https://bugs.webkit.org/show_bug.cgi?id=168752
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Base/DOMUtilities.js:
+        (WebInspector.linkifyNodeReference):
+        (WebInspector.linkifyNodeReferenceElement):
+        Expose linkifying an existing element.
+
+        * UserInterface/Views/DOMNodeTreeElement.js:
+        (WebInspector.DOMNodeTreeElement):
+        (WebInspector.DOMNodeTreeElement.prototype.populateContextMenu):
+        Add "Reveal in DOM Tree" context menu item.
+
+        * UserInterface/Views/DebuggerSidebarPanel.css:
+        (.sidebar > .panel.navigation.debugger .details-section.dom-breakpoints .item.dom-node:not(:hover, .selected) .status .go-to-arrow):
+        Hide the go-to arrow unless hovering or selected.
+
+2017-03-11  Matt Baker  <[email protected]>
+
         Web Inspector: RTL: fix broken font content view
         https://bugs.webkit.org/show_bug.cgi?id=169513
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Base/DOMUtilities.js (213764 => 213765)


--- trunk/Source/WebInspectorUI/UserInterface/Base/DOMUtilities.js	2017-03-12 03:00:46 UTC (rev 213764)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/DOMUtilities.js	2017-03-12 05:02:25 UTC (rev 213765)
@@ -65,19 +65,26 @@
 
     let link = document.createElement("span");
     link.append(displayName);
-    link.setAttribute("role", "link");
+    return WebInspector.linkifyNodeReferenceElement(node, link, displayName);
+};
 
-    link.title = displayName;
+WebInspector.linkifyNodeReferenceElement = function(node, element, displayName)
+{
+    if (!displayName)
+        displayName = node.displayName;
 
+    element.setAttribute("role", "link");
+    element.title = displayName;
+
     let nodeType = node.nodeType();
     if ((nodeType !== Node.DOCUMENT_NODE || node.parentNode) && nodeType !== Node.TEXT_NODE)
-        link.className = "node-link";
+        element.classList.add("node-link");
 
-    link.addEventListener("click", WebInspector.domTreeManager.inspectElement.bind(WebInspector.domTreeManager, node.id));
-    link.addEventListener("mouseover", WebInspector.domTreeManager.highlightDOMNode.bind(WebInspector.domTreeManager, node.id, "all"));
-    link.addEventListener("mouseout", WebInspector.domTreeManager.hideDOMNodeHighlight.bind(WebInspector.domTreeManager));
+    element.addEventListener("click", WebInspector.domTreeManager.inspectElement.bind(WebInspector.domTreeManager, node.id));
+    element.addEventListener("mouseover", WebInspector.domTreeManager.highlightDOMNode.bind(WebInspector.domTreeManager, node.id, "all"));
+    element.addEventListener("mouseout", WebInspector.domTreeManager.hideDOMNodeHighlight.bind(WebInspector.domTreeManager));
 
-    return link;
+    return element;
 };
 
 function createSVGElement(tagName)

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeTreeElement.js (213764 => 213765)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeTreeElement.js	2017-03-12 03:00:46 UTC (rev 213764)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeTreeElement.js	2017-03-12 05:02:25 UTC (rev 213765)
@@ -30,6 +30,8 @@
         console.assert(domNode instanceof WebInspector.DOMNode);
 
         super("dom-node", domNode.displayName, null, domNode, true);
+
+        this.status = WebInspector.linkifyNodeReferenceElement(domNode, WebInspector.createGoToArrowButton());
     }
 
     // Protected
@@ -47,5 +49,11 @@
 
         const allowEditing = true;
         WebInspector.DOMBreakpointTreeController.appendBreakpointContextMenuItems(contextMenu, this.representedObject, allowEditing);
+
+        contextMenu.appendSeparator();
+
+        contextMenu.appendItem(WebInspector.UIString("Reveal in DOM Tree"), () => {
+            WebInspector.domTreeManager.inspectElement(this.representedObject.id);
+        });
     }
 };

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css (213764 => 213765)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css	2017-03-12 03:00:46 UTC (rev 213764)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css	2017-03-12 05:02:25 UTC (rev 213765)
@@ -104,6 +104,10 @@
     content: url(../Images/DOMElement.svg);
 }
 
+.sidebar > .panel.navigation.debugger .details-section.dom-breakpoints .item.dom-node:not(:hover, .selected) .status .go-to-arrow {
+    display: none;
+}
+
 .sidebar > .panel.navigation.debugger .details-section.xhr-breakpoints .item.breakpoint .subtitle:before {
     content: "";
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to