| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 void sortAndTransferMatchedRules(); | 108 void sortAndTransferMatchedRules(); |
| 109 void clearMatchedRules(); | 109 void clearMatchedRules(); |
| 110 void addElementStyleProperties(const StylePropertySet*, bool isCacheable = t
rue); | 110 void addElementStyleProperties(const StylePropertySet*, bool isCacheable = t
rue); |
| 111 | 111 |
| 112 unsigned lastMatchedRulesPosition() const { return m_matchedRules ? m_matche
dRules->size() : 0; } | 112 unsigned lastMatchedRulesPosition() const { return m_matchedRules ? m_matche
dRules->size() : 0; } |
| 113 void sortMatchedRulesFrom(unsigned position); | 113 void sortMatchedRulesFrom(unsigned position); |
| 114 void sortAndTransferMatchedRulesWithOnlySortBySpecificity(); | 114 void sortAndTransferMatchedRulesWithOnlySortBySpecificity(); |
| 115 | 115 |
| 116 private: | 116 private: |
| 117 void collectRuleIfMatches(const RuleData&, SelectorChecker::BehaviorAtBounda
ry, CascadeScope, CascadeOrder, const MatchRequest&, RuleRange&); | 117 void collectRuleIfMatches(const RuleData&, SelectorChecker::BehaviorAtBounda
ry, CascadeScope, CascadeOrder, const MatchRequest&, RuleRange&); |
| 118 void collectMatchingRulesForList(const Vector<RuleData>*, SelectorChecker::B
ehaviorAtBoundary, CascadeScope, CascadeOrder, const MatchRequest&, RuleRange&); | 118 |
| 119 void collectMatchingRulesForList(const RuleData*, SelectorChecker::BehaviorA
tBoundary, CascadeScope, CascadeOrder, const MatchRequest&, RuleRange&); | 119 template<typename RuleDataListType> |
| 120 void collectMatchingRulesForList(const RuleDataListType* rules, SelectorChec
ker::BehaviorAtBoundary behaviorAtBoundary, CascadeScope cascadeScope, CascadeOr
der cascadeOrder, const MatchRequest& matchRequest, RuleRange& ruleRange) |
| 121 { |
| 122 if (!rules) |
| 123 return; |
| 124 |
| 125 for (typename RuleDataListType::const_iterator it = rules->begin(), end
= rules->end(); it != end; ++it) |
| 126 collectRuleIfMatches(*it, behaviorAtBoundary, cascadeScope, cascadeO
rder, matchRequest, ruleRange); |
| 127 } |
| 128 |
| 120 bool ruleMatches(const RuleData&, const ContainerNode* scope, SelectorChecke
r::BehaviorAtBoundary, SelectorChecker::MatchResult*); | 129 bool ruleMatches(const RuleData&, const ContainerNode* scope, SelectorChecke
r::BehaviorAtBoundary, SelectorChecker::MatchResult*); |
| 121 | 130 |
| 122 CSSRuleList* nestedRuleList(CSSRule*); | 131 CSSRuleList* nestedRuleList(CSSRule*); |
| 123 template<class CSSRuleCollection> | 132 template<class CSSRuleCollection> |
| 124 CSSRule* findStyleRule(CSSRuleCollection*, StyleRule*); | 133 CSSRule* findStyleRule(CSSRuleCollection*, StyleRule*); |
| 125 void appendCSSOMWrapperForRule(CSSStyleSheet*, StyleRule*); | 134 void appendCSSOMWrapperForRule(CSSStyleSheet*, StyleRule*); |
| 126 | 135 |
| 127 void sortMatchedRules(); | 136 void sortMatchedRules(); |
| 128 void addMatchedRule(const RuleData*, unsigned specificity, CascadeScope, Cas
cadeOrder, unsigned styleSheetIndex, const CSSStyleSheet* parentStyleSheet); | 137 void addMatchedRule(const RuleData*, unsigned specificity, CascadeScope, Cas
cadeOrder, unsigned styleSheetIndex, const CSSStyleSheet* parentStyleSheet); |
| 129 | 138 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 145 | 154 |
| 146 // Output. | 155 // Output. |
| 147 RefPtr<StaticCSSRuleList> m_cssRuleList; | 156 RefPtr<StaticCSSRuleList> m_cssRuleList; |
| 148 RefPtr<StyleRuleList> m_styleRuleList; | 157 RefPtr<StyleRuleList> m_styleRuleList; |
| 149 MatchResult m_result; | 158 MatchResult m_result; |
| 150 }; | 159 }; |
| 151 | 160 |
| 152 } // namespace WebCore | 161 } // namespace WebCore |
| 153 | 162 |
| 154 #endif // ElementRuleCollector_h | 163 #endif // ElementRuleCollector_h |
| OLD | NEW |