Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(727)

Unified Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js

Issue 2840663002: DevTools: clicking in console messages should not jump to bottom (Closed)
Patch Set: test Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/console/console-focus-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
index be61b1a8bbe8206cb165e078dad479ca8235a504..a95d73deba9aafe78e7da3068766c0aab46cecce 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
@@ -115,6 +115,7 @@ Console.ConsoleView = class extends UI.VBox {
this._viewport.contentElement().classList.add('console-group', 'console-group-messages');
this._contentsElement.appendChild(this._viewport.element);
this._messagesElement = this._viewport.element;
+ this._messagesElement.tabIndex = -1;
luoe 2017/04/24 22:28:33 Currently on ToT, using up/down/pageup/pagedown ke
this._messagesElement.id = 'console-messages';
this._messagesElement.classList.add('monospace');
this._messagesElement.addEventListener('click', this._messagesClicked.bind(this), true);
@@ -309,8 +310,6 @@ Console.ConsoleView = class extends UI.VBox {
focus() {
if (this._prompt.hasFocus())
return;
- // Set caret position before setting focus in order to avoid scrolling
- // by focus().
luoe 2017/04/24 22:28:33 This is no longer the case. Calling moveCaretToEn
this._prompt.moveCaretToEndOfPrompt();
this._prompt.focus();
}
@@ -666,8 +665,11 @@ Console.ConsoleView = class extends UI.VBox {
*/
_messagesClicked(event) {
var targetElement = event.deepElementFromPoint();
- if (!targetElement || targetElement.isComponentSelectionCollapsed())
+ if (!targetElement || this._viewport.element.isScrolledToBottom())
this.focus();
luoe 2017/04/24 22:28:33 I think we still need to keep 2 paths. When you c
+ else if (targetElement.isComponentSelectionCollapsed())
+ this._prompt.focus();
+
var groupMessage = event.target.enclosingNodeOrSelfWithClass('console-group-title');
if (!groupMessage)
return;
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/console/console-focus-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698