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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 14 11:23:36 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=135769





--- Comment #7 from Tim Horton <thorton at apple.com>  2014-08-14 11:23:43 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

> Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp:112
> +    if (frameView->verticalSnapOffsets()) {

perhaps a reusable static snapOffsetsAsFloats or something? this code is here four times

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:86
> +#if ENABLE(CSS_SCROLL_SNAP)

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.

> 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.

> Source/WebKit2/UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:33
> +#if ENABLE(CSS_SCROLL_SNAP)

no #if blocks inside the big block of #imports!

> 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

> Source/WebKit2/UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:40
> +#include <WebCore/ScrollingTreeFrameScrollingNode.h>

this is not sorted right

>> 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!

> 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