Bug 11749 - ScrollBar::setProportion() calls updateThumbProportion() unnecessarily
Summary: ScrollBar::setProportion() calls updateThumbProportion() unnecessarily
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 420+
Hardware: PC All
: P2 Normal
Assignee: Don Gibson
URL: http://mlb.mlb.com
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-04 15:00 PST by Don Gibson
Modified: 2006-12-07 16:23 PST (History)
0 users

See Also:


Attachments
patch v1 (1.01 KB, patch)
2006-12-04 15:10 PST, Don Gibson
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Don Gibson 2006-12-04 15:00:43 PST
setProportion() blindly calls updateThumbProportion() even when nothing has changed.  Depending on how platforms implement updateThumbProportion(), this can lead to anything from too much work to infinite loops.

Rather than force updateThumbProportion() to realize when the proportion has not been updated, we should just make setProportion() be like setPosition() and do nothing when appropriate.

Patch coming shortly.
Comment 1 Don Gibson 2006-12-04 15:10:47 PST
Created attachment 11731 [details]
patch v1

The simplest possible fix.  I could have made setProportion() return a bool (like setPosition() does) or check that its arguments were positive, but I didn't have a particular reason to do so.
Comment 2 Alexey Proskuryakov 2006-12-05 01:13:50 PST
(In reply to comment #0)
> Depending on how platforms implement updateThumbProportion(), this
> can lead to anything from too much work to infinite loops.

Sounds like this fix needs a layout test then (especially if the latter is the Windows behavior). Is it possible to make one?
Comment 3 Darin Adler 2006-12-07 15:42:03 PST
Comment on attachment 11731 [details]
patch v1

Looks fine, r=me.
Comment 4 Mark Rowe (bdash) 2006-12-07 16:23:06 PST
Landed in r18066.