Bug 148086 - Cannot change WKWebView scrollView deceleration rate
Summary: Cannot change WKWebView scrollView deceleration rate
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2015-08-17 13:02 PDT by Wenson Hsieh
Modified: 2016-08-02 13:56 PDT (History)
2 users (show)

See Also:

Patch (1.55 KB, patch)
2015-08-17 13:12 PDT, Wenson Hsieh
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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
Comment 2 Wenson Hsieh 2015-08-17 13:12:24 PDT
Created attachment 259173 [details]
Comment 3 Simon Fraser (smfr) 2015-08-17 13:27:06 PDT
Comment on attachment 259173 [details]

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?