Title: [192110] trunk/Source/WebInspectorUI
Revision
192110
Author
[email protected]
Date
2015-11-06 11:18:31 -0800 (Fri, 06 Nov 2015)

Log Message

Web Inspector: Search Results tab causes jump to Resources tab on reload
https://bugs.webkit.org/show_bug.cgi?id=150817

Reviewed by Brian Burg.

Remove the "search on reload" behavior from the Search Results tab. It often didn't find everything
on large pages, since it only searched after 500ms of the main resource changing. The bug here
was caused by performSearch selecting the first result, even if it was a background tab. We now
avoid doing unnecessary search work in the background when the Search Results tab isn't visible.

* UserInterface/Views/SearchSidebarPanel.js:
(WebInspector.SearchSidebarPanel): Deleted.
(WebInspector.SearchSidebarPanel.prototype._mainResourceDidChange): Remove children from the
sidebar since performSearch isn't doing it now and ScriptTreeElements were not being removed.
ResourceTreeElements were already being removed by NavigationSidebarPanel's prune behavior.
Removed the call to performSearch and related code.
(WebInspector.SearchSidebarPanel.prototype._mainResourceDidChange.delayedWork): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (192109 => 192110)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-11-06 18:52:57 UTC (rev 192109)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-11-06 19:18:31 UTC (rev 192110)
@@ -1,3 +1,23 @@
+2015-11-06  Timothy Hatcher  <[email protected]>
+
+        Web Inspector: Search Results tab causes jump to Resources tab on reload
+        https://bugs.webkit.org/show_bug.cgi?id=150817
+
+        Reviewed by Brian Burg.
+
+        Remove the "search on reload" behavior from the Search Results tab. It often didn't find everything
+        on large pages, since it only searched after 500ms of the main resource changing. The bug here
+        was caused by performSearch selecting the first result, even if it was a background tab. We now
+        avoid doing unnecessary search work in the background when the Search Results tab isn't visible.
+
+        * UserInterface/Views/SearchSidebarPanel.js:
+        (WebInspector.SearchSidebarPanel): Deleted.
+        (WebInspector.SearchSidebarPanel.prototype._mainResourceDidChange): Remove children from the
+        sidebar since performSearch isn't doing it now and ScriptTreeElements were not being removed.
+        ResourceTreeElements were already being removed by NavigationSidebarPanel's prune behavior.
+        Removed the call to performSearch and related code.
+        (WebInspector.SearchSidebarPanel.prototype._mainResourceDidChange.delayedWork): Deleted.
+
 2015-11-05  Matt Baker  <[email protected]>
 
         Web Inspector: Convert remaining ContentViews to View base class

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js (192109 => 192110)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js	2015-11-06 18:52:57 UTC (rev 192109)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js	2015-11-06 19:18:31 UTC (rev 192110)
@@ -47,8 +47,6 @@
 
         this.filterBar.placeholder = WebInspector.UIString("Filter Search Results");
 
-        this._lastSearchedPageSetting = new WebInspector.Setting("last-searched-page", null);
-
         this._searchQuerySetting = new WebInspector.Setting("search-sidebar-query", "");
         this._inputElement.value = this._searchQuerySetting.value;
 
@@ -81,7 +79,6 @@
 
         this._inputElement.value = searchQuery;
         this._searchQuerySetting.value = searchQuery;
-        this._lastSearchedPageSetting.value = searchQuery && WebInspector.frameResourceManager.mainFrame ? WebInspector.frameResourceManager.mainFrame.url.hash : null;
 
         this.hideEmptyContentPlaceholder();
 
@@ -342,26 +339,11 @@
             this._delayedSearchTimeout = undefined;
         }
 
+        this.contentTreeOutline.removeChildren();
         this.contentBrowser.contentViewContainer.closeAllContentViews();
 
         if (this.visible)
             this.focusSearchField();
-
-        // Only if the last page searched is the same as the current page.
-        var mainFrame = event.target;
-        if (this._lastSearchedPageSetting.value !== mainFrame.url.hash)
-            return;
-
-        function delayedWork()
-        {
-            this._delayedSearchTimeout = undefined;
-
-            // Search for whatever is in the input field. This was populated with the last used search term.
-            this.performSearch(this._inputElement.value);
-        }
-
-        // Perform the search on a delay so we have a better chance of finding subresource results.
-        this._delayedSearchTimeout = setTimeout(delayedWork.bind(this), 500);
     }
 
     _treeElementSelected(treeElement, selectedByUser)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to