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

Issue 2840663002: DevTools: clicking in console messages should not jump to bottom (Closed)

Created:
3 years, 8 months ago by luoe
Modified:
3 years, 7 months ago
Reviewers:
einbinder, dgozman, pfeldman
CC:
chromium-reviews, caseq+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, apavlov+blink_chromium.org, devtools-reviews_chromium.org, blink-reviews, pfeldman, kozyatinskiy+blink_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

DevTools: clicking in console messages should not jump to bottom ConsolePrompt's moveCaretToEndOfPrompt() works by setting the CodeMirror editor's selection to the end. After a recent CodeMirror roll, doing so now scrolls the editor into view. This change in behavior led to an error where expanding an object in console would jump the viewport to bottom. This CL only focuses the prompt without moving the cursor, in some cases. BUG=706128 Review-Url: https://codereview.chromium.org/2840663002 Cr-Commit-Position: refs/heads/master@{#468009} Committed: https://chromium.googlesource.com/chromium/src/+/c5213f9bd6b6e6e95f40852b56ef62f1307c94ee

Patch Set 1 #

Patch Set 2 : test #

Total comments: 3

Patch Set 3 : fix clicking below prompt condition and add tests #

Patch Set 4 : test #

Total comments: 4

Patch Set 5 : restore scroll pos, add test for old regression #

Total comments: 20

Patch Set 6 : move caret only on click, not focus #

Total comments: 4

Patch Set 7 : ac #

Total comments: 4

Patch Set 8 : ac #

Patch Set 9 : fix platform dependent test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -7 lines) Patch
A third_party/WebKit/LayoutTests/inspector/console/console-focus.html View 1 2 3 4 5 6 7 8 1 chunk +97 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/inspector/console/console-focus-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +27 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js View 1 2 3 4 5 6 2 chunks +9 lines, -7 lines 0 comments Download

Messages

Total messages: 30 (15 generated)
luoe
ptal https://codereview.chromium.org/2840663002/diff/20001/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js File third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js (left): https://codereview.chromium.org/2840663002/diff/20001/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js#oldcode313 third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js:313: // by focus(). This is no longer the ...
3 years, 8 months ago (2017-04-24 22:28:33 UTC) #3
luoe
A few more tests added and a fix to the case: clicking when scrolled to ...
3 years, 8 months ago (2017-04-25 02:56:24 UTC) #6
pfeldman
https://codereview.chromium.org/2840663002/diff/60001/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js File third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js (right): https://codereview.chromium.org/2840663002/diff/60001/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js#newcode312 third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js:312: this._prompt.moveCaretToEndOfPrompt(); We probably should no longer call moveCaretToEndOfPrompt since ...
3 years, 8 months ago (2017-04-25 07:29:30 UTC) #7
luoe
I've basically changed my CL to look like yours, except keeping the moveCaretToEnd. My bad ...
3 years, 8 months ago (2017-04-25 18:11:39 UTC) #9
pfeldman
https://codereview.chromium.org/2840663002/diff/100001/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js File third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js (right): https://codereview.chromium.org/2840663002/diff/100001/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js#newcode314 third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js:314: this._prompt.moveCaretToEndOfPrompt(); >> If possible, I would still like to ...
3 years, 8 months ago (2017-04-25 18:26:08 UTC) #10
pfeldman
https://codereview.chromium.org/2840663002/diff/100001/third_party/WebKit/LayoutTests/inspector/console/console-focus.html File third_party/WebKit/LayoutTests/inspector/console/console-focus.html (right): https://codereview.chromium.org/2840663002/diff/100001/third_party/WebKit/LayoutTests/inspector/console/console-focus.html#newcode22 third_party/WebKit/LayoutTests/inspector/console/console-focus.html:22: if (prompt._editor) We should not have races in the ...
3 years, 8 months ago (2017-04-25 18:40:56 UTC) #11
pfeldman
https://codereview.chromium.org/2840663002/diff/120001/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js File third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js (right): https://codereview.chromium.org/2840663002/diff/120001/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js#newcode311 third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js:311: this._prompt.focus(); I think we still reset scroll position here, ...
3 years, 8 months ago (2017-04-25 18:50:17 UTC) #12
luoe
Comments addressed, narrower test, moving caret to end only when the click target was the ...
3 years, 8 months ago (2017-04-25 23:00:34 UTC) #13
pfeldman
https://codereview.chromium.org/2840663002/diff/140001/third_party/WebKit/LayoutTests/inspector/console/console-focus.html File third_party/WebKit/LayoutTests/inspector/console/console-focus.html (right): https://codereview.chromium.org/2840663002/diff/140001/third_party/WebKit/LayoutTests/inspector/console/console-focus.html#newcode30 third_party/WebKit/LayoutTests/inspector/console/console-focus.html:30: function testClickingWithSelectedTextShouldNotFocusPrompt(next) { But does it scroll? We are ...
3 years, 7 months ago (2017-04-27 21:51:51 UTC) #14
luoe
Both scrollTop and focus are now tested for! https://codereview.chromium.org/2840663002/diff/140001/third_party/WebKit/LayoutTests/inspector/console/console-focus.html File third_party/WebKit/LayoutTests/inspector/console/console-focus.html (right): https://codereview.chromium.org/2840663002/diff/140001/third_party/WebKit/LayoutTests/inspector/console/console-focus.html#newcode30 third_party/WebKit/LayoutTests/inspector/console/console-focus.html:30: function ...
3 years, 7 months ago (2017-04-27 22:24:40 UTC) #15
pfeldman
lgtm
3 years, 7 months ago (2017-04-27 22:36:42 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2840663002/160001
3 years, 7 months ago (2017-04-27 22:38:14 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/440840)
3 years, 7 months ago (2017-04-28 02:46:23 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2840663002/180001
3 years, 7 months ago (2017-04-28 15:25:17 UTC) #27
commit-bot: I haz the power
3 years, 7 months ago (2017-04-28 15:34:20 UTC) #30
Message was sent while issue was closed.
Committed patchset #9 (id:180001) as
https://chromium.googlesource.com/chromium/src/+/c5213f9bd6b6e6e95f40852b56ef...

Powered by Google App Engine
This is Rietveld 408576698