Bug 17179

Summary: [wx] Use PlatformWheelEvent for handling scroll wheel events
Product: WebKit Reporter: Kevin Ollivier <kevino>
Component: WebKit wxAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal Keywords: Wx
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Correctly handle PlatformWheelEvent in wx port
darin: review+
Updated patch with ASSERTS added to ensure widths and heights are valid darin: review+

Description Kevin Ollivier 2008-02-04 16:43:16 PST
We currently catch and handle scroll wheel events directly, but this doesn't allow the event to go through WebCore. Instead, remove our current handler and fix ScrollView so that it properly handles the PlatformWheelEvent.
Comment 1 Kevin Ollivier 2008-02-04 16:45:50 PST
Created attachment 18923 [details]
Correctly handle PlatformWheelEvent in wx port
Comment 2 Darin Adler 2008-02-05 14:52:33 PST
Comment on attachment 18923 [details]
Correctly handle PlatformWheelEvent in wx port

Looks fine, r=me.

+IntSize ScrollView::maximumScroll() const
+{
+    IntSize delta = (IntSize(contentsWidth(), contentsHeight()) - IntSize(visibleWidth(), visibleHeight())) - scrollOffset();
+    delta.clampNegativeToZero();
+    return delta;
+}

Is there a guarantee that this can't overflow?
Comment 3 Kevin Ollivier 2008-02-05 22:13:28 PST
Created attachment 18951 [details]
Updated patch with ASSERTS added to ensure widths and heights are valid

So long as all the values are positive, there should not be any issues with overflows, but you're right that we don't guarantee anywhere that the values are positive. So I've added asserts to guard against negative x, y, width or height values. I wasn't sure if it was okay to land this without the extra review, so I've gone ahead and replaced the patch.
Comment 4 Darin Adler 2008-02-06 06:40:48 PST
Comment on attachment 18951 [details]
Updated patch with ASSERTS added to ensure widths and heights are valid

r=me
Comment 5 Kevin Ollivier 2008-02-06 20:18:20 PST
Landed in r30060. Thanks!