Skip to content

Commit

Permalink
DevTools: remove ElementsTreeElement.updateSelection.
Browse files Browse the repository at this point in the history
BUG=627306
NOTRY=true

Review-Url: https://codereview.chromium.org/2137313003
Cr-Commit-Position: refs/heads/master@{#404852}
  • Loading branch information
pavelfeldman authored and Commit bot committed Jul 12, 2016
1 parent e02009f commit 21cc3d9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 37 deletions.
10 changes: 0 additions & 10 deletions front_end/elements/ElementsPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ WebInspector.ElementsPanel.prototype = {
width -= this._splitWidget.sidebarSize();
for (var i = 0; i < this._treeOutlines.length; ++i) {
this._treeOutlines[i].setVisibleWidth(width);
this._treeOutlines[i].updateSelection();
}
this._breadcrumbs.updateSizes();
},
Expand Down Expand Up @@ -337,7 +336,6 @@ WebInspector.ElementsPanel.prototype = {

for (var i = 0; i < this._treeOutlines.length; ++i) {
var treeOutline = this._treeOutlines[i];
treeOutline.updateSelection();
treeOutline.setVisible(true);

if (!treeOutline.rootDOMNode)
Expand Down Expand Up @@ -559,14 +557,6 @@ WebInspector.ElementsPanel.prototype = {
this._contentElement.classList.toggle("elements-wrap", event.data);
for (var i = 0; i < this._treeOutlines.length; ++i)
this._treeOutlines[i].setWordWrap(/** @type {boolean} */ (event.data));

var selectedNode = this.selectedDOMNode();
if (!selectedNode)
return;

var treeElement = this._treeElementForNode(selectedNode);
if (treeElement)
treeElement.updateSelection(); // Recalculate selection highlight dimensions.
},

switchToAndFocus: function(node)
Expand Down
17 changes: 5 additions & 12 deletions front_end/elements/ElementsTreeElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ WebInspector.ElementsTreeElement.prototype = {

if (this.listItemElement) {
if (x) {
this.updateSelection();
this._createSelection();
this.listItemElement.classList.add("hovered");
} else {
this.listItemElement.classList.remove("hovered");
Expand All @@ -253,7 +253,7 @@ WebInspector.ElementsTreeElement.prototype = {
this._expandedChildrenLimit = expandedChildrenLimit;
},

updateSelection: function()
_createSelection: function()
{
var listItemElement = this.listItemElement;
if (!listItemElement)
Expand Down Expand Up @@ -290,7 +290,7 @@ WebInspector.ElementsTreeElement.prototype = {
onattach: function()
{
if (this._hovered) {
this.updateSelection();
this._createSelection();
this.listItemElement.classList.add("hovered");
}

Expand Down Expand Up @@ -337,7 +337,6 @@ WebInspector.ElementsTreeElement.prototype = {
return;

this.updateTitle();
this.treeOutline.updateSelection();
},

oncollapse: function()
Expand All @@ -346,7 +345,6 @@ WebInspector.ElementsTreeElement.prototype = {
return;

this.updateTitle();
this.treeOutline.updateSelection();
},

/**
Expand All @@ -373,7 +371,7 @@ WebInspector.ElementsTreeElement.prototype = {
this.treeOutline.selectDOMNode(this._node, selectedByUser);
if (selectedByUser)
this._node.highlight();
this.updateSelection();
this._createSelection();
this.treeOutline.suppressRevealAndSelect = false;
return true;
},
Expand Down Expand Up @@ -454,8 +452,6 @@ WebInspector.ElementsTreeElement.prototype = {
tag.appendChild(node);
tag.createTextChild(">");
}

this.updateSelection();
},

/**
Expand Down Expand Up @@ -810,8 +806,6 @@ WebInspector.ElementsTreeElement.prototype = {
this.listItemElement.classList.add("editing-as-html");
this.treeOutline.element.addEventListener("mousedown", consume, false);

this.updateSelection();

/**
* @param {!Element} element
* @param {string} newValue
Expand Down Expand Up @@ -847,7 +841,6 @@ WebInspector.ElementsTreeElement.prototype = {
}

this.treeOutline.element.removeEventListener("mousedown", consume, false);
this.updateSelection();
this.treeOutline.focus();
}

Expand Down Expand Up @@ -1079,7 +1072,7 @@ WebInspector.ElementsTreeElement.prototype = {

delete this.selectionElement;
if (this.selected)
this.updateSelection();
this._createSelection();
this._preventFollowingLinksOnDoubleClick();
this._highlightSearchResults();
},
Expand Down
15 changes: 0 additions & 15 deletions front_end/elements/ElementsTreeOutline.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,6 @@ WebInspector.ElementsTreeOutline.prototype = {
this._revealAndSelectNode(selectedNode, true);
},

updateSelection: function()
{
if (!this.selectedTreeElement)
return;
var element = this.selectedTreeElement;
element.updateSelection();
},

_selectedNodeChanged: function()
{
this.dispatchEventToListeners(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, this._selectedDOMNode);
Expand Down Expand Up @@ -743,7 +735,6 @@ WebInspector.ElementsTreeOutline.prototype = {
node = node.parentNode;
}

treeElement.updateSelection();
treeElement.listItemElement.classList.add("elements-drag-over");
this._dragOverTreeElement = treeElement;
event.preventDefault();
Expand Down Expand Up @@ -822,7 +813,6 @@ WebInspector.ElementsTreeOutline.prototype = {
_clearDragOverTreeElementMarker: function()
{
if (this._dragOverTreeElement) {
this._dragOverTreeElement.updateSelection();
this._dragOverTreeElement.listItemElement.classList.remove("elements-drag-over");
delete this._dragOverTreeElement;
}
Expand Down Expand Up @@ -1243,7 +1233,6 @@ WebInspector.ElementsTreeOutline.prototype = {
this._element.classList.remove("hidden");
if (originalScrollTop)
treeOutlineContainerElement.scrollTop = originalScrollTop;
this.updateSelection();
}

this._updateRecords.clear();
Expand Down Expand Up @@ -1750,10 +1739,6 @@ WebInspector.ElementsTreeOutline.ShortcutTreeElement.prototype = {
this.listItemElement.classList.toggle("hovered", x);
},

updateSelection: function()
{
},

/**
* @return {number}
*/
Expand Down

0 comments on commit 21cc3d9

Please sign in to comment.