Bug 148086

Summary: Cannot change WKWebView scrollView deceleration rate
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: rob, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: iPhone / iPad   
OS: Unspecified   
Attachments:
Description Flags
Patch simon.fraser: review+

Description Wenson Hsieh 2015-08-17 13:02:20 PDT
Currently, developers are not able to change a WKScrollView's decelerationRate by explicitly setting it, e.g. webView.scrollView.decelerationRate = UIScrollViewDecelerationRateNormal; This fixes the deceleration rate to UIScrollViewDecelerationRateFast. This is because _preferredScrollDecelerationFactor in WKScrollView is not updated when [WKScrollView setDecelerationRate] is invoked, so when the snap points code determines whether the decelerationRate should be fast or whatever the preferred value is, the decelerationRate is always set to UIScrollViewDecelerationRateFast.
Comment 1 Wenson Hsieh 2015-08-17 13:05:06 PDT
<rdar://problem/21893685>
Comment 2 Wenson Hsieh 2015-08-17 13:12:24 PDT
Created attachment 259173 [details]
Patch
Comment 3 Simon Fraser (smfr) 2015-08-17 13:27:06 PDT
Comment on attachment 259173 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=259173&action=review

> Source/WebKit2/ChangeLog:5
> +        https://bugs.webkit.org/show_bug.cgi?id=148086
> +

There should be a radar url here too.

> Source/WebKit2/ChangeLog:8
> +        Updates the preferred scroll deceleration factor when the scrollView's decelerationRate is explicitly set.

Can you put more words here to say why this fixes the bug?
Comment 4 Wenson Hsieh 2015-08-17 13:39:10 PDT
Committed r188541: <http://trac.webkit.org/changeset/188541>
Comment 5 rob 2016-08-02 13:42:07 PDT
(In reply to comment #4)
> Committed r188541: <http://trac.webkit.org/changeset/188541>

@Wenson: Can you specify what version of iOS this bug fix was released with? Still seems to be an issue in iOS 9.3 13E230.
Comment 6 Wenson Hsieh 2016-08-02 13:56:29 PDT
Hi Rob,

As far as I know, this fix did not make it into iOS 9. Could you try it out on the iOS 10 beta?

Thanks!
Wenson