| 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. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
| 4 * All rights reserved. | 4 * All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 class CSSValue; | 51 class CSSValue; |
| 52 class ContainerNode; | 52 class ContainerNode; |
| 53 class Document; | 53 class Document; |
| 54 class Element; | 54 class Element; |
| 55 class Interpolation; | 55 class Interpolation; |
| 56 class MatchResult; | 56 class MatchResult; |
| 57 class MediaQueryEvaluator; | 57 class MediaQueryEvaluator; |
| 58 class ScopedStyleResolver; | 58 class ScopedStyleResolver; |
| 59 class StylePropertySet; | 59 class StylePropertySet; |
| 60 class StyleRule; | 60 class StyleRule; |
| 61 class StyleRuleUsageTracker; |
| 61 | 62 |
| 62 enum StyleSharingBehavior { | 63 enum StyleSharingBehavior { |
| 63 AllowStyleSharing, | 64 AllowStyleSharing, |
| 64 DisallowStyleSharing, | 65 DisallowStyleSharing, |
| 65 }; | 66 }; |
| 66 | 67 |
| 67 enum RuleMatchingBehavior { MatchAllRules, MatchAllRulesExcludingSMIL }; | 68 enum RuleMatchingBehavior { MatchAllRules, MatchAllRulesExcludingSMIL }; |
| 68 | 69 |
| 69 const unsigned styleSharingListSize = 15; | 70 const unsigned styleSharingListSize = 15; |
| 70 const unsigned styleSharingMaxDepth = 32; | 71 const unsigned styleSharingMaxDepth = 32; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 188 |
| 188 void increaseStyleSharingDepth() { ++m_styleSharingDepth; } | 189 void increaseStyleSharingDepth() { ++m_styleSharingDepth; } |
| 189 void decreaseStyleSharingDepth() { --m_styleSharingDepth; } | 190 void decreaseStyleSharingDepth() { --m_styleSharingDepth; } |
| 190 | 191 |
| 191 PseudoElement* createPseudoElementIfNeeded(Element& parent, PseudoId); | 192 PseudoElement* createPseudoElementIfNeeded(Element& parent, PseudoId); |
| 192 | 193 |
| 193 DECLARE_TRACE(); | 194 DECLARE_TRACE(); |
| 194 | 195 |
| 195 void initWatchedSelectorRules(); | 196 void initWatchedSelectorRules(); |
| 196 | 197 |
| 198 void setRuleUsageTracker(StyleRuleUsageTracker*); |
| 199 |
| 197 private: | 200 private: |
| 198 explicit StyleResolver(Document&); | 201 explicit StyleResolver(Document&); |
| 199 | 202 |
| 200 PassRefPtr<ComputedStyle> initialStyleForElement(); | 203 PassRefPtr<ComputedStyle> initialStyleForElement(); |
| 201 | 204 |
| 202 // FIXME: This should probably go away, folded into FontBuilder. | 205 // FIXME: This should probably go away, folded into FontBuilder. |
| 203 void updateFont(StyleResolverState&); | 206 void updateFont(StyleResolverState&); |
| 204 | 207 |
| 208 void addMatchedRulesToTracker(const ElementRuleCollector&); |
| 209 |
| 205 void loadPendingResources(StyleResolverState&); | 210 void loadPendingResources(StyleResolverState&); |
| 206 void adjustComputedStyle(StyleResolverState&, Element*); | 211 void adjustComputedStyle(StyleResolverState&, Element*); |
| 207 | 212 |
| 208 void appendCSSStyleSheet(CSSStyleSheet&); | 213 void appendCSSStyleSheet(CSSStyleSheet&); |
| 209 | 214 |
| 210 void collectPseudoRulesForElement(const Element&, | 215 void collectPseudoRulesForElement(const Element&, |
| 211 ElementRuleCollector&, | 216 ElementRuleCollector&, |
| 212 PseudoId, | 217 PseudoId, |
| 213 unsigned rulesToInclude); | 218 unsigned rulesToInclude); |
| 214 void matchRuleSet(ElementRuleCollector&, RuleSet*); | 219 void matchRuleSet(ElementRuleCollector&, RuleSet*); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 HeapListHashSet<Member<CSSStyleSheet>, 16> m_pendingStyleSheets; | 283 HeapListHashSet<Member<CSSStyleSheet>, 16> m_pendingStyleSheets; |
| 279 | 284 |
| 280 // FIXME: The entire logic of collecting features on StyleResolver, as well as | 285 // FIXME: The entire logic of collecting features on StyleResolver, as well as |
| 281 // transferring them between various parts of machinery smells wrong. This | 286 // transferring them between various parts of machinery smells wrong. This |
| 282 // needs to be better somehow. | 287 // needs to be better somehow. |
| 283 RuleFeatureSet m_features; | 288 RuleFeatureSet m_features; |
| 284 Member<RuleSet> m_siblingRuleSet; | 289 Member<RuleSet> m_siblingRuleSet; |
| 285 Member<RuleSet> m_uncommonAttributeRuleSet; | 290 Member<RuleSet> m_uncommonAttributeRuleSet; |
| 286 Member<RuleSet> m_watchedSelectorsRules; | 291 Member<RuleSet> m_watchedSelectorsRules; |
| 287 | 292 |
| 293 Member<StyleRuleUsageTracker> m_tracker; |
| 294 |
| 288 bool m_needCollectFeatures; | 295 bool m_needCollectFeatures; |
| 289 bool m_printMediaType; | 296 bool m_printMediaType; |
| 290 bool m_hasFullscreenUAStyle = false; | 297 bool m_hasFullscreenUAStyle = false; |
| 291 | 298 |
| 292 unsigned m_styleSharingDepth; | 299 unsigned m_styleSharingDepth; |
| 293 HeapVector<Member<StyleSharingList>, styleSharingMaxDepth> | 300 HeapVector<Member<StyleSharingList>, styleSharingMaxDepth> |
| 294 m_styleSharingLists; | 301 m_styleSharingLists; |
| 295 }; | 302 }; |
| 296 | 303 |
| 297 } // namespace blink | 304 } // namespace blink |
| 298 | 305 |
| 299 #endif // StyleResolver_h | 306 #endif // StyleResolver_h |
| OLD | NEW |