Title: [169123] trunk/Source
Revision
169123
Author
[email protected]
Date
2014-05-20 12:13:14 -0700 (Tue, 20 May 2014)

Log Message

REGRESSION (r169063) Fixed and sticky nodes misplaced on scrolling sometimes
https://bugs.webkit.org/show_bug.cgi?id=133106
<rdar://problem/16967648>

Reviewed by Sam Weinig.

Fix regression from r169063. That commit removed scrolledContentsLayers from
frame scrolling nodes, but they do actually use them.

So put them back; not in the base class, because they have a somewhat different
meaning for overflow scrolling and frame scrolling.

Source/WebCore:
* WebCore.exp.in:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::updateFrameScrollingNode):
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setScrolledContentsLayer):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

Source/WebKit2:
* Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
(ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
(WebKit::RemoteScrollingTreeTextStream::dump):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (169122 => 169123)


--- trunk/Source/WebCore/ChangeLog	2014-05-20 18:44:52 UTC (rev 169122)
+++ trunk/Source/WebCore/ChangeLog	2014-05-20 19:13:14 UTC (rev 169123)
@@ -1,3 +1,33 @@
+2014-05-19  Simon Fraser  <[email protected]>
+
+        REGRESSION (r169063) Fixed and sticky nodes misplaced on scrolling sometimes
+        https://bugs.webkit.org/show_bug.cgi?id=133106
+        <rdar://problem/16967648>
+
+        Reviewed by Sam Weinig.
+
+        Fix regression from r169063. That commit removed scrolledContentsLayers from 
+        frame scrolling nodes, but they do actually use them.
+        
+        So put them back; not in the base class, because they have a somewhat different
+        meaning for overflow scrolling and frame scrolling.
+
+        * WebCore.exp.in:
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
+        (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
+        * page/scrolling/AsyncScrollingCoordinator.h:
+        * page/scrolling/ScrollingCoordinator.h:
+        (WebCore::ScrollingCoordinator::updateFrameScrollingNode):
+        * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
+        (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
+        (WebCore::ScrollingStateFrameScrollingNode::setScrolledContentsLayer):
+        * page/scrolling/ScrollingStateFrameScrollingNode.h:
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
+
 2014-05-20  Radu Stavila  <[email protected]>
 
         REGRESSION: [CSS Regions] Content flowed directly into the flow thread that ends up in the second region is not properly repainted

Modified: trunk/Source/WebCore/WebCore.exp.in (169122 => 169123)


--- trunk/Source/WebCore/WebCore.exp.in	2014-05-20 18:44:52 UTC (rev 169122)
+++ trunk/Source/WebCore/WebCore.exp.in	2014-05-20 19:13:14 UTC (rev 169123)
@@ -826,8 +826,8 @@
 __ZN7WebCore19toInt32EnforceRangeEPN3JSC9ExecStateENS0_7JSValueE
 __ZN7WebCore20ApplicationCacheHost17maybeLoadResourceEPNS_14ResourceLoaderERKNS_15ResourceRequestERKNS_3URLE
 __ZN7WebCore20ApplicationCacheHost25maybeLoadFallbackForErrorEPNS_14ResourceLoaderERKNS_13ResourceErrorE
+__ZN7WebCore20ApplicationCacheHost28maybeLoadFallbackForRedirectEPNS_14ResourceLoaderERNS_15ResourceRequestERKNS_16ResourceResponseE
 __ZN7WebCore20ApplicationCacheHost28maybeLoadFallbackForResponseEPNS_14ResourceLoaderERKNS_16ResourceResponseE
-__ZN7WebCore20ApplicationCacheHost28maybeLoadFallbackForRedirectEPNS_14ResourceLoaderERNS_15ResourceRequestERKNS_16ResourceResponseE
 __ZN7WebCore20CachedResourceLoader31garbageCollectDocumentResourcesEv
 __ZN7WebCore20DictationAlternativeC1Ejjy
 __ZN7WebCore20DictationAlternativeC1Ev
@@ -2815,7 +2815,7 @@
 __ZN7WebCore25AsyncScrollingCoordinator18syncChildPositionsERKNS_10LayoutRectE
 __ZN7WebCore25AsyncScrollingCoordinator19detachFromStateTreeEy
 __ZN7WebCore25AsyncScrollingCoordinator22frameViewLayoutUpdatedEPNS_9FrameViewE
-__ZN7WebCore25AsyncScrollingCoordinator24updateFrameScrollingNodeEyPNS_13GraphicsLayerES2_S2_PKNS_20ScrollingCoordinator17ScrollingGeometryE
+__ZN7WebCore25AsyncScrollingCoordinator24updateFrameScrollingNodeEyPNS_13GraphicsLayerES2_S2_S2_PKNS_20ScrollingCoordinator17ScrollingGeometryE
 __ZN7WebCore25AsyncScrollingCoordinator27frameViewRootLayerDidChangeEPNS_9FrameViewE
 __ZN7WebCore25AsyncScrollingCoordinator27requestScrollPositionUpdateEPNS_9FrameViewERKNS_8IntPointE
 __ZN7WebCore25AsyncScrollingCoordinator27updateOverflowScrollingNodeEyPNS_13GraphicsLayerES2_PKNS_20ScrollingCoordinator17ScrollingGeometryE
@@ -2846,6 +2846,7 @@
 __ZN7WebCore32ScrollingStateFrameScrollingNode19setFrameScaleFactorEf
 __ZN7WebCore32ScrollingStateFrameScrollingNode21setContentShadowLayerERKNS_19LayerRepresentationE
 __ZN7WebCore32ScrollingStateFrameScrollingNode24setCounterScrollingLayerERKNS_19LayerRepresentationE
+__ZN7WebCore32ScrollingStateFrameScrollingNode24setScrolledContentsLayerERKNS_19LayerRepresentationE
 __ZN7WebCore32ScrollingStateFrameScrollingNode25setWheelEventHandlerCountEj
 __ZN7WebCore32ScrollingStateFrameScrollingNode26setNonFastScrollableRegionERKNS_6RegionE
 __ZN7WebCore32ScrollingStateFrameScrollingNode30setSynchronousScrollingReasonsEj

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (169122 => 169123)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2014-05-20 18:44:52 UTC (rev 169122)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2014-05-20 19:13:14 UTC (rev 169123)
@@ -134,6 +134,7 @@
 
     ScrollingStateFrameScrollingNode* node = toScrollingStateFrameScrollingNode(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
     node->setLayer(scrollLayerForFrameView(frameView));
+    node->setScrolledContentsLayer(rootContentLayerForFrameView(frameView));
     node->setCounterScrollingLayer(counterScrollingLayerForFrameView(frameView));
     node->setInsetClipLayer(insetClipLayerForFrameView(frameView));
     node->setContentShadowLayer(contentShadowLayerForFrameView(frameView));
@@ -328,7 +329,7 @@
     attachToStateTree(FrameScrollingNode, frameView->scrollLayerID(), 0);
 }
 
-void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* scrollingGeometry)
+void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* scrollingGeometry)
 {
     ScrollingStateFrameScrollingNode* node = toScrollingStateFrameScrollingNode(m_scrollingStateTree->stateNodeForID(nodeID));
     ASSERT(node);
@@ -337,6 +338,7 @@
 
     node->setLayer(layer);
     node->setInsetClipLayer(insetClipLayer);
+    node->setScrolledContentsLayer(scrolledContentsLayer);
     node->setCounterScrollingLayer(counterScrollingLayer);
 
     if (scrollingGeometry) {

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h (169122 => 169123)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h	2014-05-20 18:44:52 UTC (rev 169122)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h	2014-05-20 19:13:14 UTC (rev 169123)
@@ -88,7 +88,7 @@
     
     virtual void updateViewportConstrainedNode(ScrollingNodeID, const ViewportConstraints&, GraphicsLayer*) override;
     
-    virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* = nullptr);
+    virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* = nullptr);
     virtual void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry* = nullptr);
     
     virtual String scrollingStateTreeAsText() const override;

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (169122 => 169123)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2014-05-20 18:44:52 UTC (rev 169122)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2014-05-20 19:13:14 UTC (rev 169123)
@@ -165,7 +165,7 @@
         IntPoint scrollOrigin;
     };
 
-    virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*counterScrollingLayer*/, GraphicsLayer* /*insetClipLayer*/, const ScrollingGeometry* = nullptr) { }
+    virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, GraphicsLayer* /*counterScrollingLayer*/, GraphicsLayer* /*insetClipLayer*/, const ScrollingGeometry* = nullptr) { }
     virtual void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, const ScrollingGeometry* = nullptr) { }
     virtual void syncChildPositions(const LayoutRect&) { }
     virtual String scrollingStateTreeAsText() const;

Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp (169122 => 169123)


--- trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp	2014-05-20 18:44:52 UTC (rev 169122)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp	2014-05-20 19:13:14 UTC (rev 169123)
@@ -73,6 +73,9 @@
     , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll())
     , m_topContentInset(stateNode.topContentInset())
 {
+    if (hasChangedProperty(ScrolledContentsLayer))
+        setScrolledContentsLayer(stateNode.scrolledContentsLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
+
     if (hasChangedProperty(CounterScrollingLayer))
         setCounterScrollingLayer(stateNode.counterScrollingLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
 
@@ -171,6 +174,15 @@
     setPropertyChanged(TopContentInset);
 }
 
+void ScrollingStateFrameScrollingNode::setScrolledContentsLayer(const LayerRepresentation& layerRepresentation)
+{
+    if (layerRepresentation == m_scrolledContentsLayer)
+        return;
+    
+    m_scrolledContentsLayer = layerRepresentation;
+    setPropertyChanged(ScrolledContentsLayer);
+}
+
 void ScrollingStateFrameScrollingNode::setCounterScrollingLayer(const LayerRepresentation& layerRepresentation)
 {
     if (layerRepresentation == m_counterScrollingLayer)

Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h (169122 => 169123)


--- trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h	2014-05-20 18:44:52 UTC (rev 169122)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h	2014-05-20 19:13:14 UTC (rev 169123)
@@ -52,6 +52,7 @@
         NonFastScrollableRegion,
         WheelEventHandlerCount,
         ReasonsForSynchronousScrolling,
+        ScrolledContentsLayer,
         CounterScrollingLayer,
         InsetClipLayer,
         ContentShadowLayer,
@@ -87,7 +88,10 @@
 
     float topContentInset() const { return m_topContentInset; }
     void setTopContentInset(float);
-    
+
+    const LayerRepresentation& scrolledContentsLayer() const { return m_scrolledContentsLayer; }
+    void setScrolledContentsLayer(const LayerRepresentation&);
+
     // This is a layer moved in the opposite direction to scrolling, for example for background-attachment:fixed
     const LayerRepresentation& counterScrollingLayer() const { return m_counterScrollingLayer; }
     void setCounterScrollingLayer(const LayerRepresentation&);
@@ -124,6 +128,7 @@
 
     LayerRepresentation m_counterScrollingLayer;
     LayerRepresentation m_insetClipLayer;
+    LayerRepresentation m_scrolledContentsLayer;
     LayerRepresentation m_contentShadowLayer;
     LayerRepresentation m_headerLayer;
     LayerRepresentation m_footerLayer;

Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm (169122 => 169123)


--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm	2014-05-20 18:44:52 UTC (rev 169122)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm	2014-05-20 19:13:14 UTC (rev 169123)
@@ -77,7 +77,10 @@
 
     if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer))
         m_scrollLayer = scrollingStateNode.layer();
-    
+
+    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer))
+        m_scrolledContentsLayer = scrollingStateNode.scrolledContentsLayer();
+
     if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
         m_counterScrollingLayer = scrollingStateNode.counterScrollingLayer();
 

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (169122 => 169123)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2014-05-20 18:44:52 UTC (rev 169122)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2014-05-20 19:13:14 UTC (rev 169123)
@@ -3673,7 +3673,7 @@
             scrolledContentsLayer = m_rootContentLayer.get();
             counterScrollingLayer = fixedRootBackgroundLayer();
             insetClipLayer = clipLayer();
-            scrollingCoordinator->updateFrameScrollingNode(nodeID, scrollingLayer, counterScrollingLayer, insetClipLayer);
+            scrollingCoordinator->updateFrameScrollingNode(nodeID, scrollingLayer, scrolledContentsLayer, counterScrollingLayer, insetClipLayer);
         } else {
             ScrollingCoordinator::ScrollingGeometry scrollingGeometry;
             scrollingGeometry.scrollOrigin = layer.scrollOrigin();

Modified: trunk/Source/WebKit2/ChangeLog (169122 => 169123)


--- trunk/Source/WebKit2/ChangeLog	2014-05-20 18:44:52 UTC (rev 169122)
+++ trunk/Source/WebKit2/ChangeLog	2014-05-20 19:13:14 UTC (rev 169123)
@@ -1,3 +1,24 @@
+2014-05-19  Simon Fraser  <[email protected]>
+
+        REGRESSION (r169063) Fixed and sticky nodes misplaced on scrolling sometimes
+        https://bugs.webkit.org/show_bug.cgi?id=133106
+        <rdar://problem/16967648>
+
+        Reviewed by Sam Weinig.
+
+        Fix regression from r169063. That commit removed scrolledContentsLayers from 
+        frame scrolling nodes, but they do actually use them.
+        
+        So put them back; not in the base class, because they have a somewhat different
+        meaning for overflow scrolling and frame scrolling.
+
+        * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
+        (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
+        (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
+        (WebKit::RemoteScrollingTreeTextStream::dump):
+        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
+        (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
+
 2014-05-20  Alexey Proskuryakov  <[email protected]>
 
         [Mac] WebProcess doesn't follow localization of UI process when run as a service

Modified: trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp (169122 => 169123)


--- trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp	2014-05-20 18:44:52 UTC (rev 169122)
+++ trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp	2014-05-20 19:13:14 UTC (rev 169123)
@@ -145,6 +145,9 @@
     SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::FooterHeight, footerHeight)
     SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::TopContentInset, topContentInset)
 
+    if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer))
+        encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer());
+
     if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
         encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.counterScrollingLayer());
 
@@ -220,6 +223,13 @@
     SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::FooterHeight, int, setFooterHeight);
     SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::TopContentInset, float, setTopContentInset);
 
+    if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer)) {
+        GraphicsLayer::PlatformLayerID layerID;
+        if (!decoder.decode(layerID))
+            return false;
+        node.setScrolledContentsLayer(layerID);
+    }
+
     if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer)) {
         GraphicsLayer::PlatformLayerID layerID;
         if (!decoder.decode(layerID))
@@ -595,10 +605,12 @@
     if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::TopContentInset))
         dumpProperty(ts, "top-content-inset", node.topContentInset());
 
+    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer))
+        dumpProperty(ts, "scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer()));
+
     if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer))
         dumpProperty(ts, "clip-inset-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.insetClipLayer()));
 
-
     if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer))
         dumpProperty(ts, "content-shadow-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.contentShadowLayer()));
 

Modified: trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp (169122 => 169123)


--- trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp	2014-05-20 18:44:52 UTC (rev 169122)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp	2014-05-20 19:13:14 UTC (rev 169123)
@@ -103,6 +103,9 @@
         case FrameScrollingNode: {
             ScrollingStateFrameScrollingNode* scrollingStateNode = toScrollingStateFrameScrollingNode(currNode);
             
+            if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer))
+                scrollingStateNode->setScrolledContentsLayer(layerTreeHost.getLayer(scrollingStateNode->scrolledContentsLayer()));
+
             if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
                 scrollingStateNode->setCounterScrollingLayer(layerTreeHost.getLayer(scrollingStateNode->counterScrollingLayer()));
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to