| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 | 143 |
| 144 const Vector<RefPtr<StyleRuleBase> >& rules = styleSheetContents->childRules
(); | 144 const Vector<RefPtr<StyleRuleBase> >& rules = styleSheetContents->childRules
(); |
| 145 for (unsigned i = 0; i < rules.size(); i++) { | 145 for (unsigned i = 0; i < rules.size(); i++) { |
| 146 StyleRuleBase* rule = rules[i].get(); | 146 StyleRuleBase* rule = rules[i].get(); |
| 147 if (!rule->isStyleRule()) { | 147 if (!rule->isStyleRule()) { |
| 148 // FIXME: Media rules and maybe some others could be allowed. | 148 // FIXME: Media rules and maybe some others could be allowed. |
| 149 m_dirtiesAllStyle = true; | 149 m_dirtiesAllStyle = true; |
| 150 return; | 150 return; |
| 151 } | 151 } |
| 152 StyleRule* styleRule = static_cast<StyleRule*>(rule); | 152 StyleRule* styleRule = toStyleRule(rule); |
| 153 if (!determineSelectorScopes(styleRule->selectorList(), m_idScopes, m_cl
assScopes)) { | 153 if (!determineSelectorScopes(styleRule->selectorList(), m_idScopes, m_cl
assScopes)) { |
| 154 m_dirtiesAllStyle = true; | 154 m_dirtiesAllStyle = true; |
| 155 return; | 155 return; |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 | 159 |
| 160 static bool elementMatchesSelectorScopes(const Element* element, const HashSet<S
tringImpl*>& idScopes, const HashSet<StringImpl*>& classScopes) | 160 static bool elementMatchesSelectorScopes(const Element* element, const HashSet<S
tringImpl*>& idScopes, const HashSet<StringImpl*>& classScopes) |
| 161 { | 161 { |
| 162 if (!idScopes.isEmpty() && element->hasID() && idScopes.contains(element->id
ForStyleResolution().impl())) | 162 if (!idScopes.isEmpty() && element->hasID() && idScopes.contains(element->id
ForStyleResolution().impl())) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 188 element->setNeedsStyleRecalc(); | 188 element->setNeedsStyleRecalc(); |
| 189 // The whole subtree is now invalidated, we can skip to the next sib
ling. | 189 // The whole subtree is now invalidated, we can skip to the next sib
ling. |
| 190 element = ElementTraversal::nextSkippingChildren(element); | 190 element = ElementTraversal::nextSkippingChildren(element); |
| 191 continue; | 191 continue; |
| 192 } | 192 } |
| 193 element = ElementTraversal::next(element); | 193 element = ElementTraversal::next(element); |
| 194 } | 194 } |
| 195 } | 195 } |
| 196 | 196 |
| 197 } | 197 } |
| OLD | NEW |