Web Inspector: Quick Open fails to match pattern "bB" in file "abBc"
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Apr 2016 16:04:24 +0000 (16:04 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Apr 2016 16:04:24 +0000 (16:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=156398

Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

Correct an off-by-one error in the backtrack routine that set the dead
branch index to the character just before the match that was popped.
The dead branch index should equal the index of the popped match.

* UserInterface/Controllers/ResourceQueryController.js:
(WebInspector.ResourceQueryController.prototype._findQueryMatches.backtrack):
(WebInspector.ResourceQueryController.prototype._findQueryMatches):

LayoutTests:

* inspector/unit-tests/resource-query-controller-expected.txt:
* inspector/unit-tests/resource-query-controller.html:
Test that two repeated characters in the search string are correctly
matched when the first character is lowercase and the second is uppercase.

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

LayoutTests/ChangeLog
LayoutTests/inspector/unit-tests/resource-query-controller-expected.txt
LayoutTests/inspector/unit-tests/resource-query-controller.html
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/ResourceQueryController.js

index be1a14b..dc2691b 100644 (file)
@@ -1,3 +1,15 @@
+2016-04-08  Matt Baker  <mattbaker@apple.com>
+
+        Web Inspector: Quick Open fails to match pattern "bB" in file "abBc"
+        https://bugs.webkit.org/show_bug.cgi?id=156398
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/unit-tests/resource-query-controller-expected.txt:
+        * inspector/unit-tests/resource-query-controller.html:
+        Test that two repeated characters in the search string are correctly
+        matched when the first character is lowercase and the second is uppercase.
+
 2016-04-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
 
         Testharness-based tests that time out should be able to produce a detailled output
index c098530..2e67cdf 100644 (file)
@@ -45,6 +45,7 @@ PASS: Query "abcde" should match "A B C D E" in "AaBbCcDdEe".
 PASS: Query "abcde" should match "A   B  C De" in "AbcdBcdCdDe".
 PASS: Query "abcdex" should match "A B C d ex" in "AxBxCxdxexDxyxEF".
 PASS: Query "bc" should match " bC" in "abCd".
+PASS: Query "bb" should match " bB" in "abBc".
 
 -- Running test case: ExecuteQueryShouldIgnoreCase
 All case permutations of query "abcd" should match "abcd" in "abcde".
index e9663a4..c877395 100644 (file)
@@ -179,6 +179,11 @@ function test()
                     filename: "abCd",
                     expected: " bC"
                 },
+                {
+                    query: "bb",
+                    filename: "abBc",
+                    expected: " bB"
+                }
             ];
 
             for (let {query, filename, expected} of tests) {
@@ -187,7 +192,7 @@ function test()
 
                 let results = matcher.executeQuery(query);
                 InspectorTest.assert(results.length === 1, "Should return exactly one match.");
-                let actual = results[0].__test_createMatchesMask();
+                let actual = results.length ? results[0].__test_createMatchesMask() : null;
                 InspectorTest.expectThat(actual === expected, `Query "${query}" should match "${expected}" in "${filename}".`);
             }
         }
index 71f002d..289078d 100644 (file)
@@ -1,3 +1,18 @@
+2016-04-08  Matt Baker  <mattbaker@apple.com>
+
+        Web Inspector: Quick Open fails to match pattern "bB" in file "abBc"
+        https://bugs.webkit.org/show_bug.cgi?id=156398
+
+        Reviewed by Timothy Hatcher.
+
+        Correct an off-by-one error in the backtrack routine that set the dead
+        branch index to the character just before the match that was popped.
+        The dead branch index should equal the index of the popped match.
+
+        * UserInterface/Controllers/ResourceQueryController.js:
+        (WebInspector.ResourceQueryController.prototype._findQueryMatches.backtrack):
+        (WebInspector.ResourceQueryController.prototype._findQueryMatches):
+
 2016-04-07  Matt Baker  <mattbaker@apple.com>
 
         Web Inspector: OpenResourceDialog should keep its resources list up-to-date
index 99bec60..126f151 100644 (file)
@@ -129,7 +129,7 @@ WebInspector.ResourceQueryController = class ResourceQueryController extends Web
                 if (lastMatch.type !== WebInspector.ResourceQueryMatch.Type.Special)
                     continue;
 
-                deadBranches[lastMatch.queryIndex] = lastMatch.index - 1;
+                deadBranches[lastMatch.queryIndex] = lastMatch.index;
                 searchIndex = matches.lastValue ? matches.lastValue.index + 1 : 0;
                 return true;
             }