Title: [221332] trunk/Source/WebInspectorUI
Revision
221332
Author
commit-qu...@webkit.org
Date
2017-08-29 18:29:25 -0700 (Tue, 29 Aug 2017)

Log Message

REGRESSION(r220235): Web Inspector: Global search should not happen incrementally
https://bugs.webkit.org/show_bug.cgi?id=176063

Patch by Joseph Pecoraro <pecor...@apple.com> on 2017-08-29
Reviewed by Devin Rousso.

* UserInterface/Base/Main.js:
(WI.contentLoaded):
* UserInterface/Views/SearchBar.js:
(WI.SearchBar):
(WI.SearchBar.prototype._handleKeydownEvent):
Remove delegate and simplify setting incremental.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (221331 => 221332)


--- trunk/Source/WebInspectorUI/ChangeLog	2017-08-30 01:27:18 UTC (rev 221331)
+++ trunk/Source/WebInspectorUI/ChangeLog	2017-08-30 01:29:25 UTC (rev 221332)
@@ -1,3 +1,17 @@
+2017-08-29  Joseph Pecoraro  <pecor...@apple.com>
+
+        REGRESSION(r220235): Web Inspector: Global search should not happen incrementally
+        https://bugs.webkit.org/show_bug.cgi?id=176063
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Base/Main.js:
+        (WI.contentLoaded):
+        * UserInterface/Views/SearchBar.js:
+        (WI.SearchBar):
+        (WI.SearchBar.prototype._handleKeydownEvent):
+        Remove delegate and simplify setting incremental.
+
 2017-08-29  Nikita Vasilyev  <nvasil...@apple.com>
 
         Web Inspector: Convert all methods in Utilities.js to ECMAScript 2015 shorthand syntax

Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (221331 => 221332)


--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2017-08-30 01:27:18 UTC (rev 221331)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2017-08-30 01:29:25 UTC (rev 221332)
@@ -397,7 +397,8 @@
     this._dashboardContainer = new WI.DashboardContainerView;
     this._dashboardContainer.showDashboardViewForRepresentedObject(this.dashboardManager.dashboards.default);
 
-    this._searchToolbarItem = new WI.SearchBar("inspector-search", WI.UIString("Search"), true);
+    const incremental = false;
+    this._searchToolbarItem = new WI.SearchBar("inspector-search", WI.UIString("Search"), incremental);
     this._searchToolbarItem.addEventListener(WI.SearchBar.Event.TextChanged, this._searchTextDidChange, this);
 
     this.toolbar.addToolbarItem(this._closeToolbarButton, WI.Toolbar.Section.Control);

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SearchBar.js (221331 => 221332)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SearchBar.js	2017-08-30 01:27:18 UTC (rev 221331)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SearchBar.js	2017-08-30 01:29:25 UTC (rev 221332)
@@ -25,12 +25,10 @@
 
 WI.SearchBar = class SearchBar extends WI.NavigationItem
 {
-    constructor(identifier, placeholder, delegate, suppressIncremental)
+    constructor(identifier, placeholder, incremental)
     {
         super(identifier);
 
-        this.delegate = delegate;
-
         this._element.classList.add("search-bar");
 
         this._keyboardShortcutEsc = new WI.KeyboardShortcut(null, WI.KeyboardShortcut.Key.Escape);
@@ -39,12 +37,11 @@
         this._searchInput = this._element.appendChild(document.createElement("input"));
         this._searchInput.type = "search";
         this._searchInput.spellcheck = false;
-        this._searchInput.incremental = !suppressIncremental;
+        this._searchInput.incremental = incremental;
         this._searchInput.setAttribute("results", 5);
         this._searchInput.setAttribute("autosave", identifier + "-autosave");
         this._searchInput.setAttribute("placeholder", placeholder);
         this._searchInput.addEventListener("search", this._handleSearchEvent.bind(this));
-        this._searchInput.addEventListener("keydown", this._handleKeydownEvent.bind(this));
     }
 
     // Public
@@ -74,23 +71,6 @@
     {
         this.dispatchEventToListeners(WI.SearchBar.Event.TextChanged);
     }
-
-    _handleKeydownEvent(event)
-    {
-        if (this._keyboardShortcutEsc.matchesEvent(event)) {
-            if (this.delegate && typeof this.delegate.searchBarWantsToLoseFocus === "function") {
-                this.delegate.searchBarWantsToLoseFocus(this);
-                event.stopPropagation();
-                event.preventDefault();
-            }
-        } else if (this._keyboardShortcutEnter.matchesEvent(event)) {
-            if (this.delegate && typeof this.delegate.searchBarDidActivate === "function") {
-                this.delegate.searchBarDidActivate(this);
-                event.stopPropagation();
-                event.preventDefault();
-            }
-        }
-    }
 };
 
 WI.SearchBar.Event = {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to