DevTools: do not highlight selected node on DevTools focus

Switching windows or using the Element picker may focus the DevTools
area with relatedTarget=null. In these cases, re-applying node
highlight is not needed.

Bug: 905252
Change-Id: Ie3ae228c9cc404f16598ff428d9e593bb90e33e5
Reviewed-on: https://chromium-review.googlesource.com/c/1336910
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#608541}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: bb1a4687d53112eba231613f92d018c116850eaf
This commit is contained in:
Erik Luo
2018-11-15 22:17:45 +00:00
committed by Commit Bot
parent 214df616bb
commit 4d3ca59cdb
+2 -1
View File
@@ -550,7 +550,8 @@ Elements.ElementsTreeOutline = class extends UI.TreeOutline {
const listItem = event.target.enclosingNodeOrSelfWithNodeName('li');
if (!listItem || !listItem.treeElement || !listItem.treeElement.selected)
return;
this._highlightTreeElement(/** @type {!UI.TreeElement} */ (listItem.treeElement), true /* showInfo */);
if (event.relatedTarget)
this._highlightTreeElement(/** @type {!UI.TreeElement} */ (listItem.treeElement), true /* showInfo */);
}
/**