Chromium Code Reviews| 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; |