Bug 179223

Summary: Web Inspector: Selecting a DOM Search Result in Search Tab unexpectedly changes Tabs
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: hi, inspector-bugzilla-changes, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
joepeck: commit-queue-
[PATCH] Proposed Fix
hi: review+
[IMAGE] DOM Tree in Search Tab
none
[IMAGE] Context Menu in Search Tab none

Description Joseph Pecoraro 2017-11-02 18:58:46 PDT
Selecting a DOM Search Result in Search Tab unexpectedly changes Tabs

Steps to Reproduce:
1. Inspect <https://webkit.org>
2. Global search for "Linux" => End up in Search Tab
3. Select one of the [T] DOM Search results in the sidebar
  => Unexpectedly changed to Elements tab

Expected:
- See a DOM Tree in the Search Tab
Comment 1 Joseph Pecoraro 2017-11-02 18:58:54 PDT
<rdar://problem/33949556>
Comment 2 Joseph Pecoraro 2017-11-02 19:05:18 PDT
Created attachment 325819 [details]
[PATCH] Proposed Fix
Comment 3 Joseph Pecoraro 2017-11-02 19:07:36 PDT
Comment on attachment 325819 [details]
[PATCH] Proposed Fix

Going to not mark this as review right now since switching to the Elements tab sometimes doesn't bring all of its Details sidebars... so probably an existing bug.
Comment 4 Joseph Pecoraro 2017-11-02 20:22:45 PDT
Created attachment 325832 [details]
[PATCH] Proposed Fix

Here we go, fixing the tab switching issue, which ran pretty deep into ContentBrowser.
Comment 5 Joseph Pecoraro 2017-11-02 20:24:00 PDT
Created attachment 325833 [details]
[IMAGE] DOM Tree in Search Tab
Comment 6 Joseph Pecoraro 2017-11-02 20:24:21 PDT
Created attachment 325834 [details]
[IMAGE] Context Menu in Search Tab
Comment 7 Devin Rousso 2017-11-06 01:10:43 PST
Comment on attachment 325832 [details]
[PATCH] Proposed Fix

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

r=me

> Source/WebInspectorUI/ChangeLog:19
> +        (WI.SearchTabContentView):
> +        Check experimental setting for experimental sidebars.

This is unrelated.  Did you forget to upload part of the diff, or is this from another patch?

> Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js:236
> +        let currentContentView = this.currentContentView;
> +        this._updateContentViewSelectionPathNavigationItem(currentContentView);
> +        this._updateHierarchicalPathNavigationItem(currentContentView ? currentContentView.representedObject : null);

I would personally restructure this to make use of existing functions.

    this._updateContentViewSelectionPathNavigationItem(this.currentContentView);
    this.updateHierarchicalPathForCurrentContentView();
Comment 8 Joseph Pecoraro 2017-11-06 10:49:08 PST
Comment on attachment 325832 [details]
[PATCH] Proposed Fix

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

>> Source/WebInspectorUI/ChangeLog:19
>> +        Check experimental setting for experimental sidebars.
> 
> This is unrelated.  Did you forget to upload part of the diff, or is this from another patch?

Ross actually landed this part, heh.

>> Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js:236
>> +        this._updateHierarchicalPathNavigationItem(currentContentView ? currentContentView.representedObject : null);
> 
> I would personally restructure this to make use of existing functions.
> 
>     this._updateContentViewSelectionPathNavigationItem(this.currentContentView);
>     this.updateHierarchicalPathForCurrentContentView();

Sounds good!
Comment 9 Joseph Pecoraro 2017-11-06 10:57:18 PST
<https://trac.webkit.org/r224499>