Bug 190643 - Web Inspector: Quickly Open to line/column does should have caret indicating where the position is
Summary: Web Inspector: Quickly Open to line/column does should have caret indicating ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks: 190862
  Show dependency treegraph
 
Reported: 2018-10-16 15:12 PDT by Joseph Pecoraro
Modified: 2018-10-23 22:20 PDT (History)
6 users (show)

See Also:


Attachments
Patch (2.96 KB, patch)
2018-10-16 23:24 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (3.10 KB, patch)
2018-10-16 23:24 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2018-10-16 15:12:56 PDT
Quickly Open to line/column does should have caret indicating where the position is

Steps to Reproduce:
1. Inspect <http://bogojoker.com/shell/>
2. Show the "easySlider.min.js" resource in the Debugger tab
3. Unformat the resource so it is not pretty printed
4. ⌘⇧O to trigger the quickly open dialog
5. Type ":5:507" and press return to go to a specific line/column
  => The editor moves and flashes, but it is unclear where the exact position is, a caret should be showing to indicate it
Comment 1 Devin Rousso 2018-10-16 23:24:31 PDT
Created attachment 352552 [details]
Patch
Comment 2 Devin Rousso 2018-10-16 23:24:57 PDT
Created attachment 352553 [details]
Patch
Comment 3 Matt Baker 2018-10-17 10:27:16 PDT
Comment on attachment 352553 [details]
Patch

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

This solves the problem, but I'm a little wary of changing revealPosition to force the editor to become focused. We call revealPosition in about a dozen places, are we sure this is the behavior we want?

> Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:-284
> -        this.focus();

Why not just move this above the call to revealPosition? See comment below.

> Source/WebInspectorUI/UserInterface/Views/TextEditor.js:231
> +        this.focus();

Is there ever a time we would want to set the selection, but not focus the editor?
Comment 4 Joseph Pecoraro 2018-10-17 11:50:02 PDT
(In reply to Matt Baker from comment #3)
> We call revealPosition in about a dozen places, are we sure this is the behavior we want?

This sounds like a good idea to me. We could land it, and live on it, and see if there are any cases that stand out.

I imagine the most likely issue I'd come across is that `Escape` in an editable TextEditor might not take me to the QuickConsole due to focus being inside the TextEditor. I think I might be okay with that, and we might even be able to improve that situation if it even happens at all.
Comment 5 Matt Baker 2018-10-17 12:22:36 PDT
Comment on attachment 352553 [details]
Patch

r=me
Comment 6 WebKit Commit Bot 2018-10-17 12:47:01 PDT
Comment on attachment 352553 [details]
Patch

Clearing flags on attachment: 352553

Committed r237232: <https://trac.webkit.org/changeset/237232>
Comment 7 WebKit Commit Bot 2018-10-17 12:47:02 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2018-10-17 12:48:49 PDT
<rdar://problem/45347635>