Bug 99933 - Factor stylesheet invalidation analysis code into a class
Summary: Factor stylesheet invalidation analysis code into a class
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-21 07:38 PDT by Antti Koivisto
Modified: 2012-10-21 15:04 PDT (History)
8 users (show)

See Also:


Attachments
patch (36.59 KB, patch)
2012-10-21 07:43 PDT, Antti Koivisto
sam: 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 2012-10-21 07:38:26 PDT
Currently the code is all over the place. It should be factored into a class to make further progress easier.
Comment 1 Antti Koivisto 2012-10-21 07:43:22 PDT
Created attachment 169798 [details]
patch
Comment 2 Sam Weinig 2012-10-21 14:12:43 PDT
Comment on attachment 169798 [details]
patch

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

> Source/WebCore/css/StyleInvalidationAnalysis.h:30
> +#include <wtf/OwnPtr.h>

OwnPtr is unused in the header (though PassOwnPtr is).
Comment 3 Sam Weinig 2012-10-21 14:13:19 PDT
Comment on attachment 169798 [details]
patch

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

> Source/WebCore/dom/DocumentStyleSheetCollection.cpp:406
> +    OwnPtr<StyleInvalidationAnalysis> invalidationAnalysis = StyleInvalidationAnalysis::create(addedSheets);
> +    if (invalidationAnalysis->dirtiesAllStyle())
> +        return;
> +    invalidationAnalysis->invalidateStyle(m_document);

Could we create the StyleInvalidationAnalysis on the stack?
Comment 4 Antti Koivisto 2012-10-21 14:40:44 PDT
(In reply to comment #3)
> Could we create the StyleInvalidationAnalysis on the stack?

We could but I was sort of considering caching it later. Doesn't make any meaningful difference in terms of performance.
Comment 5 Antti Koivisto 2012-10-21 15:03:53 PDT
http://trac.webkit.org/changeset/132009

(with stack allocated analysis object)