Diff
Modified: branches/safari-538.34-branch/Source/WebCore/ChangeLog (168806 => 168807)
--- branches/safari-538.34-branch/Source/WebCore/ChangeLog 2014-05-14 07:56:36 UTC (rev 168806)
+++ branches/safari-538.34-branch/Source/WebCore/ChangeLog 2014-05-14 07:59:53 UTC (rev 168807)
@@ -1,5 +1,50 @@
2014-05-14 Lucas Forschler <[email protected]>
+ Merge r168655
+
+ 2014-05-12 Beth Dakin <[email protected]>
+
+ 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):
+
+2014-05-14 Lucas Forschler <[email protected]>
+
Merge r168643
2014-05-12 Beth Dakin <[email protected]>
Modified: branches/safari-538.34-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (168806 => 168807)
--- branches/safari-538.34-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2014-05-14 07:56:36 UTC (rev 168806)
+++ branches/safari-538.34-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2014-05-14 07:59:53 UTC (rev 168807)
@@ -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)
Modified: branches/safari-538.34-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (168806 => 168807)
--- branches/safari-538.34-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2014-05-14 07:56:36 UTC (rev 168806)
+++ branches/safari-538.34-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2014-05-14 07:59:53 UTC (rev 168807)
@@ -255,6 +255,13 @@
return nullptr;
}
+GraphicsLayer* ScrollingCoordinator::contentShadowLayerForFrameView(FrameView* frameView)
+{
+ if (RenderView* renderView = frameView->frame().contentRenderer())
+ return renderView->compositor().layerForContentShadow();
+ return nullptr;
+}
+
GraphicsLayer* ScrollingCoordinator::rootContentLayerForFrameView(FrameView* frameView)
{
if (RenderView* renderView = frameView->frame().contentRenderer())
Modified: branches/safari-538.34-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.h (168806 => 168807)
--- branches/safari-538.34-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2014-05-14 07:56:36 UTC (rev 168806)
+++ branches/safari-538.34-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2014-05-14 07:59:53 UTC (rev 168807)
@@ -205,6 +205,7 @@
GraphicsLayer* counterScrollingLayerForFrameView(FrameView*);
GraphicsLayer* insetClipLayerForFrameView(FrameView*);
GraphicsLayer* rootContentLayerForFrameView(FrameView*);
+ GraphicsLayer* contentShadowLayerForFrameView(FrameView*);
GraphicsLayer* headerLayerForFrameView(FrameView*);
GraphicsLayer* footerLayerForFrameView(FrameView*);
Modified: branches/safari-538.34-branch/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp (168806 => 168807)
--- branches/safari-538.34-branch/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp 2014-05-14 07:56:36 UTC (rev 168806)
+++ branches/safari-538.34-branch/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp 2014-05-14 07:59:53 UTC (rev 168807)
@@ -87,6 +87,9 @@
if (hasChangedProperty(InsetClipLayer))
setInsetClipLayer(stateNode.insetClipLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
+ if (hasChangedProperty(ContentShadowLayer))
+ setContentShadowLayer(stateNode.contentShadowLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
+
if (hasChangedProperty(HeaderLayer))
setHeaderLayer(stateNode.headerLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
@@ -255,6 +258,15 @@
setPropertyChanged(InsetClipLayer);
}
+void ScrollingStateScrollingNode::setContentShadowLayer(const LayerRepresentation& layerRepresentation)
+{
+ if (layerRepresentation == m_contentShadowLayer)
+ return;
+
+ m_contentShadowLayer = layerRepresentation;
+ setPropertyChanged(ContentShadowLayer);
+}
+
void ScrollingStateScrollingNode::setHeaderLayer(const LayerRepresentation& layerRepresentation)
{
if (layerRepresentation == m_headerLayer)
Modified: branches/safari-538.34-branch/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h (168806 => 168807)
--- branches/safari-538.34-branch/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h 2014-05-14 07:56:36 UTC (rev 168806)
+++ branches/safari-538.34-branch/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h 2014-05-14 07:59:53 UTC (rev 168807)
@@ -63,6 +63,7 @@
ScrolledContentsLayer,
CounterScrollingLayer,
InsetClipLayer,
+ ContentShadowLayer,
HeaderHeight,
FooterHeight,
HeaderLayer,
@@ -130,6 +131,9 @@
const LayerRepresentation& insetClipLayer() const { return m_insetClipLayer; }
void setInsetClipLayer(const LayerRepresentation&);
+ const LayerRepresentation& contentShadowLayer() const { return m_contentShadowLayer; }
+ void setContentShadowLayer(const LayerRepresentation&);
+
// The header and footer layers scroll vertically with the page, they should remain fixed when scrolling horizontally.
const LayerRepresentation& headerLayer() const { return m_headerLayer; }
void setHeaderLayer(const LayerRepresentation&);
@@ -153,6 +157,7 @@
LayerRepresentation m_scrolledContentsLayer;
LayerRepresentation m_counterScrollingLayer;
LayerRepresentation m_insetClipLayer;
+ LayerRepresentation m_contentShadowLayer;
LayerRepresentation m_headerLayer;
LayerRepresentation m_footerLayer;
Modified: branches/safari-538.34-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.h (168806 => 168807)
--- branches/safari-538.34-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.h 2014-05-14 07:56:36 UTC (rev 168806)
+++ branches/safari-538.34-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.h 2014-05-14 07:59:53 UTC (rev 168807)
@@ -90,6 +90,7 @@
RetainPtr<CALayer> m_scrolledContentsLayer;
RetainPtr<CALayer> m_counterScrollingLayer;
RetainPtr<CALayer> m_insetClipLayer;
+ RetainPtr<CALayer> m_contentShadowLayer;
RetainPtr<CALayer> m_headerLayer;
RetainPtr<CALayer> m_footerLayer;
RetainPtr<ScrollbarPainter> m_verticalScrollbarPainter;
Modified: branches/safari-538.34-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm (168806 => 168807)
--- branches/safari-538.34-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm 2014-05-14 07:56:36 UTC (rev 168806)
+++ branches/safari-538.34-branch/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm 2014-05-14 07:59:53 UTC (rev 168807)
@@ -87,6 +87,9 @@
if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::InsetClipLayer))
m_insetClipLayer = scrollingStateNode.insetClipLayer();
+ if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ContentShadowLayer))
+ m_contentShadowLayer = scrollingStateNode.contentShadowLayer();
+
if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::HeaderLayer))
m_headerLayer = scrollingStateNode.headerLayer();
@@ -360,6 +363,8 @@
m_insetClipLayer.get().position = FloatPoint(0, FrameView::yPositionForInsetClipLayer(position, topContentInset));
m_scrolledContentsLayer.get().position = FloatPoint(m_scrolledContentsLayer.get().position.x,
FrameView::yPositionForRootContentLayer(position, topContentInset, headerHeight()));
+ if (m_contentShadowLayer)
+ m_contentShadowLayer.get().position = m_scrolledContentsLayer.get().position;
}
if (m_headerLayer || m_footerLayer) {
Modified: branches/safari-538.34-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp (168806 => 168807)
--- branches/safari-538.34-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp 2014-05-14 07:56:36 UTC (rev 168806)
+++ branches/safari-538.34-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp 2014-05-14 07:59:53 UTC (rev 168807)
@@ -3102,6 +3102,7 @@
#endif
m_contentShadowLayer->setSize(m_rootContentLayer->size());
m_contentShadowLayer->setPosition(m_rootContentLayer->position());
+ m_contentShadowLayer->setAnchorPoint(FloatPoint3D());
m_contentShadowLayer->setCustomAppearance(GraphicsLayer::ScrollingShadow);
m_scrollLayer->addChildBelow(m_contentShadowLayer.get(), m_rootContentLayer.get());