Bug 86651

Summary: FrameView::scrollContentsFastPath should use painted area to determine whether to drop out of the fast path
Product: WebKit Reporter: Tim Horton <thorton>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, benjamin, enne, manyoso, simon.fraser, tonikitoo
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch simon.fraser: review+

Description Tim Horton 2012-05-16 10:23:40 PDT
<rdar://problem/11459243>

FrameView::scrollContentsFastPath has a fixedObjectThreshold of 5: if there are more than 5 fixed-positioning elements on the page, it will fall out of the fast (blit) path and repaint everything.

This doesn't make sense - causing repaints of the whole page just because someone used 5 (or 10, or whatever) tiny fixed-position elements is wasteful (and vice versa, blitting the whole window and then just going ahead and redrawing it all because someone used only one enormous fixed-position element also doesn't make sense).

We can make trivial use of regions and threshold based on percentage of the view that will need to be repainted by fixed-position elements.

I've tested a few different thresholds with an internal test; 50% seems to work relatively well, but the ideal value is hard to determine and likely depends on hardware.

I have a patch.
Comment 1 Tim Horton 2012-05-16 10:29:48 PDT
Created attachment 142292 [details]
patch
Comment 2 Tim Horton 2012-05-16 11:41:47 PDT
http://trac.webkit.org/changeset/117313
Comment 3 Adrienne Walker 2012-05-16 12:23:10 PDT
Ooh, that's excellent.  That seems like a much better heuristic.