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

Side by Side Diff: Source/core/css/ElementRuleCollector.h

Issue 1155393002: Refactor matched rule ranges. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | Source/core/css/ElementRuleCollector.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 111
112 void setMode(SelectorChecker::Mode mode) { m_mode = mode; } 112 void setMode(SelectorChecker::Mode mode) { m_mode = mode; }
113 void setPseudoStyleRequest(const PseudoStyleRequest& request) { m_pseudoStyl eRequest = request; } 113 void setPseudoStyleRequest(const PseudoStyleRequest& request) { m_pseudoStyl eRequest = request; }
114 void setSameOriginOnly(bool f) { m_sameOriginOnly = f; } 114 void setSameOriginOnly(bool f) { m_sameOriginOnly = f; }
115 115
116 void setMatchingUARules(bool matchingUARules) { m_matchingUARules = matching UARules; } 116 void setMatchingUARules(bool matchingUARules) { m_matchingUARules = matching UARules; }
117 void setScopeContainsLastMatchedElement(bool scopeContainsLastMatchedElement ) { m_scopeContainsLastMatchedElement = scopeContainsLastMatchedElement; } 117 void setScopeContainsLastMatchedElement(bool scopeContainsLastMatchedElement ) { m_scopeContainsLastMatchedElement = scopeContainsLastMatchedElement; }
118 bool scopeContainsLastMatchedElement() const { return m_scopeContainsLastMat chedElement; } 118 bool scopeContainsLastMatchedElement() const { return m_scopeContainsLastMat chedElement; }
119 bool hasAnyMatchingRules(RuleSet*); 119 bool hasAnyMatchingRules(RuleSet*);
120 120
121 MatchResult& matchedResult(); 121 const MatchResult& matchedResult();
esprehn 2015/06/02 03:19:35 matchResult() const; ?
122 PassRefPtrWillBeRawPtr<StyleRuleList> matchedStyleRuleList(); 122 PassRefPtrWillBeRawPtr<StyleRuleList> matchedStyleRuleList();
123 PassRefPtrWillBeRawPtr<CSSRuleList> matchedCSSRuleList(); 123 PassRefPtrWillBeRawPtr<CSSRuleList> matchedCSSRuleList();
124 124
125 void collectMatchingRules(const MatchRequest&, RuleRange&, CascadeOrder = ig noreCascadeOrder, bool matchingTreeBoundaryRules = false); 125 void collectMatchingRules(const MatchRequest&, CascadeOrder = ignoreCascadeO rder, bool matchingTreeBoundaryRules = false);
126 void collectMatchingShadowHostRules(const MatchRequest&, RuleRange&, Cascade Order = ignoreCascadeOrder, bool matchingTreeBoundaryRules = false); 126 void collectMatchingShadowHostRules(const MatchRequest&, CascadeOrder = igno reCascadeOrder, bool matchingTreeBoundaryRules = false);
127 void sortAndTransferMatchedRules(); 127 void sortAndTransferMatchedRules();
128 void clearMatchedRules(); 128 void clearMatchedRules();
129 void addElementStyleProperties(const StylePropertySet*, bool isCacheable = t rue); 129 void addElementStyleProperties(const StylePropertySet*, bool isCacheable = t rue);
130 130
131 private: 131 private:
132 template<typename RuleDataListType> 132 template<typename RuleDataListType>
133 void collectMatchingRulesForList(const RuleDataListType*, CascadeOrder, cons t MatchRequest&, RuleRange&); 133 void collectMatchingRulesForList(const RuleDataListType*, CascadeOrder, cons t MatchRequest&);
134 134
135 void didMatchRule(const RuleData&, const SelectorChecker::MatchResult&, Casc adeOrder, const MatchRequest&, RuleRange&); 135 void didMatchRule(const RuleData&, const SelectorChecker::MatchResult&, Casc adeOrder, const MatchRequest&);
136 136
137 template<class CSSRuleCollection> 137 template<class CSSRuleCollection>
138 CSSRule* findStyleRule(CSSRuleCollection*, StyleRule*); 138 CSSRule* findStyleRule(CSSRuleCollection*, StyleRule*);
139 void appendCSSOMWrapperForRule(CSSStyleSheet*, StyleRule*); 139 void appendCSSOMWrapperForRule(CSSStyleSheet*, StyleRule*);
140 140
141 void sortMatchedRules(); 141 void sortMatchedRules();
142 142
143 StaticCSSRuleList* ensureRuleList(); 143 StaticCSSRuleList* ensureRuleList();
144 StyleRuleList* ensureStyleRuleList(); 144 StyleRuleList* ensureStyleRuleList();
145 145
(...skipping 13 matching lines...) Expand all
159 159
160 // Output. 160 // Output.
161 RefPtrWillBeMember<StaticCSSRuleList> m_cssRuleList; 161 RefPtrWillBeMember<StaticCSSRuleList> m_cssRuleList;
162 RefPtrWillBeMember<StyleRuleList> m_styleRuleList; 162 RefPtrWillBeMember<StyleRuleList> m_styleRuleList;
163 MatchResult m_result; 163 MatchResult m_result;
164 }; 164 };
165 165
166 } // namespace blink 166 } // namespace blink
167 167
168 #endif // ElementRuleCollector_h 168 #endif // ElementRuleCollector_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/ElementRuleCollector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698