[Webkit-unassigned] [Bug 47320] [Performance] Only call sendContentResizeNotification when the scrollbar actually did change

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 5 23:15:33 PDT 2011


--- Comment #24 from Peter Kasting <pkasting at google.com>  2011-07-05 23:15:32 PST ---
(From update of attachment 89577)
View in context: https://bugs.webkit.org/attachment.cgi?id=89577&action=review

In theory this seems OK, but I'm not a WebKit reviewer.

> Source/WebCore/platform/ScrollView.cpp:500
>          if (hasHorizontalScrollbar != newHasHorizontalScrollbar) {

Nit: I think it might be clearer to write this block as follows:

if (hasHorizontalScrollbar != newHasHorizontalScrollbar && (hasHorizontalScrollbar || !avoidScrollbarCreation())) {
    ... original block contents here...

...and the same for the case below.  This makes it a bit clearer that we don't want to do anything in the case where we're supposed to avoid scrollbar creation.

I would also like to see setHasXXXScrollbar() converted from conditional-checking (hasBar && avoidScrollbarCreation()) into asserting that that combination is false.  Either this is safe because these are the only places which call these functions, or else your patch should probably be expanded to the other callers thereof.  In either case, making this expectation part of those functions' contracts seems clearer and safer long-term to me.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list