Changeset 244327 in webkit


Ignore:
Timestamp:
Apr 15, 2019 11:57:16 PM (5 years ago)
Author:
Joseph Pecoraro
Message:

Web Inspector: DOM Nodes should not show $0 when selected in Console area
https://bugs.webkit.org/show_bug.cgi?id=196953

Reviewed by Devin Rousso.

  • UserInterface/Views/DOMTreeContentView.js:

(WI.DOMTreeContentView):
Enable showing the last selected element.

  • UserInterface/Views/DOMTreeOutline.js:

Make parameters explicit. Drop "selectable" which was always true.
And add a new option for adding a class name.

  • UserInterface/Views/DOMTreeOutline.css:

(.tree-outline.dom.show-last-selected li.last-selected > span::after):
(.tree-outline.dom.show-last-selected:focus li.last-selected > span::after):
Only show the "= $0" for a DOM tree that has enabled showing the last selected element.

  • UserInterface/Views/FormattedValue.css:

(.formatted-node > .tree-outline.dom li.selected .selection-area):
Don't show the selection-area for a console formatted node.

Location:
trunk/Source/WebInspectorUI
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r244318 r244327  
     12019-04-15  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: DOM Nodes should not show $0 when selected in Console area
     4        https://bugs.webkit.org/show_bug.cgi?id=196953
     5
     6        Reviewed by Devin Rousso.
     7
     8        * UserInterface/Views/DOMTreeContentView.js:
     9        (WI.DOMTreeContentView):
     10        Enable showing the last selected element.
     11
     12        * UserInterface/Views/DOMTreeOutline.js:
     13        Make parameters explicit. Drop "selectable" which was always true.
     14        And add a new option for adding a class name.
     15
     16        * UserInterface/Views/DOMTreeOutline.css:
     17        (.tree-outline.dom.show-last-selected li.last-selected > span::after):
     18        (.tree-outline.dom.show-last-selected:focus li.last-selected > span::after):
     19        Only show the "= $0" for a DOM tree that has enabled showing the last selected element.
     20
     21        * UserInterface/Views/FormattedValue.css:
     22        (.formatted-node > .tree-outline.dom li.selected .selection-area):
     23        Don't show the selection-area for a console formatted node.
     24
    1252019-04-15  Devin Rousso  <drousso@apple.com>
    226
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js

    r244264 r244327  
    6464        this.element.addEventListener("click", this._mouseWasClicked.bind(this), false);
    6565
    66         this._domTreeOutline = new WI.DOMTreeOutline(true, true, true);
     66        this._domTreeOutline = new WI.DOMTreeOutline({omitRootDOMNode: true, excludeRevealElementContextMenu: true, showLastSelected: true});
    6767        this._domTreeOutline.allowsEmptySelection = false;
    6868        this._domTreeOutline.allowsMultipleSelection = true;
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css

    r242768 r244327  
    7171}
    7272
    73 .tree-outline.dom li.last-selected > span::after {
     73.tree-outline.dom.show-last-selected li.last-selected > span::after {
    7474    content: " = $0";
    7575    color: var(--console-secondary-text-color);
     
    7878}
    7979
    80 .tree-outline.dom:focus li.last-selected > span::after {
     80.tree-outline.dom.show-last-selected:focus li.last-selected > span::after {
    8181    color: var(--selected-secondary-text-color);
    8282}
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js

    r244271 r244327  
    3131WI.DOMTreeOutline = class DOMTreeOutline extends WI.TreeOutline
    3232{
    33     constructor(omitRootDOMNode, selectable, excludeRevealElementContextMenu)
    34     {
    35         super(selectable);
     33    constructor({omitRootDOMNode, excludeRevealElementContextMenu, showLastSelected} = {})
     34    {
     35        super();
    3636
    3737        this.element.addEventListener("mousedown", this._onmousedown.bind(this), false);
     
    4545
    4646        this.element.classList.add("dom", WI.SyntaxHighlightedStyleClassName);
     47
     48        if (showLastSelected)
     49            this.element.classList.add("show-last-selected");
    4750
    4851        this._includeRootDOMNode = !omitRootDOMNode;
  • trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.css

    r239760 r244327  
    7373}
    7474
     75.formatted-node > .tree-outline.dom li.selected .selection-area {
     76    background-color: transparent;
     77}
     78
    7579.formatted-node > .tree-outline.dom li.hovered:not(.selected) .selection-area {
    7680    display: block;
Note: See TracChangeset for help on using the changeset viewer.