RESOLVED FIXED 190345
Adjust keyboard scrolling animator to be a bit more physical
https://bugs.webkit.org/show_bug.cgi?id=190345
Summary Adjust keyboard scrolling animator to be a bit more physical
Tim Horton
Reported 2018-10-08 00:15:09 PDT
Adjust keyboard scrolling animator to be a bit more physical
Attachments
Patch (39.74 KB, patch)
2018-10-08 00:20 PDT, Tim Horton
no flags
Patch (43.06 KB, patch)
2018-10-08 11:29 PDT, Tim Horton
no flags
Patch (43.06 KB, patch)
2018-10-08 11:30 PDT, Tim Horton
no flags
Patch (43.04 KB, patch)
2018-10-08 12:03 PDT, Tim Horton
no flags
Patch (43.43 KB, patch)
2018-10-08 12:49 PDT, Tim Horton
no flags
Tim Horton
Comment 1 2018-10-08 00:20:52 PDT
Tim Horton
Comment 2 2018-10-08 00:21:55 PDT
I'll flesh out the changelog a bit. Also I think maybe we can unit test the class independent of a scroll view, which would be nice, so I'll try that.
Tim Horton
Comment 3 2018-10-08 11:29:18 PDT
Tim Horton
Comment 4 2018-10-08 11:30:03 PDT
Simon Fraser (smfr)
Comment 5 2018-10-08 11:44:33 PDT
Comment on attachment 351795 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=351795&action=review > Source/WebKit/ChangeLog:3 > + Adjust keyboard scrolling animator to be a bit more physical "a bit more" > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:3854 > + return self.bounds.size.height * selfScale; Wouldn't that be the content view height? > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:3858 > + return WebCore::Scrollbar::pixelsPerLineStep() * selfScale; Maybe get this from the content view too? > Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm:46 > + WebCore::FloatSize offset; // Points per increment. > + WebCore::FloatSize maximumVelocity; // Points per second. The comments indicate that the members could be named better (or maybe some typedef types) > Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm:142 > + return WebCore::FloatSize(0, -1); return { 0., -1. } ? > Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm:292 > + _velocity = WebCore::FloatSize(); = { } > Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm:380 > + _velocity = WebCore::FloatSize(); = { } > Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm:391 > + WebCore::RectEdges<bool> scrollableDirections = [_scrollable scrollableDirectionsFromOffset:_currentPosition]; auto > Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm:421 > + // Compute the spring's force, and apply it in allowed directions. > + // F_spring = -k * x - c * v > + auto springForce = - displacement.scaled(self.parameters.springStiffness) - _velocity.scaled(self.parameters.springDamping); > + force += springForce * axesToApplySpring; I kinda feel like all the spring logic should be packaged up in a separate helper class. > Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm:435 > + _velocity = WebCore::FloatSize(); = { } > Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm:580 > + return CGSizeMake(scrollView._horizontalVelocity * 1000, scrollView._verticalVelocity * 1000); Please document the * 1000
Tim Horton
Comment 6 2018-10-08 12:03:33 PDT
Tim Horton
Comment 7 2018-10-08 12:49:28 PDT
WebKit Commit Bot
Comment 8 2018-10-08 13:18:33 PDT
Comment on attachment 351806 [details] Patch Clearing flags on attachment: 351806 Committed r236935: <https://trac.webkit.org/changeset/236935>
WebKit Commit Bot
Comment 9 2018-10-08 13:18:35 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10 2018-10-08 13:19:23 PDT
Daniel Bates
Comment 11 2018-11-07 16:58:07 PST
(In reply to WebKit Commit Bot from comment #8) > Comment on attachment 351806 [details] > Patch > > Clearing flags on attachment: 351806 > > Committed r236935: <https://trac.webkit.org/changeset/236935> This regressed key repeats for arrow keys on iOS device. See bug #191408 for more details.
Note You need to log in before you can comment on or make changes to this bug.