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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 case CSSPropertyWebkitTransformOriginY: | 79 case CSSPropertyWebkitTransformOriginY: |
80 case CSSPropertyWebkitTransformOriginZ: | 80 case CSSPropertyWebkitTransformOriginZ: |
81 case CSSPropertyWebkitTransformOrigin: | 81 case CSSPropertyWebkitTransformOrigin: |
82 return CSSPropertyTransformOrigin; | 82 return CSSPropertyTransformOrigin; |
83 default: | 83 default: |
84 break; | 84 break; |
85 } | 85 } |
86 return property; | 86 return property; |
87 } | 87 } |
88 | 88 |
89 static PassRefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> createKeyframe
Effect(StyleResolver* resolver, const Element* animatingElement, Element& elemen
t, const LayoutStyle& style, LayoutStyle* parentStyle, | 89 static PassRefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> createKeyframe
Effect(StyleResolver* resolver, const Element* animatingElement, Element& elemen
t, const LayoutStyle& style, const LayoutStyle* parentStyle, |
90 const AtomicString& name, TimingFunction* defaultTimingFunction) | 90 const AtomicString& name, TimingFunction* defaultTimingFunction) |
91 { | 91 { |
92 // When the animating element is null, use its parent for scoping purposes. | 92 // When the animating element is null, use its parent for scoping purposes. |
93 const Element* elementForScoping = animatingElement ? animatingElement : &el
ement; | 93 const Element* elementForScoping = animatingElement ? animatingElement : &el
ement; |
94 const StyleRuleKeyframes* keyframesRule = resolver->findKeyframesRule(elemen
tForScoping, name); | 94 const StyleRuleKeyframes* keyframesRule = resolver->findKeyframesRule(elemen
tForScoping, name); |
95 ASSERT(keyframesRule); | 95 ASSERT(keyframesRule); |
96 | 96 |
97 AnimatableValueKeyframeVector keyframes; | 97 AnimatableValueKeyframeVector keyframes; |
98 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe>>& styleKeyframe
s = keyframesRule->keyframes(); | 98 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe>>& styleKeyframe
s = keyframesRule->keyframes(); |
99 | 99 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 220 |
221 bool CSSAnimations::isTransitionAnimationForInspector(const AnimationPlayer& pla
yer) const | 221 bool CSSAnimations::isTransitionAnimationForInspector(const AnimationPlayer& pla
yer) const |
222 { | 222 { |
223 for (const auto& it : m_transitions) { | 223 for (const auto& it : m_transitions) { |
224 if (it.value.player->sequenceNumber() == player.sequenceNumber()) | 224 if (it.value.player->sequenceNumber() == player.sequenceNumber()) |
225 return true; | 225 return true; |
226 } | 226 } |
227 return false; | 227 return false; |
228 } | 228 } |
229 | 229 |
230 PassOwnPtrWillBeRawPtr<CSSAnimationUpdate> CSSAnimations::calculateUpdate(const
Element* animatingElement, Element& element, const LayoutStyle& style, LayoutSty
le* parentStyle, StyleResolver* resolver) | 230 PassOwnPtrWillBeRawPtr<CSSAnimationUpdate> CSSAnimations::calculateUpdate(const
Element* animatingElement, Element& element, const LayoutStyle& style, const Lay
outStyle* parentStyle, StyleResolver* resolver) |
231 { | 231 { |
232 OwnPtrWillBeRawPtr<CSSAnimationUpdate> update = adoptPtrWillBeNoop(new CSSAn
imationUpdate()); | 232 OwnPtrWillBeRawPtr<CSSAnimationUpdate> update = adoptPtrWillBeNoop(new CSSAn
imationUpdate()); |
233 calculateAnimationUpdate(update.get(), animatingElement, element, style, par
entStyle, resolver); | 233 calculateAnimationUpdate(update.get(), animatingElement, element, style, par
entStyle, resolver); |
234 calculateAnimationActiveInterpolations(update.get(), animatingElement, eleme
nt.document().timeline().currentTimeInternal()); | 234 calculateAnimationActiveInterpolations(update.get(), animatingElement, eleme
nt.document().timeline().currentTimeInternal()); |
235 calculateTransitionUpdate(update.get(), animatingElement, style); | 235 calculateTransitionUpdate(update.get(), animatingElement, style); |
236 calculateTransitionActiveInterpolations(update.get(), animatingElement, elem
ent.document().timeline().currentTimeInternal()); | 236 calculateTransitionActiveInterpolations(update.get(), animatingElement, elem
ent.document().timeline().currentTimeInternal()); |
237 return update->isEmpty() ? nullptr : update.release(); | 237 return update->isEmpty() ? nullptr : update.release(); |
238 } | 238 } |
239 | 239 |
240 void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate* update, const E
lement* animatingElement, Element& element, const LayoutStyle& style, LayoutStyl
e* parentStyle, StyleResolver* resolver) | 240 void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate* update, const E
lement* animatingElement, Element& element, const LayoutStyle& style, const Layo
utStyle* parentStyle, StyleResolver* resolver) |
241 { | 241 { |
242 const ActiveAnimations* activeAnimations = animatingElement ? animatingEleme
nt->activeAnimations() : nullptr; | 242 const ActiveAnimations* activeAnimations = animatingElement ? animatingEleme
nt->activeAnimations() : nullptr; |
243 | 243 |
244 bool isAnimationStyleChange = activeAnimations && activeAnimations->isAnimat
ionStyleChange(); | 244 bool isAnimationStyleChange = activeAnimations && activeAnimations->isAnimat
ionStyleChange(); |
245 | 245 |
246 #if !ENABLE(ASSERT) | 246 #if !ENABLE(ASSERT) |
247 // If we're in an animation style change, no animations can have started, be
en cancelled or changed play state. | 247 // If we're in an animation style change, no animations can have started, be
en cancelled or changed play state. |
248 // When ASSERT is enabled, we verify this optimization. | 248 // When ASSERT is enabled, we verify this optimization. |
249 if (isAnimationStyleChange) | 249 if (isAnimationStyleChange) |
250 return; | 250 return; |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 visitor->trace(m_activeInterpolationsForAnimations); | 805 visitor->trace(m_activeInterpolationsForAnimations); |
806 visitor->trace(m_activeInterpolationsForTransitions); | 806 visitor->trace(m_activeInterpolationsForTransitions); |
807 visitor->trace(m_newAnimations); | 807 visitor->trace(m_newAnimations); |
808 visitor->trace(m_suppressedAnimationPlayers); | 808 visitor->trace(m_suppressedAnimationPlayers); |
809 visitor->trace(m_animationsWithUpdates); | 809 visitor->trace(m_animationsWithUpdates); |
810 visitor->trace(m_animationsWithStyleUpdates); | 810 visitor->trace(m_animationsWithStyleUpdates); |
811 #endif | 811 #endif |
812 } | 812 } |
813 | 813 |
814 } // namespace blink | 814 } // namespace blink |
OLD | NEW |