Bug 76376 - CSSStyleSelector: Factor 'isCacheable' flag out of MatchedResult.
Summary: CSSStyleSelector: Factor 'isCacheable' flag out of MatchedResult.
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
Depends on:
Reported: 2012-01-16 04:39 PST by Andreas Kling
Modified: 2012-01-19 13:17 PST (History)
4 users (show)

See Also:

Patch (8.75 KB, patch)
2012-01-16 04:49 PST, Andreas Kling
koivisto: review-
Details | Formatted Diff | Diff
Patch v2 (Special Anttified Edition) (13.95 KB, patch)
2012-01-19 11:39 PST, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2012-01-16 04:39:17 PST
We can shrink the matched declaration cache by getting rid of the 'isCacheable' bit.
Comment 1 Andreas Kling 2012-01-16 04:49:45 PST
Created attachment 122617 [details]
Comment 2 Antti Koivisto 2012-01-16 07:28:49 PST
Comment on attachment 122617 [details]

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

> Source/WebCore/css/CSSStyleSelector.cpp:821
> +void CSSStyleSelector::matchAllRules(MatchResult& result, bool& resultIsCacheable)

I think I would prefer keeping everything in the MatchResult and instead factoring the ranges out to a separate struct that can be used in the matched declaration cache (instead of the full MatchResult).
Comment 3 Antti Koivisto 2012-01-16 07:30:10 PST
If we want to add more context later we will be able to do it cleanly without adding even more function arguments in the future.
Comment 4 Andreas Kling 2012-01-19 11:39:30 PST
Created attachment 123158 [details]
Patch v2 (Special Anttified Edition)
Comment 5 Antti Koivisto 2012-01-19 11:46:12 PST
Comment on attachment 123158 [details]
Patch v2 (Special Anttified Edition)

Comment 6 Andreas Kling 2012-01-19 12:32:29 PST
Comment on attachment 123158 [details]
Patch v2 (Special Anttified Edition)

Clearing flags on attachment: 123158

Committed r105435: <http://trac.webkit.org/changeset/105435>
Comment 7 Andreas Kling 2012-01-19 12:32:37 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Csaba Osztrogonác 2012-01-19 13:05:51 PST
Reopen, because it broke the debug build on Qt. Could you fix it?

../../../../Source/WebCore/css/CSSStyleSelector.cpp: In member function ‘const WebCore::CSSStyleSelector::MatchedStyleDeclarationCacheItem* WebCore::CSSStyleSelector::findFromMatchedDeclarationCache(unsigned int, const WebCore::CSSStyleSelector::MatchResult&)’:
../../../../Source/WebCore/css/CSSStyleSelector.cpp:2368: error: ‘struct WebCore::CSSStyleSelector::MatchedStyleDeclarationCacheItem’ has no member named ‘matchResult’
Comment 9 Andreas Kling 2012-01-19 13:17:40 PST
Debug build fixed by <http://trac.webkit.org/changeset/105440>.