Index: third_party/WebKit/Source/core/frame/VisualViewport.cpp |
diff --git a/third_party/WebKit/Source/core/frame/VisualViewport.cpp b/third_party/WebKit/Source/core/frame/VisualViewport.cpp |
index c14a23d716f2697cb07e40e05586b09a857e2854..577f983bd17f77e613d0310fbb297e86793411fe 100644 |
--- a/third_party/WebKit/Source/core/frame/VisualViewport.cpp |
+++ b/third_party/WebKit/Source/core/frame/VisualViewport.cpp |
@@ -453,10 +453,8 @@ |
ASSERT(coordinator); |
ScrollbarOrientation webcoreOrientation = |
isHorizontal ? HorizontalScrollbar : VerticalScrollbar; |
- WebLayer* scrollLayer = layerForScrolling()->platformLayer(); |
webScrollbarLayer = coordinator->createSolidColorScrollbarLayer( |
- webcoreOrientation, thumbThickness, scrollbarMargin, false, |
- scrollLayer); |
+ webcoreOrientation, thumbThickness, scrollbarMargin, false); |
// The compositor will control the scrollbar's visibility. Set to invisible |
// by default so scrollbars don't show up in layout tests. |
@@ -485,6 +483,14 @@ |
scrollbarGraphicsLayer->setPosition(IntPoint(xPosition, yPosition)); |
scrollbarGraphicsLayer->setSize(FloatSize(width, height)); |
scrollbarGraphicsLayer->setContentsRect(IntRect(0, 0, width, height)); |
+} |
+ |
+void VisualViewport::setScrollLayerOnScrollbars(WebLayer* scrollLayer) const { |
+ // TODO(bokan): This is currently done while registering viewport layers |
+ // with the compositor but could it actually be done earlier, like in |
+ // setupScrollbars? Then we wouldn't need this method. |
+ m_webOverlayScrollbarHorizontal->setScrollLayer(scrollLayer); |
+ m_webOverlayScrollbarVertical->setScrollLayer(scrollLayer); |
} |
bool VisualViewport::visualViewportSuppliesScrollbars() const { |