Bug 24359 - Repaint throttling mechanism
Summary: Repaint throttling mechanism
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2009-03-04 10:28 PST by Antti Koivisto
Modified: 2009-03-04 14:01 PST (History)
3 users (show)

See Also:

patch (12.83 KB, patch)
2009-03-04 10:36 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
some cleanups (12.98 KB, patch)
2009-03-04 13:20 PST, Antti Koivisto
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2009-03-04 10:28:23 PST
Excessive repainting can slow down page loading/
Comment 1 Antti Koivisto 2009-03-04 10:36:11 PST
Created attachment 28273 [details]

This patch has the feature enabled and bunch of debugging printfs
Comment 2 Dave Hyatt 2009-03-04 11:37:52 PST
This looks pretty cool.  The biggest issue is just catching all of the things that should not be throttled.  You caught user events, but I think you need to catch all the ways a page can animate on its own as well.  These include:

CSS Animations and Transitions
Animated GIFs

We have to make sure none of the situations where a page paints itself because of animations end up getting throttled.

Comment 3 Dave Hyatt 2009-03-04 11:38:44 PST
Oh, <video> also.  <video> shouldn't be throttled while painting either.

Comment 4 Dave Hyatt 2009-03-04 11:40:02 PST

Comment 5 Antti Koivisto 2009-03-04 13:20:44 PST
Created attachment 28281 [details]
some cleanups

I agree that a desktop targeted version of this should prefer smooth animations over reduces repaints. On slower CPUs the balance is different.

This patch does not enable the delays by default.
Comment 6 Dave Hyatt 2009-03-04 13:29:00 PST
Comment on attachment 28281 [details]
some cleanups

This looks fine to me.  Can you maybe add a FIXME comment (similar to what you said in the bug) to the place where the constants are defined that this is primarily for mobile devices now, and that we might want to consider a version for the desktop that doesn't throttle animations?

Comment 7 Antti Koivisto 2009-03-04 14:01:59 PST
Sending        JavaScriptCore/ChangeLog
Sending        JavaScriptCore/wtf/Platform.h
Sending        WebCore/ChangeLog
Sending        WebCore/loader/FrameLoader.cpp
Sending        WebCore/page/EventHandler.cpp
Sending        WebCore/page/FrameView.cpp
Sending        WebCore/page/FrameView.h
Transmitting file data .......
Committed revision 41431.