Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(507)

Unified Diff: third_party/WebKit/Source/core/input/EventHandlingUtil.cpp

Issue 2623213002: Expand PaintLayer clip to account for hidden URL bar with document.rootScroller (Closed)
Patch Set: Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698