Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: Source/core/css/resolver/StyleResolver.h

Issue 192473003: Move CSSRuleList to the garbage collected heap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ager feedback Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/StyleSheetList.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 19 matching lines...) Expand all
30 #include "core/css/SelectorChecker.h" 30 #include "core/css/SelectorChecker.h"
31 #include "core/css/SelectorFilter.h" 31 #include "core/css/SelectorFilter.h"
32 #include "core/css/SiblingTraversalStrategies.h" 32 #include "core/css/SiblingTraversalStrategies.h"
33 #include "core/css/TreeBoundaryCrossingRules.h" 33 #include "core/css/TreeBoundaryCrossingRules.h"
34 #include "core/css/resolver/MatchedPropertiesCache.h" 34 #include "core/css/resolver/MatchedPropertiesCache.h"
35 #include "core/css/resolver/ScopedStyleResolver.h" 35 #include "core/css/resolver/ScopedStyleResolver.h"
36 #include "core/css/resolver/ScopedStyleTree.h" 36 #include "core/css/resolver/ScopedStyleTree.h"
37 #include "core/css/resolver/StyleBuilder.h" 37 #include "core/css/resolver/StyleBuilder.h"
38 #include "core/css/resolver/StyleResolverState.h" 38 #include "core/css/resolver/StyleResolverState.h"
39 #include "core/css/resolver/StyleResourceLoader.h" 39 #include "core/css/resolver/StyleResourceLoader.h"
40 #include "heap/Handle.h"
40 #include "wtf/Deque.h" 41 #include "wtf/Deque.h"
41 #include "wtf/HashMap.h" 42 #include "wtf/HashMap.h"
42 #include "wtf/HashSet.h" 43 #include "wtf/HashSet.h"
43 #include "wtf/ListHashSet.h" 44 #include "wtf/ListHashSet.h"
44 #include "wtf/RefPtr.h" 45 #include "wtf/RefPtr.h"
45 #include "wtf/Vector.h" 46 #include "wtf/Vector.h"
46 47
47 namespace WebCore { 48 namespace WebCore {
48 49
49 class CSSAnimationUpdate; 50 class CSSAnimationUpdate;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 PassRefPtr<RenderStyle> styleForText(Text*); 131 PassRefPtr<RenderStyle> styleForText(Text*);
131 132
132 static PassRefPtr<RenderStyle> styleForDocument(Document&, CSSFontSelector* = 0); 133 static PassRefPtr<RenderStyle> styleForDocument(Document&, CSSFontSelector* = 0);
133 134
134 // FIXME: This only has 5 callers and should be removed. Callers should be e xplicit about 135 // FIXME: This only has 5 callers and should be removed. Callers should be e xplicit about
135 // their dependency on Document* instead of grabbing one through StyleResolv er. 136 // their dependency on Document* instead of grabbing one through StyleResolv er.
136 Document& document() { return m_document; } 137 Document& document() { return m_document; }
137 138
138 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte r we factor StyleResolver further. 139 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte r we factor StyleResolver further.
139 // https://bugs.webkit.org/show_bug.cgi?id=108890 140 // https://bugs.webkit.org/show_bug.cgi?id=108890
140 void appendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSStyle Sheet> >&); 141 void appendAuthorStyleSheets(unsigned firstNew, const WillBeHeapVector<RefPt rWillBeMember<CSSStyleSheet> >&);
141 void resetAuthorStyle(const ContainerNode*); 142 void resetAuthorStyle(const ContainerNode*);
142 void finishAppendAuthorStyleSheets(); 143 void finishAppendAuthorStyleSheets();
143 144
144 TreeBoundaryCrossingRules& treeBoundaryCrossingRules() { return m_treeBounda ryCrossingRules; } 145 TreeBoundaryCrossingRules& treeBoundaryCrossingRules() { return m_treeBounda ryCrossingRules; }
145 void processScopedRules(const RuleSet& authorRules, const KURL&, ContainerNo de* scope = 0); 146 void processScopedRules(const RuleSet& authorRules, const KURL&, ContainerNo de* scope = 0);
146 147
147 void lazyAppendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSS tyleSheet> >&); 148 void lazyAppendAuthorStyleSheets(unsigned firstNew, const WillBeHeapVector<R efPtrWillBeMember<CSSStyleSheet> >&);
148 void removePendingAuthorStyleSheets(const Vector<RefPtr<CSSStyleSheet> >&); 149 void removePendingAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMembe r<CSSStyleSheet> >&);
149 void appendPendingAuthorStyleSheets(); 150 void appendPendingAuthorStyleSheets();
150 bool hasPendingAuthorStyleSheets() const { return m_pendingStyleSheets.size( ) > 0 || m_needCollectFeatures; } 151 bool hasPendingAuthorStyleSheets() const { return m_pendingStyleSheets.size( ) > 0 || m_needCollectFeatures; }
151 152
152 SelectorFilter& selectorFilter() { return m_selectorFilter; } 153 SelectorFilter& selectorFilter() { return m_selectorFilter; }
153 154
154 void setBuildScopedStyleTreeInDocumentOrder(bool enabled) { m_styleTree.setB uildInDocumentOrder(enabled); } 155 void setBuildScopedStyleTreeInDocumentOrder(bool enabled) { m_styleTree.setB uildInDocumentOrder(enabled); }
155 bool buildScopedStyleTreeInDocumentOrder() const { return m_styleTree.buildI nDocumentOrder(); } 156 bool buildScopedStyleTreeInDocumentOrder() const { return m_styleTree.buildI nDocumentOrder(); }
156 bool styleTreeHasOnlyScopedResolverForDocument() const { return m_styleTree. hasOnlyScopedResolverForDocument(); } 157 bool styleTreeHasOnlyScopedResolverForDocument() const { return m_styleTree. hasOnlyScopedResolverForDocument(); }
157 ScopedStyleResolver* styleTreeScopedStyleResolverForDocument() const { retur n m_styleTree.scopedStyleResolverForDocument(); } 158 ScopedStyleResolver* styleTreeScopedStyleResolverForDocument() const { retur n m_styleTree.scopedStyleResolverForDocument(); }
158 159
(...skipping 10 matching lines...) Expand all
169 170
170 // These methods will give back the set of rules that matched for a given el ement (or a pseudo-element). 171 // These methods will give back the set of rules that matched for a given el ement (or a pseudo-element).
171 enum CSSRuleFilter { 172 enum CSSRuleFilter {
172 UAAndUserCSSRules = 1 << 1, 173 UAAndUserCSSRules = 1 << 1,
173 AuthorCSSRules = 1 << 2, 174 AuthorCSSRules = 1 << 2,
174 EmptyCSSRules = 1 << 3, 175 EmptyCSSRules = 1 << 3,
175 CrossOriginCSSRules = 1 << 4, 176 CrossOriginCSSRules = 1 << 4,
176 AllButEmptyCSSRules = UAAndUserCSSRules | AuthorCSSRules | CrossOriginCS SRules, 177 AllButEmptyCSSRules = UAAndUserCSSRules | AuthorCSSRules | CrossOriginCS SRules,
177 AllCSSRules = AllButEmptyCSSRules | EmptyCSSRules, 178 AllCSSRules = AllButEmptyCSSRules | EmptyCSSRules,
178 }; 179 };
179 PassRefPtr<CSSRuleList> cssRulesForElement(Element*, unsigned rulesToInclude = AllButEmptyCSSRules); 180 PassRefPtrWillBeRawPtr<CSSRuleList> cssRulesForElement(Element*, unsigned ru lesToInclude = AllButEmptyCSSRules);
180 PassRefPtr<CSSRuleList> pseudoCSSRulesForElement(Element*, PseudoId, unsigne d rulesToInclude = AllButEmptyCSSRules); 181 PassRefPtrWillBeRawPtr<CSSRuleList> pseudoCSSRulesForElement(Element*, Pseud oId, unsigned rulesToInclude = AllButEmptyCSSRules);
181 PassRefPtr<StyleRuleList> styleRulesForElement(Element*, unsigned rulesToInc lude); 182 PassRefPtr<StyleRuleList> styleRulesForElement(Element*, unsigned rulesToInc lude);
182 183
183 // |properties| is an array with |count| elements. 184 // |properties| is an array with |count| elements.
184 void applyPropertiesToStyle(const CSSPropertyValue* properties, size_t count , RenderStyle*); 185 void applyPropertiesToStyle(const CSSPropertyValue* properties, size_t count , RenderStyle*);
185 186
186 ViewportStyleResolver* viewportStyleResolver() { return m_viewportStyleResol ver.get(); } 187 ViewportStyleResolver* viewportStyleResolver() { return m_viewportStyleResol ver.get(); }
187 188
188 void addMediaQueryResults(const MediaQueryResultList&); 189 void addMediaQueryResults(const MediaQueryResultList&);
189 MediaQueryResultList* viewportDependentMediaQueryResults() { return &m_viewp ortDependentMediaQueryResults; } 190 MediaQueryResultList* viewportDependentMediaQueryResults() { return &m_viewp ortDependentMediaQueryResults; }
190 bool hasViewportDependentMediaQueries() const { return !m_viewportDependentM ediaQueryResults.isEmpty(); } 191 bool hasViewportDependentMediaQueries() const { return !m_viewportDependentM ediaQueryResults.isEmpty(); }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; 325 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals;
325 unsigned m_styleResolverStatsSequence; 326 unsigned m_styleResolverStatsSequence;
326 327
327 // Use only for Internals::updateStyleAndReturnAffectedElementCount. 328 // Use only for Internals::updateStyleAndReturnAffectedElementCount.
328 unsigned m_accessCount; 329 unsigned m_accessCount;
329 }; 330 };
330 331
331 } // namespace WebCore 332 } // namespace WebCore
332 333
333 #endif // StyleResolver_h 334 #endif // StyleResolver_h
OLDNEW
« no previous file with comments | « Source/core/css/StyleSheetList.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698