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

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

Issue 2565113002: DevTools: update console viewport scroll when prompt is resized (Closed)
Patch Set: rebaseline 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
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 f32a81cb77740992c205ca6d7cf49bd71010f00a..ba21103a76c773253dd7910ba92e154fa5baa14d 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
@@ -128,7 +128,6 @@ Console.ConsoleView = class extends UI.VBox {
var promptIcon = UI.Icon.create('smallicon-text-prompt', 'console-prompt-icon');
this._promptElement.appendChild(promptIcon);
this._promptElement.id = 'console-prompt';
- this._promptElement.addEventListener('input', this._promptInput.bind(this), false);
// FIXME: This is a workaround for the selection machinery bug. See crbug.com/410899
var selectAllFixer = this._messagesElement.createChild('div', 'console-view-fix-select-all');
@@ -150,6 +149,7 @@ Console.ConsoleView = class extends UI.VBox {
this._prompt = new Console.ConsolePrompt();
this._prompt.show(this._promptElement);
this._prompt.element.addEventListener('keydown', this._promptKeyDown.bind(this), true);
+ this._prompt.addEventListener(Console.ConsolePrompt.Events.TextChanged, this._promptTextChanged, this);
this._consoleHistoryAutocompleteSetting.addChangeListener(this._consoleHistoryAutocompleteChanged, this);
@@ -984,10 +984,16 @@ Console.ConsoleView = class extends UI.VBox {
this._updateStickToBottomOnMouseUp();
}
- _promptInput(event) {
+ _promptTextChanged() {
// Scroll to the bottom, except when the prompt is the only visible item.
if (this.itemCount() !== 0 && this._viewport.firstVisibleIndex() !== this.itemCount())
this._immediatelyScrollToBottom();
+
+ this._promptTextChangedForTest();
+ }
+
+ _promptTextChangedForTest() {
+ // This method is sniffed in tests.
}
};

Powered by Google App Engine
This is Rietveld 408576698