Bug 56890 - It is possible to calculate a NaN value for "value" in ScrollbarThemeMac::paint()
Summary: It is possible to calculate a NaN value for "value" in ScrollbarThemeMac::pai...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Beth Dakin
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-03-22 19:16 PDT by Beth Dakin
Modified: 2011-03-22 20:16 PDT (History)
1 user (show)

See Also:


Attachments
Patch (1.49 KB, patch)
2011-03-22 19:19 PDT, Beth Dakin
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Beth Dakin 2011-03-22 19:16:38 PDT
In ScrollbarThemeMac::paint() the following code can result in value being NaN, which is not great:

else {
    // Within the bounds of the scrollable area.
    value = scrollbar->currentPos() / scrollbar->maximum();
}

Patch forthcoming.

<rdar://problem/9160621>
Comment 1 Beth Dakin 2011-03-22 19:19:51 PDT
Created attachment 86561 [details]
Patch
Comment 2 Sam Weinig 2011-03-22 19:43:42 PDT
Comment on attachment 86561 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=86561&action=review

> Source/WebCore/platform/mac/ScrollbarThemeMac.mm:445
> +        if (max > 0)
> +            value = scrollbar->currentPos() / max;

I think the whole word maximum here would be better.
Comment 3 Beth Dakin 2011-03-22 20:16:59 PDT
Fixed with revision 81745. Thanks, Sam!