Title: [126435] trunk/Source/WebCore
Revision
126435
Author
[email protected]
Date
2012-08-23 08:59:52 -0700 (Thu, 23 Aug 2012)

Log Message

Web Inspector: introduce canFilter on panel (otherwise we check for function existence).
https://bugs.webkit.org/show_bug.cgi?id=94820

Reviewed by Alexander Pavlov.

Drive-by: fix for network panel sorting null pointer access.

* inspector/front-end/NetworkPanel.js:
(WebInspector.NetworkPanel.prototype.performSearch):
(WebInspector.NetworkPanel.prototype.canFilter):
* inspector/front-end/Panel.js:
(WebInspector.Panel.prototype.replaceAllWith):
(WebInspector.Panel.prototype.canFilter):
(WebInspector.Panel.prototype.performFilter):
* inspector/front-end/SearchController.js:
(WebInspector.SearchController.prototype._updateFilterVisibility):
(WebInspector.SearchController.prototype._performFilter):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (126434 => 126435)


--- trunk/Source/WebCore/ChangeLog	2012-08-23 15:58:58 UTC (rev 126434)
+++ trunk/Source/WebCore/ChangeLog	2012-08-23 15:59:52 UTC (rev 126435)
@@ -1,5 +1,25 @@
 2012-08-23  Pavel Feldman  <[email protected]>
 
+        Web Inspector: introduce canFilter on panel (otherwise we check for function existence).
+        https://bugs.webkit.org/show_bug.cgi?id=94820
+
+        Reviewed by Alexander Pavlov.
+
+        Drive-by: fix for network panel sorting null pointer access.
+
+        * inspector/front-end/NetworkPanel.js:
+        (WebInspector.NetworkPanel.prototype.performSearch):
+        (WebInspector.NetworkPanel.prototype.canFilter):
+        * inspector/front-end/Panel.js:
+        (WebInspector.Panel.prototype.replaceAllWith):
+        (WebInspector.Panel.prototype.canFilter):
+        (WebInspector.Panel.prototype.performFilter):
+        * inspector/front-end/SearchController.js:
+        (WebInspector.SearchController.prototype._updateFilterVisibility):
+        (WebInspector.SearchController.prototype._performFilter):
+
+2012-08-23  Pavel Feldman  <[email protected]>
+
         Web Inspector: introduce TimelineGrid.Calculator interface.
         https://bugs.webkit.org/show_bug.cgi?id=94819
 

Modified: trunk/Source/WebCore/inspector/front-end/NetworkPanel.js (126434 => 126435)


--- trunk/Source/WebCore/inspector/front-end/NetworkPanel.js	2012-08-23 15:58:58 UTC (rev 126434)
+++ trunk/Source/WebCore/inspector/front-end/NetworkPanel.js	2012-08-23 15:59:52 UTC (rev 126435)
@@ -305,7 +305,7 @@
         this._timelineSortSelector.selectedIndex = 0;
         this._updateOffscreenRows();
 
-        this.performSearch(null);
+        this.searchCanceled();
     },
 
     _sortByTimeline: function()
@@ -451,7 +451,7 @@
             selectMultiple = true;
 
         this._filter(e.target, selectMultiple);
-        this.performSearch(null);
+        this.searchCanceled();
         this._updateSummaryBar();
     },
 
@@ -1083,6 +1083,7 @@
 
     _clearSearchMatchedList: function()
     {
+        delete this._searchRegExp;
         this._matchedRequests = [];
         this._matchedRequestsMap = {};
         this._removeAllHighlights();
@@ -1170,8 +1171,8 @@
         if (this._currentMatchedRequestIndex !== -1)
             currentMatchedRequestId = this._matchedRequests[this._currentMatchedRequestIndex];
 
+        this._clearSearchMatchedList();
         this._searchRegExp = createPlainTextSearchRegex(searchQuery, "i");
-        this._clearSearchMatchedList();
 
         var childNodes = this._dataGrid.dataTableBody.childNodes;
         var requestNodes = Array.prototype.slice.call(childNodes, 0, childNodes.length - 1); // drop the filler row.
@@ -1463,13 +1464,21 @@
 
     /**
      * @param {string} searchQuery
-     */    
+     */
     performSearch: function(searchQuery)
     {
         this._networkLogView.performSearch(searchQuery);
     },
-    
+
     /**
+     * @return {boolean}
+     */
+    canFilter: function()
+    {
+        return true;
+    },
+
+    /**
      * @param {string} query
      */    
     performFilter: function(query)

Modified: trunk/Source/WebCore/inspector/front-end/Panel.js (126434 => 126435)


--- trunk/Source/WebCore/inspector/front-end/Panel.js	2012-08-23 15:58:58 UTC (rev 126434)
+++ trunk/Source/WebCore/inspector/front-end/Panel.js	2012-08-23 15:59:52 UTC (rev 126435)
@@ -126,13 +126,29 @@
     },
 
     /**
+     * @param {string} query
      * @param {string} text
      */
-    replaceAllWith: function(text)
+    replaceAllWith: function(query, text)
     {
     },
 
     /**
+     * @return {boolean}
+     */
+    canFilter: function()
+    {
+        return false;
+    },
+
+    /**
+     * @param {string} query
+     */
+    performFilter: function(query)
+    {
+    },
+
+    /**
      * @param {Element=} parentElement
      * @param {string=} position
      * @param {number=} defaultWidth

Modified: trunk/Source/WebCore/inspector/front-end/SearchController.js (126434 => 126435)


--- trunk/Source/WebCore/inspector/front-end/SearchController.js	2012-08-23 15:58:58 UTC (rev 126434)
+++ trunk/Source/WebCore/inspector/front-end/SearchController.js	2012-08-23 15:59:52 UTC (rev 126435)
@@ -276,7 +276,7 @@
     
     _updateFilterVisibility: function()
     {
-        if (typeof WebInspector.inspectorView.currentPanel().performFilter === "function")
+        if (WebInspector.inspectorView.currentPanel().canFilter())
             this._filterCheckboxContainer.removeStyleClass("hidden");
         else
             this._filterCheckboxContainer.addStyleClass("hidden");
@@ -431,8 +431,7 @@
      */
     _performFilter: function(query)
     {
-        if (typeof WebInspector.inspectorView.currentPanel().performFilter === "function")
-            WebInspector.inspectorView.currentPanel().performFilter(query);
+        WebInspector.inspectorView.currentPanel().performFilter(query);
     },
   
     _onFilterInput: function(event)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to