Title: [211197] trunk/Source/WebKit2
Revision
211197
Author
[email protected]
Date
2017-01-25 20:05:25 -0800 (Wed, 25 Jan 2017)

Log Message

Stop inheriting from UIWebScrollView, just use UIScrollView
https://bugs.webkit.org/show_bug.cgi?id=167440
<rdar://problem/7729691>

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView scrollViewWillBeginDragging:]):
* UIProcess/ios/WKScrollView.h:
* UIProcess/ios/WKScrollView.mm:
(-[WKScrollView initWithFrame:]): Deleted.
(-[WKScrollView setDecelerationRate:]): Deleted.
Inherit directly from UIScrollView, no need for UIWebScrollView.
Set the few settings we care about directly.
This has the side effect of reducing the default rate of scroll deceleration.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (211196 => 211197)


--- trunk/Source/WebKit2/ChangeLog	2017-01-26 04:00:41 UTC (rev 211196)
+++ trunk/Source/WebKit2/ChangeLog	2017-01-26 04:05:25 UTC (rev 211197)
@@ -1,3 +1,21 @@
+2017-01-25  Tim Horton  <[email protected]>
+
+        Stop inheriting from UIWebScrollView, just use UIScrollView
+        https://bugs.webkit.org/show_bug.cgi?id=167440
+        <rdar://problem/7729691>
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView scrollViewWillBeginDragging:]):
+        * UIProcess/ios/WKScrollView.h:
+        * UIProcess/ios/WKScrollView.mm:
+        (-[WKScrollView initWithFrame:]): Deleted.
+        (-[WKScrollView setDecelerationRate:]): Deleted.
+        Inherit directly from UIScrollView, no need for UIWebScrollView.
+        Set the few settings we care about directly.
+        This has the side effect of reducing the default rate of scroll deceleration.
+
 2017-01-25  Matt Rajca  <[email protected]>
 
         Notify clients when the user plays media otherwise prevented from autoplaying

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (211196 => 211197)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-01-26 04:00:41 UTC (rev 211196)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-01-26 04:05:25 UTC (rev 211197)
@@ -1881,7 +1881,7 @@
     // FIXME: We will want to detect whether snapping will occur before beginning to drag. See WebPageProxy::didCommitLayerTree.
     WebKit::RemoteScrollingCoordinatorProxy* coordinator = _page->scrollingCoordinatorProxy();
     ASSERT(scrollView == _scrollView.get());
-    CGFloat scrollDecelerationFactor = (coordinator && coordinator->shouldSetScrollViewDecelerationRateFast()) ? UIScrollViewDecelerationRateFast : [_scrollView preferredScrollDecelerationFactor];
+    CGFloat scrollDecelerationFactor = (coordinator && coordinator->shouldSetScrollViewDecelerationRateFast()) ? UIScrollViewDecelerationRateFast : UIScrollViewDecelerationRateNormal;
     scrollView.horizontalScrollDecelerationFactor = scrollDecelerationFactor;
     scrollView.verticalScrollDecelerationFactor = scrollDecelerationFactor;
 #endif

Modified: trunk/Source/WebKit2/UIProcess/ios/WKScrollView.h (211196 => 211197)


--- trunk/Source/WebKit2/UIProcess/ios/WKScrollView.h	2017-01-26 04:00:41 UTC (rev 211196)
+++ trunk/Source/WebKit2/UIProcess/ios/WKScrollView.h	2017-01-26 04:05:25 UTC (rev 211197)
@@ -29,10 +29,9 @@
 
 @class WKWebView;
 
-@interface WKScrollView : UIWebScrollView
+@interface WKScrollView : UIScrollView
 
 @property (nonatomic, assign) WKWebView <UIScrollViewDelegate> *internalDelegate;
-@property (nonatomic, readonly) CGFloat preferredScrollDecelerationFactor;
 
 - (void)_setContentSizePreservingContentOffsetDuringRubberband:(CGSize)contentSize;
 

Modified: trunk/Source/WebKit2/UIProcess/ios/WKScrollView.mm (211196 => 211197)


--- trunk/Source/WebKit2/UIProcess/ios/WKScrollView.mm	2017-01-26 04:00:41 UTC (rev 211196)
+++ trunk/Source/WebKit2/UIProcess/ios/WKScrollView.mm	2017-01-26 04:05:25 UTC (rev 211197)
@@ -118,11 +118,13 @@
 
 - (id)initWithFrame:(CGRect)frame
 {
-    if (self = [super initWithFrame:frame]) {
-        ASSERT([self verticalScrollDecelerationFactor] == [self horizontalScrollDecelerationFactor]);
-        // FIXME: use UIWebPreferredScrollDecelerationFactor() from UIKit: rdar://problem/18931007.
-        _preferredScrollDecelerationFactor = [self verticalScrollDecelerationFactor];
-    }
+    self = [super initWithFrame:frame];
+
+    if (!self)
+        return nil;
+
+    self.alwaysBounceVertical = YES;
+    self.directionalLockEnabled = YES;
     
     return self;
 }
@@ -273,12 +275,6 @@
         [self _restoreContentOffsetWithRubberbandAmount:rubberbandAmount];
 }
 
-- (void)setDecelerationRate:(CGFloat)decelerationRate
-{
-    [super setDecelerationRate:decelerationRate];
-    _preferredScrollDecelerationFactor = decelerationRate;
-}
-
 @end
 
 #endif // PLATFORM(IOS)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to