Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
index c72cb6d3f03e5bbf1155f7aa2bf4595a8529e040..89d8e71bd8340a17bfa689487bd27bbd0d06d196 100644 |
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
@@ -52,6 +52,7 @@ |
#include "core/page/Page.h" |
#include "core/page/scrolling/ScrollingCoordinator.h" |
#include "core/page/scrolling/StickyPositionScrollingConstraints.h" |
+#include "core/page/scrolling/TopDocumentRootScrollerController.h" |
#include "core/paint/ObjectPaintInvalidator.h" |
#include "core/paint/PaintInfo.h" |
#include "core/paint/PaintLayerPainter.h" |
@@ -1259,6 +1260,17 @@ void CompositedLayerMapping::updateScrollingLayerGeometry( |
LayoutBox* layoutBox = toLayoutBox(layoutObject()); |
IntRect overflowClipRect = |
pixelSnappedIntRect(layoutBox->overflowClipRect(LayoutPoint())); |
+ |
+ const TopDocumentRootScrollerController& globalRootScrollerController = |
+ layoutBox->document().frameHost()->globalRootScrollerController(); |
+ |
+ if (&m_owningLayer == globalRootScrollerController.rootScrollerPaintLayer()) { |
+ LayoutRect clipRect = |
+ layoutBox->document().layoutView()->overflowClipRect(LayoutPoint()); |
+ DCHECK(clipRect.size() == LayoutSize(pixelSnappedIntRect(clipRect).size())); |
+ overflowClipRect.setSize(pixelSnappedIntRect(clipRect).size()); |
+ } |
+ |
FloatPoint scrollPosition = |
m_owningLayer.getScrollableArea()->scrollPosition(); |
m_scrollingLayer->setPosition(FloatPoint( |