Web Inspector: showing the Find banner doesn't immediately focus it
authorwebkit@devinrousso.com <webkit@devinrousso.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Apr 2017 00:41:19 +0000 (00:41 +0000)
committerwebkit@devinrousso.com <webkit@devinrousso.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Apr 2017 00:41:19 +0000 (00:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=169804

Reviewed by Matt Baker.

* UserInterface/Base/Main.js:
(WebInspector._focusChanged):
Slightly change the logic from <https://webkit.org/b/168119> (r213689) to not prevent a new
selection if the focus change target is an element from WebInspector.startEditing.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js

index 497ab5e..bd6d66f 100644 (file)
@@ -1,3 +1,15 @@
+2017-04-03  Devin Rousso  <webkit@devinrousso.com>
+
+        Web Inspector: showing the Find banner doesn't immediately focus it
+        https://bugs.webkit.org/show_bug.cgi?id=169804
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Base/Main.js:
+        (WebInspector._focusChanged):
+        Slightly change the logic from <https://webkit.org/b/168119> (r213689) to not prevent a new
+        selection if the focus change target is an element from WebInspector.startEditing.
+
 2017-04-03  Nikita Vasilyev  <nvasilyev@apple.com>
 
         Web Inspector: WebSockets: Don't store binary frames in memory since they are never shown
index 24fa74f..6da96cc 100644 (file)
@@ -1311,8 +1311,14 @@ WebInspector._focusChanged = function(event)
         if (codeMirrorEditorElement && codeMirrorEditorElement !== this.currentFocusElement) {
             this.previousFocusElement = this.currentFocusElement;
             this.currentFocusElement = codeMirrorEditorElement;
-            return;
         }
+
+        // Due to the change in WebInspector.isEventTargetAnEditableField (r196271), this return
+        // will also get run when WebInspector.startEditing is called on an element. We do not want
+        // to return early in this case, as WebInspector.EditingConfig handles its own editing
+        // completion, so only return early if the focus change target is not from WebInspector.startEditing.
+        if (!WebInspector.isBeingEdited(event.target))
+            return;
     }
 
     var selection = window.getSelection();