Web Inspector: ResourceQueryController should early return when query is longer than...
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Nov 2018 07:13:25 +0000 (07:13 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Nov 2018 07:13:25 +0000 (07:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191436

Reviewed by Devin Rousso.

* UserInterface/Controllers/ResourceQueryController.js:

* UserInterface/Models/ResourceQueryMatch.js:
(WI.ResourceQueryMatch):
Drive-by fixes.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/ResourceQueryController.js
Source/WebInspectorUI/UserInterface/Models/ResourceQueryMatch.js

index d96f9ff..171dcf1 100644 (file)
@@ -1,3 +1,16 @@
+2018-11-08  Matt Baker  <mattbaker@apple.com>
+
+        Web Inspector: ResourceQueryController should early return when query is longer than search string
+        https://bugs.webkit.org/show_bug.cgi?id=191436
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Controllers/ResourceQueryController.js:
+
+        * UserInterface/Models/ResourceQueryMatch.js:
+        (WI.ResourceQueryMatch):
+        Drive-by fixes.
+
 2018-11-08  Joseph Pecoraro  <pecoraro@apple.com>
 
         Uncaught Exception: undefined is not an object (evaluating 'treeElement.parent.removeChild')
index 5a9f3d8..339c241 100644 (file)
@@ -91,6 +91,9 @@ WI.ResourceQueryController = class ResourceQueryController extends WI.Object
 
     _findQueryMatches(query, searchString, specialCharacterIndices)
     {
+        if (query.length > searchString.length)
+            return [];
+
         let matches = [];
         let queryIndex = 0;
         let searchIndex = 0;
index 90c1df0..1d140da 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WI.ResourceQueryMatch = class QueryMatch
+WI.ResourceQueryMatch = class ResourceQueryMatch
 {
     constructor(type, index, queryIndex)
     {
         this._type = type;
         this._index = index;
         this._queryIndex = queryIndex;
-        this._rank = undefined;
     }
 
     // Public