Changeset 162748 in webkit


Ignore:
Timestamp:
Jan 24, 2014 6:32:26 PM (10 years ago)
Author:
Simon Fraser
Message:

Start using the RemoteScrollingCoordinatorProxy on iOS
https://bugs.webkit.org/show_bug.cgi?id=127598

Reviewed by Tim Horton.

Source/WebCore:

Add a scrollPositionChangedViaDelegatedScrolling() function to
ScrollingTree, allowing the ScrollingTree to be informed about
external sources of scrolling.

Also add a convenience getter for nodes, nodeForID().

  • WebCore.exp.in:
  • page/scrolling/ScrollingTree.cpp:

(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
(WebCore::ScrollingTree::nodeForID):

  • page/scrolling/ScrollingTree.h:
  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
To avoid assertions on iOS, bail from iOS WK1 fixed position code if
we have a ScrollingCoordinator.
(WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers):
Ditto.

Source/WebKit2:

Add a scrollPositionChangedViaDelegatedScrolling() function to
ScrollingTree, allowing the ScrollingTree to be informed about
external sources of scrolling.

Call it from -[WKContentView didScrollTo:] for the root node.

  • UIProcess/API/ios/WKContentView.mm:

(-[WKContentView didScrollTo:]):

  • UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:

(WebKit::RemoteScrollingCoordinatorProxy::rootScrollingNodeID):
(WebKit::RemoteScrollingCoordinatorProxy::scrollPositionChangedViaDelegatedScrolling):

  • UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r162747 r162748  
     12014-01-24  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Start using the RemoteScrollingCoordinatorProxy on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=127598
     5
     6        Reviewed by Tim Horton.
     7
     8        Add a scrollPositionChangedViaDelegatedScrolling() function to
     9        ScrollingTree, allowing the ScrollingTree to be informed about
     10        external sources of scrolling.
     11       
     12        Also add a convenience getter for nodes, nodeForID().
     13
     14        * WebCore.exp.in:
     15        * page/scrolling/ScrollingTree.cpp:
     16        (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
     17        (WebCore::ScrollingTree::nodeForID):
     18        * page/scrolling/ScrollingTree.h:
     19        * rendering/RenderLayerCompositor.cpp:
     20        (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
     21        To avoid assertions on iOS, bail from iOS WK1 fixed position code if
     22        we have a ScrollingCoordinator.
     23        (WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers):
     24        Ditto.
     25
    1262014-01-24  Simon Fraser  <simon.fraser@apple.com>
    227
  • trunk/Source/WebCore/WebCore.exp.in

    r162745 r162748  
    29752975__ZN7WebCore13ScrollingTree35shouldHandleWheelEventSynchronouslyERKNS_18PlatformWheelEventE
    29762976__ZN7WebCore13ScrollingTree37setScrollingPerformanceLoggingEnabledEb
     2977__ZN7WebCore13ScrollingTree42scrollPositionChangedViaDelegatedScrollingEyRKNS_8IntPointE
    29772978__ZN7WebCore13ScrollingTreeC2Ev
    29782979__ZN7WebCore13ScrollingTreeD1Ev
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp

    r161276 r162748  
    8181}
    8282
     83void ScrollingTree::scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const IntPoint& scrollPosition)
     84{
     85    ScrollingTreeNode* node = nodeForID(nodeID);
     86    if (!node)
     87        return;
     88
     89    if (node->nodeType() != ScrollingNode)
     90        return;
     91
     92    toScrollingTreeScrollingNode(node)->setScrollPosition(scrollPosition);
     93}
     94
    8395void ScrollingTree::commitNewTreeState(PassOwnPtr<ScrollingStateTree> scrollingStateTree)
    8496{
     
    174186}
    175187
     188ScrollingTreeNode* ScrollingTree::nodeForID(ScrollingNodeID nodeID) const
     189{
     190    if (!nodeID)
     191        return nullptr;
     192
     193    return m_nodeMap.get(nodeID);
     194}
     195
    176196void ScrollingTree::setMainFramePinState(bool pinnedToTheLeft, bool pinnedToTheRight, bool pinnedToTheTop, bool pinnedToTheBottom)
    177197{
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.h

    r162736 r162748  
    6363    virtual EventResult tryToHandleWheelEvent(const PlatformWheelEvent&) = 0;
    6464    bool shouldHandleWheelEventSynchronously(const PlatformWheelEvent&);
     65   
     66    virtual void scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID, const IntPoint&);
    6567
    6668    void setMainFrameIsRubberBanding(bool);
     
    108110    virtual PassOwnPtr<ScrollingTreeNode> createNode(ScrollingNodeType, ScrollingNodeID) = 0;
    109111
     112    ScrollingTreeNode* nodeForID(ScrollingNodeID) const;
     113
    110114    OwnPtr<ScrollingTreeScrollingNode> m_rootNode;
    111115
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r162523 r162748  
    35293529        return;
    35303530
     3531    if (scrollingCoordinator())
     3532        return;
     3533
    35313534    LayerMap layerMap;
    35323535    StickyContainerMap stickyContainerMap;
     
    35603563        return;
    35613564
     3565    if (scrollingCoordinator())
     3566        return;
     3567
    35623568    if (ChromeClient* client = this->chromeClient()) {
    35633569        LayerMap layerMap;
  • trunk/Source/WebKit2/ChangeLog

    r162746 r162748  
     12014-01-24  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Start using the RemoteScrollingCoordinatorProxy on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=127598
     5
     6        Reviewed by Tim Horton.
     7
     8        Add a scrollPositionChangedViaDelegatedScrolling() function to
     9        ScrollingTree, allowing the ScrollingTree to be informed about
     10        external sources of scrolling.
     11       
     12        Call it from -[WKContentView didScrollTo:] for the root node.
     13
     14        * UIProcess/API/ios/WKContentView.mm:
     15        (-[WKContentView didScrollTo:]):
     16        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
     17        (WebKit::RemoteScrollingCoordinatorProxy::rootScrollingNodeID):
     18        (WebKit::RemoteScrollingCoordinatorProxy::scrollPositionChangedViaDelegatedScrolling):
     19        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
     20
    1212014-01-24  Anders Carlsson  <andersca@apple.com>
    222
  • trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.mm

    r162730 r162748  
    3030#import "PageClientImplIOS.h"
    3131#import "RemoteLayerTreeDrawingAreaProxy.h"
     32#import "RemoteScrollingCoordinatorProxy.h"
    3233#import "WebKit2Initialize.h"
    3334#import "WKBrowsingContextControllerInternal.h"
     
    194195    _currentExposedRectPosition = contentOffset;
    195196    [self _updateViewExposedRect];
     197
     198    _page->scrollingCoordinatorProxy()->scrollPositionChangedViaDelegatedScrolling(_page->scrollingCoordinatorProxy()->rootScrollingNodeID(), roundedIntPoint(contentOffset));
    196199}
    197200
  • trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp

    r161529 r162748  
    4040#include "WebProcessProxy.h"
    4141#include <WebCore/ScrollingStateTree.h>
     42#include <WebCore/ScrollingTreeScrollingNode.h>
    4243
    4344using namespace WebCore;
     
    5354RemoteScrollingCoordinatorProxy::~RemoteScrollingCoordinatorProxy()
    5455{
     56}
     57
     58WebCore::ScrollingNodeID RemoteScrollingCoordinatorProxy::rootScrollingNodeID() const
     59{
     60    return m_scrollingTree->rootNode()->scrollingNodeID();
    5561}
    5662
     
    121127}
    122128
     129void RemoteScrollingCoordinatorProxy::scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const IntPoint& offset)
     130{
     131    m_scrollingTree->scrollPositionChangedViaDelegatedScrolling(nodeID, offset);
     132}
     133
    123134void RemoteScrollingCoordinatorProxy::scrollPositionChanged(WebCore::ScrollingNodeID scrolledNodeID, const WebCore::FloatPoint& newScrollPosition)
    124135{
  • trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h

    r161529 r162748  
    5252    virtual ~RemoteScrollingCoordinatorProxy();
    5353   
    54     // Inform the web process that the scroll position changed.
     54    // Inform the web process that the scroll position changed (called from the scrolling tree)
    5555    void scrollPositionChanged(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition);
     56
     57    // Called externally when native views move around.
     58    void scrollPositionChangedViaDelegatedScrolling(WebCore::ScrollingNodeID, const WebCore::IntPoint&);
    5659
    5760    // FIXME: expose the tree and pass this to that?
Note: See TracChangeset for help on using the changeset viewer.