Index: third_party/WebKit/Source/core/input/EventHandlingUtil.cpp |
diff --git a/third_party/WebKit/Source/core/input/EventHandlingUtil.cpp b/third_party/WebKit/Source/core/input/EventHandlingUtil.cpp |
index 908de11084e01bf8a44b9de6c32cb8ae855d5339..0c3903dda6c6db44debbf5491cce2c707be99951 100644 |
--- a/third_party/WebKit/Source/core/input/EventHandlingUtil.cpp |
+++ b/third_party/WebKit/Source/core/input/EventHandlingUtil.cpp |
@@ -4,9 +4,11 @@ |
#include "core/input/EventHandlingUtil.h" |
+#include "core/frame/FrameHost.h" |
#include "core/frame/FrameView.h" |
#include "core/frame/LocalFrame.h" |
#include "core/layout/api/LayoutViewItem.h" |
+#include "core/page/scrolling/TopDocumentRootScrollerController.h" |
#include "core/paint/PaintLayer.h" |
#include "platform/scroll/ScrollableArea.h" |
@@ -18,13 +20,23 @@ HitTestResult hitTestResultInFrame(LocalFrame* frame, |
HitTestRequest::HitTestRequestType hitType) { |
HitTestResult result(HitTestRequest(hitType), point); |
- if (!frame || frame->contentLayoutItem().isNull()) |
+ if (!frame || frame->contentLayoutItem().isNull() || !frame->view()) |
return result; |
- if (frame->view()) { |
- IntRect rect = frame->view()->visibleContentRect(IncludeScrollbars); |
- if (!rect.contains(roundedIntPoint(point))) |
- return result; |
+ |
+ IntRect frameRect = frame->view()->visibleContentRect(IncludeScrollbars); |
+ |
+ DCHECK(frame->host()); |
+ DCHECK(frame->document()); |
+ TopDocumentRootScrollerController& rootScrollerController = |
+ frame->host()->globalRootScrollerController(); |
+ if (rootScrollerController.isRootScrollerAncestor(*frame->document())) { |
+ frameRect.setSize( |
+ rootScrollerController.visibleContentRect(IncludeScrollbars).size()); |
} |
+ |
+ if (!frameRect.contains(roundedIntPoint(point))) |
+ return result; |
+ |
frame->contentLayoutItem().hitTest(result); |
return result; |
} |