RESOLVED FIXED154719
Web Inspector: Increase clickable area of the console prompt
https://bugs.webkit.org/show_bug.cgi?id=154719
Summary Web Inspector: Increase clickable area of the console prompt
Nikita Vasilyev
Reported 2016-02-25 22:46:48 PST
Created attachment 272300 [details] [Image] Before/after Currently, only the middle part of the console prompt is clickable. When I click on ">" icon or the white space just below or above the CodeMirror element, the console prompt loses focus. Instead, it should keep the focus (or focus on the prompt, if it wasn't focused before).
Attachments
[Image] Before/after (29.79 KB, image/png)
2016-02-25 22:46 PST, Nikita Vasilyev
no flags
Patch (29.79 KB, patch)
2016-02-25 22:52 PST, Nikita Vasilyev
timothy: review-
timothy: commit-queue-
Patch (2.76 KB, patch)
2016-02-26 14:18 PST, Nikita Vasilyev
timothy: review+
Patch (2.25 KB, patch)
2016-02-26 21:54 PST, Nikita Vasilyev
commit-queue: commit-queue-
Patch (2.90 KB, patch)
2016-02-26 22:46 PST, Nikita Vasilyev
no flags
Radar WebKit Bug Importer
Comment 1 2016-02-25 22:47:01 PST
Nikita Vasilyev
Comment 2 2016-02-25 22:52:06 PST
Timothy Hatcher
Comment 3 2016-02-26 09:10:09 PST
Comment on attachment 272301 [details] Patch Not a patch. Is an image.
Nikita Vasilyev
Comment 4 2016-02-26 14:18:25 PST
Created attachment 272370 [details] Patch Whoops. Now it's a patch.
Timothy Hatcher
Comment 5 2016-02-26 14:20:03 PST
Comment on attachment 272370 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=272370&action=review > Source/WebInspectorUI/UserInterface/Views/QuickConsole.css:57 > + pointer-events: none; Why is this needed? > Source/WebInspectorUI/UserInterface/Views/QuickConsole.js:113 > + requestAnimationFrame(() => this.prompt.focus()); Why does this need a requestAnimationFrame?
Nikita Vasilyev
Comment 6 2016-02-26 15:02:12 PST
Comment on attachment 272370 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=272370&action=review >> Source/WebInspectorUI/UserInterface/Views/QuickConsole.css:57 >> + pointer-events: none; > > Why is this needed? In _handleMouseDown I do this to avoid capturing all the mousedown events from CodeMirror: if (event.target !== this.element) If I don't use .quick-console > .console-prompt {pointer-events: none} event.target could either be .quick-console or .console-prompt. Setting `pointer-events: none` makes event.target to be always .quick-console. >> Source/WebInspectorUI/UserInterface/Views/QuickConsole.js:113 >> + requestAnimationFrame(() => this.prompt.focus()); > > Why does this need a requestAnimationFrame? Without it, the prompt loses focus right after it gets it. However, event.preventDefault() seems like a better solution.
Timothy Hatcher
Comment 7 2016-02-26 21:12:58 PST
Comment on attachment 272370 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=272370&action=review >>> Source/WebInspectorUI/UserInterface/Views/QuickConsole.js:113 >>> + requestAnimationFrame(() => this.prompt.focus()); >> >> Why does this need a requestAnimationFrame? > > Without it, the prompt loses focus right after it gets it. > However, event.preventDefault() seems like a better solution. Yeah, lets try with event.preventDefault() instead.
Joseph Pecoraro
Comment 8 2016-02-26 21:34:57 PST
Comment on attachment 272370 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=272370&action=review >>> Source/WebInspectorUI/UserInterface/Views/QuickConsole.css:57 >>> + pointer-events: none; >> >> Why is this needed? > > In _handleMouseDown I do this to avoid capturing all the mousedown events from CodeMirror: > > if (event.target !== this.element) > > If I don't use > > .quick-console > .console-prompt {pointer-events: none} > > event.target could either be .quick-console or .console-prompt. > Setting `pointer-events: none` makes event.target to be always .quick-console. When adding something like this there should really be a comment in the ChangeLog, as it is non-obvious. > Source/WebInspectorUI/UserInterface/Views/QuickConsole.js:42 > + this.element.addEventListener("mousedown", this._handleMouseDown.bind(this), false); Style: We have been leaving off the "false" on addEventListener calls that use the normal bubbling phase.
Nikita Vasilyev
Comment 9 2016-02-26 21:54:30 PST
WebKit Commit Bot
Comment 10 2016-02-26 21:55:43 PST
Comment on attachment 272402 [details] Patch Rejecting attachment 272402 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'apply-attachment', '--no-update', '--non-interactive', 272402, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit Last 500 characters of output: ng file Source/WebInspectorUI/ChangeLog Hunk #1 FAILED at 4. 1 out of 1 hunk FAILED -- saving rejects to file Source/WebInspectorUI/ChangeLog.rej patching file Source/WebInspectorUI/UserInterface/Views/QuickConsole.js Hunk #1 FAILED at 39. Hunk #2 FAILED at 110. 2 out of 2 hunks FAILED -- saving rejects to file Source/WebInspectorUI/UserInterface/Views/QuickConsole.js.rej Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit Full output: http://webkit-queues.webkit.org/results/889130
Nikita Vasilyev
Comment 11 2016-02-26 22:46:52 PST
WebKit Commit Bot
Comment 12 2016-02-26 23:44:23 PST
Comment on attachment 272410 [details] Patch Clearing flags on attachment: 272410 Committed r197245: <http://trac.webkit.org/changeset/197245>
WebKit Commit Bot
Comment 13 2016-02-26 23:44:27 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.