| 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 * Copyright (C) 2012 Google Inc. All rights reserved. | 4 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 public: | 48 public: |
| 49 static PassOwnPtrWillBeRawPtr<ScopedStyleResolver> create(TreeScope& scope) | 49 static PassOwnPtrWillBeRawPtr<ScopedStyleResolver> create(TreeScope& scope) |
| 50 { | 50 { |
| 51 return adoptPtrWillBeNoop(new ScopedStyleResolver(scope)); | 51 return adoptPtrWillBeNoop(new ScopedStyleResolver(scope)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 const TreeScope& treeScope() const { return *m_scope; } | 54 const TreeScope& treeScope() const { return *m_scope; } |
| 55 ScopedStyleResolver* parent() const; | 55 ScopedStyleResolver* parent() const; |
| 56 | 56 |
| 57 StyleRuleKeyframes* keyframeStylesForAnimation(const StringImpl* animationNa
me); | 57 StyleRuleKeyframes* keyframeStylesForAnimation(const StringImpl* animationNa
me); |
| 58 CSSStyleSheet* styleSheetForAnimation(const StringImpl* animationName); |
| 58 | 59 |
| 59 void appendCSSStyleSheet(CSSStyleSheet&, const MediaQueryEvaluator&); | 60 void appendCSSStyleSheet(CSSStyleSheet&, const MediaQueryEvaluator&); |
| 60 void collectMatchingAuthorRules(ElementRuleCollector&, bool includeEmptyRule
s, CascadeOrder = ignoreCascadeOrder); | 61 void collectMatchingAuthorRules(ElementRuleCollector&, bool includeEmptyRule
s, CascadeOrder = ignoreCascadeOrder); |
| 61 void collectMatchingShadowHostRules(ElementRuleCollector&, bool includeEmpty
Rules, CascadeOrder = ignoreCascadeOrder); | 62 void collectMatchingShadowHostRules(ElementRuleCollector&, bool includeEmpty
Rules, CascadeOrder = ignoreCascadeOrder); |
| 62 void collectMatchingTreeBoundaryCrossingRules(ElementRuleCollector&, bool in
cludeEmptyRules, CascadeOrder); | 63 void collectMatchingTreeBoundaryCrossingRules(ElementRuleCollector&, bool in
cludeEmptyRules, CascadeOrder); |
| 63 void matchPageRules(PageRuleCollector&); | 64 void matchPageRules(PageRuleCollector&); |
| 64 void collectFeaturesTo(RuleFeatureSet&, HashSet<const StyleSheetContents*>&
visitedSharedStyleSheetContents) const; | 65 void collectFeaturesTo(RuleFeatureSet&, HashSet<const StyleSheetContents*>&
visitedSharedStyleSheetContents) const; |
| 65 void resetAuthorStyle(); | 66 void resetAuthorStyle(); |
| 66 void collectViewportRulesTo(ViewportStyleResolver*) const; | 67 void collectViewportRulesTo(ViewportStyleResolver*) const; |
| 67 | 68 |
| 68 DECLARE_TRACE(); | 69 DECLARE_TRACE(); |
| 69 | 70 |
| 70 private: | 71 private: |
| 71 explicit ScopedStyleResolver(TreeScope& scope) | 72 explicit ScopedStyleResolver(TreeScope& scope) |
| 72 : m_scope(scope) | 73 : m_scope(scope) |
| 73 { | 74 { |
| 74 } | 75 } |
| 75 | 76 |
| 76 void addTreeBoundaryCrossingRules(const RuleSet&, CSSStyleSheet*, unsigned s
heetIndex); | 77 void addTreeBoundaryCrossingRules(const RuleSet&, CSSStyleSheet*, unsigned s
heetIndex); |
| 77 void addKeyframeRules(const RuleSet&); | 78 void addKeyframeRules(const RuleSet&, CSSStyleSheet*); |
| 78 void addFontFaceRules(const RuleSet&); | 79 void addFontFaceRules(const RuleSet&); |
| 79 void addKeyframeStyle(PassRefPtrWillBeRawPtr<StyleRuleKeyframes>); | 80 void addKeyframeStyle(PassRefPtrWillBeRawPtr<StyleRuleKeyframes>, CSSStyleSh
eet*); |
| 80 | 81 |
| 81 RawPtrWillBeMember<TreeScope> m_scope; | 82 RawPtrWillBeMember<TreeScope> m_scope; |
| 82 | 83 |
| 83 WillBeHeapVector<RawPtrWillBeMember<CSSStyleSheet>> m_authorStyleSheets; | 84 WillBeHeapVector<RawPtrWillBeMember<CSSStyleSheet>> m_authorStyleSheets; |
| 84 | 85 |
| 85 using KeyframesRuleMap = WillBeHeapHashMap<const StringImpl*, RefPtrWillBeMe
mber<StyleRuleKeyframes>>; | 86 using KeyframesRuleMap = WillBeHeapHashMap<const StringImpl*, RefPtrWillBeMe
mber<StyleRuleKeyframes>>; |
| 86 KeyframesRuleMap m_keyframesRuleMap; | 87 KeyframesRuleMap m_keyframesRuleMap; |
| 88 WillBeHeapHashMap<const StringImpl*, CSSStyleSheet*> m_keyframesStyleSheetMa
p; |
| 87 | 89 |
| 88 class RuleSubSet final : public NoBaseWillBeGarbageCollected<RuleSubSet> { | 90 class RuleSubSet final : public NoBaseWillBeGarbageCollected<RuleSubSet> { |
| 89 public: | 91 public: |
| 90 static PassOwnPtrWillBeRawPtr<RuleSubSet> create(CSSStyleSheet* sheet, u
nsigned index, PassOwnPtrWillBeRawPtr<RuleSet> rules) | 92 static PassOwnPtrWillBeRawPtr<RuleSubSet> create(CSSStyleSheet* sheet, u
nsigned index, PassOwnPtrWillBeRawPtr<RuleSet> rules) |
| 91 { | 93 { |
| 92 return adoptPtrWillBeNoop(new RuleSubSet(sheet, index, rules)); | 94 return adoptPtrWillBeNoop(new RuleSubSet(sheet, index, rules)); |
| 93 } | 95 } |
| 94 | 96 |
| 95 RawPtrWillBeMember<CSSStyleSheet> m_parentStyleSheet; | 97 RawPtrWillBeMember<CSSStyleSheet> m_parentStyleSheet; |
| 96 unsigned m_parentIndex; | 98 unsigned m_parentIndex; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 107 } | 109 } |
| 108 }; | 110 }; |
| 109 using CSSStyleSheetRuleSubSet = WillBeHeapVector<OwnPtrWillBeMember<RuleSubS
et>>; | 111 using CSSStyleSheetRuleSubSet = WillBeHeapVector<OwnPtrWillBeMember<RuleSubS
et>>; |
| 110 | 112 |
| 111 OwnPtrWillBeMember<CSSStyleSheetRuleSubSet> m_treeBoundaryCrossingRuleSet; | 113 OwnPtrWillBeMember<CSSStyleSheetRuleSubSet> m_treeBoundaryCrossingRuleSet; |
| 112 }; | 114 }; |
| 113 | 115 |
| 114 } // namespace blink | 116 } // namespace blink |
| 115 | 117 |
| 116 #endif // ScopedStyleResolver_h | 118 #endif // ScopedStyleResolver_h |
| OLD | NEW |