New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 602099 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Console tab scrolls down when switching to(or from) other DevTools tab

Reported by klesto...@gmail.com, Apr 10 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36

Steps to reproduce the problem:
1. open Console tab in DevTools
2. run code: for(let i=0;i<100;++i){console.log(i)}
3. scroll up Console tab to top(or not to very top, just don't leave it in the bottom position)
4. switch to any other tab of DevTools by clicking other tab title with mouse or by pressing keys "Ctrl + [" or "Ctrl + ]"
5. switch back to Console tab BY MOUSE

What is the expected behavior?
scroll position in Console tab should remain the same as it was before switching to another DevTools tab

What went wrong?
Console tab scrolls to bottom when you switch back to it

Did this work before? Yes This problem occurred in one of recent versions

Chrome version: 49.0.2623.112  Channel: stable
OS Version: 10.0
Flash Version: 

THIS IS VERY FRUSTRATING. Debugging turns to distress! All worked good for many years. I could freely switch from Console tab to other tab, and was sure that when I return, scroll position will remain the same. Now when I return to Console tab, I have to scroll up and find place where I was. This is madness!

I also found two things:
1. when I return to Console tab by pressing keys "Ctrl + [" or "Ctrl + ]" problem doesn't happen.
2. in Console tab, when I simply press Console tab title, it scroll to bottom.
It looks like problem is related to mouse. It probably happened was you added possibility to rearrange tabs by drag and drop.

Problem also happens in version 51.0.2704.0 canary (64-bit).

Please fix it.
 
Owner: lushnikov@chromium.org
Status: Assigned (was: Unconfirmed)
Cc: lushnikov@chromium.org
Owner: tkent@chromium.org
Hi @tkent,

I've bisected this down to https://codereview.chromium.org/1437813002
Locally reverting this patch also fixes the problem.

Could you please take a look?

Comment 3 by tkent@chromium.org, Apr 12 2016

Before my change:

1. element.focus() is called.
2. It's set to document.activeElement
3. Dispatch 'focus' event
4. Set text selection in the element and scroll if there's no text selection
  DevTools sets text selection in focus event handler. So this step was skipped.

After my change, step 3 and 4 were reversed.  So scrolling happens.

I checked the behavior of Firefox and Edge, and the current Blink behavior is interoperable.  We need to update DevTools code.


Comment 4 by tkent@chromium.org, Apr 12 2016

Status: Started (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, Apr 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a31414c359daff0ca68381b7e9625e188cdfbfbf

commit a31414c359daff0ca68381b7e9625e188cdfbfbf
Author: tkent <tkent@chromium.org>
Date: Tue Apr 12 18:37:02 2016

DevTools: Do not scroll the console to show the prompt when we select the console tab.

This CL fixes a regression by the behavior change of crrev.com/360545.
We'd like to avoid text selection and scrolling in focus() by setting text
selection before focus().

BUG= 602099 

Review URL: https://codereview.chromium.org/1877233002

Cr-Commit-Position: refs/heads/master@{#386751}

[modify] https://crrev.com/a31414c359daff0ca68381b7e9625e188cdfbfbf/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js

I think it worth merging this to 51 - the change is small and very useful.

Comment 7 by tkent@chromium.org, Apr 15 2016

Labels: Merge-Request-51 M-51
Status: Fixed (was: Started)
It seems crrev.com/386751 didn't cause bad side effect.  Let's merge it.

Comment 8 by tin...@google.com, Apr 15 2016

Labels: -Merge-Request-51 Merge-Approved-51 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M51 (branch: 2704)

Comment 9 by gov...@chromium.org, Apr 15 2016

Please merge your change before 5:00 PM PST on Monday (04/18) so we can take it in for next week M51 release.
Project Member

Comment 10 by bugdroid1@chromium.org, Apr 18 2016

Labels: -merge-approved-51 merge-merged-2704
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/198d46b2310aa09d5ac7885607d0829826a8af72

commit 198d46b2310aa09d5ac7885607d0829826a8af72
Author: Kent Tamura <tkent@chromium.org>
Date: Mon Apr 18 01:39:06 2016

Merge "DevTools: Do not scroll the console to show the prompt when we select the console tab." to M51

This CL fixes a regression by the behavior change of crrev.com/360545.
We'd like to avoid text selection and scrolling in focus() by setting text
selection before focus().

BUG= 602099 

Review URL: https://codereview.chromium.org/1877233002

Cr-Commit-Position: refs/heads/master@{#386751}
(cherry picked from commit a31414c359daff0ca68381b7e9625e188cdfbfbf)

Review URL: https://codereview.chromium.org/1894003002 .

Cr-Commit-Position: refs/branch-heads/2704@{#86}
Cr-Branched-From: 6e53600def8f60d8c632fadc70d7c1939ccea347-refs/heads/master@{#386251}

[modify] https://crrev.com/198d46b2310aa09d5ac7885607d0829826a8af72/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js

Cc: ashej...@chromium.org
Labels: Needs-Feedback
Retested the above issue on Windows 10 with chrome version '51.0.2704.19' and the behavior is still reproducible the console tab gets scroll to the bottom even when you select text. 

@tkent: Hey, can you please check the video below and let us know if I have missed something ?

Appreciate your help.

Thank you!



Retest-602099.mp4
1.1 MB Download
tkent@, This issue still reproduces on Latest Canary#52.0.2712.0 as well for "Win10 Home". We are following the same steps per c#0 and could you please let us know if something is missed here?

Thank you!

Comment 13 by tkent@chromium.org, Apr 19 2016

Labels: -Needs-Feedback
Status: Assigned (was: Fixed)
It seems my CL fixed only a specific case.  It didn't fix this completely.

lushnikov@, is there a way to call a Blink C++ function from devtools/front_end code?  We might need a variant of element.focus() which doesn't scroll.

Comment 14 by tkent@chromium.org, Apr 22 2016

Status: Started (was: Assigned)
@tkent: I apologize for the late response - i must've overlooked the e-mail.

There is a way to call Blink C++ function from devtools/front_end code (@see InspectorFrontendHostAPI.js). However, there are lots of benefits when the front-end is just a WebApp, so we tend to battle all of the rendering issues with css/js.

Project Member

Comment 16 by bugdroid1@chromium.org, Apr 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/80d0fa58f8b0277244ffab1702692fa96f6d9386

commit 80d0fa58f8b0277244ffab1702692fa96f6d9386
Author: tkent <tkent@chromium.org>
Date: Fri Apr 22 23:21:36 2016

DevTools: ConsolePanel should delegate focus() to ConsoleView.

ConsoleView has a special handling in focus(). Delegating
defaultFocusedElement() without delegating focus() is inconsistent.

BUG= 602099 

Review URL: https://codereview.chromium.org/1909423002

Cr-Commit-Position: refs/heads/master@{#389295}

[modify] https://crrev.com/80d0fa58f8b0277244ffab1702692fa96f6d9386/third_party/WebKit/Source/devtools/front_end/console/ConsolePanel.js

Comment 17 by tkent@chromium.org, Apr 25 2016

Labels: -Arch-x86_64 -Hotlist-Merge-Approved -merge-merged-2704
Status: Fixed (was: Started)
#15, thank you for the information.

Fortunately crrev.com/389295 should fix the issue without adding a native API.

Comment 18 by tkent@chromium.org, Apr 26 2016

Labels: Needs-TestConfirmation
52.0.2716.0 canary has the fix.
TEs, can you verify the fix?

Comment 19 by tkent@chromium.org, Apr 28 2016

Labels: Merge-Request-51

Comment 20 by tin...@google.com, Apr 28 2016

Labels: -Merge-Request-51 Merge-Approved-51 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M51 (branch: 2704)
Project Member

Comment 21 by bugdroid1@chromium.org, Apr 28 2016

Labels: -merge-approved-51 merge-merged-2704
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7e01e4e7339b3c93fef757eaad7b00277b3a0d75

commit 7e01e4e7339b3c93fef757eaad7b00277b3a0d75
Author: Kent Tamura <tkent@chromium.org>
Date: Thu Apr 28 03:13:18 2016

Merge "DevTools: ConsolePanel should delegate focus() to ConsoleView." to M51 branch

ConsoleView has a special handling in focus(). Delegating
defaultFocusedElement() without delegating focus() is inconsistent.

BUG= 602099 

Review URL: https://codereview.chromium.org/1909423002

Cr-Commit-Position: refs/heads/master@{#389295}
(cherry picked from commit 80d0fa58f8b0277244ffab1702692fa96f6d9386)

Review URL: https://codereview.chromium.org/1931743002 .

Cr-Commit-Position: refs/branch-heads/2704@{#282}
Cr-Branched-From: 6e53600def8f60d8c632fadc70d7c1939ccea347-refs/heads/master@{#386251}

[modify] https://crrev.com/7e01e4e7339b3c93fef757eaad7b00277b3a0d75/third_party/WebKit/Source/devtools/front_end/console/ConsolePanel.js

Sign in to add a comment