[Webkit-unassigned] [Bug 135769] Implement snapping behavior for iOS

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 14 13:33:11 PDT 2014


--- Comment #9 from Wenson Hsieh <wenson_hsieh at apple.com>  2014-08-14 13:33:18 PST ---
(From update of attachment 236591)
View in context: https://bugs.webkit.org/attachment.cgi?id=236591&action=review

>> Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp:106
>> +        // FIXME: Make sure we snap these pixel values.
> Why not do this now? I'm sure Zalan can tell you how, and I think it's not too hard.


>> Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp:108
>> +            snapOffsetsAsFloat.append(frameView->horizontalSnapOffsets()->at(i).round());
> you're .at()ing again

Good catch. Fixed.

>> Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp:112
>> +    if (frameView->verticalSnapOffsets()) {
> perhaps a reusable static snapOffsetsAsFloats or something? this code is here four times

So much cleaner :)

>> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:86
> This doesn't belong in the middle of the big block if it has #if, but I don't think it needs the #if, either.

Got it. Removed #if.

>> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:1306
>> +    if (_page->mainFrame() && _page->mainFrame()->page() && _page->mainFrame()->page()->scrollingCoordinatorProxy()) {
> I wonder if this code can go somewhere more scrollingy (RemoteScrollingCoordinatorProxy?) and we can just call something->adjustTargetContentOffsetForSnapping(targetContentOffset) or something.

Added adjustTargetContentOffsetForSnapping to RemoteScrollingCoordinatorProxy.

>> Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:33
> no #if blocks inside the big block of #imports!

Got it -- fixed.

>> Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:206
>> +        // FIXME: In only one axis snaps in 2D scrolling, the other axis will decelerate fast as well. Is this what we want?
> there's some mixup at the beginning of this sentence

Oops, good catch! (it's supposed to be "if")

>>> Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:112
>>> +bool RemoteScrollingCoordinatorProxy::shouldHorizontalSnapForMainframeScrolling() const
>> To prevent requiring ScrollTypes, I split these methods into horizontal and vertical versions. Otherwise, I could pass in a WebCore::ScrollEventAxis
> Deduplicate!

Re-merged into 1 method.

>> Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:143
>> +float RemoteScrollingCoordinatorProxy::closestVerticalSnapOffsetForMainframeScrolling(float scrollDestination, float velocity) const
> deduplicate!


Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list