Bug 58537

Summary: Web Inspector: TAB should not move focus from the text editor while live editing
Product: WebKit Reporter: Andrey Adaikin <aandrey>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, apavlov, bweinstein, commit-queue, eric, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

Description Andrey Adaikin 2011-04-14 06:31:47 PDT
Seems like we should override the native behavior for the TAB key.
Comment 1 Andrey Adaikin 2011-04-15 08:18:33 PDT
Created attachment 89791 [details]
Patch
Comment 2 Yury Semikhatsky 2011-04-18 02:58:11 PDT
Comment on attachment 89791 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=89791&action=review

> Source/WebCore/inspector/front-end/TextViewer.js:243
> +        var handleUndo = this._mainPanel.handleUndoRedo.bind(this._mainPanel, 0);

Why do we prefer 0/1 to false/true here?

> Source/WebCore/inspector/front-end/TextViewer.js:951
> +        this._setCaretLocation(newRange.endLine, newRange.endColumn);

Shouldn't we scroll the viewer to the new caret location?
Comment 3 Andrey Adaikin 2011-04-18 03:42:51 PDT
Done. Diff to apply before the commit:


diff --git a/Source/WebCore/inspector/front-end/TextViewer.js b/Source/WebCore/inspector/front-end/TextViewer.js
index 09c3092..8f823cf 100644
--- a/Source/WebCore/inspector/front-end/TextViewer.js
+++ b/Source/WebCore/inspector/front-end/TextViewer.js
@@ -240,13 +240,13 @@ WebInspector.TextViewer.prototype = {
         this._shortcuts[WebInspector.KeyboardShortcut.makeKey(keys.Enter.code, modifiers.CtrlOrMeta)] = commitEditing;
         this._shortcuts[WebInspector.KeyboardShortcut.makeKey(keys.Esc.code)] = cancelEditing;
 
-        var handleUndo = this._mainPanel.handleUndoRedo.bind(this._mainPanel, 0);
-        var handleRedo = this._mainPanel.handleUndoRedo.bind(this._mainPanel, 1);
+        var handleUndo = this._mainPanel.handleUndoRedo.bind(this._mainPanel, false);
+        var handleRedo = this._mainPanel.handleUndoRedo.bind(this._mainPanel, true);
         this._shortcuts[WebInspector.KeyboardShortcut.makeKey("z", modifiers.CtrlOrMeta)] = handleUndo;
         this._shortcuts[WebInspector.KeyboardShortcut.makeKey("z", modifiers.Shift | modifiers.CtrlOrMeta)] = handleRedo;
 
-        var handleTabKey = this._mainPanel.handleTabKeyPress.bind(this._mainPanel, 0);
-        var handleShiftTabKey = this._mainPanel.handleTabKeyPress.bind(this._mainPanel, 1);
+        var handleTabKey = this._mainPanel.handleTabKeyPress.bind(this._mainPanel, false);
+        var handleShiftTabKey = this._mainPanel.handleTabKeyPress.bind(this._mainPanel, true);
         this._shortcuts[WebInspector.KeyboardShortcut.makeKey(keys.Tab.code)] = handleTabKey;
         this._shortcuts[WebInspector.KeyboardShortcut.makeKey(keys.Tab.code, modifiers.Shift)] = handleShiftTabKey;
     },
@@ -948,7 +948,7 @@ WebInspector.TextEditorMainPanel.prototype = {
         this._exitTextChangeMode(range, newRange);
         this.endUpdates();
 
-        this._setCaretLocation(newRange.endLine, newRange.endColumn);
+        this._setCaretLocation(newRange.endLine, newRange.endColumn, true);
         return true;
     },
Comment 4 Andrey Adaikin 2011-04-18 05:49:22 PDT
Created attachment 90022 [details]
Patch
Comment 5 WebKit Review Bot 2011-04-18 06:09:37 PDT
Comment on attachment 90022 [details]
Patch

Rejecting attachment 90022 [details] from commit-queue.

aandrey@chromium.org does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py.

- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.

- If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your committer rights.
Comment 6 WebKit Commit Bot 2011-04-18 06:36:27 PDT
Comment on attachment 90022 [details]
Patch

Clearing flags on attachment: 90022

Committed r84136: <http://trac.webkit.org/changeset/84136>
Comment 7 WebKit Commit Bot 2011-04-18 06:36:33 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 WebKit Review Bot 2011-04-18 07:41:25 PDT
http://trac.webkit.org/changeset/84136 might have broken Windows 7 Release (Tests)
The following tests are not passing:
http/tests/inspector/resource-tree-model.html