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

Issue 721303 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

scrollbar still sticks after losing focus

Reported by dolabm...@gmail.com, May 11 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/58.0.3029.96 Chrome/58.0.3029.96 Safari/537.36

Steps to reproduce the problem:
1. Mousedown on any scrollbar and hold
2. Drag mouse out of the area of scrollbar
3. While holding left button, click midden button or right button
4. Mouseup
5. Move mouse on the scrollbar

What is the expected behavior?

What went wrong?
Scrollbar is still stuck even no mouse button is pressed
While mousemove on scrollbar, scrollbar still follows

Did this work before? N/A 

Chrome version: 58.0.3029.96  Channel: n/a
OS Version: 
Flash Version:
 
Labels: Needs-Triage-M58
Components: -UI Blink>Scroll
Labels: M-60 OS-Mac OS-Windows
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on windows 7 , Ubuntu 14.04 and Mac 10.12.4 using chrome version 58.0.3029.110 and canary 60.0.3099.0.
This is non regression issue as the issue seen from M30 old builds
Marking it as Untriaged.

Thanks,

Labels: Hotlist-Input-Dev
Owner: bokan@chromium.org
Status: Assigned (was: Untriaged)
Can reproduce on linux.

Comment 4 by bokan@chromium.org, Aug 15 2017

Labels: -Pri-2 Pri-3
Owner: chaopeng@chromium.org

Comment 5 by bokan@chromium.org, Aug 15 2017

Cc: bokan@chromium.org

Comment 6 by bokan@chromium.org, Oct 12 2017

Cc: krajshree@chromium.org
 Issue 772403  has been merged into this issue.
Project Member

Comment 7 by bugdroid1@chromium.org, May 14 2018

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

commit 11b79e0f80933879da85ea22a438a36b2a0cb2d6
Author: chaopeng <chaopeng@chromium.org>
Date: Mon May 14 01:43:56 2018

Only handle mouse left button for Scrollbar

This issue is caused by:

1. Press on any mouse button will update the last_scrollbar_under_mouse_ in
   EventHandler. last_scrollbar_under_mouse_ will set to null and call
   Scrollbar::MouseExited() when mouse middle click out of scrollbar.
2. Release any mouse button will check last_scrollbar_under_mouse_ for cleanup
   the mouse press state on Scrollbar.

Because mouse middle button press happens before any mouse button release,
last_scrollbar_under_mouse_ is null then release mouse button will not clear
the scrollbar press state.

There is another related issue here. We can drag the scrollbar by pressing the
middle button.

The root cause of the bug is not checking for the left mouse button before
updating last_scrollbar_under_mouse_ and calling Scrollbar::MouseDown.

In this patch, we only handle mouse left button for Scrollbar.

Bug:  721303 
Change-Id: I714eca2bbdd9dd1628e596dc6b9119bb5de85cc3
Reviewed-on: https://chromium-review.googlesource.com/1048389
Commit-Queue: Jianpeng Chao <chaopeng@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558172}
[modify] https://crrev.com/11b79e0f80933879da85ea22a438a36b2a0cb2d6/content/test/test_blink_web_unit_test_support.cc
[modify] https://crrev.com/11b79e0f80933879da85ea22a438a36b2a0cb2d6/content/test/test_blink_web_unit_test_support.h
[modify] https://crrev.com/11b79e0f80933879da85ea22a438a36b2a0cb2d6/third_party/WebKit/LayoutTests/fast/scrolling/scrollbar-mousedown-move-mouseup-expected.txt
[modify] https://crrev.com/11b79e0f80933879da85ea22a438a36b2a0cb2d6/third_party/WebKit/LayoutTests/fast/scrolling/scrollbar-mousedown-move-mouseup.html
[modify] https://crrev.com/11b79e0f80933879da85ea22a438a36b2a0cb2d6/third_party/blink/renderer/core/input/event_handler.cc
[modify] https://crrev.com/11b79e0f80933879da85ea22a438a36b2a0cb2d6/third_party/blink/renderer/core/layout/scrollbars_test.cc

Status: Fixed (was: Assigned)
This still happens in Chrome 68.0.3440.75 (which includes the above change in its changelog), and the purported fix also appears to have broken middle-click scrolling.

Since the early versions of Chrome it's always been possible to jump the scroll handle to a particular position on the scrollbar by middle-clicking there; this behavior is useful and is intentionally implemented by the default scrollbar theme at https://github.com/adobe/webkit/blob/067e0a8adb3c27c682d894072098c405fb5ca386/Source/WebCore/platform/chromium/ScrollbarThemeChromiumDefault.cpp#L120, but is now broken because this change prevents the middle-click event from making it to the scrollbar.  Incidentally, a workaround to achieve the same behavior is to use shift-left-click (which I only learned just now by digging through the code).

Moreover, this change does not fix the original bug: trying to reproduce with middle clicks is now flaky (sometimes triggers the bug and sometimes doesn't, without any pattern I could find), but right-clicking consistently reproduces the original problem.  Specifically:

1. Left-click and hold in the scrollbar handle.
2. While still holding the left button, move the mouse out of the scroll bar.
3. While still holding the left button, right-click anywhere to summon a context menu.
4. Release the left mouse button and dismiss the context menu by left-clicking anywhere again.
5. The scrollbar still thinks it's grabbed and will follow the mouse cursor when it's moved within the scrollbar.
6. Left-click the scrollbar handle again to get it back into an un-grabbed state.
Hi awpritchard@, we have a regression and new fix for this issue. please check  crbug.com/852943 
Awesome, thanks.

Sign in to add a comment