Index: Source/core/page/EventHandler.cpp |
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp |
index 46e48ac448b53e0de8c14b10db360fc897fd2c5e..7c91f6bd48f327730e2ffb8f7bc54a8d8c9926ff 100644 |
--- a/Source/core/page/EventHandler.cpp |
+++ b/Source/core/page/EventHandler.cpp |
@@ -1271,6 +1271,14 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent) |
m_frame->selection().setCaretBlinkingSuspended(true); |
+ FrameView* view = m_frame->view(); |
+ Scrollbar* scrollbar = view ? view->scrollbarAtPoint(mouseEvent.position()) : 0; |
Rick Byers
2014/05/22 13:53:36
Shouldn't this already be in mev.scrollbar()? See
|
+ if (scrollbar) { |
+ updateLastScrollbarUnderMouse(scrollbar, true); |
+ if (passMousePressEventToScrollbar(mev, scrollbar)) |
+ return true; |
+ } |
+ |
bool swallowEvent = !dispatchMouseEvent(EventTypeNames::mousedown, mev.targetNode(), m_clickCount, mouseEvent, true); |
swallowEvent = swallowEvent || !handleMouseFocus(mouseEvent); |
m_capturesDragging = !swallowEvent || mev.scrollbar(); |
@@ -1287,7 +1295,7 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent) |
if (swallowEvent) { |
// scrollbars should get events anyway, even disabled controls might be scrollable |
- Scrollbar* scrollbar = mev.scrollbar(); |
+ scrollbar = mev.scrollbar(); |
updateLastScrollbarUnderMouse(scrollbar, true); |
@@ -1299,10 +1307,7 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent) |
mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent); |
} |
- FrameView* view = m_frame->view(); |
- Scrollbar* scrollbar = view ? view->scrollbarAtPoint(mouseEvent.position()) : 0; |
- if (!scrollbar) |
- scrollbar = mev.scrollbar(); |
+ scrollbar = mev.scrollbar(); |
updateLastScrollbarUnderMouse(scrollbar, true); |