WebKit Bugzilla
Attachment 373104 Details for
Bug 199222
: [iOS Scrolling] Propagate scrolls to non-nested UIScrollViews
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
non-acestor-scroll-parent.patch (text/plain), 6.32 KB, created by
Antti Koivisto
on 2019-06-28 04:31:45 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Antti Koivisto
Created:
2019-06-28 04:31:45 PDT
Size:
6.32 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 246923) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,29 @@ >+2019-06-28 Antti Koivisto <antti@apple.com> >+ >+ [iOS Scrolling] Propagate scrolls to non-nested UIScrollViews >+ https://bugs.webkit.org/show_bug.cgi?id=199222 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ We may generate scrolling hierarchies where the scrolling ancestor of a layer is not >+ an ancestor in the layer tree. We handle this in most situations but there is still >+ a problem where a scroller fails to propage scroll to the ancestor when it reaches >+ the edge. >+ >+ This patch hooks up a new SPI that allows us to tell UIKit about non-ancestor scrolling >+ relations and solve this problem. >+ >+ * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h: >+ * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: >+ (WebKit::findActingScrollParent): >+ * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: >+ * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: >+ (-[WKScrollingNodeScrollViewDelegate _actingParentScrollViewForScrollView:]): >+ >+ Hook into UIKit SPI. >+ >+ (WebKit::ScrollingTreeScrollingNodeDelegateIOS::findActingScrollParent): >+ > 2019-06-28 Carlos Garcia Campos <cgarcia@igalia.com> > > [SOUP] WebSockets: runtime critical warning when closing the connection in some cases >Index: Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h (revision 246921) >+++ Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h (working copy) >@@ -31,6 +31,7 @@ > #import <WebCore/GraphicsLayer.h> > > namespace WebKit { >+class RemoteLayerTreeHost; > class WebPageProxy; > } > >@@ -77,6 +78,7 @@ namespace WebKit { > #if ENABLE(POINTER_EVENTS) > OptionSet<WebCore::TouchAction> touchActionsForPoint(UIView *rootView, const WebCore::IntPoint&); > #endif >+UIScrollView *findActingScrollParent(UIScrollView *, const RemoteLayerTreeHost&); > > } > >Index: Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm (revision 246921) >+++ Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm (working copy) >@@ -124,6 +124,35 @@ OptionSet<WebCore::TouchAction> touchAct > } > #endif > >+UIScrollView *findActingScrollParent(UIScrollView *scrollView, const RemoteLayerTreeHost& host) >+{ >+ HashSet<WebCore::GraphicsLayer::PlatformLayerID> scrollersToSkip; >+ >+ for (UIView *view = [scrollView superview]; view; view = [view superview]) { >+ if ([view isKindOfClass:[WKChildScrollView class]] && !scrollersToSkip.contains(RemoteLayerTreeNode::layerID(view.layer))) { >+ // FIXME: Ideally we would return the scroller we want in all cases but the current UIKit SPI only allows returning a non-ancestor. >+ return nil; >+ } >+ >+ if (auto* node = RemoteLayerTreeNode::forCALayer(view.layer)) { >+ switch (node->relatedScrollContainerPositioningBehavior()) { >+ case WebCore::ScrollPositioningBehavior::Moves: >+ if (!node->relatedScrollContainerIDs().isEmpty()) { >+ if (auto* nonAncestorScrollingNode = host.nodeForID(node->relatedScrollContainerIDs()[0])) >+ return (WKChildScrollView *)nonAncestorScrollingNode->uiView(); >+ } >+ break; >+ case WebCore::ScrollPositioningBehavior::Stationary: >+ scrollersToSkip.add(node->relatedScrollContainerIDs().begin(), node->relatedScrollContainerIDs().end()); >+ break; >+ case WebCore::ScrollPositioningBehavior::None: >+ break; >+ } >+ } >+ } >+ return nil; >+} >+ > } > > @interface UIView (WKHitTesting) >Index: Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h (revision 246921) >+++ Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h (working copy) >@@ -73,6 +73,8 @@ public: > void cancelPointersForGestureRecognizer(UIGestureRecognizer*); > #endif > >+ UIScrollView *findActingScrollParent(UIScrollView *); >+ > private: > UIScrollView *scrollView() const; > >Index: Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm (revision 246921) >+++ Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm (working copy) >@@ -28,6 +28,7 @@ > > #if PLATFORM(IOS_FAMILY) && ENABLE(ASYNC_SCROLLING) > >+#import "RemoteLayerTreeViews.h" > #import "RemoteScrollingCoordinatorProxy.h" > #import "RemoteScrollingTree.h" > #import "UIKitSPI.h" >@@ -61,6 +62,12 @@ - (instancetype)initWithScrollingTreeNod > return self; > } > >+- (UIScrollView *)_actingParentScrollViewForScrollView:(UIScrollView *)scrollView >+{ >+ // An "acting parent" is a non-ancestor scrolling parent. We tell this to UIKit so it can propagate scrolls correctly. >+ return _scrollingTreeNodeDelegate->findActingScrollParent(scrollView); >+} >+ > - (void)scrollViewDidScroll:(UIScrollView *)scrollView > { > _scrollingTreeNodeDelegate->scrollViewDidScroll(scrollView.contentOffset, _inUserInteraction); >@@ -338,6 +345,14 @@ UIScrollView *ScrollingTreeScrollingNode > return scrollView; > } > >+UIScrollView *ScrollingTreeScrollingNodeDelegateIOS::findActingScrollParent(UIScrollView *scrollView) >+{ >+ ASSERT(scrollView == this->scrollView()); >+ >+ auto& scrollingCoordinatorProxy = downcast<RemoteScrollingTree>(scrollingTree()).scrollingCoordinatorProxy(); >+ return WebKit::findActingScrollParent(scrollView, *scrollingCoordinatorProxy.layerTreeHost()); >+} >+ > #if ENABLE(POINTER_EVENTS) > void ScrollingTreeScrollingNodeDelegateIOS::computeActiveTouchActionsForGestureRecognizer(UIGestureRecognizer* gestureRecognizer) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199222
:
372913
|
372914
|
373030
| 373104