Web Inspector: NetworkPanel search failed if the matched sting is in the query part...
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Jul 2011 15:53:56 +0000 (15:53 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Jul 2011 15:53:56 +0000 (15:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=64167

Reviewed by Yury Semikhatsky.

* inspector/front-end/NetworkPanel.js:
(WebInspector.NetworkPanel.prototype._matchResource):
(WebInspector.NetworkPanel.prototype._highlightNthMatchedResource):
(WebInspector.NetworkDataGridNode.prototype._refreshNameCell):
* inspector/front-end/Resource.js:
(WebInspector.Resource.prototype.get folder):

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

Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/NetworkPanel.js
Source/WebCore/inspector/front-end/Resource.js

index df7c5e42dd2c9e2b34ccd415dd325c7de63b3dad..a4a540885ef8c6d3411874c111c315edfce5ae32 100644 (file)
@@ -1,3 +1,17 @@
+2011-07-08  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Web Inspector: NetworkPanel search failed if the matched sting is in the query part of url
+        https://bugs.webkit.org/show_bug.cgi?id=64167
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/NetworkPanel.js:
+        (WebInspector.NetworkPanel.prototype._matchResource):
+        (WebInspector.NetworkPanel.prototype._highlightNthMatchedResource):
+        (WebInspector.NetworkDataGridNode.prototype._refreshNameCell):
+        * inspector/front-end/Resource.js:
+        (WebInspector.Resource.prototype.get folder):
+
 2011-07-08  Benjamin Poulain  <benjamin@webkit.org>
 
         [Qt] Enable HTTP Pipelining by default
index 90f8583386ed3e898555e213f4bebc97e50820c6..b4a5b6ad56cb38ae3f4b4ff59781de5196aa82fa 100644 (file)
@@ -1117,7 +1117,7 @@ WebInspector.NetworkPanel.prototype = {
         if (!this._searchRegExp)
             return -1;
 
-        if ((!resource.displayName || !resource.displayName.match(this._searchRegExp)) && (!resource.path || !resource.path.match(this._searchRegExp)))
+        if ((!resource.displayName || !resource.displayName.match(this._searchRegExp)) && !resource.folder.match(this._searchRegExp))
             return -1;
 
         if (resource.identifier in this._matchedResourcesMap)
@@ -1168,7 +1168,7 @@ WebInspector.NetworkPanel.prototype = {
             return;
 
         var nameMatched = resource.displayName && resource.displayName.match(this._searchRegExp);
-        var pathMatched = resource.path && resource.path.match(this._searchRegExp);
+        var pathMatched = resource.path && resource.folder.match(this._searchRegExp);
         if (!nameMatched && pathMatched && !this._largerResourcesButton.toggled)
             this._toggleLargerResources();
 
@@ -1658,11 +1658,8 @@ WebInspector.NetworkDataGridNode.prototype = {
 
         var subtitle = this._resource.displayDomain;
 
-        if (this._resource.path && this._resource.lastPathComponent) {
-            var lastPathComponentIndex = this._resource.path.lastIndexOf("/" + this._resource.lastPathComponent);
-            if (lastPathComponentIndex != -1)
-                subtitle += this._resource.path.substring(0, lastPathComponentIndex);
-        }
+        if (this._resource.path)
+            subtitle += this._resource.folder;
 
         this._appendSubtitle(this._nameCell, subtitle);
         this._nameCell.title = this._resource.url;
index a104035aa9c451008d55ed46577af31fb48d3975..92a53ee77174e58cbeb2b5b28b837466c00fba2c 100644 (file)
@@ -247,6 +247,16 @@ WebInspector.Resource.prototype = {
         return this._displayName;
     },
 
+    get folder()
+    {
+        var path = this.path;
+        var indexOfQuery = path.indexOf("?");
+        if (indexOfQuery !== -1)
+            path = path.substring(0, indexOfQuery);
+        var lastSlashIndex = path.lastIndexOf("/");
+        return lastSlashIndex !== -1 ? path.substring(0, lastSlashIndex) : "";
+    },
+
     get displayDomain()
     {
         // WebInspector.Database calls this, so don't access more than this.domain.