Web Inspector: Unfocusing / Focusing inspector window should not change ContentView
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Sep 2016 17:25:38 +0000 (17:25 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Sep 2016 17:25:38 +0000 (17:25 +0000)
commitdb7ded7352d5f194b1158eb5c35e0ef62529fc9d
tree35b1dadf4991cb32844db6ed3b64566d69660d31
parented9d75f4eeb784629b620e8fca3c792c71e16e87
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: https://svn.webkit.org/repository/webkit/trunk@206442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js