Index: Source/web/WebViewImpl.cpp |
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
index 94ab8cc45b04f89c0276867bc1c142168416aa00..3b6ab3bfdcec18d696e9e6458ae88658d5593cd6 100644 |
--- a/Source/web/WebViewImpl.cpp |
+++ b/Source/web/WebViewImpl.cpp |
@@ -484,14 +484,16 @@ void WebViewImpl::handleMouseDown(LocalFrame& mainFrame, const WebMouseEvent& ev |
m_lastMouseDownPoint = WebPoint(event.x, event.y); |
- if (event.button == WebMouseEvent::ButtonLeft) { |
- IntPoint point(event.x, event.y); |
+ // Take capture on a mouse down on a plugin so we can send it mouse events. |
+ // If the hit node is a plugin but a scrollbar is over it don't start mouse |
+ // capture because it will interfere with the scrollbar receiving events. |
+ IntPoint point(event.x, event.y); |
+ if (event.button == WebMouseEvent::ButtonLeft && !m_page->mainFrame()->view()->scrollbarAtPoint(point)) { |
point = m_page->mainFrame()->view()->windowToContents(point); |
HitTestResult result(m_page->mainFrame()->eventHandler().hitTestResultAtPoint(point)); |
Node* hitNode = result.innerNonSharedNode(); |
- // Take capture on a mouse down on a plugin so we can send it mouse events. |
- if (hitNode && hitNode->renderer() && hitNode->renderer()->isEmbeddedObject()) { |
+ if (!result.scrollbar() && hitNode && hitNode->renderer() && hitNode->renderer()->isEmbeddedObject()) { |
m_mouseCaptureNode = hitNode; |
TRACE_EVENT_ASYNC_BEGIN0("input", "capturing mouse", this); |
} |