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

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

Issue 87503003: Moving fontSelector from StyleResolver to StyleEngine. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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/FontFaceSet.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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 // FIXME: This only has 5 callers and should be removed. Callers should be e xplicit about 136 // FIXME: This only has 5 callers and should be removed. Callers should be e xplicit about
137 // their dependency on Document* instead of grabbing one through StyleResolv er. 137 // their dependency on Document* instead of grabbing one through StyleResolv er.
138 Document& document() { return m_document; } 138 Document& document() { return m_document; }
139 139
140 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte r we factor StyleResolver further. 140 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte r we factor StyleResolver further.
141 // https://bugs.webkit.org/show_bug.cgi?id=108890 141 // https://bugs.webkit.org/show_bug.cgi?id=108890
142 void appendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSStyle Sheet> >&); 142 void appendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSStyle Sheet> >&);
143 void resetAuthorStyle(const ContainerNode*); 143 void resetAuthorStyle(const ContainerNode*);
144 void finishAppendAuthorStyleSheets(); 144 void finishAppendAuthorStyleSheets();
145 void resetFontSelector();
146 145
147 TreeBoundaryCrossingRules& treeBoundaryCrossingRules() { return m_treeBounda ryCrossingRules; } 146 TreeBoundaryCrossingRules& treeBoundaryCrossingRules() { return m_treeBounda ryCrossingRules; }
148 void processScopedRules(const RuleSet& authorRules, const KURL&, ContainerNo de* scope = 0); 147 void processScopedRules(const RuleSet& authorRules, const KURL&, ContainerNo de* scope = 0);
149 148
150 void lazyAppendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSS tyleSheet> >&); 149 void lazyAppendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSS tyleSheet> >&);
151 void removePendingAuthorStyleSheets(const Vector<RefPtr<CSSStyleSheet> >&); 150 void removePendingAuthorStyleSheets(const Vector<RefPtr<CSSStyleSheet> >&);
152 void appendPendingAuthorStyleSheets(); 151 void appendPendingAuthorStyleSheets();
153 bool hasPendingAuthorStyleSheets() const { return m_pendingStyleSheets.size( ) > 0 || m_needCollectFeatures; } 152 bool hasPendingAuthorStyleSheets() const { return m_pendingStyleSheets.size( ) > 0 || m_needCollectFeatures; }
154 153
155 SelectorFilter& selectorFilter() { return m_selectorFilter; } 154 SelectorFilter& selectorFilter() { return m_selectorFilter; }
(...skipping 23 matching lines...) Expand all
179 AllButEmptyCSSRules = UAAndUserCSSRules | AuthorCSSRules | CrossOriginCS SRules, 178 AllButEmptyCSSRules = UAAndUserCSSRules | AuthorCSSRules | CrossOriginCS SRules,
180 AllCSSRules = AllButEmptyCSSRules | EmptyCSSRules, 179 AllCSSRules = AllButEmptyCSSRules | EmptyCSSRules,
181 }; 180 };
182 PassRefPtr<CSSRuleList> cssRulesForElement(Element*, unsigned rulesToInclude = AllButEmptyCSSRules, ShouldIncludeStyleSheetInCSSOMWrapper = IncludeStyleShee tInCSSOMWrapper); 181 PassRefPtr<CSSRuleList> cssRulesForElement(Element*, unsigned rulesToInclude = AllButEmptyCSSRules, ShouldIncludeStyleSheetInCSSOMWrapper = IncludeStyleShee tInCSSOMWrapper);
183 PassRefPtr<CSSRuleList> pseudoCSSRulesForElement(Element*, PseudoId, unsigne d rulesToInclude = AllButEmptyCSSRules, ShouldIncludeStyleSheetInCSSOMWrapper = IncludeStyleSheetInCSSOMWrapper); 182 PassRefPtr<CSSRuleList> pseudoCSSRulesForElement(Element*, PseudoId, unsigne d rulesToInclude = AllButEmptyCSSRules, ShouldIncludeStyleSheetInCSSOMWrapper = IncludeStyleSheetInCSSOMWrapper);
184 PassRefPtr<StyleRuleList> styleRulesForElement(Element*, unsigned rulesToInc lude); 183 PassRefPtr<StyleRuleList> styleRulesForElement(Element*, unsigned rulesToInc lude);
185 184
186 // |properties| is an array with |count| elements. 185 // |properties| is an array with |count| elements.
187 void applyPropertiesToStyle(const CSSPropertyValue* properties, size_t count , RenderStyle*); 186 void applyPropertiesToStyle(const CSSPropertyValue* properties, size_t count , RenderStyle*);
188 187
189 CSSFontSelector* fontSelector() const { return m_fontSelector.get(); }
190 ViewportStyleResolver* viewportStyleResolver() { return m_viewportStyleResol ver.get(); } 188 ViewportStyleResolver* viewportStyleResolver() { return m_viewportStyleResol ver.get(); }
191 189
192 void addMediaQueryResults(const MediaQueryResultList&); 190 void addMediaQueryResults(const MediaQueryResultList&);
193 MediaQueryResultList* viewportDependentMediaQueryResults() { return &m_viewp ortDependentMediaQueryResults; } 191 MediaQueryResultList* viewportDependentMediaQueryResults() { return &m_viewp ortDependentMediaQueryResults; }
194 bool hasViewportDependentMediaQueries() const { return !m_viewportDependentM ediaQueryResults.isEmpty(); } 192 bool hasViewportDependentMediaQueries() const { return !m_viewportDependentM ediaQueryResults.isEmpty(); }
195 bool affectedByViewportChange() const; 193 bool affectedByViewportChange() const;
196 194
197 // FIXME: Regions should not require special logic in StyleResolver. 195 // FIXME: Regions should not require special logic in StyleResolver.
198 bool checkRegionStyle(Element* regionElement); 196 bool checkRegionStyle(Element* regionElement);
199 197
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 MatchedPropertiesCache m_matchedPropertiesCache; 294 MatchedPropertiesCache m_matchedPropertiesCache;
297 295
298 OwnPtr<MediaQueryEvaluator> m_medium; 296 OwnPtr<MediaQueryEvaluator> m_medium;
299 MediaQueryResultList m_viewportDependentMediaQueryResults; 297 MediaQueryResultList m_viewportDependentMediaQueryResults;
300 298
301 RefPtr<RenderStyle> m_rootDefaultStyle; 299 RefPtr<RenderStyle> m_rootDefaultStyle;
302 300
303 Document& m_document; 301 Document& m_document;
304 SelectorFilter m_selectorFilter; 302 SelectorFilter m_selectorFilter;
305 303
306 RefPtr<CSSFontSelector> m_fontSelector;
307
308 RefPtr<ViewportStyleResolver> m_viewportStyleResolver; 304 RefPtr<ViewportStyleResolver> m_viewportStyleResolver;
309 305
310 ListHashSet<CSSStyleSheet*, 16> m_pendingStyleSheets; 306 ListHashSet<CSSStyleSheet*, 16> m_pendingStyleSheets;
311 307
312 ScopedStyleTree m_styleTree; 308 ScopedStyleTree m_styleTree;
313 309
314 // FIXME: The entire logic of collecting features on StyleResolver, as well astransferring them 310 // FIXME: The entire logic of collecting features on StyleResolver, as well astransferring them
315 // between various parts of machinery smells wrong. This needs to be better somehow. 311 // between various parts of machinery smells wrong. This needs to be better somehow.
316 RuleFeatureSet m_features; 312 RuleFeatureSet m_features;
317 OwnPtr<RuleSet> m_siblingRuleSet; 313 OwnPtr<RuleSet> m_siblingRuleSet;
(...skipping 28 matching lines...) Expand all
346 SelectorChecker::SelectorCheckingContext selectorCheckingContext(s, regi onElement, SelectorChecker::VisitedMatchDisabled); 342 SelectorChecker::SelectorCheckingContext selectorCheckingContext(s, regi onElement, SelectorChecker::VisitedMatchDisabled);
347 if (selectorChecker.match(selectorCheckingContext, DOMSiblingTraversalSt rategy()) == SelectorChecker::SelectorMatches) 343 if (selectorChecker.match(selectorCheckingContext, DOMSiblingTraversalSt rategy()) == SelectorChecker::SelectorMatches)
348 return true; 344 return true;
349 } 345 }
350 return false; 346 return false;
351 } 347 }
352 348
353 } // namespace WebCore 349 } // namespace WebCore
354 350
355 #endif // StyleResolver_h 351 #endif // StyleResolver_h
OLDNEW
« no previous file with comments | « Source/core/css/FontFaceSet.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698