Changeset 106750 in webkit


Ignore:
Timestamp:
Feb 4, 2012 4:43:39 PM (12 years ago)
Author:
andersca@apple.com
Message:

The scrolling tree should inform the main scrolling coordinator when the scroll position changes
https://bugs.webkit.org/show_bug.cgi?id=77818

Reviewed by Sam Weinig.

  • page/scrolling/ScrollingCoordinator.cpp:

(WebCore::ScrollingCoordinator::updateMainFrameScrollPosition):
Set the main frame scroll position.

  • page/scrolling/ScrollingTree.cpp:

(WebCore::ScrollingTree::updateMainFrameScrollPosition):
Call ScrollingCoordinator::updateMainFrameScrollPosition on the main thread.

  • page/scrolling/mac/ScrollingTreeNodeMac.mm:

(WebCore::ScrollingTreeNodeMac::scrollBy):
Call ScrollingTree::updateMainFrameScrollPosition.

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106746 r106750  
     12012-02-04  Anders Carlsson  <andersca@apple.com>
     2
     3        The scrolling tree should inform the main scrolling coordinator when the scroll position changes
     4        https://bugs.webkit.org/show_bug.cgi?id=77818
     5
     6        Reviewed by Sam Weinig.
     7
     8        * page/scrolling/ScrollingCoordinator.cpp:
     9        (WebCore::ScrollingCoordinator::updateMainFrameScrollPosition):
     10        Set the main frame scroll position.
     11
     12        * page/scrolling/ScrollingTree.cpp:
     13        (WebCore::ScrollingTree::updateMainFrameScrollPosition):
     14        Call ScrollingCoordinator::updateMainFrameScrollPosition on the main thread.
     15
     16        * page/scrolling/mac/ScrollingTreeNodeMac.mm:
     17        (WebCore::ScrollingTreeNodeMac::scrollBy):
     18        Call ScrollingTree::updateMainFrameScrollPosition.
     19
    1202012-02-04  Andreas Kling  <awesomekling@apple.com>
    221
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp

    r106723 r106750  
    105105}
    106106
     107void ScrollingCoordinator::updateMainFrameScrollPosition(const IntPoint& scrollPosition)
     108{
     109    ASSERT(isMainThread());
     110
     111    if (!m_page)
     112        return;
     113
     114    FrameView* frameView = m_page->mainFrame()->view();
     115    if (!frameView)
     116        return;
     117
     118    frameView->setConstrainsScrollingToContentEdge(false);
     119    frameView->scrollToOffsetWithoutAnimation(scrollPosition);
     120    frameView->setConstrainsScrollingToContentEdge(true);
     121}
     122
    107123void ScrollingCoordinator::syncFrameViewGeometry(FrameView* frameView)
    108124{
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h

    r106723 r106750  
    7777    void frameViewVerticalScrollbarLayerDidChange(FrameView*, GraphicsLayer* verticalScrollbarLayer);
    7878
     79    // Dispatched by the scrolling tree whenever the main frame scroll position changes.
     80    void updateMainFrameScrollPosition(const IntPoint&);
     81
    7982    // Should be called whenever the geometry of the given frame view changes,
    8083    // including the visible content rect and the content size.
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp

    r106720 r106750  
    3434#include "ScrollingTreeNode.h"
    3535#include "ScrollingTreeState.h"
     36#include <wtf/MainThread.h>
    3637
    3738namespace WebCore {
     
    8586}
    8687
     88void ScrollingTree::updateMainFrameScrollPosition(const IntPoint& scrollPosition)
     89{
     90    if (!m_scrollingCoordinator)
     91        return;
     92
     93    callOnMainThread(bind(&ScrollingCoordinator::updateMainFrameScrollPosition, m_scrollingCoordinator.get(), scrollPosition));
     94}
     95
    8796} // namespace WebCore
    8897
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.h

    r106720 r106750  
    3737namespace WebCore {
    3838
     39class IntPoint;
    3940class PlatformWheelEvent;
    4041class ScrollingCoordinator;
     
    6263    void commitNewTreeState(PassOwnPtr<ScrollingTreeState>);
    6364
     65    void updateMainFrameScrollPosition(const IntPoint& scrollPosition);
     66
    6467private:
    6568    explicit ScrollingTree(ScrollingCoordinator*);
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeNodeMac.mm

    r106720 r106750  
    3030
    3131#include "PlatformWheelEvent.h"
     32#include "ScrollingTree.h"
    3233#include "ScrollingTreeState.h"
    3334
     
    7374    setScrollPosition(scrollPosition() + offset);
    7475
    75     // FIXME: Tell the scrolling coordinator that our position changed.
     76    scrollingTree()->updateMainFrameScrollPosition(scrollPosition());
    7677}
    7778
Note: See TracChangeset for help on using the changeset viewer.