Changeset 166518 in webkit


Ignore:
Timestamp:
Mar 31, 2014 12:42:04 PM (10 years ago)
Author:
Simon Fraser
Message:

Fix scrolling on OS X with UI-side compositing
https://bugs.webkit.org/show_bug.cgi?id=130930

Reviewed by Tim Horton.

On iOS, we rely on visible rect updates to propagate scroll offset
changes to the WebProcess. RemoteScrollingCoordinatorProxy was thus hardcoded
to bail from scrollPositionChanged() when the scrolled node was the root node,
but this broke OS X. Fix by adding a behavior flag to RemoteScrollingCoordinatorProxy.

  • UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:

(WebKit::RemoteScrollingCoordinatorProxy::RemoteScrollingCoordinatorProxy):
(WebKit::RemoteScrollingCoordinatorProxy::scrollPositionChanged):

  • UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:

(WebKit::RemoteScrollingCoordinatorProxy::setPropagatesMainFrameScrolls):
(WebKit::RemoteScrollingCoordinatorProxy::propagatesMainFrameScrolls):

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::initializeWebPage):

Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r166516 r166518  
     12014-03-29  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix scrolling on OS X with UI-side compositing
     4        https://bugs.webkit.org/show_bug.cgi?id=130930
     5
     6        Reviewed by Tim Horton.
     7       
     8        On iOS, we rely on visible rect updates to propagate scroll offset
     9        changes to the WebProcess. RemoteScrollingCoordinatorProxy was thus hardcoded
     10        to bail from scrollPositionChanged() when the scrolled node was the root node,
     11        but this broke OS X. Fix by adding a behavior flag to RemoteScrollingCoordinatorProxy.
     12
     13        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
     14        (WebKit::RemoteScrollingCoordinatorProxy::RemoteScrollingCoordinatorProxy):
     15        (WebKit::RemoteScrollingCoordinatorProxy::scrollPositionChanged):
     16        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
     17        (WebKit::RemoteScrollingCoordinatorProxy::setPropagatesMainFrameScrolls):
     18        (WebKit::RemoteScrollingCoordinatorProxy::propagatesMainFrameScrolls):
     19        * UIProcess/WebPageProxy.cpp:
     20        (WebKit::WebPageProxy::initializeWebPage):
     21
    1222014-03-31  Tim Horton  <timothy_horton@apple.com>
    223
  • trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp

    r166293 r166518  
    4949    : m_webPageProxy(webPageProxy)
    5050    , m_scrollingTree(RemoteScrollingTree::create(*this))
     51    , m_propagatesMainFrameScrolls(true)
    5152{
    5253}
     
    154155    // Scroll updates for the main frame are sent via WebPageProxy::updateVisibleContentRects()
    155156    // so don't send them here.
    156     if (scrolledNodeID == rootScrollingNodeID())
     157    if (!m_propagatesMainFrameScrolls && scrolledNodeID == rootScrollingNodeID())
    157158        return;
    158159
  • trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h

    r165652 r166518  
    6969    void updateScrollingTree(const RemoteScrollingCoordinatorTransaction&, bool& fixedOrStickyLayerChanged);
    7070
     71    void setPropagatesMainFrameScrolls(bool propagatesMainFrameScrolls) { m_propagatesMainFrameScrolls = propagatesMainFrameScrolls; }
     72    bool propagatesMainFrameScrolls() const { return m_propagatesMainFrameScrolls; }
     73
    7174private:
    7275    void connectStateNodeLayers(WebCore::ScrollingStateTree&, const RemoteLayerTreeHost&, bool& fixedOrStickyLayerChanged);
     
    7477    WebPageProxy& m_webPageProxy;
    7578    RefPtr<RemoteScrollingTree> m_scrollingTree;
     79    bool m_propagatesMainFrameScrolls;
    7680};
    7781
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r166466 r166518  
    557557
    558558#if ENABLE(ASYNC_SCROLLING)
    559     if (m_drawingArea->type() == DrawingAreaTypeRemoteLayerTree)
     559    if (m_drawingArea->type() == DrawingAreaTypeRemoteLayerTree) {
    560560        m_scrollingCoordinatorProxy = std::make_unique<RemoteScrollingCoordinatorProxy>(*this);
     561#if PLATFORM(IOS)
     562        // On iOS, main frame scrolls are sent in terms of visible rect updates.
     563        m_scrollingCoordinatorProxy->setPropagatesMainFrameScrolls(false);
     564#endif
     565    }
    561566#endif
    562567
Note: See TracChangeset for help on using the changeset viewer.