Summary: | [wx] Use PlatformWheelEvent for handling scroll wheel events | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Kevin Ollivier <kevino> | ||||||
Component: | WebKit wx | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | Keywords: | Wx | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Kevin Ollivier
2008-02-04 16:43:16 PST
Created attachment 18923 [details]
Correctly handle PlatformWheelEvent in wx port
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?
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 on attachment 18951 [details]
Updated patch with ASSERTS added to ensure widths and heights are valid
r=me
|