Web Inspector: Unfocusing / Focusing inspector window should not change ContentView
https://bugs.webkit.org/show_bug.cgi?id=162572
<rdar://problem/28479562>

Reviewed by Brian Burg.

Improve NavigationSidebarPanel logic for coordinating selection between trees.
When tree selection changes, the most recent selection should be restored
the next time the tree is focused.

The sidebar should also handle focusing a tree for the first time, in
which no previous selection exists, and focusing a tree that has had its
previous selection filtered out (hidden).

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineDidFocus):
(WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineTreeSelectionDidChange):
Restoring the last deselected element, instead of the last selected element
only works when the selection is moving from one tree to another. When
the elements belong to the same tree the newly selected element won't
be saved until the next selection change. If the window loses and regains
the focus before then, the tree will restore the previous selection,
effectively reverting the last selection change.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@206442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2 files changed