Web Inspector: Search doesn't seem to find text that is present in multiple places
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Feb 2016 01:55:48 +0000 (01:55 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Feb 2016 01:55:48 +0000 (01:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=154016
<rdar://problem/23391307>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-02-08
Reviewed by Brian Burg.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype.get searchableScripts):
* UserInterface/Views/SearchSidebarPanel.js:
(WebInspector.SearchSidebarPanel.prototype.performSearch):
Only search scripts with a URL. Don't search the potentially
large number of anonymous scripts.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196285 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js

index 22ee26c..c7aed09 100644 (file)
@@ -1,5 +1,20 @@
 2016-02-08  Joseph Pecoraro  <pecoraro@apple.com>
 
+        Web Inspector: Search doesn't seem to find text that is present in multiple places
+        https://bugs.webkit.org/show_bug.cgi?id=154016
+        <rdar://problem/23391307>
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Controllers/DebuggerManager.js:
+        (WebInspector.DebuggerManager.prototype.get searchableScripts):
+        * UserInterface/Views/SearchSidebarPanel.js:
+        (WebInspector.SearchSidebarPanel.prototype.performSearch):
+        Only search scripts with a URL. Don't search the potentially
+        large number of anonymous scripts.
+
+2016-02-08  Joseph Pecoraro  <pecoraro@apple.com>
+
         Web Inspector: Zooming in on the timeline graph does not increase its time resolution from minutes
         https://bugs.webkit.org/show_bug.cgi?id=154013
         <rdar://problem/23844527>
index 427adb0..34444ff 100644 (file)
@@ -316,6 +316,11 @@ WebInspector.DebuggerManager = class DebuggerManager extends WebInspector.Object
         DebuggerAgent.continueToLocation({scriptId: scriptIdentifier, lineNumber, columnNumber});
     }
 
+    get searchableScripts()
+    {
+        return this.knownNonResourceScripts.filter((script) => !!script.url);
+    }
+
     get knownNonResourceScripts()
     {
         let knownScripts = [];
index 81c8588..bd05fd5 100644 (file)
@@ -270,7 +270,7 @@ WebInspector.SearchSidebarPanel = class SearchSidebarPanel extends WebInspector.
         if (window.PageAgent)
             PageAgent.searchInResources(searchQuery, isCaseSensitive, isRegex, resourcesCallback.bind(this));
 
-        setTimeout(searchScripts.bind(this, WebInspector.debuggerManager.knownNonResourceScripts), 0);
+        setTimeout(searchScripts.bind(this, WebInspector.debuggerManager.searchableScripts), 0);
 
         if (window.DOMAgent) {
             if (this._domSearchIdentifier) {