Bug 17179 - [wx] Use PlatformWheelEvent for handling scroll wheel events
Summary: [wx] Use PlatformWheelEvent for handling scroll wheel events
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit wx (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: Wx
Depends on:
Blocks:
 
Reported: 2008-02-04 16:43 PST by Kevin Ollivier
Modified: 2008-02-06 20:18 PST (History)
0 users

See Also:


Attachments
Correctly handle PlatformWheelEvent in wx port (4.53 KB, patch)
2008-02-04 16:45 PST, Kevin Ollivier
darin: review+
Details | Formatted Diff | Diff
Updated patch with ASSERTS added to ensure widths and heights are valid (5.37 KB, patch)
2008-02-05 22:13 PST, Kevin Ollivier
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!