Title: [185134] trunk/Source/WebInspectorUI
Revision
185134
Author
commit-qu...@webkit.org
Date
2015-06-02 16:56:12 -0700 (Tue, 02 Jun 2015)

Log Message

Web Inspector: Shift + Cmd + Left/Right shouldn't switch tabs while editing text
https://bugs.webkit.org/show_bug.cgi?id=145562

Patch by Joseph Pecoraro <pecor...@apple.com> on 2015-06-02
Reviewed by Timothy Hatcher.

* UserInterface/Views/TabBrowser.js:
(WebInspector.TabBrowser):
Only these keyboard shortcuts should check if we are in an editable field.
Remove the implicit prevent default so they can fall back to system behavior
if necessary.

(WebInspector.TabBrowser.prototype._showNextTabCheckingForEditableField):
(WebInspector.TabBrowser.prototype._showPreviousTabCheckingForEditableField):
Bail if we are in an editable field. Otherwise perform the action and prevent default.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (185133 => 185134)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-06-02 23:51:18 UTC (rev 185133)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-06-02 23:56:12 UTC (rev 185134)
@@ -1,5 +1,22 @@
 2015-06-02  Joseph Pecoraro  <pecor...@apple.com>
 
+        Web Inspector: Shift + Cmd + Left/Right shouldn't switch tabs while editing text
+        https://bugs.webkit.org/show_bug.cgi?id=145562
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/TabBrowser.js:
+        (WebInspector.TabBrowser):
+        Only these keyboard shortcuts should check if we are in an editable field.
+        Remove the implicit prevent default so they can fall back to system behavior
+        if necessary.
+
+        (WebInspector.TabBrowser.prototype._showNextTabCheckingForEditableField):
+        (WebInspector.TabBrowser.prototype._showPreviousTabCheckingForEditableField):
+        Bail if we are in an editable field. Otherwise perform the action and prevent default.
+
+2015-06-02  Joseph Pecoraro  <pecor...@apple.com>
+
         Web Inspector: ⌘F no longer brings up the find-in-page bar after typing in the quick console
         https://bugs.webkit.org/show_bug.cgi?id=145546
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TabBrowser.js (185133 => 185134)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TabBrowser.js	2015-06-02 23:51:18 UTC (rev 185133)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TabBrowser.js	2015-06-02 23:56:12 UTC (rev 185134)
@@ -57,9 +57,12 @@
         this._showPreviousTabKeyboardShortcut1 = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, WebInspector.KeyboardShortcut.Key.LeftCurlyBrace, showPreviousTab);
         this._showNextTabKeyboardShortcut2 = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control, WebInspector.KeyboardShortcut.Key.Tab, showNextTab);
         this._showPreviousTabKeyboardShortcut2 = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.Control | WebInspector.KeyboardShortcut.Modifier.Shift, WebInspector.KeyboardShortcut.Key.Tab, showPreviousTab);
-        this._showNextTabKeyboardShortcut3 = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, WebInspector.KeyboardShortcut.Key.Right, showNextTab);
-        this._showPreviousTabKeyboardShortcut3 = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, WebInspector.KeyboardShortcut.Key.Left, showPreviousTab);
 
+        this._showNextTabKeyboardShortcut3 = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, WebInspector.KeyboardShortcut.Key.Right, this._showNextTabCheckingForEditableField.bind(this));
+        this._showNextTabKeyboardShortcut3.implicitlyPreventsDefault = false;
+        this._showPreviousTabKeyboardShortcut3 = new WebInspector.KeyboardShortcut(WebInspector.KeyboardShortcut.Modifier.CommandOrControl | WebInspector.KeyboardShortcut.Modifier.Shift, WebInspector.KeyboardShortcut.Key.Left, this._showPreviousTabCheckingForEditableField.bind(this));
+        this._showPreviousTabKeyboardShortcut3.implicitlyPreventsDefault = false;
+
         this._tabBar.newTabItem = new WebInspector.TabBarItem("Images/NewTabPlus.svg", WebInspector.UIString("Create a new tab"), true);
 
         this._tabBar.addEventListener(WebInspector.TabBar.Event.TabBarItemSelected, this._tabBarItemSelected, this);
@@ -351,6 +354,26 @@
     {
         this._tabBar.selectNextTab();
     }
+
+    _showNextTabCheckingForEditableField(event)
+    {
+        if (WebInspector.isEventTargetAnEditableField(event))
+            return;
+
+        this._showNextTab(event);
+
+        event.preventDefault();
+    }
+
+    _showPreviousTabCheckingForEditableField(event)
+    {
+        if (WebInspector.isEventTargetAnEditableField(event))
+            return;
+
+        this._showPreviousTab(event);
+
+        event.preventDefault();
+    }
 };
 
 WebInspector.TabBrowser.Event = {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to