Chromium Code Reviews| Index: third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
| diff --git a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
| index 71273852b4c469c5fb9cd44d7b4113cf02a48fda..516eed533a8be643ee4b9a1c0b32f7df95180df5 100644 |
| --- a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
| +++ b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
| @@ -462,12 +462,16 @@ void Scrollbar::mouseExited() { |
| } |
| void Scrollbar::mouseUp(const PlatformMouseEvent& mouseEvent) { |
| + bool isCaptured = m_pressedPart == ThumbPart; |
|
skobes
2016/11/02 21:02:43
Does this work if the mouse is pressed on the thum
bokan
2016/11/02 22:41:57
Yes, there's a bunch of logic in EventHandler for
|
| setPressedPart(NoPart); |
| m_pressedPos = 0; |
| m_draggingDocument = false; |
| stopTimerIfNeeded(); |
| if (m_scrollableArea) { |
| + if (isCaptured) |
| + m_scrollableArea->mouseReleasedScrollbar(); |
| + |
| // m_hoveredPart won't be updated until the next mouseMoved or mouseDown, so |
| // we have to hit test to really know if the mouse has exited the scrollbar |
| // on a mouseUp. |
| @@ -502,17 +506,20 @@ void Scrollbar::mouseDown(const PlatformMouseEvent& evt) { |
| moveThumb(desiredPos); |
| return; |
| } |
| - if (m_pressedPart == ThumbPart) |
| + if (m_pressedPart == ThumbPart) { |
| m_dragOrigin = m_currentPos; |
| + if (m_scrollableArea) |
| + m_scrollableArea->mouseCapturedScrollbar(); |
| + } |
| m_pressedPos = pressedPos; |
| autoscrollPressedPart(theme().initialAutoscrollTimerDelay()); |
| } |
| -void Scrollbar::visibilityChanged() { |
| +void Scrollbar::setScrollbarsHidden(bool hidden) { |
| if (m_scrollableArea) |
| - m_scrollableArea->scrollbarVisibilityChanged(); |
| + m_scrollableArea->setScrollbarsHidden(hidden); |
| } |
| void Scrollbar::setEnabled(bool e) { |
| @@ -538,8 +545,7 @@ bool Scrollbar::shouldParticipateInHitTesting() { |
| // Non-overlay scrollbars should always participate in hit testing. |
| if (!isOverlayScrollbar()) |
| return true; |
| - return m_scrollableArea->scrollAnimator() |
| - .shouldScrollbarParticipateInHitTesting(*this); |
| + return !m_scrollableArea->scrollbarsHidden(); |
| } |
| bool Scrollbar::isWindowActive() const { |