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