RESOLVED FIXED 204936
Smooth-scroll animations should run in the UI process on iOS
https://bugs.webkit.org/show_bug.cgi?id=204936
Summary Smooth-scroll animations should run in the UI process on iOS
cathiechen
Reported 2019-12-05 23:00:23 PST
This is the second implement part of scroll behavior in bug 188043. This patch contains the implement of scroll behavior that relies on native scroll interfaces on iOS platform. On other platforms, the behavior isn't changed. I.g. The smooth scroll will be performed by an instant scroll instead.
Attachments
Patch (243.92 KB, patch)
2019-12-06 00:33 PST, cathiechen
no flags
Patch (248.44 KB, patch)
2019-12-09 06:02 PST, cathiechen
no flags
UI-scroll-animation-for-review (189.47 KB, patch)
2019-12-09 08:51 PST, cathiechen
no flags
native-animation-for-ews(including parsing + non_native_animation) (297.32 KB, patch)
2019-12-11 00:45 PST, cathiechen
no flags
native-animation-for-review (149.71 KB, patch)
2019-12-11 00:46 PST, cathiechen
no flags
native-animation-for-ews(including parsing + non_native_animation) (295.72 KB, patch)
2019-12-11 03:35 PST, cathiechen
no flags
native-animation-for-review (148.84 KB, patch)
2019-12-11 03:35 PST, cathiechen
no flags
native-animation-for-ews(including parsing + non_native_animation) (295.66 KB, patch)
2019-12-11 07:24 PST, cathiechen
no flags
native-animation-for-review (148.78 KB, patch)
2019-12-11 07:25 PST, cathiechen
no flags
native-animation-for-ews(including parsing + non_native_animation) (295.32 KB, patch)
2019-12-11 09:06 PST, cathiechen
no flags
native-animation-for-review (148.45 KB, patch)
2019-12-11 09:06 PST, cathiechen
no flags
native-animation-for-ews(including parsing + non_native_animation) (295.22 KB, patch)
2019-12-11 09:25 PST, cathiechen
no flags
native-animation-for-review (148.34 KB, patch)
2019-12-11 09:25 PST, cathiechen
no flags
native-animation-for-ews(including parsing + non_native_animation) (294.92 KB, patch)
2019-12-13 04:32 PST, cathiechen
no flags
native-animation-for-review (148.04 KB, patch)
2019-12-13 04:33 PST, cathiechen
no flags
native-animation-for-ews(including parsing + non_native_animation) (294.92 KB, patch)
2019-12-13 05:53 PST, cathiechen
no flags
native-animation-for-ews(including parsing + non_native_animation) (295.57 KB, patch)
2019-12-13 06:18 PST, cathiechen
no flags
native-animation-for-ews(including parsing + non_native_animation) (295.76 KB, patch)
2019-12-13 07:07 PST, cathiechen
no flags
native-animation-for-ews(including parsing + non_native_animation) (295.74 KB, patch)
2019-12-13 07:53 PST, cathiechen
no flags
native-animation-for-ews(including parsing + non_native_animation) (294.95 KB, patch)
2019-12-15 07:08 PST, cathiechen
no flags
native-animation-for-review (148.03 KB, patch)
2019-12-15 07:08 PST, cathiechen
no flags
native-animation-for-ews(including parsing + non_native_animation) (294.88 KB, patch)
2019-12-15 09:13 PST, cathiechen
no flags
native-animation-for-review (147.97 KB, patch)
2019-12-15 09:14 PST, cathiechen
no flags
Patch (152.05 KB, patch)
2020-01-19 22:22 PST, cathiechen
no flags
Patch (152.51 KB, patch)
2020-02-12 01:43 PST, cathiechen
no flags
Patch (152.17 KB, patch)
2020-02-17 21:40 PST, cathiechen
no flags
Patch (31.30 KB, patch)
2021-10-10 10:36 PDT, Simon Fraser (smfr)
ews-feeder: commit-queue-
Patch (38.18 KB, patch)
2021-10-10 10:49 PDT, Simon Fraser (smfr)
ews-feeder: commit-queue-
Patch (38.47 KB, patch)
2021-10-10 11:01 PDT, Simon Fraser (smfr)
no flags
cathiechen
Comment 1 2019-12-06 00:33:58 PST
cathiechen
Comment 2 2019-12-09 06:02:46 PST
cathiechen
Comment 3 2019-12-09 08:51:55 PST
Created attachment 385155 [details] UI-scroll-animation-for-review This patch only contains change for UI scroll.
cathiechen
Comment 4 2019-12-11 00:45:55 PST
Created attachment 385361 [details] native-animation-for-ews(including parsing + non_native_animation)
cathiechen
Comment 5 2019-12-11 00:46:38 PST
Created attachment 385362 [details] native-animation-for-review
Frédéric Wang (:fredw)
Comment 6 2019-12-11 01:45:33 PST
Comment on attachment 385362 [details] native-animation-for-review View in context: https://bugs.webkit.org/attachment.cgi?id=385362&action=review > LayoutTests/ChangeLog:12 > + copy scroll-behavior test to fast/scrolling/ios/ why not move them into fast/scrolling/ios/cssom-view? > LayoutTests/ChangeLog:14 > + * fast/scrolling/ios/resources/scroll-behavior.js: Added. I think this is copied from LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/support/scroll-behavior.js ; any reason why you decided to move it to the shared ios/resources/ ? > Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp:255 > + // The scroll position of animated scrolling will be set from the the UI process. So it shouldn't be set now. the the => by the? > Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp:-266 > - unneeded whitespace change > Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp:226 > + } This is a bit weird, why not #if PLATFORM(IOS_FAMILY) if (requestScrollWithAnimation()) return; #endif ? > Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:215 > +#endif Do we really need to add IOS conditionals for this and other APIs? I think we can add the instantScrollDidStopAnimation parameter on all platforms with a default value and ignore it on non-iOS ones.
cathiechen
Comment 7 2019-12-11 03:33:37 PST
Comment on attachment 385362 [details] native-animation-for-review View in context: https://bugs.webkit.org/attachment.cgi?id=385362&action=review Hi Fred, Thanks for the review:) >> Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp:255 >> + // The scroll position of animated scrolling will be set from the the UI process. So it shouldn't be set now. > > the the => by the? Done >> Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp:-266 >> - > > unneeded whitespace change done >> Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp:226 >> + } > > This is a bit weird, why not > > #if PLATFORM(IOS_FAMILY) > if (requestScrollWithAnimation()) > return; > #endif > > ? Done >> Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:215 >> +#endif > > Do we really need to add IOS conditionals for this and other APIs? > > I think we can add the instantScrollDidStopAnimation parameter on all platforms with a default value and ignore it on non-iOS ones. done
cathiechen
Comment 8 2019-12-11 03:35:07 PST
Created attachment 385374 [details] native-animation-for-ews(including parsing + non_native_animation)
cathiechen
Comment 9 2019-12-11 03:35:25 PST
Created attachment 385375 [details] native-animation-for-review
cathiechen
Comment 10 2019-12-11 07:24:45 PST
Created attachment 385388 [details] native-animation-for-ews(including parsing + non_native_animation)
cathiechen
Comment 11 2019-12-11 07:25:06 PST
Created attachment 385389 [details] native-animation-for-review
cathiechen
Comment 12 2019-12-11 09:06:23 PST
Created attachment 385399 [details] native-animation-for-ews(including parsing + non_native_animation)
cathiechen
Comment 13 2019-12-11 09:06:42 PST
Created attachment 385400 [details] native-animation-for-review
cathiechen
Comment 14 2019-12-11 09:25:36 PST
Created attachment 385402 [details] native-animation-for-ews(including parsing + non_native_animation)
cathiechen
Comment 15 2019-12-11 09:25:57 PST
Created attachment 385403 [details] native-animation-for-review
Frédéric Wang (:fredw)
Comment 16 2019-12-13 01:23:59 PST
Comment on attachment 385403 [details] native-animation-for-review View in context: https://bugs.webkit.org/attachment.cgi?id=385403&action=review > LayoutTests/ChangeLog:12 > + copy scroll-behavior test to fast/scrolling/ios/ I guess this is only needed because AsyncOverflowScrollingEnabled is not fully supported on non-iOS platforms? Maybe explain this? > Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp:277 > +#endif Maybe you can do only one call stateNode->setRequestedScrollPosition (see below). bool animated = false #if PLATFORM(IOS_FAMILY) ... #endif stateNode->setRequestedScrollPosition(scrollPosition, inProgrammaticScroll, animated); > Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp:240 > +#endif I think this #if #else can be merged in one function definition using the UNUSED_PARAM(requestedWithAnimation) on non-iOS platform? > Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h:119 > +#endif setRequestedScrollPosition can be have a single declaration outside the #if ; maybe you can remove the default value for requestedWithAnimation you end up always being explicit. > Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp:168 > +#endif You don't need PLATFORM(IOS_FAMILY) here, just use UNUSED_PARAM(needSyncScrollPosition) on non-iOS platforms. > Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:273 > +#endif Again, you can probably do only one node.setRequestedScrollPosition call ouside the #if > Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:231 > +#endif Ditto? > Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:111 > +#endif Can probably merge this in one m_scrollingCoordinatorProxy.scrollingTreeNodeDidScroll call and do the #if to calculate the last parameter.
cathiechen
Comment 17 2019-12-13 02:15:31 PST
Comment on attachment 385403 [details] native-animation-for-review View in context: https://bugs.webkit.org/attachment.cgi?id=385403&action=review Hi Fred, Thanks for the review:) >> LayoutTests/ChangeLog:12 >> + copy scroll-behavior test to fast/scrolling/ios/ > > I guess this is only needed because AsyncOverflowScrollingEnabled is not fully supported on non-iOS platforms? Maybe explain this? done >> Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp:240 >> +#endif > > I think this #if #else can be merged in one function definition using the UNUSED_PARAM(requestedWithAnimation) on non-iOS platform? Done, thanks:) >> Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h:119 >> +#endif > > setRequestedScrollPosition can be have a single declaration outside the #if ; maybe you can remove the default value for requestedWithAnimation you end up always being explicit. Done >> Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp:168 >> +#endif > > You don't need PLATFORM(IOS_FAMILY) here, just use UNUSED_PARAM(needSyncScrollPosition) on non-iOS platforms. Done >> Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:273 >> +#endif > > Again, you can probably do only one node.setRequestedScrollPosition call ouside the #if Done >> Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:231 >> +#endif > > Ditto? done >> Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:111 >> +#endif > > Can probably merge this in one m_scrollingCoordinatorProxy.scrollingTreeNodeDidScroll call and do the #if to calculate the last parameter. done
cathiechen
Comment 18 2019-12-13 04:32:57 PST
Created attachment 385591 [details] native-animation-for-ews(including parsing + non_native_animation)
cathiechen
Comment 19 2019-12-13 04:33:18 PST
Created attachment 385592 [details] native-animation-for-review
cathiechen
Comment 20 2019-12-13 05:53:30 PST
Created attachment 385596 [details] native-animation-for-ews(including parsing + non_native_animation)
cathiechen
Comment 21 2019-12-13 06:18:59 PST
Created attachment 385597 [details] native-animation-for-ews(including parsing + non_native_animation)
cathiechen
Comment 22 2019-12-13 07:07:10 PST
Created attachment 385600 [details] native-animation-for-ews(including parsing + non_native_animation)
cathiechen
Comment 23 2019-12-13 07:53:20 PST
Created attachment 385602 [details] native-animation-for-ews(including parsing + non_native_animation)
cathiechen
Comment 24 2019-12-15 07:08:04 PST
Created attachment 385716 [details] native-animation-for-ews(including parsing + non_native_animation) Rebase
cathiechen
Comment 25 2019-12-15 07:08:31 PST
Created attachment 385717 [details] native-animation-for-review
cathiechen
Comment 26 2019-12-15 09:13:55 PST
Created attachment 385722 [details] native-animation-for-ews(including parsing + non_native_animation)
cathiechen
Comment 27 2019-12-15 09:14:16 PST
Created attachment 385723 [details] native-animation-for-review
cathiechen
Comment 28 2020-01-19 22:22:57 PST
cathiechen
Comment 29 2020-02-12 01:43:46 PST
Frédéric Wang (:fredw)
Comment 30 2020-02-13 05:17:17 PST
Comment on attachment 390497 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=390497&action=review > Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp:307 > +void AsyncScrollingCoordinator::setScrollAnimationInProgress(ScrollingNodeID nodeID, bool isScrollAnimationInProgress) This function does nothing if isScrollAnimationInProgress is true. Should it be called interruptScrollAnimation()? > Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:110 > + setScrollAnimationInProgress(nodeID, isScrollAnimationInProgress); This could be if (!isScrollAnimationInProgress) interruptScrollAnimation(nodeID);
cathiechen
Comment 31 2020-02-17 21:37:44 PST
Comment on attachment 390497 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=390497&action=review >> Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp:307 >> +void AsyncScrollingCoordinator::setScrollAnimationInProgress(ScrollingNodeID nodeID, bool isScrollAnimationInProgress) > > This function does nothing if isScrollAnimationInProgress is true. Should it be called interruptScrollAnimation()? isScrollAnimationInProgress is always false currently. This function is used to indicate that native animated scroll is end. I changed the name to nativeScrollAnimationStopped, WDYT?
cathiechen
Comment 32 2020-02-17 21:40:34 PST
Radar WebKit Bug Importer
Comment 33 2020-11-12 10:12:12 PST
Simon Fraser (smfr)
Comment 34 2021-10-05 17:34:19 PDT
I'll take this over, if that's OK.
cathiechen
Comment 35 2021-10-06 01:29:32 PDT
(In reply to Simon Fraser (smfr) from comment #34) > I'll take this over, if that's OK. Sure, no problem, thanks!
Simon Fraser (smfr)
Comment 36 2021-10-10 10:36:55 PDT
Simon Fraser (smfr)
Comment 37 2021-10-10 10:49:32 PDT
EWS Watchlist
Comment 38 2021-10-10 10:50:44 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Simon Fraser (smfr)
Comment 39 2021-10-10 11:01:20 PDT
EWS
Comment 40 2021-10-11 10:53:04 PDT
Committed r283911 (242782@main): <https://commits.webkit.org/242782@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 440731 [details].
Note You need to log in before you can comment on or make changes to this bug.