Web Inspector: Elements: highlight the node when hovering event listeners sorted...
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2019 04:32:50 +0000 (04:32 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2019 04:32:50 +0000 (04:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195368

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.generateGroupsByNode):

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js

index 68f6ee8..6c02fb5 100644 (file)
@@ -1,3 +1,13 @@
+2019-03-06  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: Elements: highlight the node when hovering event listeners sorted by node
+        https://bugs.webkit.org/show_bug.cgi?id=195368
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
+        (WI.DOMNodeDetailsSidebarPanel.prototype._refreshEventListeners.generateGroupsByNode):
+
 2019-03-06  Matt Baker  <mattbaker@apple.com>
 
         Web Inspector: system accent color follow-ups
index 8980c0d..e35ed03 100644 (file)
@@ -393,9 +393,18 @@ WI.DOMNodeDetailsSidebarPanel = class DOMNodeDetailsSidebarPanel extends WI.DOMD
                 if (!eventListenersForNode)
                     continue;
 
+                let nodeId = currentNode.id;
+
                 eventListenersForNode.sort((a, b) => a.type.toLowerCase().extendedLocaleCompare(b.type.toLowerCase()));
 
-                rows.push(createEventListenerSection(currentNode.displayName, eventListenersForNode, {hideNode: true}));
+                let section = createEventListenerSection(currentNode.displayName, eventListenersForNode, {hideNode: true});
+                section.titleElement.addEventListener("mouseover", (event) => {
+                    WI.domManager.highlightDOMNode(nodeId, "all");
+                });
+                section.titleElement.addEventListener("mouseout", (event) => {
+                    WI.domManager.hideDOMNodeHighlight();
+                });
+                rows.push(section);
             } while (currentNode = currentNode.parentNode);
 
             return rows;