Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp |
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
index 62a1ce16e876f295d51ecba6a033efc97d0e7185..51ecd0567278cc834b40025311ca8c39bbb999cf 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
@@ -49,6 +49,7 @@ |
#include "core/css/PseudoStyleRequest.h" |
#include "core/dom/Document.h" |
#include "core/dom/shadow/ShadowRoot.h" |
+#include "core/frame/FrameHost.h" |
#include "core/frame/FrameView.h" |
#include "core/frame/LocalFrame.h" |
#include "core/frame/Settings.h" |
@@ -70,6 +71,7 @@ |
#include "core/page/Page.h" |
#include "core/page/scrolling/RootScrollerController.h" |
#include "core/page/scrolling/ScrollingCoordinator.h" |
+#include "core/page/scrolling/TopDocumentRootScrollerController.h" |
#include "core/paint/BoxReflectionUtils.h" |
#include "core/paint/FilterEffectBuilder.h" |
#include "core/paint/ObjectPaintInvalidator.h" |
@@ -212,6 +214,14 @@ LayoutRect PaintLayer::visualRect() const { |
return m_layoutObject->visualRect(); |
} |
+bool PaintLayer::isRootScrollerLayer() const { |
+ return this == |
+ layoutObject() |
+ ->document() |
+ .rootScrollerController() |
+ .rootScrollerPaintLayer(); |
+} |
+ |
PaintLayerCompositor* PaintLayer::compositor() const { |
if (!layoutObject()->view()) |
return 0; |
@@ -1700,12 +1710,27 @@ void PaintLayer::collectFragments( |
} |
} |
-static inline LayoutRect frameVisibleRect(LayoutObject* layoutObject) { |
- FrameView* frameView = layoutObject->document().view(); |
+static inline LayoutRect frameVisibleRect(PaintLayer* layer) { |
+ LayoutObject* layoutObject = layer->layoutObject(); |
+ DCHECK(layoutObject); |
+ |
+ Document& doc = layoutObject->document(); |
+ |
+ FrameView* frameView = doc.view(); |
if (!frameView) |
return LayoutRect(); |
- return LayoutRect(frameView->visibleContentRect()); |
+ IntRect frameRect = frameView->visibleContentRect(ExcludeScrollbars); |
+ |
+ FrameHost* host = doc.frameHost(); |
+ DCHECK(host); |
+ if (host->globalRootScrollerController().isRootScrollerAncestor(doc)) { |
chrishtr
2017/01/21 02:06:47
This adjustment in hit-testing code doesn't also a
|
+ frameRect.setSize(host->globalRootScrollerController() |
+ .visibleContentRect(ExcludeScrollbars) |
+ .size()); |
+ } |
+ |
+ return LayoutRect(frameRect); |
} |
bool PaintLayer::hitTest(HitTestResult& result) { |
@@ -1719,7 +1744,7 @@ bool PaintLayer::hitTest(HitTestResult& result) { |
const HitTestLocation& hitTestLocation = result.hitTestLocation(); |
// Start with frameVisibleRect to ensure we include the scrollbars. |
- LayoutRect hitTestArea = frameVisibleRect(layoutObject()); |
+ LayoutRect hitTestArea = frameVisibleRect(this); |
if (request.ignoreClipping()) |
hitTestArea.unite(LayoutRect(layoutObject()->view()->documentRect())); |