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 23 matching lines...) Expand all Loading... |
34 | 34 |
35 ElementAnimations::ElementAnimations() : m_animationStyleChange(false) {} | 35 ElementAnimations::ElementAnimations() : m_animationStyleChange(false) {} |
36 | 36 |
37 ElementAnimations::~ElementAnimations() {} | 37 ElementAnimations::~ElementAnimations() {} |
38 | 38 |
39 void ElementAnimations::updateAnimationFlags(ComputedStyle& style) { | 39 void ElementAnimations::updateAnimationFlags(ComputedStyle& style) { |
40 for (const auto& entry : m_animations) { | 40 for (const auto& entry : m_animations) { |
41 const Animation& animation = *entry.key; | 41 const Animation& animation = *entry.key; |
42 DCHECK(animation.effect()); | 42 DCHECK(animation.effect()); |
43 // FIXME: Needs to consider AnimationGroup once added. | 43 // FIXME: Needs to consider AnimationGroup once added. |
44 DCHECK(animation.effect()->isKeyframeEffect()); | 44 DCHECK(animation.effect()->isKeyframeEffectReadOnly()); |
45 const KeyframeEffect& effect = *toKeyframeEffect(animation.effect()); | 45 const KeyframeEffectReadOnly& effect = |
| 46 *toKeyframeEffectReadOnly(animation.effect()); |
46 if (effect.isCurrent()) { | 47 if (effect.isCurrent()) { |
47 if (effect.affects(PropertyHandle(CSSPropertyOpacity))) | 48 if (effect.affects(PropertyHandle(CSSPropertyOpacity))) |
48 style.setHasCurrentOpacityAnimation(true); | 49 style.setHasCurrentOpacityAnimation(true); |
49 if (effect.affects(PropertyHandle(CSSPropertyTransform)) || | 50 if (effect.affects(PropertyHandle(CSSPropertyTransform)) || |
50 effect.affects(PropertyHandle(CSSPropertyRotate)) || | 51 effect.affects(PropertyHandle(CSSPropertyRotate)) || |
51 effect.affects(PropertyHandle(CSSPropertyScale)) || | 52 effect.affects(PropertyHandle(CSSPropertyScale)) || |
52 effect.affects(PropertyHandle(CSSPropertyTranslate))) | 53 effect.affects(PropertyHandle(CSSPropertyTranslate))) |
53 style.setHasCurrentTransformAnimation(true); | 54 style.setHasCurrentTransformAnimation(true); |
54 if (effect.affects(PropertyHandle(CSSPropertyFilter))) | 55 if (effect.affects(PropertyHandle(CSSPropertyFilter))) |
55 style.setHasCurrentFilterAnimation(true); | 56 style.setHasCurrentFilterAnimation(true); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // as Font::operator== will compare versions, hence ComputedStyle::operator== | 118 // as Font::operator== will compare versions, hence ComputedStyle::operator== |
118 // will return false. We avoid using baseComputedStyle (the check for | 119 // will return false. We avoid using baseComputedStyle (the check for |
119 // isFallbackValid()) in that case to avoid triggering the ComputedStyle | 120 // isFallbackValid()) in that case to avoid triggering the ComputedStyle |
120 // comparison ASSERT in updateBaseComputedStyle. | 121 // comparison ASSERT in updateBaseComputedStyle. |
121 return m_animationStyleChange && | 122 return m_animationStyleChange && |
122 (!m_baseComputedStyle || | 123 (!m_baseComputedStyle || |
123 m_baseComputedStyle->font().isFallbackValid()); | 124 m_baseComputedStyle->font().isFallbackValid()); |
124 } | 125 } |
125 | 126 |
126 } // namespace blink | 127 } // namespace blink |
OLD | NEW |