Currently the code is all over the place. It should be factored into a class to make further progress easier.
Created attachment 169798 [details] patch
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 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?
(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.
http://trac.webkit.org/changeset/132009 (with stack allocated analysis object)