[Webkit-unassigned] [Bug 226986] Refactor MacOS keyboard scrolling and use KeyboardScroll struct

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 24 12:09:29 PDT 2021


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

--- Comment #27 from Aditya Keerthi <akeerthi at apple.com> ---
Comment on attachment 432194
  --> https://bugs.webkit.org/attachment.cgi?id=432194
Patch

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

> Source/WebCore/ChangeLog:8
> +        No tests yet

Nit: Add a period at the end of the sentence.

Also might be good to summarize the changes.

> Source/WebCore/page/EventHandler.cpp:4237
> +static FloatSize unitVector(ScrollDirection direction)

The IOS_FAMILY build is failing because this method is not in a header (and is not WEBCORE_EXPORT).

I think you should move this to a new KeyboardScroll.cpp, and WEBCORE_EXPORT the method in KeyboardScroll.h. And probably rename the method to unitVectorForScrollDirection.

You'll need to add the new file to Source/WebCore/Sources.txt (and we should probably add the header to Source/WebCore/Headers.cmake).

> Source/WebCore/page/EventHandler.cpp:4332
> +    CGFloat distance = scrollDistance(direction, granularity);
> +    
> +    KeyboardScroll scroll;
> +
> +    scroll.offset = unitVector(direction).scaled(distance);
> +    scroll.granularity = granularity;
> +    scroll.direction = direction;
> +    scroll.maximumVelocity = scroll.offset.scaled(KeyboardScrollParameters::parameters().maximumVelocityMultiplier);
> +
> +    scroll.force = scroll.maximumVelocity.scaled(KeyboardScrollParameters::parameters().springMass / KeyboardScrollParameters::parameters().timeToMaximumVelocity);

It looks like none of these variables are actually used?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210624/46318a89/attachment.htm>


More information about the webkit-unassigned mailing list