Changeset 169123 in webkit


Ignore:
Timestamp:
May 20, 2014 12:13:14 PM (10 years ago)
Author:
Simon Fraser
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):

Location:
trunk/Source
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r169120 r169123  
     12014-05-19  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r169063) Fixed and sticky nodes misplaced on scrolling sometimes
     4        https://bugs.webkit.org/show_bug.cgi?id=133106
     5        <rdar://problem/16967648>
     6
     7        Reviewed by Sam Weinig.
     8
     9        Fix regression from r169063. That commit removed scrolledContentsLayers from
     10        frame scrolling nodes, but they do actually use them.
     11       
     12        So put them back; not in the base class, because they have a somewhat different
     13        meaning for overflow scrolling and frame scrolling.
     14
     15        * WebCore.exp.in:
     16        * page/scrolling/AsyncScrollingCoordinator.cpp:
     17        (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
     18        (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
     19        * page/scrolling/AsyncScrollingCoordinator.h:
     20        * page/scrolling/ScrollingCoordinator.h:
     21        (WebCore::ScrollingCoordinator::updateFrameScrollingNode):
     22        * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
     23        (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
     24        (WebCore::ScrollingStateFrameScrollingNode::setScrolledContentsLayer):
     25        * page/scrolling/ScrollingStateFrameScrollingNode.h:
     26        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
     27        (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
     28        * rendering/RenderLayerCompositor.cpp:
     29        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
     30
    1312014-05-20  Radu Stavila  <stavila@adobe.com>
    232
  • trunk/Source/WebCore/WebCore.exp.in

    r169063 r169123  
    827827__ZN7WebCore20ApplicationCacheHost17maybeLoadResourceEPNS_14ResourceLoaderERKNS_15ResourceRequestERKNS_3URLE
    828828__ZN7WebCore20ApplicationCacheHost25maybeLoadFallbackForErrorEPNS_14ResourceLoaderERKNS_13ResourceErrorE
     829__ZN7WebCore20ApplicationCacheHost28maybeLoadFallbackForRedirectEPNS_14ResourceLoaderERNS_15ResourceRequestERKNS_16ResourceResponseE
    829830__ZN7WebCore20ApplicationCacheHost28maybeLoadFallbackForResponseEPNS_14ResourceLoaderERKNS_16ResourceResponseE
    830 __ZN7WebCore20ApplicationCacheHost28maybeLoadFallbackForRedirectEPNS_14ResourceLoaderERNS_15ResourceRequestERKNS_16ResourceResponseE
    831831__ZN7WebCore20CachedResourceLoader31garbageCollectDocumentResourcesEv
    832832__ZN7WebCore20DictationAlternativeC1Ejjy
     
    28162816__ZN7WebCore25AsyncScrollingCoordinator19detachFromStateTreeEy
    28172817__ZN7WebCore25AsyncScrollingCoordinator22frameViewLayoutUpdatedEPNS_9FrameViewE
    2818 __ZN7WebCore25AsyncScrollingCoordinator24updateFrameScrollingNodeEyPNS_13GraphicsLayerES2_S2_PKNS_20ScrollingCoordinator17ScrollingGeometryE
     2818__ZN7WebCore25AsyncScrollingCoordinator24updateFrameScrollingNodeEyPNS_13GraphicsLayerES2_S2_S2_PKNS_20ScrollingCoordinator17ScrollingGeometryE
    28192819__ZN7WebCore25AsyncScrollingCoordinator27frameViewRootLayerDidChangeEPNS_9FrameViewE
    28202820__ZN7WebCore25AsyncScrollingCoordinator27requestScrollPositionUpdateEPNS_9FrameViewERKNS_8IntPointE
     
    28472847__ZN7WebCore32ScrollingStateFrameScrollingNode21setContentShadowLayerERKNS_19LayerRepresentationE
    28482848__ZN7WebCore32ScrollingStateFrameScrollingNode24setCounterScrollingLayerERKNS_19LayerRepresentationE
     2849__ZN7WebCore32ScrollingStateFrameScrollingNode24setScrolledContentsLayerERKNS_19LayerRepresentationE
    28492850__ZN7WebCore32ScrollingStateFrameScrollingNode25setWheelEventHandlerCountEj
    28502851__ZN7WebCore32ScrollingStateFrameScrollingNode26setNonFastScrollableRegionERKNS_6RegionE
  • trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

    r169063 r169123  
    135135    ScrollingStateFrameScrollingNode* node = toScrollingStateFrameScrollingNode(m_scrollingStateTree->stateNodeForID(frameView->scrollLayerID()));
    136136    node->setLayer(scrollLayerForFrameView(frameView));
     137    node->setScrolledContentsLayer(rootContentLayerForFrameView(frameView));
    137138    node->setCounterScrollingLayer(counterScrollingLayerForFrameView(frameView));
    138139    node->setInsetClipLayer(insetClipLayerForFrameView(frameView));
     
    329330}
    330331
    331 void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* scrollingGeometry)
     332void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* scrollingGeometry)
    332333{
    333334    ScrollingStateFrameScrollingNode* node = toScrollingStateFrameScrollingNode(m_scrollingStateTree->stateNodeForID(nodeID));
     
    338339    node->setLayer(layer);
    339340    node->setInsetClipLayer(insetClipLayer);
     341    node->setScrolledContentsLayer(scrolledContentsLayer);
    340342    node->setCounterScrollingLayer(counterScrollingLayer);
    341343
  • trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h

    r169063 r169123  
    8989    virtual void updateViewportConstrainedNode(ScrollingNodeID, const ViewportConstraints&, GraphicsLayer*) override;
    9090   
    91     virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* = nullptr);
     91    virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* = nullptr);
    9292    virtual void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry* = nullptr);
    9393   
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h

    r169063 r169123  
    166166    };
    167167
    168     virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*counterScrollingLayer*/, GraphicsLayer* /*insetClipLayer*/, const ScrollingGeometry* = nullptr) { }
     168    virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, GraphicsLayer* /*counterScrollingLayer*/, GraphicsLayer* /*insetClipLayer*/, const ScrollingGeometry* = nullptr) { }
    169169    virtual void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, const ScrollingGeometry* = nullptr) { }
    170170    virtual void syncChildPositions(const LayoutRect&) { }
  • trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp

    r169063 r169123  
    7474    , m_topContentInset(stateNode.topContentInset())
    7575{
     76    if (hasChangedProperty(ScrolledContentsLayer))
     77        setScrolledContentsLayer(stateNode.scrolledContentsLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
     78
    7679    if (hasChangedProperty(CounterScrollingLayer))
    7780        setCounterScrollingLayer(stateNode.counterScrollingLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
     
    170173    m_topContentInset = topContentInset;
    171174    setPropertyChanged(TopContentInset);
     175}
     176
     177void ScrollingStateFrameScrollingNode::setScrolledContentsLayer(const LayerRepresentation& layerRepresentation)
     178{
     179    if (layerRepresentation == m_scrolledContentsLayer)
     180        return;
     181   
     182    m_scrolledContentsLayer = layerRepresentation;
     183    setPropertyChanged(ScrolledContentsLayer);
    172184}
    173185
  • trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h

    r169063 r169123  
    5353        WheelEventHandlerCount,
    5454        ReasonsForSynchronousScrolling,
     55        ScrolledContentsLayer,
    5556        CounterScrollingLayer,
    5657        InsetClipLayer,
     
    8889    float topContentInset() const { return m_topContentInset; }
    8990    void setTopContentInset(float);
    90    
     91
     92    const LayerRepresentation& scrolledContentsLayer() const { return m_scrolledContentsLayer; }
     93    void setScrolledContentsLayer(const LayerRepresentation&);
     94
    9195    // This is a layer moved in the opposite direction to scrolling, for example for background-attachment:fixed
    9296    const LayerRepresentation& counterScrollingLayer() const { return m_counterScrollingLayer; }
     
    125129    LayerRepresentation m_counterScrollingLayer;
    126130    LayerRepresentation m_insetClipLayer;
     131    LayerRepresentation m_scrolledContentsLayer;
    127132    LayerRepresentation m_contentShadowLayer;
    128133    LayerRepresentation m_headerLayer;
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm

    r169063 r169123  
    7878    if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer))
    7979        m_scrollLayer = scrollingStateNode.layer();
    80    
     80
     81    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer))
     82        m_scrolledContentsLayer = scrollingStateNode.scrolledContentsLayer();
     83
    8184    if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
    8285        m_counterScrollingLayer = scrollingStateNode.counterScrollingLayer();
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r169096 r169123  
    36743674            counterScrollingLayer = fixedRootBackgroundLayer();
    36753675            insetClipLayer = clipLayer();
    3676             scrollingCoordinator->updateFrameScrollingNode(nodeID, scrollingLayer, counterScrollingLayer, insetClipLayer);
     3676            scrollingCoordinator->updateFrameScrollingNode(nodeID, scrollingLayer, scrolledContentsLayer, counterScrollingLayer, insetClipLayer);
    36773677        } else {
    36783678            ScrollingCoordinator::ScrollingGeometry scrollingGeometry;
  • trunk/Source/WebKit2/ChangeLog

    r169122 r169123  
     12014-05-19  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r169063) Fixed and sticky nodes misplaced on scrolling sometimes
     4        https://bugs.webkit.org/show_bug.cgi?id=133106
     5        <rdar://problem/16967648>
     6
     7        Reviewed by Sam Weinig.
     8
     9        Fix regression from r169063. That commit removed scrolledContentsLayers from
     10        frame scrolling nodes, but they do actually use them.
     11       
     12        So put them back; not in the base class, because they have a somewhat different
     13        meaning for overflow scrolling and frame scrolling.
     14
     15        * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
     16        (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
     17        (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
     18        (WebKit::RemoteScrollingTreeTextStream::dump):
     19        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
     20        (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
     21
    1222014-05-20  Alexey Proskuryakov  <ap@apple.com>
    223
  • trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp

    r169063 r169123  
    146146    SCROLLING_NODE_ENCODE(ScrollingStateFrameScrollingNode::TopContentInset, topContentInset)
    147147
     148    if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer))
     149        encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer());
     150
    148151    if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
    149152        encoder << static_cast<GraphicsLayer::PlatformLayerID>(node.counterScrollingLayer());
     
    220223    SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::FooterHeight, int, setFooterHeight);
    221224    SCROLLING_NODE_DECODE(ScrollingStateFrameScrollingNode::TopContentInset, float, setTopContentInset);
     225
     226    if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer)) {
     227        GraphicsLayer::PlatformLayerID layerID;
     228        if (!decoder.decode(layerID))
     229            return false;
     230        node.setScrolledContentsLayer(layerID);
     231    }
    222232
    223233    if (node.hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer)) {
     
    596606        dumpProperty(ts, "top-content-inset", node.topContentInset());
    597607
     608    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer))
     609        dumpProperty(ts, "scrolled-contents-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.scrolledContentsLayer()));
     610
    598611    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::InsetClipLayer))
    599612        dumpProperty(ts, "clip-inset-layer", static_cast<GraphicsLayer::PlatformLayerID>(node.insetClipLayer()));
    600 
    601613
    602614    if (!changedPropertiesOnly || node.hasChangedProperty(ScrollingStateFrameScrollingNode::ContentShadowLayer))
  • trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp

    r169063 r169123  
    104104            ScrollingStateFrameScrollingNode* scrollingStateNode = toScrollingStateFrameScrollingNode(currNode);
    105105           
     106            if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::ScrolledContentsLayer))
     107                scrollingStateNode->setScrolledContentsLayer(layerTreeHost.getLayer(scrollingStateNode->scrolledContentsLayer()));
     108
    106109            if (scrollingStateNode->hasChangedProperty(ScrollingStateFrameScrollingNode::CounterScrollingLayer))
    107110                scrollingStateNode->setCounterScrollingLayer(layerTreeHost.getLayer(scrollingStateNode->counterScrollingLayer()));
Note: See TracChangeset for help on using the changeset viewer.