| 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. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
| 4 * All rights reserved. | 4 * All rights reserved. |
| 5 * Copyright (C) 2012 Google Inc. All rights reserved. | 5 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 parentResolver->m_hasUnresolvedKeyframesRule = false; | 191 parentResolver->m_hasUnresolvedKeyframesRule = false; |
| 192 hadUnresolvedKeyframes = true; | 192 hadUnresolvedKeyframes = true; |
| 193 } | 193 } |
| 194 | 194 |
| 195 if (hadUnresolvedKeyframes) { | 195 if (hadUnresolvedKeyframes) { |
| 196 // If an animation ended up not being started because no @keyframes | 196 // If an animation ended up not being started because no @keyframes |
| 197 // rules were found for the animation-name, we need to recalculate style | 197 // rules were found for the animation-name, we need to recalculate style |
| 198 // for the elements in the scope, including its shadow host if | 198 // for the elements in the scope, including its shadow host if |
| 199 // applicable. | 199 // applicable. |
| 200 invalidationRootForTreeScope(treeScope).setNeedsStyleRecalc( | 200 invalidationRootForTreeScope(treeScope).setNeedsStyleRecalc( |
| 201 SubtreeStyleChange, StyleChangeReasonForTracing::create( | 201 SubtreeStyleChange, |
| 202 StyleChangeReason::StyleSheetChange)); | 202 StyleChangeReasonForTracing::create( |
| 203 StyleChangeReason::StyleSheetChange)); |
| 203 return; | 204 return; |
| 204 } | 205 } |
| 205 | 206 |
| 206 // If we have animations running, added/removed @keyframes may affect these. | 207 // If we have animations running, added/removed @keyframes may affect these. |
| 207 treeScope.document().timeline().invalidateKeyframeEffects(treeScope); | 208 treeScope.document().timeline().invalidateKeyframeEffects(treeScope); |
| 208 } | 209 } |
| 209 | 210 |
| 210 void ScopedStyleResolver::collectMatchingAuthorRules( | 211 void ScopedStyleResolver::collectMatchingAuthorRules( |
| 211 ElementRuleCollector& collector, | 212 ElementRuleCollector& collector, |
| 212 CascadeOrder cascadeOrder) { | 213 CascadeOrder cascadeOrder) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 ruleSet->addRule(info.m_rule, info.m_selectorIndex, info.m_flags); | 267 ruleSet->addRule(info.m_rule, info.m_selectorIndex, info.m_flags); |
| 267 } | 268 } |
| 268 } | 269 } |
| 269 | 270 |
| 270 void ScopedStyleResolver::addTreeBoundaryCrossingRules( | 271 void ScopedStyleResolver::addTreeBoundaryCrossingRules( |
| 271 const RuleSet& authorRules, | 272 const RuleSet& authorRules, |
| 272 CSSStyleSheet* parentStyleSheet, | 273 CSSStyleSheet* parentStyleSheet, |
| 273 unsigned sheetIndex) { | 274 unsigned sheetIndex) { |
| 274 bool isDocumentScope = treeScope().rootNode().isDocumentNode(); | 275 bool isDocumentScope = treeScope().rootNode().isDocumentNode(); |
| 275 if (authorRules.deepCombinatorOrShadowPseudoRules().isEmpty() && | 276 if (authorRules.deepCombinatorOrShadowPseudoRules().isEmpty() && |
| 276 (isDocumentScope || (authorRules.contentPseudoElementRules().isEmpty() && | 277 (isDocumentScope || |
| 277 authorRules.slottedPseudoElementRules().isEmpty()))) | 278 (authorRules.contentPseudoElementRules().isEmpty() && |
| 279 authorRules.slottedPseudoElementRules().isEmpty()))) |
| 278 return; | 280 return; |
| 279 | 281 |
| 280 if (!authorRules.deepCombinatorOrShadowPseudoRules().isEmpty()) | 282 if (!authorRules.deepCombinatorOrShadowPseudoRules().isEmpty()) |
| 281 m_hasDeepOrShadowSelector = true; | 283 m_hasDeepOrShadowSelector = true; |
| 282 | 284 |
| 283 RuleSet* ruleSetForScope = RuleSet::create(); | 285 RuleSet* ruleSetForScope = RuleSet::create(); |
| 284 addRules(ruleSetForScope, authorRules.deepCombinatorOrShadowPseudoRules()); | 286 addRules(ruleSetForScope, authorRules.deepCombinatorOrShadowPseudoRules()); |
| 285 | 287 |
| 286 if (!isDocumentScope) { | 288 if (!isDocumentScope) { |
| 287 addRules(ruleSetForScope, authorRules.contentPseudoElementRules()); | 289 addRules(ruleSetForScope, authorRules.contentPseudoElementRules()); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 } | 321 } |
| 320 return true; | 322 return true; |
| 321 } | 323 } |
| 322 | 324 |
| 323 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) { | 325 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) { |
| 324 visitor->trace(m_parentStyleSheet); | 326 visitor->trace(m_parentStyleSheet); |
| 325 visitor->trace(m_ruleSet); | 327 visitor->trace(m_ruleSet); |
| 326 } | 328 } |
| 327 | 329 |
| 328 } // namespace blink | 330 } // namespace blink |
| OLD | NEW |