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

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

Issue 579253002: Change StyleResolver::document() to be private (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 static PassRefPtrWillBeRawPtr<AnimatableValue> createAnimatableValueSnapshot (StyleResolverState&, CSSPropertyID, CSSValue&); 111 static PassRefPtrWillBeRawPtr<AnimatableValue> createAnimatableValueSnapshot (StyleResolverState&, CSSPropertyID, CSSValue&);
112 112
113 PassRefPtr<RenderStyle> pseudoStyleForElement(Element*, const PseudoStyleReq uest&, RenderStyle* parentStyle); 113 PassRefPtr<RenderStyle> pseudoStyleForElement(Element*, const PseudoStyleReq uest&, RenderStyle* parentStyle);
114 114
115 PassRefPtr<RenderStyle> styleForPage(int pageIndex); 115 PassRefPtr<RenderStyle> styleForPage(int pageIndex);
116 PassRefPtr<RenderStyle> defaultStyleForElement(); 116 PassRefPtr<RenderStyle> defaultStyleForElement();
117 PassRefPtr<RenderStyle> styleForText(Text*); 117 PassRefPtr<RenderStyle> styleForText(Text*);
118 118
119 static PassRefPtr<RenderStyle> styleForDocument(Document&); 119 static PassRefPtr<RenderStyle> styleForDocument(Document&);
120 120
121 // FIXME: This only has 5 callers and should be removed. Callers should be e xplicit about
122 // their dependency on Document* instead of grabbing one through StyleResolv er.
123 Document& document() { return *m_document; }
124
125 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte r we factor StyleResolver further. 121 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte r we factor StyleResolver further.
126 // https://bugs.webkit.org/show_bug.cgi?id=108890 122 // https://bugs.webkit.org/show_bug.cgi?id=108890
127 void appendAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSSt yleSheet> >&); 123 void appendAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMember<CSSSt yleSheet> >&);
128 void resetAuthorStyle(TreeScope&); 124 void resetAuthorStyle(TreeScope&);
129 void finishAppendAuthorStyleSheets(); 125 void finishAppendAuthorStyleSheets();
130 126
131 void processScopedRules(const RuleSet& authorRules, CSSStyleSheet*, unsigned sheetIndex, ContainerNode& scope); 127 void processScopedRules(const RuleSet& authorRules, CSSStyleSheet*, unsigned sheetIndex, ContainerNode& scope);
132 128
133 void lazyAppendAuthorStyleSheets(unsigned firstNew, const WillBeHeapVector<R efPtrWillBeMember<CSSStyleSheet> >&); 129 void lazyAppendAuthorStyleSheets(unsigned firstNew, const WillBeHeapVector<R efPtrWillBeMember<CSSStyleSheet> >&);
134 void removePendingAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMembe r<CSSStyleSheet> >&); 130 void removePendingAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMembe r<CSSStyleSheet> >&);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 private: 205 private:
210 void initWatchedSelectorRules(const WillBeHeapVector<RefPtrWillBeMember<Styl eRule> >& watchedSelectors); 206 void initWatchedSelectorRules(const WillBeHeapVector<RefPtrWillBeMember<Styl eRule> >& watchedSelectors);
211 207
212 // FIXME: This should probably go away, folded into FontBuilder. 208 // FIXME: This should probably go away, folded into FontBuilder.
213 void updateFont(StyleResolverState&); 209 void updateFont(StyleResolverState&);
214 210
215 void loadPendingResources(StyleResolverState&); 211 void loadPendingResources(StyleResolverState&);
216 void adjustRenderStyle(StyleResolverState&, Element*); 212 void adjustRenderStyle(StyleResolverState&, Element*);
217 213
218 void appendCSSStyleSheet(CSSStyleSheet*); 214 void appendCSSStyleSheet(CSSStyleSheet*);
215 void addRulesFromSheet(CSSStyleSheet*, TreeScope*, unsigned);
219 216
220 void collectPseudoRulesForElement(Element*, ElementRuleCollector&, PseudoId, unsigned rulesToInclude); 217 void collectPseudoRulesForElement(Element*, ElementRuleCollector&, PseudoId, unsigned rulesToInclude);
221 void matchUARules(ElementRuleCollector&, RuleSet*); 218 void matchUARules(ElementRuleCollector&, RuleSet*);
222 void matchAuthorRules(Element*, ElementRuleCollector&, bool includeEmptyRule s); 219 void matchAuthorRules(Element*, ElementRuleCollector&, bool includeEmptyRule s);
223 void matchAuthorRulesForShadowHost(Element*, ElementRuleCollector&, bool inc ludeEmptyRules, WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8>& re solvers, WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8>& resolvers InShadowTree); 220 void matchAuthorRulesForShadowHost(Element*, ElementRuleCollector&, bool inc ludeEmptyRules, WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8>& re solvers, WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8>& resolvers InShadowTree);
224 void matchAllRules(StyleResolverState&, ElementRuleCollector&, bool includeS MILProperties); 221 void matchAllRules(StyleResolverState&, ElementRuleCollector&, bool includeS MILProperties);
225 void matchUARules(ElementRuleCollector&); 222 void matchUARules(ElementRuleCollector&);
226 void collectFeatures(); 223 void collectFeatures();
227 void resetRuleFeatures(); 224 void resetRuleFeatures();
228 225
(...skipping 29 matching lines...) Expand all
258 void matchPageRulesForList(WillBeHeapVector<RawPtrWillBeMember<StyleRulePage > >& matchedRules, const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage> >&, bool isLeftPage, bool isFirstPage, const String& pageName); 255 void matchPageRulesForList(WillBeHeapVector<RawPtrWillBeMember<StyleRulePage > >& matchedRules, const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage> >&, bool isLeftPage, bool isFirstPage, const String& pageName);
259 void collectViewportRules(); 256 void collectViewportRules();
260 257
261 bool isLeftPage(int pageIndex) const; 258 bool isLeftPage(int pageIndex) const;
262 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); } 259 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); }
263 bool isFirstPage(int pageIndex) const; 260 bool isFirstPage(int pageIndex) const;
264 String pageName(int pageIndex) const; 261 String pageName(int pageIndex) const;
265 262
266 bool pseudoStyleForElementInternal(Element&, const PseudoStyleRequest&, Rend erStyle* parentStyle, StyleResolverState&); 263 bool pseudoStyleForElementInternal(Element&, const PseudoStyleRequest&, Rend erStyle* parentStyle, StyleResolverState&);
267 264
265 Document& document() { return *m_document; }
266
268 // FIXME: This likely belongs on RuleSet. 267 // FIXME: This likely belongs on RuleSet.
269 typedef WillBeHeapHashMap<StringImpl*, RefPtrWillBeMember<StyleRuleKeyframes > > KeyframesRuleMap; 268 typedef WillBeHeapHashMap<StringImpl*, RefPtrWillBeMember<StyleRuleKeyframes > > KeyframesRuleMap;
270 KeyframesRuleMap m_keyframesRuleMap; 269 KeyframesRuleMap m_keyframesRuleMap;
271 270
272 static RenderStyle* s_styleNotYetAvailable; 271 static RenderStyle* s_styleNotYetAvailable;
273 272
274 void cacheBorderAndBackground(); 273 void cacheBorderAndBackground();
275 274
276 MatchedPropertiesCache m_matchedPropertiesCache; 275 MatchedPropertiesCache m_matchedPropertiesCache;
277 276
(...skipping 27 matching lines...) Expand all
305 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; 304 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals;
306 unsigned m_styleResolverStatsSequence; 305 unsigned m_styleResolverStatsSequence;
307 306
308 // Use only for Internals::updateStyleAndReturnAffectedElementCount. 307 // Use only for Internals::updateStyleAndReturnAffectedElementCount.
309 unsigned m_accessCount; 308 unsigned m_accessCount;
310 }; 309 };
311 310
312 } // namespace blink 311 } // namespace blink
313 312
314 #endif // StyleResolver_h 313 #endif // StyleResolver_h
OLDNEW
« no previous file with comments | « Source/core/css/resolver/ScopedStyleResolver.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698