OLD | NEW |
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 Loading... |
135 // 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 |
136 // their dependency on Document* instead of grabbing one through StyleResolv
er. | 136 // their dependency on Document* instead of grabbing one through StyleResolv
er. |
137 Document& document() { return m_document; } | 137 Document& document() { return m_document; } |
138 | 138 |
139 // 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. |
140 // https://bugs.webkit.org/show_bug.cgi?id=108890 | 140 // https://bugs.webkit.org/show_bug.cgi?id=108890 |
141 void appendAuthorStyleSheets(unsigned firstNew, const WillBeHeapVector<RefPt
rWillBeMember<CSSStyleSheet> >&); | 141 void appendAuthorStyleSheets(unsigned firstNew, const WillBeHeapVector<RefPt
rWillBeMember<CSSStyleSheet> >&); |
142 void resetAuthorStyle(const ContainerNode*); | 142 void resetAuthorStyle(const ContainerNode*); |
143 void finishAppendAuthorStyleSheets(); | 143 void finishAppendAuthorStyleSheets(); |
144 | 144 |
145 TreeBoundaryCrossingRules& treeBoundaryCrossingRules() { return m_treeBounda
ryCrossingRules; } | 145 void processScopedRules(const RuleSet& authorRules, CSSStyleSheet*, Containe
rNode* scope = 0); |
146 void processScopedRules(const RuleSet& authorRules, const KURL&, ContainerNo
de* scope = 0); | |
147 | 146 |
148 void lazyAppendAuthorStyleSheets(unsigned firstNew, const WillBeHeapVector<R
efPtrWillBeMember<CSSStyleSheet> >&); | 147 void lazyAppendAuthorStyleSheets(unsigned firstNew, const WillBeHeapVector<R
efPtrWillBeMember<CSSStyleSheet> >&); |
149 void removePendingAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMembe
r<CSSStyleSheet> >&); | 148 void removePendingAuthorStyleSheets(const WillBeHeapVector<RefPtrWillBeMembe
r<CSSStyleSheet> >&); |
150 void appendPendingAuthorStyleSheets(); | 149 void appendPendingAuthorStyleSheets(); |
151 bool hasPendingAuthorStyleSheets() const { return m_pendingStyleSheets.size(
) > 0 || m_needCollectFeatures; } | 150 bool hasPendingAuthorStyleSheets() const { return m_pendingStyleSheets.size(
) > 0 || m_needCollectFeatures; } |
152 | 151 |
153 SelectorFilter& selectorFilter() { return m_selectorFilter; } | 152 SelectorFilter& selectorFilter() { return m_selectorFilter; } |
154 | 153 |
155 void setBuildScopedStyleTreeInDocumentOrder(bool enabled) { m_styleTree.setB
uildInDocumentOrder(enabled); } | 154 void setBuildScopedStyleTreeInDocumentOrder(bool enabled) { m_styleTree.setB
uildInDocumentOrder(enabled); } |
156 bool buildScopedStyleTreeInDocumentOrder() const { return m_styleTree.buildI
nDocumentOrder(); } | 155 bool buildScopedStyleTreeInDocumentOrder() const { return m_styleTree.buildI
nDocumentOrder(); } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 | 229 |
231 PassRefPtr<PseudoElement> createPseudoElementIfNeeded(Element& parent, Pseud
oId); | 230 PassRefPtr<PseudoElement> createPseudoElementIfNeeded(Element& parent, Pseud
oId); |
232 | 231 |
233 private: | 232 private: |
234 // CSSFontSelectorClient implementation. | 233 // CSSFontSelectorClient implementation. |
235 virtual void fontsNeedUpdate(CSSFontSelector*) OVERRIDE; | 234 virtual void fontsNeedUpdate(CSSFontSelector*) OVERRIDE; |
236 | 235 |
237 private: | 236 private: |
238 void initWatchedSelectorRules(const WillBeHeapVector<RefPtrWillBeMember<Styl
eRule> >& watchedSelectors); | 237 void initWatchedSelectorRules(const WillBeHeapVector<RefPtrWillBeMember<Styl
eRule> >& watchedSelectors); |
239 | 238 |
240 void addTreeBoundaryCrossingRules(const WillBeHeapVector<MinimalRuleData>&,
ContainerNode* scope); | 239 void addTreeBoundaryCrossingRules(const WillBeHeapVector<MinimalRuleData>&,
ContainerNode* scope, CSSStyleSheet* parentStyleSheet); |
241 | 240 |
242 // FIXME: This should probably go away, folded into FontBuilder. | 241 // FIXME: This should probably go away, folded into FontBuilder. |
243 void updateFont(StyleResolverState&); | 242 void updateFont(StyleResolverState&); |
244 | 243 |
245 void loadPendingResources(StyleResolverState&); | 244 void loadPendingResources(StyleResolverState&); |
246 | 245 |
247 void appendCSSStyleSheet(CSSStyleSheet*); | 246 void appendCSSStyleSheet(CSSStyleSheet*); |
248 | 247 |
249 void collectPseudoRulesForElement(Element*, ElementRuleCollector&, PseudoId,
unsigned rulesToInclude); | 248 void collectPseudoRulesForElement(Element*, ElementRuleCollector&, PseudoId,
unsigned rulesToInclude); |
250 void matchUARules(ElementRuleCollector&, RuleSet*); | 249 void matchUARules(ElementRuleCollector&, RuleSet*); |
251 void matchAuthorRules(Element*, ElementRuleCollector&, bool includeEmptyRule
s); | 250 void matchAuthorRules(Element*, ElementRuleCollector&, bool includeEmptyRule
s); |
252 void matchAuthorRulesForShadowHost(Element*, ElementRuleCollector&, bool inc
ludeEmptyRules, Vector<ScopedStyleResolver*, 8>& resolvers, Vector<ScopedStyleRe
solver*, 8>& resolversInShadowTree); | 251 void matchAuthorRulesForShadowHost(Element*, ElementRuleCollector&, bool inc
ludeEmptyRules, Vector<ScopedStyleResolver*, 8>& resolvers, Vector<ScopedStyleRe
solver*, 8>& resolversInShadowTree); |
253 void matchAllRules(StyleResolverState&, ElementRuleCollector&, bool includeS
MILProperties); | 252 void matchAllRules(StyleResolverState&, ElementRuleCollector&, bool includeS
MILProperties); |
254 void matchUARules(ElementRuleCollector&); | 253 void matchUARules(ElementRuleCollector&); |
255 // FIXME: watched selectors should be implemented using injected author styl
esheets: http://crbug.com/316960 | 254 // FIXME: watched selectors should be implemented using injected author styl
esheets: http://crbug.com/316960 |
256 void matchWatchSelectorRules(ElementRuleCollector&); | 255 void matchWatchSelectorRules(ElementRuleCollector&); |
257 void collectFeatures(); | 256 void collectFeatures(); |
258 void collectTreeBoundaryCrossingRules(Element*, ElementRuleCollector&, bool
includeEmptyRules); | |
259 void resetRuleFeatures(); | 257 void resetRuleFeatures(); |
260 | 258 |
261 bool fastRejectSelector(const RuleData&) const; | 259 bool fastRejectSelector(const RuleData&) const; |
262 | 260 |
263 void applyMatchedProperties(StyleResolverState&, const MatchResult&); | 261 void applyMatchedProperties(StyleResolverState&, const MatchResult&); |
264 void applyAnimatedProperties(StyleResolverState&, Element* animatingElement)
; | 262 void applyAnimatedProperties(StyleResolverState&, Element* animatingElement)
; |
265 | 263 |
266 enum StyleApplicationPass { | 264 enum StyleApplicationPass { |
267 AnimationProperties, | 265 AnimationProperties, |
268 HighPriorityProperties, | 266 HighPriorityProperties, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; | 333 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; |
336 unsigned m_styleResolverStatsSequence; | 334 unsigned m_styleResolverStatsSequence; |
337 | 335 |
338 // Use only for Internals::updateStyleAndReturnAffectedElementCount. | 336 // Use only for Internals::updateStyleAndReturnAffectedElementCount. |
339 unsigned m_accessCount; | 337 unsigned m_accessCount; |
340 }; | 338 }; |
341 | 339 |
342 } // namespace WebCore | 340 } // namespace WebCore |
343 | 341 |
344 #endif // StyleResolver_h | 342 #endif // StyleResolver_h |
OLD | NEW |