Changeset 247013 in webkit


Ignore:
Timestamp:
Jul 1, 2019 11:14:10 AM (5 years ago)
Author:
Wenson Hsieh
Message:

iOS: REGRESSION(async scroll): Caret doesn't scroll when scrolling textarea
https://bugs.webkit.org/show_bug.cgi?id=198217
<rdar://problem/51097296>

Reviewed by Simon Fraser.

Source/WebCore:

Add a ScrollingLayerPositionAction argument to ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling, and
avoid bailing early in the case where ScrollingLayerPositionAction::Set is used. See the WebKit ChangeLog for
more detail.

Test: editing/selection/ios/update-selection-after-overflow-scroll.html

  • page/scrolling/ScrollingTreeScrollingNode.cpp:

(WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):

  • page/scrolling/ScrollingTreeScrollingNode.h:

Source/WebKit:

In iOS 12, when scrolling a text selection in an fast-scrolling container, editor state updates are scheduled
under AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll after the end of the scrolling gesture,
when the scrolling layer action is ScrollingLayerPositionAction::Set. This is no longer the case in iOS 13,
because we now bail in ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling after scroll deceleration
finishes since the scroll position didn't end up changing. Additionally, we no longer use
ScrollingLayerPositionAction::Set in the case where scrolling finished decelerating, since
ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll no longer uses to value of inUserInteraction to
determine whether to Set or Sync scrolling layer positions.

To restore iOS 12 behavior, ensure that we send a scrolling tree update using ScrollingLayerPositionAction::Set
after scrolling ends.

  • UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:

(WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):

LayoutTests:

Add a new layout test to check that the text selection views are updated after scrolling in a fast overflow
scrolling container.

  • editing/selection/ios/update-selection-after-overflow-scroll-expected.txt: Added.
  • editing/selection/ios/update-selection-after-overflow-scroll.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r246961 r247013  
     12019-07-01  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        iOS: REGRESSION(async scroll): Caret doesn't scroll when scrolling textarea
     4        https://bugs.webkit.org/show_bug.cgi?id=198217
     5        <rdar://problem/51097296>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Add a new layout test to check that the text selection views are updated after scrolling in a fast overflow
     10        scrolling container.
     11
     12        * editing/selection/ios/update-selection-after-overflow-scroll-expected.txt: Added.
     13        * editing/selection/ios/update-selection-after-overflow-scroll.html: Added.
     14
    1152019-06-30  Fujii Hironori  <Hironori.Fujii@sony.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r247012 r247013  
     12019-07-01  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        iOS: REGRESSION(async scroll): Caret doesn't scroll when scrolling textarea
     4        https://bugs.webkit.org/show_bug.cgi?id=198217
     5        <rdar://problem/51097296>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Add a ScrollingLayerPositionAction argument to ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling, and
     10        avoid bailing early in the case where ScrollingLayerPositionAction::Set is used. See the WebKit ChangeLog for
     11        more detail.
     12
     13        Test: editing/selection/ios/update-selection-after-overflow-scroll.html
     14
     15        * page/scrolling/ScrollingTreeScrollingNode.cpp:
     16        (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
     17        * page/scrolling/ScrollingTreeScrollingNode.h:
     18
    1192019-07-01  Antti Koivisto  <antti@apple.com>
    220
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp

    r246156 r247013  
    195195}
    196196
    197 void ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(const FloatPoint& position, Optional<FloatRect> overrideLayoutViewport)
     197void ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(const FloatPoint& position, Optional<FloatRect> overrideLayoutViewport, ScrollingLayerPositionAction scrollingLayerPositionAction)
    198198{
    199199    bool scrollPositionChanged = !scrollPositionAndLayoutViewportMatch(position, overrideLayoutViewport);
    200     if (!scrollPositionChanged)
     200    if (!scrollPositionChanged && scrollingLayerPositionAction != ScrollingLayerPositionAction::Set)
    201201        return;
    202202
     
    207207
    208208    scrollingTree().notifyRelatedNodesAfterScrollPositionChange(*this);
    209     scrollingTree().scrollingTreeNodeDidScroll(*this);
     209    scrollingTree().scrollingTreeNodeDidScroll(*this, scrollingLayerPositionAction);
    210210    scrollingTree().didScrollByDelegatedScrolling();
    211211}
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h

    r246723 r247013  
    6464    void scrollBy(const FloatSize&, ScrollPositionClamp = ScrollPositionClamp::ToContentEdges);
    6565
    66     void wasScrolledByDelegatedScrolling(const FloatPoint& position, Optional<FloatRect> overrideLayoutViewport = { });
     66    void wasScrolledByDelegatedScrolling(const FloatPoint& position, Optional<FloatRect> overrideLayoutViewport = { }, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync);
    6767   
    6868    const FloatSize& scrollableAreaSize() const { return m_scrollableAreaSize; }
  • trunk/Source/WebKit/ChangeLog

    r247009 r247013  
     12019-07-01  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        iOS: REGRESSION(async scroll): Caret doesn't scroll when scrolling textarea
     4        https://bugs.webkit.org/show_bug.cgi?id=198217
     5        <rdar://problem/51097296>
     6
     7        Reviewed by Simon Fraser.
     8
     9        In iOS 12, when scrolling a text selection in an fast-scrolling container, editor state updates are scheduled
     10        under AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll after the end of the scrolling gesture,
     11        when the scrolling layer action is ScrollingLayerPositionAction::Set. This is no longer the case in iOS 13,
     12        because we now bail in ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling after scroll deceleration
     13        finishes since the scroll position didn't end up changing. Additionally, we no longer use
     14        ScrollingLayerPositionAction::Set in the case where scrolling finished decelerating, since
     15        ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll no longer uses to value of inUserInteraction to
     16        determine whether to Set or Sync scrolling layer positions.
     17
     18        To restore iOS 12 behavior, ensure that we send a scrolling tree update using ScrollingLayerPositionAction::Set
     19        after scrolling ends.
     20
     21        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
     22        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):
     23
    1242019-07-01  Per Arne Vollan  <pvollan@apple.com>
    225
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm

    r246926 r247013  
    328328
    329329    auto scrollPosition = ScrollableArea::scrollPositionFromOffset(scrollOffset, toFloatSize(scrollOrigin()));
    330     scrollingNode().wasScrolledByDelegatedScrolling(scrollPosition);
     330    scrollingNode().wasScrolledByDelegatedScrolling(scrollPosition, { }, inUserInteraction ? ScrollingLayerPositionAction::Sync : ScrollingLayerPositionAction::Set);
    331331}
    332332
Note: See TracChangeset for help on using the changeset viewer.