[Webkit-unassigned] [Bug 228009] Add key-driven smooth scrolling to macOS

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 26 13:02:20 PDT 2021


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

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

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

> Source/WebCore/page/EventHandler.cpp:4263
> +    return view->scrollAnimator().keyboardScrollingAnimator()->beginKeyboardScrollGesture(event);

If keyboardScrollingAnimator is guaranteed to be non-null, this getter should return a reference, and if not, you probably need to null-check it?

> Source/WebCore/platform/KeyboardScrollingAnimator.h:36
> +    WTF_MAKE_FAST_ALLOCATED;

probably also non-copyable

> Source/WebCore/platform/KeyboardScrollingAnimator.h:47
> +    std::optional<KeyboardScroll> keyboardScrollForKeyboardEvent(KeyboardEvent&);

const?

> Source/WebCore/platform/KeyboardScrollingAnimator.h:48
> +    float scrollDistance(ScrollDirection, ScrollGranularity);

const?

> Source/WebCore/platform/ScrollAnimator.cpp:71
> +    , m_keyboardScrollingAnimator(makeUnique<KeyboardScrollingAnimator>(*this, m_scrollController))

Any reason KeyboardScrollingAnimator isn't just a member (instead of a unique_ptr)? (either way, you can make the getter return a reference)

-- 
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/20210726/6965ac5d/attachment.htm>


More information about the webkit-unassigned mailing list