Bug 57886 - Defer repaints during style recalc
Summary: Defer repaints during style recalc
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: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-05 14:52 PDT by Antti Koivisto
Modified: 2011-04-05 15:30 PDT (History)
0 users

See Also:


Attachments
patch (1.90 KB, patch)
2011-04-05 14:59 PDT, Antti Koivisto
darin: 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 2011-04-05 14:52:24 PDT
We can reduce time spent invalidating system painting surface by deferring repaints in Document::recalcStyle(). We already do this for layouts.
Comment 1 Antti Koivisto 2011-04-05 14:52:39 PDT
<rdar://problem/9192489>
Comment 2 Antti Koivisto 2011-04-05 14:59:28 PDT
Created attachment 88312 [details]
patch
Comment 3 Darin Adler 2011-04-05 15:02:24 PDT
Comment on attachment 88312 [details]
patch

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

> Source/WebCore/dom/Document.cpp:1566
> -    if (view())
> -        view()->resumeScheduledEvents();
> +    if (frameView) {

Is there any change that view() could become 0 during the process of style recalculation?
Comment 4 Darin Adler 2011-04-05 15:02:58 PDT
Comment on attachment 88312 [details]
patch

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

>> Source/WebCore/dom/Document.cpp:1566
>> +    if (frameView) {
> 
> Is there any change that view() could become 0 during the process of style recalculation?

chance, not change

> Source/WebCore/dom/Document.cpp:1568
> +        frameView->endDeferredRepaints();

Is there any chance that repaints were already deferred and we are ending the deferral too soon?
Comment 5 Antti Koivisto 2011-04-05 15:10:59 PDT
(In reply to comment #4)
> > Is there any change that view() could become 0 during the process of style recalculation?

That would probably indicate bug elsewhere

Nevertheless, I switched to a protected pointer:

RefPtr<FrameView> frameView = view();

> > Source/WebCore/dom/Document.cpp:1568
> > +        frameView->endDeferredRepaints();
> 
> Is there any chance that repaints were already deferred and we are ending the deferral too soon?

begin/endDeferredRepaints are counting.
Comment 6 Antti Koivisto 2011-04-05 15:30:00 PDT
http://trac.webkit.org/changeset/82992