See the patch.
Created attachment 403194 [details] Patch
There's a bug where the velocity is calculated incorrectly. That's https://bugs.webkit.org/show_bug.cgi?id=213789, it happens in GTK3 as well, so a separate bug.
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment on attachment 403194 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=403194&action=review Thanks! I think it would be easier to refactor the WebEventFactory create functions. > Source/WebKit/Shared/NativeWebWheelEvent.h:64 > NativeWebWheelEvent(GdkEvent*, const WebCore::IntPoint&, const WebCore::FloatSize& wheelTicks); > + NativeWebWheelEvent(GdkEvent*, const WebCore::IntPoint&, const WebCore::FloatSize& wheelTicks, WebWheelEvent::Phase, WebWheelEvent::Phase momentumPhase); I think this new one makes the previous one unused, so better to modify the existing one if needed. > Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp:1278 > + WebWheelEvent::Phase phase = gdk_event_is_scroll_stop_event(event) ? > + WebWheelEvent::Phase::PhaseEnded : > + WebWheelEvent::Phase::PhaseChanged; So, in the end we are passing a fixed momentum phase and phase value that depends on event, so this could be done in WebEventFactory.cpp instead if the parameters currently passed.
Sure, makes sense.
Created attachment 403366 [details] Patch
Committed r263887: <https://trac.webkit.org/changeset/263887> All reviewed patches have been landed. Closing bug and clearing flags on attachment 403366 [details].