Index: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
diff --git a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
index f1e4f3954e713c0dfb2ce8037fdce48615c569a3..eaf50612712b8f8de2f60313519745cbed9427f4 100644 |
--- a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
+++ b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
@@ -633,16 +633,32 @@ void PaintLayerCompositor::frameViewDidChangeLocation( |
m_overflowControlsHostLayer->setPosition(contentsOffset); |
} |
+void PaintLayerCompositor::updateContainerSizes() { |
+ if (!m_containerLayer) |
+ return; |
+ |
+ FrameView* frameView = m_layoutView.frameView(); |
+ |
+ const TopDocumentRootScrollerController& globalRootScrollerController = |
+ m_layoutView.document().frameHost()->globalRootScrollerController(); |
+ |
+ // The global root scroller must always size to the root FrameView. |
+ if (rootLayer() && |
+ rootLayer() == globalRootScrollerController.rootScrollerPaintLayer()) |
+ frameView = m_layoutView.document().topDocument().view(); |
+ |
+ m_containerLayer->setSize(FloatSize(frameView->visibleContentSize())); |
+ m_overflowControlsHostLayer->setSize( |
+ FloatSize(frameView->visibleContentSize(IncludeScrollbars))); |
+} |
+ |
void PaintLayerCompositor::frameViewDidChangeSize() { |
- if (m_containerLayer) { |
- FrameView* frameView = m_layoutView.frameView(); |
- m_containerLayer->setSize(FloatSize(frameView->visibleContentSize())); |
- m_overflowControlsHostLayer->setSize( |
- FloatSize(frameView->visibleContentSize(IncludeScrollbars))); |
+ if (!m_containerLayer) |
+ return; |
- frameViewDidScroll(); |
- updateOverflowControlsLayers(); |
- } |
+ updateContainerSizes(); |
+ frameViewDidScroll(); |
+ updateOverflowControlsLayers(); |
} |
enum AcceleratedFixedRootBackgroundHistogramBuckets { |
@@ -842,12 +858,8 @@ void PaintLayerCompositor::updateRootLayerPosition() { |
m_rootContentLayer->setSize(FloatSize(documentRect.size())); |
m_rootContentLayer->setPosition(documentRect.location()); |
} |
- if (m_containerLayer) { |
- FrameView* frameView = m_layoutView.frameView(); |
- m_containerLayer->setSize(FloatSize(frameView->visibleContentSize())); |
- m_overflowControlsHostLayer->setSize( |
- FloatSize(frameView->visibleContentSize(IncludeScrollbars))); |
- } |
+ if (m_containerLayer) |
+ updateContainerSizes(); |
} |
void PaintLayerCompositor::updatePotentialCompositingReasonsFromStyle( |