Content shadow layer needs to move in sync with the content layer
https://bugs.webkit.org/show_bug.cgi?id=132841
-and corresponding-
<rdar://problem/16641115>
Reviewed by Simon Fraser.
Now that the root content layer moves a little bit (for y scroll positions between
0 and topContentInset), the shadow layer needs to move along with it since the
shadow layer should always have the same position as the root content layer.
Set the root state node’s shadow layer, and update the position whenever the root
content layer’s position is updated.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
Fetch the compositor’s layerForContentShadow().
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
* page/scrolling/ScrollingCoordinator.h:
Hook up the contentShadowLayer in the state node.
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setContentShadowLayer):
Hook it up in the ScrollingTreeNode as well. Move the layer whenever the m
_scrolledContentsLayer is moved.
* page/scrolling/ScrollingStateScrollingNode.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren):
(WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition):
The shadow layer needs an anchor point now that we are moving it around.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@168655 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
index a174b10..8283c1b 100644
--- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
+++ b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
@@ -135,6 +135,7 @@
node->setLayer(scrollLayerForFrameView(frameView));
node->setCounterScrollingLayer(counterScrollingLayerForFrameView(frameView));
node->setInsetClipLayer(insetClipLayerForFrameView(frameView));
+ node->setContentShadowLayer(contentShadowLayerForFrameView(frameView));
node->setHeaderLayer(headerLayerForFrameView(frameView));
node->setFooterLayer(footerLayerForFrameView(frameView));
node->setScrollBehaviorForFixedElements(frameView->scrollBehaviorForFixedElements());
@@ -215,6 +216,7 @@
if (GraphicsLayer* scrollLayer = scrollLayerForFrameView(frameView)) {
GraphicsLayer* counterScrollingLayer = counterScrollingLayerForFrameView(frameView);
GraphicsLayer* insetClipLayer = insetClipLayerForFrameView(frameView);
+ GraphicsLayer* contentShadowLayer = contentShadowLayerForFrameView(frameView);
GraphicsLayer* scrolledContentsLayer = rootContentLayerForFrameView(frameView);
GraphicsLayer* headerLayer = headerLayerForFrameView(frameView);
GraphicsLayer* footerLayer = footerLayerForFrameView(frameView);
@@ -234,6 +236,8 @@
counterScrollingLayer->setPosition(toLayoutPoint(scrollOffsetForFixed));
if (insetClipLayer)
insetClipLayer->setPosition(positionForInsetClipLayer);
+ if (contentShadowLayer)
+ contentShadowLayer->setPosition(positionForContentsLayer);
if (scrolledContentsLayer)
scrolledContentsLayer->setPosition(positionForContentsLayer);
if (headerLayer)
@@ -246,6 +250,8 @@
counterScrollingLayer->syncPosition(toLayoutPoint(scrollOffsetForFixed));
if (insetClipLayer)
insetClipLayer->syncPosition(positionForInsetClipLayer);
+ if (contentShadowLayer)
+ contentShadowLayer->syncPosition(positionForContentsLayer);
if (scrolledContentsLayer)
scrolledContentsLayer->syncPosition(positionForContentsLayer);
if (headerLayer)