⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 179884 in webkit


Ignore:
Timestamp:
Feb 10, 2015, 2:40:00 PM (12 years ago)
Author:
Lucas Forschler
Message:

Merged r176899. rdar://problem/19739097

Location:
branches/safari-600.5-branch
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/safari-600.5-branch/ChangeLog

    r179528 r179884  
     12015-02-10  Lucas Forschler  <lforschler@apple.com>
     2
     3        Merge r176899
     4
     5    2014-12-05  Simon Fraser  <simon.fraser@apple.com>
     6
     7            Programmatic scrolling and content changes are not always synchronized
     8            https://bugs.webkit.org/show_bug.cgi?id=139245
     9            rdar://problem/18833612
     10
     11            Reviewed by Anders Carlsson.
     12
     13            Manual test that tries to sync layout with programmatic scrolling.
     14
     15            * ManualTests/programmatic-scroll-flicker.html: Added.
     16
    1172015-01-21  Babak Shafiei  <bshafiei@apple.com>
    218
  • branches/safari-600.5-branch/Source/WebCore/ChangeLog

    r179761 r179884  
     12015-02-10  Lucas Forschler  <lforschler@apple.com>
     2
     3        Merge r176899
     4
     5    2014-12-05  Simon Fraser  <simon.fraser@apple.com>
     6
     7            Programmatic scrolling and content changes are not always synchronized
     8            https://bugs.webkit.org/show_bug.cgi?id=139245
     9            rdar://problem/18833612
     10
     11            Reviewed by Anders Carlsson.
     12
     13            For programmatic scrolls, AsyncScrollingCoordinator::requestScrollPositionUpdate()
     14            calls updateScrollPositionAfterAsyncScroll(), then dispatches the requested
     15            scroll position to the scrolling thread.
     16
     17            Once the scrolling thread commits, it calls back to the main thread via
     18            scheduleUpdateScrollPositionAfterAsyncScroll(), which schedules a second
     19            call to updateScrollPositionAfterAsyncScroll() on a timer. That's a problem,
     20            because some other scroll may have happened in the meantime; when the timer
     21            fires, it can sometimes restore a stale scroll position.
     22
     23            Fix by bailing early from scheduleUpdateScrollPositionAfterAsyncScroll()
     24            for programmatic scrolls, since we know that requestScrollPositionUpdate()
     25            already did the updateScrollPositionAfterAsyncScroll().
     26
     27            Test:
     28                ManualTests/programmatic-scroll-flicker.html
     29
     30            * page/FrameView.cpp:
     31            (WebCore::FrameView::reset): nullptr.
     32            (WebCore::FrameView::setScrollPosition): Ditto.
     33            (WebCore::FrameView::setWasScrolledByUser): Ditto.
     34            * page/scrolling/AsyncScrollingCoordinator.cpp:
     35            (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate): Use a local variable for
     36            isProgrammaticScroll just to make sure we use the same value for the duration of this function.
     37            (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll): Do nothing
     38            if this is a programmatic scroll.
     39
    1402015-02-06  Babak Shafiei  <bshafiei@apple.com>
    241
  • branches/safari-600.5-branch/Source/WebCore/page/FrameView.cpp

    r179531 r179884  
    271271    m_isVisuallyNonEmpty = false;
    272272    m_firstVisuallyNonEmptyLayoutCallbackPending = true;
    273     m_maintainScrollPositionAnchor = 0;
     273    m_maintainScrollPositionAnchor = nullptr;
    274274}
    275275
     
    20052005{
    20062006    TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, true);
    2007     m_maintainScrollPositionAnchor = 0;
     2007    m_maintainScrollPositionAnchor = nullptr;
    20082008    ScrollView::setScrollPosition(scrollPoint);
    20092009}
     
    36003600    if (m_inProgrammaticScroll)
    36013601        return;
    3602     m_maintainScrollPositionAnchor = 0;
     3602    m_maintainScrollPositionAnchor = nullptr;
    36033603    if (m_wasScrolledByUser == wasScrolledByUser)
    36043604        return;
  • branches/safari-600.5-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

    r178505 r179884  
    154154        return false;
    155155
    156     if (frameView->inProgrammaticScroll() || frameView->frame().document()->inPageCache())
    157         updateScrollPositionAfterAsyncScroll(frameView->scrollLayerID(), scrollPosition, frameView->inProgrammaticScroll(), SetScrollingLayerPosition);
     156    bool isProgrammaticScroll = frameView->inProgrammaticScroll();
     157    if (isProgrammaticScroll || frameView->frame().document()->inPageCache())
     158        updateScrollPositionAfterAsyncScroll(frameView->scrollLayerID(), scrollPosition, isProgrammaticScroll, SetScrollingLayerPosition);
    158159
    159160    // If this frame view's document is being put into the page cache, we don't want to update our
     
    166167        return false;
    167168
    168     stateNode->setRequestedScrollPosition(scrollPosition, frameView->inProgrammaticScroll());
     169    stateNode->setRequestedScrollPosition(scrollPosition, isProgrammaticScroll);
    169170    return true;
    170171}
     
    174175    ScheduledScrollUpdate scrollUpdate(nodeID, scrollPosition, programmaticScroll, scrollingLayerPositionAction);
    175176   
     177    // For programmatic scrolls, requestScrollPositionUpdate() has already called updateScrollPositionAfterAsyncScroll().
     178    if (programmaticScroll)
     179        return;
     180
    176181    if (m_updateNodeScrollPositionTimer.isActive()) {
    177182        if (m_scheduledScrollUpdate.matchesUpdateType(scrollUpdate)) {
Note: See TracChangeset for help on using the changeset viewer.