| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 private: | 135 private: |
| 136 void collectRuleIfMatches(const RuleData&, CascadeScope, CascadeOrder, const
MatchRequest&, RuleRange&); | 136 void collectRuleIfMatches(const RuleData&, CascadeScope, CascadeOrder, const
MatchRequest&, RuleRange&); |
| 137 | 137 |
| 138 template<typename RuleDataListType> | 138 template<typename RuleDataListType> |
| 139 void collectMatchingRulesForList(const RuleDataListType* rules, CascadeScope
cascadeScope, CascadeOrder cascadeOrder, const MatchRequest& matchRequest, Rule
Range& ruleRange) | 139 void collectMatchingRulesForList(const RuleDataListType* rules, CascadeScope
cascadeScope, CascadeOrder cascadeOrder, const MatchRequest& matchRequest, Rule
Range& ruleRange) |
| 140 { | 140 { |
| 141 if (!rules) | 141 if (!rules) |
| 142 return; | 142 return; |
| 143 | 143 |
| 144 for (typename RuleDataListType::const_iterator it = rules->begin(), end
= rules->end(); it != end; ++it) | 144 for (const auto& rule : *rules) |
| 145 collectRuleIfMatches(*it, cascadeScope, cascadeOrder, matchRequest,
ruleRange); | 145 collectRuleIfMatches(rule, cascadeScope, cascadeOrder, matchRequest,
ruleRange); |
| 146 } | 146 } |
| 147 | 147 |
| 148 bool ruleMatches(const RuleData&, const ContainerNode* scope, SelectorChecke
r::MatchResult*); | 148 bool ruleMatches(const RuleData&, const ContainerNode* scope, SelectorChecke
r::MatchResult*); |
| 149 | 149 |
| 150 CSSRuleList* nestedRuleList(CSSRule*); | 150 CSSRuleList* nestedRuleList(CSSRule*); |
| 151 template<class CSSRuleCollection> | 151 template<class CSSRuleCollection> |
| 152 CSSRule* findStyleRule(CSSRuleCollection*, StyleRule*); | 152 CSSRule* findStyleRule(CSSRuleCollection*, StyleRule*); |
| 153 void appendCSSOMWrapperForRule(CSSStyleSheet*, StyleRule*); | 153 void appendCSSOMWrapperForRule(CSSStyleSheet*, StyleRule*); |
| 154 | 154 |
| 155 void sortMatchedRules(); | 155 void sortMatchedRules(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 174 | 174 |
| 175 // Output. | 175 // Output. |
| 176 RefPtrWillBeMember<StaticCSSRuleList> m_cssRuleList; | 176 RefPtrWillBeMember<StaticCSSRuleList> m_cssRuleList; |
| 177 RefPtrWillBeMember<StyleRuleList> m_styleRuleList; | 177 RefPtrWillBeMember<StyleRuleList> m_styleRuleList; |
| 178 MatchResult m_result; | 178 MatchResult m_result; |
| 179 }; | 179 }; |
| 180 | 180 |
| 181 } // namespace blink | 181 } // namespace blink |
| 182 | 182 |
| 183 #endif // ElementRuleCollector_h | 183 #endif // ElementRuleCollector_h |
| OLD | NEW |