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

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

Issue 931143002: Start moving tree-boundary-crossing rules to ScopedStyleResolver. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
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 * 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 static TreeScope* treeScopeFor(Document&, const CSSStyleSheet*); 54 static TreeScope* treeScopeFor(Document&, const CSSStyleSheet*);
55 55
56 const TreeScope& treeScope() const { return *m_scope; } 56 const TreeScope& treeScope() const { return *m_scope; }
57 ScopedStyleResolver* parent() const; 57 ScopedStyleResolver* parent() const;
58 58
59 public:
60 StyleRuleKeyframes* keyframeStylesForAnimation(const StringImpl* animationNa me); 59 StyleRuleKeyframes* keyframeStylesForAnimation(const StringImpl* animationNa me);
61 void addKeyframeStyle(PassRefPtrWillBeRawPtr<StyleRuleKeyframes>);
62 60
63 unsigned appendCSSStyleSheet(CSSStyleSheet*); 61 void appendCSSStyleSheet(CSSStyleSheet&, const MediaQueryEvaluator&);
64 void collectMatchingAuthorRules(ElementRuleCollector&, bool includeEmptyRule s, CascadeOrder = ignoreCascadeOrder); 62 void collectMatchingAuthorRules(ElementRuleCollector&, bool includeEmptyRule s, CascadeOrder = ignoreCascadeOrder);
65 void collectMatchingShadowHostRules(ElementRuleCollector&, bool includeEmpty Rules, CascadeOrder = ignoreCascadeOrder); 63 void collectMatchingShadowHostRules(ElementRuleCollector&, bool includeEmpty Rules, CascadeOrder = ignoreCascadeOrder);
64 void collectMatchingTreeBoundaryCrossingRules(ElementRuleCollector&, bool in cludeEmptyRules, CascadeOrder);
66 void matchPageRules(PageRuleCollector&); 65 void matchPageRules(PageRuleCollector&);
67 void collectFeaturesTo(RuleFeatureSet&, HashSet<const StyleSheetContents*>& visitedSharedStyleSheetContents) const; 66 void collectFeaturesTo(RuleFeatureSet&, HashSet<const StyleSheetContents*>& visitedSharedStyleSheetContents) const;
68 void resetAuthorStyle(); 67 void resetAuthorStyle();
69 void collectViewportRulesTo(StyleResolver*) const; 68 void collectViewportRulesTo(StyleResolver*) const;
70 69
71 void trace(Visitor*); 70 void trace(Visitor*);
72 71
73 private: 72 private:
74 explicit ScopedStyleResolver(TreeScope& scope) 73 explicit ScopedStyleResolver(TreeScope& scope)
75 : m_scope(scope) 74 : m_scope(scope)
76 { 75 {
77 } 76 }
78 77
78 void addTreeBoundaryCrossingRules(const RuleSet&, CSSStyleSheet*, unsigned s heetIndex);
79 void addKeyframeRules(const RuleSet&);
80 void addFontFaceRules(const RuleSet&);
81 void addKeyframeStyle(PassRefPtrWillBeRawPtr<StyleRuleKeyframes>);
82
79 RawPtrWillBeMember<TreeScope> m_scope; 83 RawPtrWillBeMember<TreeScope> m_scope;
80 84
81 WillBeHeapVector<RawPtrWillBeMember<CSSStyleSheet> > m_authorStyleSheets; 85 WillBeHeapVector<RawPtrWillBeMember<CSSStyleSheet>> m_authorStyleSheets;
82 86
83 typedef WillBeHeapHashMap<const StringImpl*, RefPtrWillBeMember<StyleRuleKey frames> > KeyframesRuleMap; 87 typedef WillBeHeapHashMap<const StringImpl*, RefPtrWillBeMember<StyleRuleKey frames>> KeyframesRuleMap;
84 KeyframesRuleMap m_keyframesRuleMap; 88 KeyframesRuleMap m_keyframesRuleMap;
89
90 class RuleSubSet final : public NoBaseWillBeGarbageCollected<RuleSubSet> {
91 public:
92 static PassOwnPtrWillBeRawPtr<RuleSubSet> create(CSSStyleSheet* sheet, u nsigned index, PassOwnPtrWillBeRawPtr<RuleSet> rules)
93 {
94 return adoptPtrWillBeNoop(new RuleSubSet(sheet, index, rules));
95 }
96
97 CSSStyleSheet* m_parentStyleSheet;
98 unsigned m_parentIndex;
99 OwnPtrWillBeMember<RuleSet> m_ruleSet;
100
101 void trace(Visitor*);
102
103 private:
104 RuleSubSet(CSSStyleSheet* sheet, unsigned index, PassOwnPtrWillBeRawPtr< RuleSet> rules)
105 : m_parentStyleSheet(sheet)
106 , m_parentIndex(index)
107 , m_ruleSet(rules)
108 {
109 }
110 };
111 typedef WillBeHeapVector<OwnPtrWillBeMember<RuleSubSet>> CSSStyleSheetRuleSu bSet;
112
113 OwnPtrWillBeMember<CSSStyleSheetRuleSubSet> m_treeBoundaryCrossingRuleSet;
85 }; 114 };
86 115
87 } // namespace blink 116 } // namespace blink
88 117
89 #endif // ScopedStyleResolver_h 118 #endif // ScopedStyleResolver_h
OLDNEW
« no previous file with comments | « Source/core/css/TreeBoundaryCrossingRules.cpp ('k') | Source/core/css/resolver/ScopedStyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698