[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 10:01:54 PDT 2021


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

--- Comment #25 from Sam Weinig <sam at webkit.org> ---
(In reply to Tim Horton from comment #24)
> (In reply to Sam Weinig from comment #22)
> > Comment on attachment 431997 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=431997&action=review
> > 
> > Seems like there is a bunch of code duplication going on. Instead, it would
> > be better to make the code useable by both WKKeyboardScrollingAnimator and
> > EventHandler, and have those classes called shared functionality.
> 
> Ideally, yes. In practice this is a bit annoying, because the input to this
> function is an event, and I don't think there is any event type that is
> *commonly* used both in WebCore in the Web Content process and WebKit in the
> UI process. Ideally we could make the code deal in terms of WebCore events
> (WebCore::KeyboardEvent), but it's a bit weird to use the DOMmy
> KeyboardEvent in the UI process, no?

I would solve this with a new struct that contains the input to the algorithm that both event types can be be constructed from or adding a shared interface for both event types.

> 
> I think it might be better if Dana doesn't try to solve this all the way in
> the first patch, since it will involve lots of thoughtful refactoring of the
> iOS code. But there is a good bit of sharing that she /can/ do; e.g.
> `unitVector` like you said, also the code to fill out a KeyboardScroll
> instance once you have a ScrollGranularity+ScrollDirection.

Yeah, let's do what sharing we can. Free functions on the platform types will go a long way.

-- 
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/ef2e85db/attachment-0001.htm>


More information about the webkit-unassigned mailing list