Web Inspector: ⌘G / ⇧⌘G text search does not working after closing find banner
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Jan 2018 20:56:43 +0000 (20:56 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Jan 2018 20:56:43 +0000 (20:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=181280
<rdar://problem/36291175>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-01-04
Reviewed by Matt Baker.

* UserInterface/Views/ContentBrowser.js:
(WI.ContentBrowser.prototype._findBannerDidHide):
When the find banner is hidden trigger a new ContentView method,
searchHidden instead of the destructive searchCleared. This allows
most content views (text editors, DOM tree, Network Headers view)
to keep their populated search results.

* UserInterface/Views/ContentView.js:
(WI.ContentView.prototype.searchHidden):
* UserInterface/Views/LogContentView.js:
(WI.LogContentView.prototype.searchHidden):
By default searchHidden does nothing. The Console's LogContentView
treats the find banner differently and clears its search results.

* UserInterface/Views/TextEditor.js:
(WI.TextEditor.prototype.searchCleared):
Modernize some code while working in this area.

* UserInterface/Views/Main.css:
(.bouncy-highlight):
Ensure black text on yellow background in the bouncy highlight. In the
DOM Tree it could have been white if the find banner was closed.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/ContentBrowser.js
Source/WebInspectorUI/UserInterface/Views/ContentView.js
Source/WebInspectorUI/UserInterface/Views/LogContentView.js
Source/WebInspectorUI/UserInterface/Views/Main.css
Source/WebInspectorUI/UserInterface/Views/TextEditor.js

index bb47a9f..a7cb874 100644 (file)
@@ -1,3 +1,34 @@
+2018-01-04  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: ⌘G / ⇧⌘G text search does not working after closing find banner
+        https://bugs.webkit.org/show_bug.cgi?id=181280
+        <rdar://problem/36291175>
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Views/ContentBrowser.js:
+        (WI.ContentBrowser.prototype._findBannerDidHide):
+        When the find banner is hidden trigger a new ContentView method,
+        searchHidden instead of the destructive searchCleared. This allows
+        most content views (text editors, DOM tree, Network Headers view)
+        to keep their populated search results.
+
+        * UserInterface/Views/ContentView.js:
+        (WI.ContentView.prototype.searchHidden):
+        * UserInterface/Views/LogContentView.js:
+        (WI.LogContentView.prototype.searchHidden):
+        By default searchHidden does nothing. The Console's LogContentView
+        treats the find banner differently and clears its search results.
+
+        * UserInterface/Views/TextEditor.js:
+        (WI.TextEditor.prototype.searchCleared):
+        Modernize some code while working in this area.
+
+        * UserInterface/Views/Main.css:
+        (.bouncy-highlight):
+        Ensure black text on yellow background in the bouncy highlight. In the
+        DOM Tree it could have been white if the find banner was closed.
+
 2018-01-03  Ting-Wei Lan  <lantw44@gmail.com>
 
         Replace hard-coded paths in shebangs with #!/usr/bin/env
index 5c223bb..1bfadab 100644 (file)
@@ -325,7 +325,7 @@ WI.ContentBrowser = class ContentBrowser extends WI.View
             return;
 
         currentContentView.automaticallyRevealFirstSearchResult = false;
-        currentContentView.searchCleared();
+        currentContentView.searchHidden();
     }
 
     _contentViewNumberOfSearchResultsDidChange(event)
index fc1b817..459e8cd 100644 (file)
@@ -445,6 +445,11 @@ WI.ContentView = class ContentView extends WI.View
         // Implemented by subclasses.
     }
 
+    searchHidden()
+    {
+        // Implemented by subclasses.
+    }
+
     searchCleared()
     {
         // Implemented by subclasses.
index 3211710..4a2765d 100644 (file)
@@ -1076,6 +1076,11 @@ WI.LogContentView = class LogContentView extends WI.ContentView
         }
     }
 
+    searchHidden()
+    {
+        this.searchCleared();
+    }
+
     searchCleared()
     {
         this.performSearch("");
index 124f47d..fee9626 100644 (file)
@@ -333,6 +333,7 @@ body[dir=rtl] .go-to-arrow {
     box-shadow: inset hsl(50, 91%, 76%) 0 -1px 0, hsl(52, 56%, 60%) 0 1px 1px, hsla(0, 0%, 0%, 0.33) 0 1px 2px 1px;
 
     background-color: hsl(54, 93%, 70%);
+    color: black !important;
 
     padding: 2px 4px;
     margin-top: -2px;
index 0e742c7..c3d3fc8 100644 (file)
@@ -406,12 +406,10 @@ WI.TextEditor = class TextEditor extends WI.View
 
     searchCleared()
     {
-        function clearResults() {
-            for (var i = 0; i < this._searchResults.length; ++i)
-                this._searchResults[i].clear();
-        }
-
-        this._codeMirror.operation(clearResults.bind(this));
+        this._codeMirror.operation(() => {
+            for (let searchResult of this._searchResults)
+                searchResult.clear();
+        });
 
         this._searchQuery = null;
         this._searchResults = [];