| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 ElementAnimations::ElementAnimations() | 38 ElementAnimations::ElementAnimations() |
| 39 : m_animationStyleChange(false) | 39 : m_animationStyleChange(false) |
| 40 { | 40 { |
| 41 } | 41 } |
| 42 | 42 |
| 43 ElementAnimations::~ElementAnimations() | 43 ElementAnimations::~ElementAnimations() |
| 44 { | 44 { |
| 45 #if !ENABLE(OILPAN) | |
| 46 for (KeyframeEffect* effect : m_effects) | |
| 47 effect->notifyElementDestroyed(); | |
| 48 m_effects.clear(); | |
| 49 #endif | |
| 50 } | 45 } |
| 51 | 46 |
| 52 void ElementAnimations::updateAnimationFlags(ComputedStyle& style) | 47 void ElementAnimations::updateAnimationFlags(ComputedStyle& style) |
| 53 { | 48 { |
| 54 for (const auto& entry : m_animations) { | 49 for (const auto& entry : m_animations) { |
| 55 const Animation& animation = *entry.key; | 50 const Animation& animation = *entry.key; |
| 56 ASSERT(animation.effect()); | 51 ASSERT(animation.effect()); |
| 57 // FIXME: Needs to consider AnimationGroup once added. | 52 // FIXME: Needs to consider AnimationGroup once added. |
| 58 ASSERT(animation.effect()->isAnimation()); | 53 ASSERT(animation.effect()->isAnimation()); |
| 59 const KeyframeEffect& effect = *toKeyframeEffect(animation.effect()); | 54 const KeyframeEffect& effect = *toKeyframeEffect(animation.effect()); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 83 } | 78 } |
| 84 | 79 |
| 85 void ElementAnimations::restartAnimationOnCompositor() | 80 void ElementAnimations::restartAnimationOnCompositor() |
| 86 { | 81 { |
| 87 for (const auto& entry : m_animations) | 82 for (const auto& entry : m_animations) |
| 88 entry.key->restartAnimationOnCompositor(); | 83 entry.key->restartAnimationOnCompositor(); |
| 89 } | 84 } |
| 90 | 85 |
| 91 DEFINE_TRACE(ElementAnimations) | 86 DEFINE_TRACE(ElementAnimations) |
| 92 { | 87 { |
| 93 #if ENABLE(OILPAN) | |
| 94 visitor->trace(m_cssAnimations); | 88 visitor->trace(m_cssAnimations); |
| 95 visitor->trace(m_defaultStack); | 89 visitor->trace(m_defaultStack); |
| 96 visitor->trace(m_animations); | 90 visitor->trace(m_animations); |
| 97 #endif | |
| 98 } | 91 } |
| 99 | 92 |
| 100 const ComputedStyle* ElementAnimations::baseComputedStyle() const | 93 const ComputedStyle* ElementAnimations::baseComputedStyle() const |
| 101 { | 94 { |
| 102 #if !ENABLE(ASSERT) | 95 #if !ENABLE(ASSERT) |
| 103 if (isAnimationStyleChange()) | 96 if (isAnimationStyleChange()) |
| 104 return m_baseComputedStyle.get(); | 97 return m_baseComputedStyle.get(); |
| 105 #endif | 98 #endif |
| 106 return nullptr; | 99 return nullptr; |
| 107 } | 100 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 129 // TODO(rune@opera.com): The FontFaceCache version number may be increased w
ithout forcing | 122 // TODO(rune@opera.com): The FontFaceCache version number may be increased w
ithout forcing |
| 130 // a style recalc (see crbug.com/471079). ComputedStyle objects created with
different cache | 123 // a style recalc (see crbug.com/471079). ComputedStyle objects created with
different cache |
| 131 // versions will not be considered equal as Font::operator== will compare ve
rsions, hence | 124 // versions will not be considered equal as Font::operator== will compare ve
rsions, hence |
| 132 // ComputedStyle::operator== will return false. We avoid using baseComputedS
tyle (the check for | 125 // ComputedStyle::operator== will return false. We avoid using baseComputedS
tyle (the check for |
| 133 // isFallbackValid()) in that case to avoid triggering the ComputedStyle com
parison ASSERT | 126 // isFallbackValid()) in that case to avoid triggering the ComputedStyle com
parison ASSERT |
| 134 // in updateBaseComputedStyle. | 127 // in updateBaseComputedStyle. |
| 135 return m_animationStyleChange && (!m_baseComputedStyle || m_baseComputedStyl
e->font().isFallbackValid()); | 128 return m_animationStyleChange && (!m_baseComputedStyle || m_baseComputedStyl
e->font().isFallbackValid()); |
| 136 } | 129 } |
| 137 | 130 |
| 138 } // namespace blink | 131 } // namespace blink |
| OLD | NEW |