[Webkit-unassigned] [Bug 135244] Let WheelEvent wrap a PlatformWheelEvent

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 28 00:00:38 PDT 2014


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





--- Comment #16 from Wenson Hsieh <wenson_hsieh at apple.com>  2014-07-28 00:00:47 PST ---
(From update of attachment 235567)
View in context: https://bugs.webkit.org/attachment.cgi?id=235567&action=review

Thank you for the review! I'll put up a new version very soon.

>> Source/WebCore/dom/WheelEvent.cpp:53
>> +    , m_wheelEvent(PlatformWheelEvent())
> 
> No need to include this. This is what happens if you don’t explicitly initialize m_wheelEvent, so you should just omit this line.

Good catch -- thanks!

>> Source/WebCore/dom/WheelEvent.cpp:65
>> +    , m_wheelEvent(PlatformWheelEvent())
> 
> No need to include this. This is what happens if you don’t explicitly initialize m_wheelEvent, so you should just omit this line.

Fixed.

>> Source/WebCore/dom/WheelEvent.h:81
>> +    const PlatformWheelEvent* wheelEvent() const { return m_initializedWithPlatformWheelEvent ? &m_wheelEvent : nullptr; }
> 
> This comment is not needed if we put the implementation inline like this, since the code says the same thing the comment does.
> 
> But also, I am not convinced this boolean and null pointer technique is the right way to achieve what you want to achieve. Since this patch doesn’t include the changes to code that uses the wheelEvent() function, I can’t judge whether an alternative solution would be better, since I don’t know what problem the nullptr is trying to solve.

Got it -- I'll take out the comment. The problem I'm planning to address with this is that I need to distinguish events initialized through JavaScript (e.g. document.createEvent("WheelEvent")) that don't have corresponding PlatformWheelEvents from regular wheel events created using PlatformWheelEvent. Depending on which type the wheel event is, I take a different code path -- one code path calls ScrollableArea::scroll directly with a scroll delta, granularity, and direction, while the other code path calls ScrollableArea::handleWheelEvent with the PlatformWheelEvent. Ultimately, I need the PlatformWheelEvent's momentum phase information to implement scroll snapping on a Mac, although this information is also necessary for implementing behaviors like rubber-banding when overflow scrolling.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list