WebKit Bugzilla
Attachment 372913 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]
WIP
non-nested-scroll-wip.patch (text/plain), 3.96 KB, created by
Antti Koivisto
on 2019-06-26 04:27:50 PDT
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Antti Koivisto
Created:
2019-06-26 04:27:50 PDT
Size:
3.96 KB
patch
obsolete
>Index: Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h (revision 246834) >+++ 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 *findScrollParent(UIScrollView *, const RemoteLayerTreeHost&); > > } > >Index: Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm (revision 246834) >+++ Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm (working copy) >@@ -124,6 +124,27 @@ OptionSet<WebCore::TouchAction> touchAct > } > #endif > >+UIScrollView *findScrollParent(UIScrollView *scrollView, const RemoteLayerTreeHost& host) >+{ >+ UIView *view = [scrollView superview]; >+ while (view) { >+ if ([view isKindOfClass:[WKChildScrollView class]]) >+ return (WKChildScrollView *)view; >+ auto* node = RemoteLayerTreeNode::forCALayer(view.layer); >+ if (node) { >+ switch (node->relatedScrollContainerPositioningBehavior()) { >+ case WebCore::ScrollPositioningBehavior::Moves: >+ return (WKChildScrollView *)host.nodeForID(node->relatedScrollContainerIDs()[0])->uiView(); >+ case WebCore::ScrollPositioningBehavior::Stationary: >+ case WebCore::ScrollPositioningBehavior::None: >+ break; >+ } >+ } >+ view = [view superview]; >+ } >+ return nil; >+} >+ > } > > @interface UIView (WKHitTesting) >Index: Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h (revision 246834) >+++ Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h (working copy) >@@ -73,6 +73,8 @@ public: > void cancelPointersForGestureRecognizer(UIGestureRecognizer*); > #endif > >+ UIScrollView *findScrollParent(); >+ > private: > UIScrollView *scrollView() const; > >Index: Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm (revision 246834) >+++ 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,11 @@ - (instancetype)initWithScrollingTreeNod > return self; > } > >+- (UIScrollView *)_fakeParentScrollViewForScrollView:(UIScrollView *)scrollView >+{ >+ return _scrollingTreeNodeDelegate->findScrollParent(); >+} >+ > - (void)scrollViewDidScroll:(UIScrollView *)scrollView > { > _scrollingTreeNodeDelegate->scrollViewDidScroll(scrollView.contentOffset, _inUserInteraction); >@@ -338,6 +344,13 @@ UIScrollView *ScrollingTreeScrollingNode > return scrollView; > } > >+UIScrollView *ScrollingTreeScrollingNodeDelegateIOS::findScrollParent() >+{ >+ auto& scrollingCoordinatorProxy = downcast<RemoteScrollingTree>(scrollingTree()).scrollingCoordinatorProxy(); >+ >+ return WebKit::findScrollParent(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