Title: [247656] trunk/Source/WebKit
Revision
247656
Author
simon.fra...@apple.com
Date
2019-07-19 15:49:32 -0700 (Fri, 19 Jul 2019)

Log Message

[iOS WK2] Allow scrolling interaction on frames and oveflow scroll even when the main frame is rubber-banding
https://bugs.webkit.org/show_bug.cgi?id=199963
rdar://problem/52897797

Reviewed by Tim Horton.

Adopt UIKit SPI to allow for scrolling of inner UIScrollViews when the outer one is still rubber-banding.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (247655 => 247656)


--- trunk/Source/WebKit/ChangeLog	2019-07-19 22:30:47 UTC (rev 247655)
+++ trunk/Source/WebKit/ChangeLog	2019-07-19 22:49:32 UTC (rev 247656)
@@ -330,6 +330,22 @@
         (WebKit::StorageAreaMap::prewarm):
         * WebProcess/WebStorage/StorageAreaMap.h:
 
+2019-07-19  Simon Fraser  <simon.fra...@apple.com>
+
+        [iOS WK2] Allow scrolling interaction on frames and oveflow scroll even when the main frame is rubber-banding
+        https://bugs.webkit.org/show_bug.cgi?id=199963
+        rdar://problem/52897797
+
+        Reviewed by Tim Horton.
+
+        Adopt UIKit SPI to allow for scrolling of inner UIScrollViews when the outer one is still rubber-banding.
+
+        * Platform/spi/ios/UIKitSPI.h:
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _initializeWithConfiguration:]):
+        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
+        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
+
 2019-07-17  Megan Gardner  <megan_gard...@apple.com>
 
         Set WordIsNearTap flag, was not being set at all before

Modified: trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h (247655 => 247656)


--- trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2019-07-19 22:30:47 UTC (rev 247655)
+++ trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2019-07-19 22:49:32 UTC (rev 247656)
@@ -1117,6 +1117,9 @@
 - (void)_setContentOffsetWithDecelerationAnimation:(CGPoint)contentOffset;
 - (CGPoint)_adjustedContentOffsetForContentOffset:(CGPoint)contentOffset;
 - (void)_flashScrollIndicatorsPersistingPreviousFlashes:(BOOL)persisting;
+
+@property (nonatomic) BOOL tracksImmediatelyWhileDecelerating;
+@property (nonatomic, getter=_avoidsJumpOnInterruptedBounce, setter=_setAvoidsJumpOnInterruptedBounce:) BOOL _avoidsJumpOnInterruptedBounce;
 @end
 
 @interface UIPeripheralHost (IPI)

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (247655 => 247656)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-07-19 22:30:47 UTC (rev 247655)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-07-19 22:49:32 UTC (rev 247656)
@@ -690,6 +690,11 @@
     [_scrollView setInternalDelegate:self];
     [_scrollView setBouncesZoom:YES];
 
+    if ([_scrollView respondsToSelector:@selector(_setAvoidsJumpOnInterruptedBounce:)]) {
+        [_scrollView setTracksImmediatelyWhileDecelerating:NO];
+        [_scrollView _setAvoidsJumpOnInterruptedBounce:YES];
+    }
+
     if ([_configuration _editableImagesEnabled])
         [_scrollView panGestureRecognizer].allowedTouchTypes = @[ @(UITouchTypeDirect) ];
 

Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm (247655 => 247656)


--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm	2019-07-19 22:30:47 UTC (rev 247655)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm	2019-07-19 22:49:32 UTC (rev 247656)
@@ -248,6 +248,11 @@
 
             scrollView.scrollsToTop = NO;
             scrollView.delegate = m_scrollViewDelegate.get();
+
+            if ([scrollView respondsToSelector:@selector(_setAvoidsJumpOnInterruptedBounce:)]) {
+                scrollView.tracksImmediatelyWhileDecelerating = NO;
+                scrollView._avoidsJumpOnInterruptedBounce = YES;
+            }
         }
 
         bool recomputeInsets = scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to