Bug 174047 - Web Inspector: Initial search is sometimes performed twice, produces duplicate results
Summary: Web Inspector: Initial search is sometimes performed twice, produces duplicat...
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: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-06-30 15:06 PDT by Joseph Pecoraro
Modified: 2017-06-30 15:45 PDT (History)
6 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (1.62 KB, patch)
2017-06-30 15:17 PDT, Joseph Pecoraro
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 2017-06-30 15:06:28 PDT
Summary:
Initial search is sometimes performed twice

Steps to Reproduce:
1. Setup: Ensure opening inspector will not have a search tab.
2. Inspect <http://bogojoker.com/shell/>
3. Perform a global search for "reset.css"
  => Search tab is created and there are two results for "reset.css" in the same file
4. Re-perform the search
  => Just 1 result. As expected.

Notes:
- Seems to be related to opening the tab the first time.
Comment 1 Joseph Pecoraro 2017-06-30 15:09:17 PDT
Here are the traces for the initial case:

    [Log] Trace: PageAgent.searchInResources - reset.css
    	performSearch (SearchSidebarPanel.js:284)
    	performSearch (SearchTabContentView.js:88)
    	_searchTextDidChange (Main.js:1272)
    	dispatch (Object.js:170)
    	dispatchEventToListeners (Object.js:177)
    	_handleSearchEvent (SearchBar.js:75)
    	_handleSearchEvent

    [Log] Trace: PageAgent.searchInResources - reset.css
    	performSearch (SearchSidebarPanel.js:284)
    	focusSearchField (SearchSidebarPanel.js:74)
    	focusSearchField (SearchTabContentView.js:81)
    	focusSearchField

And normal case once inside of the sidebar:

    [Log] Trace: PageAgent.searchInResources - reset.css
    	performSearch (SearchSidebarPanel.js:284)
    	_searchFieldChanged (SearchSidebarPanel.js:309)
    	_searchFieldChanged
Comment 2 Joseph Pecoraro 2017-06-30 15:11:57 PDT
>     [Log] Trace: PageAgent.searchInResources - reset.css
>     	performSearch (SearchSidebarPanel.js:284)
>     	focusSearchField (SearchSidebarPanel.js:74)
>     	focusSearchField (SearchTabContentView.js:81)
>     	focusSearchField

SearchTabContentView's initialLayout sets this._forcePerformSearch which should not be necessary if the Global Search opened the tab + triggered a search.
Comment 3 Joseph Pecoraro 2017-06-30 15:17:55 PDT
Created attachment 314300 [details]
[PATCH] Proposed Fix
Comment 4 Devin Rousso 2017-06-30 15:19:23 PDT
Comment on attachment 314300 [details]
[PATCH] Proposed Fix

r=me
Comment 5 WebKit Commit Bot 2017-06-30 15:45:11 PDT
Comment on attachment 314300 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 314300

Committed r219021: <http://trac.webkit.org/changeset/219021>
Comment 6 WebKit Commit Bot 2017-06-30 15:45:12 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Jonathan Bedard 2017-06-30 15:45:59 PDT
<rdar://problem/33086273>