Index: third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp |
diff --git a/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp b/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp |
index 87f7787b0ff7be58e7bfd3271361b3b3c32aa4ff..8a0dd937d3649cfb2fdb49d4a62a8369d59a780d 100644 |
--- a/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp |
+++ b/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp |
@@ -11,6 +11,8 @@ |
#include "core/layout/LayoutBox.h" |
#include "core/layout/compositing/CompositedLayerMapping.h" |
#include "core/layout/compositing/PaintLayerCompositor.h" |
+#include "core/page/scrolling/RootScrollerUtil.h" |
+#include "core/page/scrolling/TopDocumentRootScrollerController.h" |
#include "core/paint/PaintLayer.h" |
#include "core/paint/PaintLayerScrollableArea.h" |
#include "platform/graphics/GraphicsLayer.h" |
@@ -86,10 +88,6 @@ void RootScrollerController::didUpdateLayout() |
recomputeEffectiveRootScroller(); |
} |
-void RootScrollerController::globalRootScrollerMayHaveChanged() |
-{ |
-} |
- |
void RootScrollerController::recomputeEffectiveRootScroller() |
{ |
bool rootScrollerValid = |
@@ -107,27 +105,8 @@ void RootScrollerController::recomputeEffectiveRootScroller() |
if (PaintLayer* layer = rootScrollerPaintLayer()) |
layer->setNeedsCompositingInputsUpdate(); |
- m_document->topDocument().rootScrollerController() |
- ->globalRootScrollerMayHaveChanged(); |
-} |
- |
-ScrollableArea* RootScrollerController::scrollableAreaFor( |
- const Element& element) const |
-{ |
- if (!element.layoutObject() || !element.layoutObject()->isBox()) |
- return nullptr; |
- |
- LayoutBox* box = toLayoutBox(element.layoutObject()); |
- |
- // For a FrameView, we use the layoutViewport rather than the |
- // getScrollableArea() since that could be the RootFrameViewport. The |
- // rootScroller's ScrollableArea will be swapped in as the layout viewport |
- // in RootFrameViewport so we need to ensure we get the layout viewport. |
- if (box->isDocumentElement()) |
- return element.document().view()->layoutViewportScrollableArea(); |
- |
- return static_cast<PaintInvalidationCapableScrollableArea*>( |
- box->getScrollableArea()); |
+ if (FrameHost* frameHost = m_document->frameHost()) |
+ frameHost->globalRootScrollerController().didChangeRootScroller(); |
} |
bool RootScrollerController::isValidRootScroller(const Element& element) const |
@@ -135,7 +114,7 @@ bool RootScrollerController::isValidRootScroller(const Element& element) const |
if (!element.layoutObject()) |
return false; |
- if (!scrollableAreaFor(element)) |
+ if (!RootScrollerUtil::scrollableAreaFor(element)) |
return false; |
if (!fillsViewport(element)) |
@@ -144,32 +123,6 @@ bool RootScrollerController::isValidRootScroller(const Element& element) const |
return true; |
} |
-void RootScrollerController::didUpdateCompositing() |
-{ |
-} |
- |
-void RootScrollerController::didAttachDocument() |
-{ |
-} |
- |
-GraphicsLayer* RootScrollerController::rootScrollerLayer() |
-{ |
- NOTREACHED(); |
- return nullptr; |
-} |
- |
-bool RootScrollerController::isViewportScrollCallback( |
- const ScrollStateCallback* callback) const |
-{ |
- // TopDocumentRootScrollerController must override this method to actually |
- // do the comparison. |
- DCHECK(!m_document->isInMainFrame()); |
- |
- RootScrollerController* topDocumentController = |
- m_document->topDocument().rootScrollerController(); |
- return topDocumentController->isViewportScrollCallback(callback); |
-} |
- |
PaintLayer* RootScrollerController::rootScrollerPaintLayer() const |
{ |
if (!m_effectiveRootScroller) |