Changeset 51710 in webkit


Ignore:
Timestamp:
Dec 4, 2009 1:03:38 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-04 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Timothy Hatcher.

Web Inspector: Remove suppress highlight when restoring selected node.

https://bugs.webkit.org/show_bug.cgi?id=32152

  • inspector/front-end/ElementsPanel.js: (WebInspector.ElementsPanel.prototype.setDocument.selectNode): (WebInspector.ElementsPanel.prototype.setDocument.selectLastSelectedNode): (WebInspector.ElementsPanel.prototype.setDocument):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r51708 r51710  
     12009-12-04  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Web Inspector: Remove suppress highlight when restoring selected node.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=32152
     8
     9        * inspector/front-end/ElementsPanel.js:
     10        (WebInspector.ElementsPanel.prototype.setDocument.selectNode):
     11        (WebInspector.ElementsPanel.prototype.setDocument.selectLastSelectedNode):
     12        (WebInspector.ElementsPanel.prototype.setDocument):
     13
    1142009-12-04  Dirk Schulze  <krit@webkit.org>
    215
  • trunk/WebCore/inspector/front-end/ElementsPanel.js

    r51601 r51710  
    206206        this.treeOutline.suppressSelectHighlight = false;
    207207
    208         function selectDefaultNode()
     208        function selectNode(candidateFocusNode)
    209209        {
     210            if (!candidateFocusNode)
     211                candidateFocusNode = inspectedRootDocument.body || inspectedRootDocument.documentElement;
     212
     213            if (!candidateFocusNode)
     214                return;
     215
    210216            this.treeOutline.suppressSelectHighlight = true;
    211             var candidateFocusNode = inspectedRootDocument.body || inspectedRootDocument.documentElement;
    212             if (candidateFocusNode) {
    213                 this.focusedDOMNode = candidateFocusNode;
    214 
    215                 if (this.treeOutline.selectedTreeElement)
    216                     this.treeOutline.selectedTreeElement.expand();
    217             }
     217            this.focusedDOMNode = candidateFocusNode;
     218            if (this.treeOutline.selectedTreeElement)
     219                this.treeOutline.selectedTreeElement.expand();
     220            this.treeOutline.suppressSelectHighlight = false;
    218221        }
    219222
     
    221224        {
    222225            var node = nodeId ? WebInspector.domAgent.nodeForId(nodeId) : 0;
    223             if (!node) {
    224                 selectDefaultNode.call(this);
    225                 return;
    226             }
    227 
    228             this.treeOutline.suppressSelectHighlight = true;
    229             this.focusedDOMNode = node;
    230             this.treeOutline.suppressSelectHighlight = false;
     226            selectNode.call(this, node);
    231227        }
    232228
     
    234230            InjectedScriptAccess.nodeByPath(this._selectedPathOnReset, selectLastSelectedNode.bind(this));
    235231        else
    236             selectDefaultNode.call(this);
     232            selectNode.call(this);
    237233        delete this._selectedPathOnReset;
    238234    },
Note: See TracChangeset for help on using the changeset viewer.