[webkit-reviews] review granted: [Bug 226986] Refactor MacOS keyboard scrolling and use KeyboardScroll struct : [Attachment 432293] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 28 12:23:29 PDT 2021


Tim Horton <thorton at apple.com> has granted Dana Estra <destra at apple.com>'s
request for review:
Bug 226986: Refactor MacOS keyboard scrolling and use KeyboardScroll struct
https://bugs.webkit.org/show_bug.cgi?id=226986

Attachment 432293: Patch

https://bugs.webkit.org/attachment.cgi?id=432293&action=review




--- Comment #30 from Tim Horton <thorton at apple.com> ---
Comment on attachment 432293
  --> https://bugs.webkit.org/attachment.cgi?id=432293
Patch

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

> Source/WebCore/page/EventHandler.cpp:4259
> +    // FIXME: This logic does not account for writing-mode.

This should have a bugzilla number in parens (FIXME (123456): ...)

> Source/WebCore/page/EventHandler.cpp:4318
> +    KeyboardScroll scroll;
> +
> +    scroll.offset =
unitVectorForScrollDirection(direction).scaled(distance);
> +    scroll.granularity = granularity;
> +    scroll.direction = direction;
> +    scroll.maximumVelocity =
scroll.offset.scaled(KeyboardScrollParameters::parameters().maximumVelocityMult
iplier);
> +
> +    scroll.force =
scroll.maximumVelocity.scaled(KeyboardScrollParameters::parameters().springMass
/ KeyboardScrollParameters::parameters().timeToMaximumVelocity);

Not the end of the world, but ideally you would stash this unused code aside
for patch 2 instead of including it here.

> Source/WebCore/page/KeyboardScroll.cpp:1
> +// Copyright (C) 2021 Apple Inc. All rights reserved.

This copyright header should look like the one in your .h (with a multi-line
comment); not sure where this version came from.

> Source/WebKit/UIProcess/ios/WKKeyboardScrollingAnimator.mm:-299
> -    WebKit::KeyboardScroll scroll;

Should be a FIXME in this general vicinity about adopting the WebCore version
of this.


More information about the webkit-reviews mailing list