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

Side by Side 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, 7 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 wasShown() { 302 wasShown() {
303 this._viewport.refresh(); 303 this._viewport.refresh();
304 } 304 }
305 305
306 /** 306 /**
307 * @override 307 * @override
308 */ 308 */
309 focus() { 309 focus() {
310 if (this._prompt.hasFocus()) 310 if (this._prompt.hasFocus())
311 return; 311 return;
312 // Set caret position before setting focus in order to avoid scrolling
313 // by focus().
314 this._prompt.moveCaretToEndOfPrompt(); 312 this._prompt.moveCaretToEndOfPrompt();
pfeldman 2017/04/25 07:29:30 We probably should no longer call moveCaretToEndOf
luoe 2017/04/25 18:11:39 You're right, this patch reintroduces the old regr
315 this._prompt.focus(); 313 this._prompt.focus();
316 } 314 }
317 315
318 /** 316 /**
319 * @override 317 * @override
320 */ 318 */
321 restoreScrollPositions() { 319 restoreScrollPositions() {
322 if (this._viewport.stickToBottom()) 320 if (this._viewport.stickToBottom())
323 this._immediatelyScrollToBottom(); 321 this._immediatelyScrollToBottom();
324 else 322 else
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 this._updateFilterStatus(); 657 this._updateFilterStatus();
660 this._searchableView.updateSearchMatchesCount(this._regexMatchRanges.length) ; 658 this._searchableView.updateSearchMatchesCount(this._regexMatchRanges.length) ;
661 this._viewport.invalidate(); 659 this._viewport.invalidate();
662 } 660 }
663 661
664 /** 662 /**
665 * @param {!Event} event 663 * @param {!Event} event
666 */ 664 */
667 _messagesClicked(event) { 665 _messagesClicked(event) {
668 var targetElement = event.deepElementFromPoint(); 666 var targetElement = event.deepElementFromPoint();
669 if (!targetElement || targetElement.isComponentSelectionCollapsed()) 667 if (!targetElement || !targetElement.enclosingNodeOrSelfWithClass('console-g roup'))
pfeldman 2017/04/25 07:29:30 I think !targetElement.enclosingNodeOrSelfWithClas
luoe 2017/04/25 18:11:39 When there are only a few messages, clicking in th
670 this.focus(); 668 this.focus();
669 else if (targetElement.isComponentSelectionCollapsed())
670 this._prompt.focus();
671
671 var groupMessage = event.target.enclosingNodeOrSelfWithClass('console-group- title'); 672 var groupMessage = event.target.enclosingNodeOrSelfWithClass('console-group- title');
672 if (!groupMessage) 673 if (!groupMessage)
673 return; 674 return;
674 var consoleGroupViewMessage = groupMessage.parentElement.message; 675 var consoleGroupViewMessage = groupMessage.parentElement.message;
675 consoleGroupViewMessage.setCollapsed(!consoleGroupViewMessage.collapsed()); 676 consoleGroupViewMessage.setCollapsed(!consoleGroupViewMessage.collapsed());
676 this._updateMessageList(); 677 this._updateMessageList();
677 } 678 }
678 679
679 _registerShortcuts() { 680 _registerShortcuts() {
680 this._shortcuts = {}; 681 this._shortcuts = {};
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 return true; 1273 return true;
1273 } 1274 }
1274 return false; 1275 return false;
1275 } 1276 }
1276 }; 1277 };
1277 1278
1278 /** 1279 /**
1279 * @typedef {{messageIndex: number, matchIndex: number}} 1280 * @typedef {{messageIndex: number, matchIndex: number}}
1280 */ 1281 */
1281 Console.ConsoleView.RegexMatchRange; 1282 Console.ConsoleView.RegexMatchRange;
OLDNEW
« 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