Exemplo n.º 1
0
bool ScrollingCoordinator::requestScrollPositionUpdate(FrameView* frameView, const IntPoint& scrollPosition)
{
    ASSERT(isMainThread());
    ASSERT(m_page);

    if (!coordinatesScrollingForFrameView(frameView))
        return false;

#if ENABLE(THREADED_SCROLLING)
    // Update the main frame scroll position locally before asking the scrolling thread to scroll,
    // since FrameView expects scroll position updates to happen synchronously.
    updateMainFrameScrollPosition(scrollPosition);

    if (frameView->frame()->document()->inPageCache()) {
        // If this frame view's document is being put into the page cache, we don't want to update our
        // main frame scroll position.
        return true;
    }

    m_scrollingTreeState->setRequestedScrollPosition(scrollPosition);
    scheduleTreeStateCommit();
    return true;
#else
    UNUSED_PARAM(scrollPosition);
    return false;
#endif
}
Exemplo n.º 2
0
void ScrollingCoordinator::updateShouldUpdateScrollLayerPositionOnMainThread()
{
    FrameView* frameView = m_page->mainFrame()->view();

    // FIXME: Having fixed objects on the page should not trigger the slow path.
    bool shouldUpdateScrollLayerPositionOnMainThread = frameView->hasSlowRepaintObjects() || frameView->hasFixedObjects();

    m_scrollingTreeState->setShouldUpdateScrollLayerPositionOnMainThread(shouldUpdateScrollLayerPositionOnMainThread);
    scheduleTreeStateCommit();
}
Exemplo n.º 3
0
void ScrollingCoordinator::recomputeWheelEventHandlerCount()
{
    unsigned wheelEventHandlerCount = 0;
    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
        if (frame->document())
            wheelEventHandlerCount += frame->document()->wheelEventHandlerCount();
    }

    m_scrollingTreeState->setWheelEventHandlerCount(wheelEventHandlerCount);
    scheduleTreeStateCommit();
}
Exemplo n.º 4
0
void ScrollingCoordinator::frameViewLayoutUpdated(FrameView* frameView)
{
    ASSERT(isMainThread());
    ASSERT(m_page);

    // Compute the region of the page that we can't do fast scrolling for. This currently includes
    // all scrollable areas, such as subframes, overflow divs and list boxes. We need to do this even if the
    // frame view whose layout was updated is not the main frame.
    Region nonFastScrollableRegion = computeNonFastScrollableRegion(m_page->mainFrame()->view());
    m_scrollingTreeState->setNonFastScrollableRegion(nonFastScrollableRegion);
    scheduleTreeStateCommit();

    if (!coordinatesScrollingForFrameView(frameView))
        return;

    m_scrollingTreeState->setHorizontalScrollElasticity(frameView->horizontalScrollElasticity());
    m_scrollingTreeState->setVerticalScrollElasticity(frameView->verticalScrollElasticity());
    m_scrollingTreeState->setHasEnabledHorizontalScrollbar(frameView->horizontalScrollbar() && frameView->horizontalScrollbar()->enabled());
    m_scrollingTreeState->setHasEnabledVerticalScrollbar(frameView->verticalScrollbar() && frameView->verticalScrollbar()->enabled());

    m_scrollingTreeState->setViewportRect(IntRect(IntPoint(), frameView->visibleContentRect().size()));
    m_scrollingTreeState->setContentsSize(frameView->contentsSize());
    scheduleTreeStateCommit();
}
Exemplo n.º 5
0
void ScrollingCoordinator::setScrollParameters(ScrollElasticity horizontalScrollElasticity,
                                               ScrollElasticity verticalScrollElasticity,
                                               bool hasEnabledHorizontalScrollbar,
                                               bool hasEnabledVerticalScrollbar,
                                               const IntRect& viewportRect,
                                               const IntSize& contentsSize)
{
    m_scrollingTreeState->setHorizontalScrollElasticity(horizontalScrollElasticity);
    m_scrollingTreeState->setVerticalScrollElasticity(verticalScrollElasticity);
    m_scrollingTreeState->setHasEnabledHorizontalScrollbar(hasEnabledHorizontalScrollbar);
    m_scrollingTreeState->setHasEnabledVerticalScrollbar(hasEnabledVerticalScrollbar);

    m_scrollingTreeState->setViewportRect(viewportRect);
    m_scrollingTreeState->setContentsSize(contentsSize);
    scheduleTreeStateCommit();
}
void AsyncScrollingCoordinator::setNonFastScrollableRegionDirty()
{
    m_nonFastScrollableRegionDirty = true;
    // We have to schedule a commit, but the computed non-fast region may not have actually changed.
    scheduleTreeStateCommit();
}
void AsyncScrollingCoordinator::scrollingStateTreePropertiesChanged()
{
    scheduleTreeStateCommit();
}
Exemplo n.º 8
0
void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(bool shouldUpdateScrollLayerPositionOnMainThread)
{
    m_scrollingTreeState->setShouldUpdateScrollLayerPositionOnMainThread(shouldUpdateScrollLayerPositionOnMainThread);
    scheduleTreeStateCommit();
}
Exemplo n.º 9
0
void ScrollingCoordinator::setWheelEventHandlerCount(unsigned wheelEventHandlerCount)
{
    m_scrollingTreeState->setWheelEventHandlerCount(wheelEventHandlerCount);
    scheduleTreeStateCommit();
}
Exemplo n.º 10
0
void ScrollingCoordinator::setNonFastScrollableRegion(const Region& region)
{
    m_scrollingTreeState->setNonFastScrollableRegion(region);
    scheduleTreeStateCommit();
}
Exemplo n.º 11
0
void ScrollingCoordinator::setScrollLayer(GraphicsLayer* scrollLayer)
{
    m_scrollingTreeState->setScrollLayer(scrollLayer);
    scheduleTreeStateCommit();
}