Changeset 293189 in webkit


Ignore:
Timestamp:
Apr 21, 2022 2:46:57 PM (3 months ago)
Author:
Devin Rousso
Message:

Web Inspector: Elements: Layout: hovering over a node should highlight it in the page
https://bugs.webkit.org/show_bug.cgi?id=239621

Reviewed by Patrick Angle.

  • UserInterface/Views/NodeOverlayListSection.js:

(WI.NodeOverlayListSection.prototype.layout):
Use the existing WI.linkifyNodeReference to create the UI for the WI.DOMNode.

  • UserInterface/Base/DOMUtilities.js:

(WI.linkifyNodeReferenceElement):
Don't style the UI as a link if clicking it doesn't do anything.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r293178 r293189  
     12022-04-21  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Elements: Layout: hovering over a node should highlight it in the page
     4        https://bugs.webkit.org/show_bug.cgi?id=239621
     5
     6        Reviewed by Patrick Angle.
     7
     8        * UserInterface/Views/NodeOverlayListSection.js:
     9        (WI.NodeOverlayListSection.prototype.layout):
     10        Use the existing `WI.linkifyNodeReference` to create the UI for the `WI.DOMNode`.
     11
     12        * UserInterface/Base/DOMUtilities.js:
     13        (WI.linkifyNodeReferenceElement):
     14        Don't style the UI as a link if clicking it doesn't do anything.
     15
    1162022-04-21  Devin Rousso  <drousso@apple.com>
    217
  • trunk/Source/WebInspectorUI/UserInterface/Base/DOMUtilities.js

    r288623 r293189  
    8484
    8585    let nodeType = node.nodeType();
    86     if ((nodeType !== Node.DOCUMENT_NODE || node.parentNode) && nodeType !== Node.TEXT_NODE)
     86    if (!options.ignoreClick && (nodeType !== Node.DOCUMENT_NODE || node.parentNode) && nodeType !== Node.TEXT_NODE)
    8787        element.classList.add("node-link");
    8888
  • trunk/Source/WebInspectorUI/UserInterface/Views/NodeOverlayListSection.js

    r290435 r293189  
    101101
    102102            let labelElement = itemContainerElement.appendChild(document.createElement("label"));
    103             let nodeDisplayName = labelElement.appendChild(document.createElement("span"));
     103            let nodeDisplayName = labelElement.appendChild(WI.linkifyNodeReference(domNode, {ignoreClick: true}));
    104104            nodeDisplayName.classList.add("node-display-name");
    105             nodeDisplayName.textContent = domNode.displayName;
    106105
    107106            let checkboxElement = labelElement.appendChild(document.createElement("input"));
Note: See TracChangeset for help on using the changeset viewer.