Bug 160825 - Web Inspector: Focus on text editor after opening a resource via Open Resource Dialog
Summary: Web Inspector: Focus on text editor after opening a resource via Open Resourc...
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-08-12 14:59 PDT by Nikita Vasilyev
Modified: 2016-12-13 15:40 PST (History)
3 users (show)

See Also:


Attachments
Patch (9.68 KB, patch)
2016-08-12 15:46 PDT, Nikita Vasilyev
nvasilyev: review-
nvasilyev: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2016-08-12 14:59:20 PDT
Steps:
1. Open Web Inspector on https://webkit.org
2. Press Command-Option-O
3. Type "global.js", press Enter

Expected:
global.js opens with text caret inside of it, so a person could immediately type or select text.

Actual:
global.js opens, but it doesn't get focused.

Notes:
Via https://bugs.webkit.org/show_bug.cgi?id=159732#c8
Comment 1 Radar WebKit Bug Importer 2016-08-12 14:59:53 PDT
<rdar://problem/27830981>
Comment 2 Nikita Vasilyev 2016-08-12 15:46:18 PDT
Created attachment 285965 [details]
Patch
Comment 3 Nikita Vasilyev 2016-08-12 15:49:03 PDT
Comment on attachment 285965 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Views/TextEditor.js:477
> +

Focusing works well for the current resource (e.g. ":100:42") but it still doesn't work for a different resource (e.g. "foo.js:100:42") :-/
Comment 4 Nikita Vasilyev 2016-08-12 22:13:29 PDT
Comment on attachment 285965 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Views/ResourceClusterContentView.js:144
> +            contentView.revealPosition(new WebInspector.SourceCodePosition(cookie.lineNumber, cookie.columnNumber), textRangeToSelect, forceUnformatted, shouldFocus);

Entering just "foo.js" without line numbers should still focus on the text editor, so I think focusing should NOT be done by contentView.revealPosition. Back to the drawing board.