Changeset 269558 in webkit


Ignore:
Timestamp:
Nov 6, 2020 9:34:18 PM (21 months ago)
Author:
Simon Fraser
Message:

Programmatic scrolls need updated scrolling geometry
https://bugs.webkit.org/show_bug.cgi?id=218676

Reviewed by Tim Horton.

Source/WebCore:

Part of rdar://problem/69599531: Scrolling on netflix.com sometimes jumps to the top.

A programmatic scroll can happen right after content changes affect the scrolled content size,
and need to be committed right away to avoid the scrolling thread continuing to process events
or run rubberbanding based on stale state.

So when we get requestScrollPositionUpdate(), update the scrolling node geometry and
immediately commit the scrolling tree.

Test: fast/scrolling/mac/programmatic-scroll-overrides-rubberband.html

  • page/scrolling/AsyncScrollingCoordinator.cpp:

(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):

LayoutTests:

  • fast/scrolling/mac/programmatic-scroll-overrides-rubberband-expected.txt: Added.
  • fast/scrolling/mac/programmatic-scroll-overrides-rubberband.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r269553 r269558  
     12020-11-06  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Programmatic scrolls need updated scrolling geometry
     4        https://bugs.webkit.org/show_bug.cgi?id=218676
     5
     6        Reviewed by Tim Horton.
     7
     8        * fast/scrolling/mac/programmatic-scroll-overrides-rubberband-expected.txt: Added.
     9        * fast/scrolling/mac/programmatic-scroll-overrides-rubberband.html: Added.
     10
    1112020-11-06  Andres Gonzalez  <andresg_22@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r269557 r269558  
     12020-11-06  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Programmatic scrolls need updated scrolling geometry
     4        https://bugs.webkit.org/show_bug.cgi?id=218676
     5
     6        Reviewed by Tim Horton.
     7
     8        Part of rdar://problem/69599531: Scrolling on netflix.com sometimes jumps to the top.
     9
     10        A programmatic scroll can happen right after content changes affect the scrolled content size,
     11        and need to be committed right away to avoid the scrolling thread continuing to process events
     12        or run rubberbanding based on stale state.
     13
     14        So when we get requestScrollPositionUpdate(), update the scrolling node geometry and
     15        immediately commit the scrolling tree.
     16
     17        Test: fast/scrolling/mac/programmatic-scroll-overrides-rubberband.html
     18
     19        * page/scrolling/AsyncScrollingCoordinator.cpp:
     20        (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
     21
    1222020-11-06  Peng Liu  <peng.liu6@apple.com>
    223
  • trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

    r269312 r269558  
    266266        return false;
    267267
     268    setScrollingNodeScrollableAreaGeometry(scrollingNodeID, scrollableArea);
     269
    268270    bool inBackForwardCache = frameView->frame().document()->backForwardCacheState() != Document::NotInBackForwardCache;
    269271    bool inProgrammaticScroll = scrollableArea.currentScrollType() == ScrollType::Programmatic;
     
    288290    }
    289291#endif
     292
    290293    stateNode->setRequestedScrollData({ scrollPosition, scrollType, clamping });
     294    commitTreeStateIfNeeded();
    291295    return true;
    292296}
Note: See TracChangeset for help on using the changeset viewer.