Chromium Code Reviews| 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 8fc0647065efa0b7900508e884af631613518610..87f7787b0ff7be58e7bfd3271361b3b3c32aa4ff 100644 |
| --- a/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp |
| +++ b/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp |
| @@ -9,6 +9,9 @@ |
| #include "core/frame/FrameHost.h" |
| #include "core/frame/FrameView.h" |
| #include "core/layout/LayoutBox.h" |
| +#include "core/layout/compositing/CompositedLayerMapping.h" |
|
chrishtr
2016/09/01 23:42:57
Do you need this include?
bokan
2016/09/09 00:19:02
Nope, removed.
|
| +#include "core/layout/compositing/PaintLayerCompositor.h" |
| +#include "core/paint/PaintLayer.h" |
| #include "core/paint/PaintLayerScrollableArea.h" |
| #include "platform/graphics/GraphicsLayer.h" |
| #include "platform/scroll/ScrollableArea.h" |
| @@ -101,6 +104,9 @@ void RootScrollerController::recomputeEffectiveRootScroller() |
| m_effectiveRootScroller = newEffectiveRootScroller; |
| + if (PaintLayer* layer = rootScrollerPaintLayer()) |
| + layer->setNeedsCompositingInputsUpdate(); |
| + |
| m_document->topDocument().rootScrollerController() |
| ->globalRootScrollerMayHaveChanged(); |
| } |
| @@ -164,6 +170,28 @@ bool RootScrollerController::isViewportScrollCallback( |
| return topDocumentController->isViewportScrollCallback(callback); |
| } |
| +PaintLayer* RootScrollerController::rootScrollerPaintLayer() const |
| +{ |
| + if (!m_effectiveRootScroller) |
| + return nullptr; |
| + |
| + LayoutBox* box = toLayoutBox(m_effectiveRootScroller->layoutObject()); |
| + if (!box) |
| + return nullptr; |
| + |
| + PaintLayer* layer = box->layer(); |
| + |
| + // If the root scroller is the <html> element we do a bit of a fake out because |
| + // while <html> has a PaintLayer, scrolling for it is handled by the #document's |
| + // PaintLayer (i.e. the PaintLayerCompositor's root layer). The reason the root |
| + // scroller is the <html> layer and not #document is because the latter is a Node |
| + // but not an Element. |
| + if (m_effectiveRootScroller->isSameNode(m_document->documentElement())) |
| + return layer->compositor()->rootLayer(); |
| + |
| + return layer; |
| +} |
| + |
| Element* RootScrollerController::defaultEffectiveRootScroller() |
| { |
| DCHECK(m_document); |