WebKit Bugzilla
Attachment 346432 Details for
Bug 188270
: Web Inspector: Global search sometimes returns duplicate results for a resource
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] Proposed Fix
duplicates-2.patch (text/plain), 2.41 KB, created by
Joseph Pecoraro
on 2018-08-02 16:53:01 PDT
(
hide
)
Description:
[PATCH] Proposed Fix
Filename:
MIME Type:
Creator:
Joseph Pecoraro
Created:
2018-08-02 16:53:01 PDT
Size:
2.41 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index eefca0a9b0c..b7ed3494a16 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,16 @@ >+2018-08-02 Joseph Pecoraro <pecoraro@apple.com> >+ >+ Web Inspector: Global search sometimes returns duplicate results for a resource >+ https://bugs.webkit.org/show_bug.cgi?id=188270 >+ <rdar://problem/42867498> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Views/SearchSidebarPanel.js: >+ (WI.SearchSidebarPanel.prototype.performSearch.resourcesCallback): >+ Avoid duplicate search results in the frontend. We should also fix the backend >+ but a frontend fix will also be desired for backends that have the issue. >+ > 2018-07-31 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: Include a full URL tooltip when hovering the name in the Network Tab >diff --git a/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js b/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js >index 130c147f6e0..c91e137dcdd 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js >+++ b/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js >@@ -170,11 +170,20 @@ WI.SearchSidebarPanel = class SearchSidebarPanel extends WI.NavigationSidebarPan > updateEmptyContentPlaceholder.call(this); > } > >- for (var i = 0; i < result.length; ++i) { >- var searchResult = result[i]; >+ let preventDuplicates = new Set; >+ >+ for (let i = 0; i < result.length; ++i) { >+ let searchResult = result[i]; > if (!searchResult.url || !searchResult.frameId) > continue; > >+ // FIXME: Backend sometimes searches files twice. >+ // Note we will still want this to fix legacy backends. >+ let key = searchResult.frameId + ":" + searchResult.url; >+ if (preventDuplicates.has(key)) >+ continue; >+ preventDuplicates.add(key); >+ > // COMPATIBILITY (iOS 9): Page.searchInResources did not have the optional requestId parameter. > PageAgent.searchInResource(searchResult.frameId, searchResult.url, searchQuery, isCaseSensitive, isRegex, searchResult.requestId, resourceCallback.bind(this, searchResult.frameId, searchResult.url)); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bburg
:
review+
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188270
: 346432 |
346462