Changeset 189773 in webkit


Ignore:
Timestamp:
Sep 14, 2015 7:42:39 PM (9 years ago)
Author:
Wenson Hsieh
Message:

WKWebView scroll deceleration rate is not being set properly
https://bugs.webkit.org/show_bug.cgi?id=149145
<rdar://problem/22064071>

Reviewed by Simon Fraser.

We are not currently setting the web view's deceleration rate to the correct preferred value because we
are setting the decelerationRate property of the scrollView, which snaps input values to the closer of
two predefined UIKit constants, UIScrollViewDecelerationRateFast and UIScrollViewDecelerationRateNormal.
To fix this, we directly set the horizontal and vertical scroll deceleration factors to the preferred
value.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView scrollViewWillBeginDragging:]): Directly set the scroll view's deceleration factor without

going through the decelerationRate property.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r189753 r189773  
     12015-09-14  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        WKWebView scroll deceleration rate is not being set properly
     4        https://bugs.webkit.org/show_bug.cgi?id=149145
     5        <rdar://problem/22064071>
     6
     7        Reviewed by Simon Fraser.
     8
     9        We are not currently setting the web view's deceleration rate to the correct preferred value because we
     10        are setting the decelerationRate property of the scrollView, which snaps input values to the closer of
     11        two predefined UIKit constants, UIScrollViewDecelerationRateFast and UIScrollViewDecelerationRateNormal.
     12        To fix this, we directly set the horizontal and vertical scroll deceleration factors to the preferred
     13        value.
     14
     15        * UIProcess/API/Cocoa/WKWebView.mm:
     16        (-[WKWebView scrollViewWillBeginDragging:]): Directly set the scroll view's deceleration factor without
     17                going through the decelerationRate property.
     18
    1192015-09-14  Dan Bernstein  <mitz@apple.com>
    220
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r189635 r189773  
    14811481    WebKit::RemoteScrollingCoordinatorProxy* coordinator = _page->scrollingCoordinatorProxy();
    14821482    ASSERT(scrollView == _scrollView.get());
    1483     scrollView.decelerationRate = (coordinator && coordinator->shouldSetScrollViewDecelerationRateFast()) ? UIScrollViewDecelerationRateFast : [_scrollView preferredScrollDecelerationFactor];
     1483    CGFloat scrollDecelerationFactor = (coordinator && coordinator->shouldSetScrollViewDecelerationRateFast()) ? UIScrollViewDecelerationRateFast : [_scrollView preferredScrollDecelerationFactor];
     1484    scrollView.horizontalScrollDecelerationFactor = scrollDecelerationFactor;
     1485    scrollView.verticalScrollDecelerationFactor = scrollDecelerationFactor;
    14841486#endif
    14851487}
Note: See TracChangeset for help on using the changeset viewer.