Bug 127521

Summary: Sideways 'wobble' when scrolling with trackpad on Mavericks
Product: WebKit Reporter: Beth Dakin <bdakin>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, commit-queue, jonlee, simon.fraser, thorton
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: OS X 10.9   
Attachments:
Description Flags
Patch
none
Patch simon.fraser: review+

Description Beth Dakin 2014-01-23 16:25:38 PST
Scrolling Safari on Mavericks is wobbly. We are receiving scroll events with a lot more horizontal deltas (when the user is trying to primarily scroll vertically).

<rdar://problem/14137306>
Comment 1 Beth Dakin 2014-01-23 16:40:54 PST
Created attachment 222042 [details]
Patch
Comment 2 Sam Weinig 2014-01-24 13:45:49 PST
Comment on attachment 222042 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=222042&action=review

> Source/WebCore/platform/PlatformWheelEvent.h:129
> +        void ignoreHorizontalDelta() { m_deltaX = 0; }
> +        void ignoreVerticalDelta() { m_deltaY = 0; }

Is there a way to do this without mutating the platform event? Over the years, I have been trying to make these immutable.
Comment 3 Beth Dakin 2014-01-24 14:09:32 PST
(In reply to comment #2)
> (From update of attachment 222042 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=222042&action=review
> 
> > Source/WebCore/platform/PlatformWheelEvent.h:129
> > +        void ignoreHorizontalDelta() { m_deltaX = 0; }
> > +        void ignoreVerticalDelta() { m_deltaY = 0; }
> 
> Is there a way to do this without mutating the platform event? Over the years, I have been trying to make these immutable.

We might be able to put the tracker down in the ElasticityController instead when we are handing the wheel event there, and that might allow us to avoid mutating the event.
Comment 4 Simon Fraser (smfr) 2014-01-24 14:15:55 PST
Or we can just clone the event to avoid mutation.
Comment 5 Beth Dakin 2014-01-30 16:07:15 PST
Created attachment 222754 [details]
Patch

Okay, scrollperf is wonky, and this does not appear to be a regression after all.
Comment 6 WebKit Commit Bot 2014-01-30 16:17:03 PST
Attachment 222754 [details] did not pass style-queue:


ERROR: Source/WebCore/page/WheelEventDeltaTracker.cpp:28:  You should not add a blank line before implementation file's own header.  [build/include_order] [4]
Total errors found: 1 in 12 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Simon Fraser (smfr) 2014-01-30 16:24:38 PST
Comment on attachment 222754 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=222754&action=review

> Source/WebCore/page/WheelEventDeltaTracker.h:57
> +    Deque<FloatSize> m_recentWheelEventDeltas;

This should probably have some inline capacity, matching recentEventCount.

> Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp:115
> +        // This is a little crazy because it is working around <rdar://problem/14758615>, which is a bug in a
> +        // lower-level component. While that bug is still unresolved, this will help to reduce some of the noise
> +        // we are seeing with lots of small horizontal deltas when a user is scrolling in primarily vertical
> +        // direction and vice versa.

I think just // Work around <rdar://problem/14758615>
would be sufficient.
Comment 8 Beth Dakin 2014-01-31 11:00:23 PST
Committed with http://trac.webkit.org/changeset/163180

I added the new files to all of the other projects which will hopeful fix all of the builds.
Comment 9 Darin Adler 2014-01-31 11:26:18 PST
Comment on attachment 222754 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=222754&action=review

> Source/WebCore/page/EventHandler.h:517
> +    OwnPtr<WheelEventDeltaTracker> m_recentWheelEventDeltaTracker;

Why not std::unique_ptr instead of OwnPtr?

> Source/WebKit2/WebProcess/WebPage/EventDispatcher.h:81
> +    OwnPtr<WebCore::WheelEventDeltaTracker> m_recentWheelEventDeltaTracker;

Why not std::unique_ptr instead of OwnPtr?