Bug 162572 - Web Inspector: Unfocusing / Focusing inspector window should not change ContentView
Summary: Web Inspector: Unfocusing / Focusing inspector window should not change Conte...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Matt Baker
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-09-26 12:20 PDT by Joseph Pecoraro
Modified: 2016-09-27 10:28 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.39 KB, patch)
2016-09-26 13:35 PDT, Matt Baker
no flags Details | Formatted Diff | Diff
Patch (3.80 KB, patch)
2016-09-26 15:22 PDT, Matt Baker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2016-09-26 12:20:58 PDT
Summary:
Unfocusing / Focusing inspector window should not change ContentView

Steps to Reproduce:
1. Inspect any page
2. Show Debugger Tab
3. Select a few different resources in sidebar
4. Click outside Inspector Window
5. Click back inside Inspector Window
  => Resource unexpectedly changed to the previous resource

Notes:
- This is almost certainly a regression.
Comment 1 Radar WebKit Bug Importer 2016-09-26 12:21:14 PDT
<rdar://problem/28479562>
Comment 2 Matt Baker 2016-09-26 12:38:39 PDT
This is being caused by the tree getting the focus, and reselecting the previously selected tree element.
Comment 3 Matt Baker 2016-09-26 13:35:12 PDT
Created attachment 289860 [details]
Patch
Comment 4 BJ Burg 2016-09-26 14:03:38 PDT
Comment on attachment 289860 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=289860&action=review

> Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js:654
> +                previousSelectedTreeElement = previousSelectedTreeElement.traverseNextTreeElement(skipUnrevealed, this);

If we are iterating forwards, then you should use a new variable name. I got confused.

> Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js:-660
> -            deselectedElement.treeOutline[WebInspector.NavigationSidebarPanel.PreviousSelectedTreeElementSymbol] = deselectedElement;

It would be helpful to explain in the changelog why this is wrong. Is is because deselectedElement is null when the window gets focus?
Comment 5 Matt Baker 2016-09-26 15:22:35 PDT
Created attachment 289881 [details]
Patch
Comment 6 BJ Burg 2016-09-27 10:06:58 PDT
Comment on attachment 289881 [details]
Patch

r=me
Comment 7 WebKit Commit Bot 2016-09-27 10:27:59 PDT
Comment on attachment 289881 [details]
Patch

Clearing flags on attachment: 289881

Committed r206442: <http://trac.webkit.org/changeset/206442>
Comment 8 WebKit Commit Bot 2016-09-27 10:28:03 PDT
All reviewed patches have been landed.  Closing bug.