| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 break; | 81 break; |
| 82 } | 82 } |
| 83 return property; | 83 return property; |
| 84 } | 84 } |
| 85 | 85 |
| 86 static void resolveKeyframes(StyleResolver* resolver, const Element* animatingEl
ement, Element& element, const RenderStyle& style, RenderStyle* parentStyle, con
st AtomicString& name, TimingFunction* defaultTimingFunction, | 86 static void resolveKeyframes(StyleResolver* resolver, const Element* animatingEl
ement, Element& element, const RenderStyle& style, RenderStyle* parentStyle, con
st AtomicString& name, TimingFunction* defaultTimingFunction, |
| 87 AnimatableValueKeyframeVector& keyframes) | 87 AnimatableValueKeyframeVector& keyframes) |
| 88 { | 88 { |
| 89 // When the animating element is null, use its parent for scoping purposes. | 89 // When the animating element is null, use its parent for scoping purposes. |
| 90 const Element* elementForScoping = animatingElement ? animatingElement : &el
ement; | 90 const Element* elementForScoping = animatingElement ? animatingElement : &el
ement; |
| 91 const StyleRuleKeyframes* keyframesRule = resolver->findKeyframesRule(elemen
tForScoping, name); | 91 const StyleRuleKeyframes* keyframesRule = resolver->findKeyframesRule(elemen
tForScoping, name).get(); |
| 92 if (!keyframesRule) | 92 if (!keyframesRule) |
| 93 return; | 93 return; |
| 94 | 94 |
| 95 const WillBeHeapVector<RefPtrWillBeMember<StyleKeyframe>>& styleKeyframes =
keyframesRule->keyframes(); | 95 const WillBeHeapVector<RefPtrWillBeMember<StyleKeyframe>>& styleKeyframes =
keyframesRule->keyframes(); |
| 96 | 96 |
| 97 // Construct and populate the style for each keyframe | 97 // Construct and populate the style for each keyframe |
| 98 PropertySet specifiedPropertiesForUseCounter; | 98 PropertySet specifiedPropertiesForUseCounter; |
| 99 for (size_t i = 0; i < styleKeyframes.size(); ++i) { | 99 for (size_t i = 0; i < styleKeyframes.size(); ++i) { |
| 100 const StyleKeyframe* styleKeyframe = styleKeyframes[i].get(); | 100 const StyleKeyframe* styleKeyframe = styleKeyframes[i].get(); |
| 101 RefPtr<RenderStyle> keyframeStyle = resolver->styleForKeyframe(element,
style, parentStyle, styleKeyframe, name); | 101 RefPtr<RenderStyle> keyframeStyle = resolver->styleForKeyframe(element,
style, parentStyle, styleKeyframe, name); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 199 |
| 200 } // namespace | 200 } // namespace |
| 201 | 201 |
| 202 CSSAnimations::CSSAnimations() | 202 CSSAnimations::CSSAnimations() |
| 203 { | 203 { |
| 204 } | 204 } |
| 205 | 205 |
| 206 const AtomicString CSSAnimations::getAnimationNameForInspector(const AnimationPl
ayer& player) | 206 const AtomicString CSSAnimations::getAnimationNameForInspector(const AnimationPl
ayer& player) |
| 207 { | 207 { |
| 208 for (const auto& it : m_animations) { | 208 for (const auto& it : m_animations) { |
| 209 if (it.value->sequenceNumber() == player.sequenceNumber()) | 209 if (it.value.player->sequenceNumber() == player.sequenceNumber()) |
| 210 return it.key; | 210 return it.key; |
| 211 } | 211 } |
| 212 return nullAtom; | 212 return nullAtom; |
| 213 } | 213 } |
| 214 | 214 |
| 215 PassOwnPtrWillBeRawPtr<CSSAnimationUpdate> CSSAnimations::calculateUpdate(const
Element* animatingElement, Element& element, const RenderStyle& style, RenderSty
le* parentStyle, StyleResolver* resolver) | 215 PassOwnPtrWillBeRawPtr<CSSAnimationUpdate> CSSAnimations::calculateUpdate(const
Element* animatingElement, Element& element, const RenderStyle& style, RenderSty
le* parentStyle, StyleResolver* resolver) |
| 216 { | 216 { |
| 217 OwnPtrWillBeRawPtr<CSSAnimationUpdate> update = adoptPtrWillBeNoop(new CSSAn
imationUpdate()); | 217 OwnPtrWillBeRawPtr<CSSAnimationUpdate> update = adoptPtrWillBeNoop(new CSSAn
imationUpdate()); |
| 218 calculateAnimationUpdate(update.get(), animatingElement, element, style, par
entStyle, resolver); | 218 calculateAnimationUpdate(update.get(), animatingElement, element, style, par
entStyle, resolver); |
| 219 calculateAnimationActiveInterpolations(update.get(), animatingElement, eleme
nt.document().timeline().currentTimeInternal()); | 219 calculateAnimationActiveInterpolations(update.get(), animatingElement, eleme
nt.document().timeline().currentTimeInternal()); |
| 220 calculateTransitionUpdate(update.get(), animatingElement, style); | 220 calculateTransitionUpdate(update.get(), animatingElement, style); |
| 221 calculateTransitionActiveInterpolations(update.get(), animatingElement, elem
ent.document().timeline().currentTimeInternal()); | 221 calculateTransitionActiveInterpolations(update.get(), animatingElement, elem
ent.document().timeline().currentTimeInternal()); |
| 222 return update->isEmpty() ? nullptr : update.release(); | 222 return update->isEmpty() ? nullptr : update.release(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate* update, const E
lement* animatingElement, Element& element, const RenderStyle& style, RenderStyl
e* parentStyle, StyleResolver* resolver) | 225 void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate* update, const E
lement* animatingElement, Element& element, const RenderStyle& style, RenderStyl
e* parentStyle, StyleResolver* resolver) |
| 226 { | 226 { |
| 227 const ActiveAnimations* activeAnimations = animatingElement ? animatingEleme
nt->activeAnimations() : nullptr; | 227 const ActiveAnimations* activeAnimations = animatingElement ? animatingEleme
nt->activeAnimations() : nullptr; |
| 228 | 228 |
| 229 #if !ENABLE(ASSERT) | 229 #if !ENABLE(ASSERT) |
| 230 // If we're in an animation style change, no animations can have started, be
en cancelled or changed play state. | 230 // If we're in an animation style change, no animations can have started, be
en cancelled or changed play state. |
| 231 // When ASSERT is enabled, we verify this optimization. | 231 // When ASSERT is enabled, we verify this optimization. |
| 232 if (activeAnimations && activeAnimations->isAnimationStyleChange()) | 232 if (activeAnimations && activeAnimations->isAnimationStyleChange()) |
| 233 return; | 233 return; |
| 234 #endif | 234 #endif |
| 235 | 235 |
| 236 const CSSAnimationData* animationData = style.animations(); | 236 const CSSAnimationData* animationData = style.animations(); |
| 237 const CSSAnimations* cssAnimations = activeAnimations ? &activeAnimations->c
ssAnimations() : nullptr; | 237 const CSSAnimations* cssAnimations = activeAnimations ? &activeAnimations->c
ssAnimations() : nullptr; |
| 238 const Element* elementForScoping = animatingElement ? animatingElement : &el
ement; |
| 238 | 239 |
| 239 HashSet<AtomicString> inactive; | 240 HashSet<AtomicString> inactive; |
| 240 if (cssAnimations) { | 241 if (cssAnimations) { |
| 241 for (const auto& entry : cssAnimations->m_animations) | 242 for (const auto& entry : cssAnimations->m_animations) |
| 242 inactive.add(entry.key); | 243 inactive.add(entry.key); |
| 243 } | 244 } |
| 244 | 245 |
| 245 if (style.display() != NONE) { | 246 if (style.display() != NONE) { |
| 246 for (size_t i = 0; animationData && i < animationData->nameList().size()
; ++i) { | 247 for (size_t i = 0; animationData && i < animationData->nameList().size()
; ++i) { |
| 247 AtomicString animationName(animationData->nameList()[i]); | 248 AtomicString animationName(animationData->nameList()[i]); |
| 248 if (animationName == CSSAnimationData::initialName()) | 249 if (animationName == CSSAnimationData::initialName()) |
| 249 continue; | 250 continue; |
| 250 | 251 |
| 251 const bool isPaused = CSSTimingData::getRepeated(animationData->play
StateList(), i) == AnimPlayStatePaused; | 252 const bool isPaused = CSSTimingData::getRepeated(animationData->play
StateList(), i) == AnimPlayStatePaused; |
| 252 | 253 |
| 253 Timing timing = animationData->convertToTiming(i); | 254 Timing timing = animationData->convertToTiming(i); |
| 255 Timing specifiedTiming = timing; |
| 254 RefPtr<TimingFunction> keyframeTimingFunction = timing.timingFunctio
n; | 256 RefPtr<TimingFunction> keyframeTimingFunction = timing.timingFunctio
n; |
| 255 timing.timingFunction = Timing::defaults().timingFunction; | 257 timing.timingFunction = Timing::defaults().timingFunction; |
| 256 | 258 |
| 259 RefPtrWillBeRawPtr<StyleRuleKeyframes> keyframesRule = resolver->fin
dKeyframesRule(elementForScoping, animationName); |
| 260 if (!keyframesRule) |
| 261 continue; // Cancel the animation if there's no style rule for i
t. |
| 262 |
| 257 if (cssAnimations) { | 263 if (cssAnimations) { |
| 258 AnimationMap::const_iterator existing(cssAnimations->m_animation
s.find(animationName)); | 264 AnimationMap::const_iterator existing(cssAnimations->m_animation
s.find(animationName)); |
| 259 if (existing != cssAnimations->m_animations.end()) { | 265 if (existing != cssAnimations->m_animations.end()) { |
| 260 inactive.remove(animationName); | 266 inactive.remove(animationName); |
| 261 | 267 |
| 262 AnimationPlayer* player = existing->value.get(); | 268 const RunningAnimation& runningAnimation = existing->value; |
| 269 AnimationPlayer* player = runningAnimation.player.get(); |
| 263 | 270 |
| 264 // FIXME: Should handle changes in the timing function. | 271 ASSERT(keyframesRule); |
| 265 if (timing != player->source()->specifiedTiming()) { | 272 if (keyframesRule != runningAnimation.styleRule || keyframes
Rule->styleChangeCounter() != runningAnimation.styleChangeCounter || runningAnim
ation.specifiedTiming != specifiedTiming) { |
| 266 ASSERT(!activeAnimations || !activeAnimations->isAnimati
onStyleChange()); | |
| 267 | |
| 268 AnimatableValueKeyframeVector resolvedKeyframes; | 273 AnimatableValueKeyframeVector resolvedKeyframes; |
| 269 resolveKeyframes(resolver, animatingElement, element, st
yle, parentStyle, animationName, keyframeTimingFunction.get(), resolvedKeyframes
); | 274 resolveKeyframes(resolver, animatingElement, element, st
yle, parentStyle, animationName, keyframeTimingFunction.get(), resolvedKeyframes
); |
| 270 | 275 |
| 271 update->updateAnimationTiming(player, InertAnimation::cr
eate(AnimatableValueKeyframeEffectModel::create(resolvedKeyframes), | 276 update->updateAnimation(animationName, player, InertAnim
ation::create(AnimatableValueKeyframeEffectModel::create(resolvedKeyframes), |
| 272 timing, isPaused, player->currentTimeInternal()), ti
ming); | 277 timing, isPaused, player->currentTimeInternal()), sp
ecifiedTiming, keyframesRule, keyframesRule->styleChangeCounter()); |
| 273 } | 278 } |
| 274 | 279 |
| 275 if (isPaused != player->paused()) { | 280 if (isPaused != player->paused()) { |
| 276 ASSERT(!activeAnimations || !activeAnimations->isAnimati
onStyleChange()); | 281 ASSERT(!activeAnimations || !activeAnimations->isAnimati
onStyleChange()); |
| 277 update->toggleAnimationPaused(animationName); | 282 update->toggleAnimationPaused(animationName); |
| 278 } | 283 } |
| 279 | 284 |
| 280 continue; | 285 continue; |
| 281 } | 286 } |
| 282 } | 287 } |
| 283 | 288 |
| 284 AnimatableValueKeyframeVector resolvedKeyframes; | 289 AnimatableValueKeyframeVector resolvedKeyframes; |
| 285 resolveKeyframes(resolver, animatingElement, element, style, parentS
tyle, animationName, keyframeTimingFunction.get(), resolvedKeyframes); | 290 resolveKeyframes(resolver, animatingElement, element, style, parentS
tyle, animationName, keyframeTimingFunction.get(), resolvedKeyframes); |
| 286 if (!resolvedKeyframes.isEmpty()) { | 291 if (!resolvedKeyframes.isEmpty()) { |
| 287 ASSERT(!activeAnimations || !activeAnimations->isAnimationStyleC
hange()); | 292 ASSERT(!activeAnimations || !activeAnimations->isAnimationStyleC
hange()); |
| 288 update->startAnimation(animationName, InertAnimation::create(Ani
matableValueKeyframeEffectModel::create(resolvedKeyframes), timing, isPaused, 0)
); | 293 unsigned styleChangeCounter = keyframesRule ? keyframesRule->sty
leChangeCounter() : 0; |
| 294 update->startAnimation(animationName, InertAnimation::create(Ani
matableValueKeyframeEffectModel::create(resolvedKeyframes), timing, isPaused, 0)
, specifiedTiming, keyframesRule, styleChangeCounter); |
| 289 } | 295 } |
| 290 } | 296 } |
| 291 } | 297 } |
| 292 | 298 |
| 293 ASSERT(inactive.isEmpty() || cssAnimations); | 299 ASSERT(inactive.isEmpty() || cssAnimations); |
| 294 for (const AtomicString& animationName : inactive) { | 300 for (const AtomicString& animationName : inactive) { |
| 295 ASSERT(!activeAnimations || !activeAnimations->isAnimationStyleChange())
; | 301 ASSERT(!activeAnimations || !activeAnimations->isAnimationStyleChange())
; |
| 296 update->cancelAnimation(animationName, *cssAnimations->m_animations.get(
animationName)); | 302 update->cancelAnimation(animationName, *cssAnimations->m_animations.get(
animationName).player); |
| 297 } | 303 } |
| 298 } | 304 } |
| 299 | 305 |
| 300 void CSSAnimations::maybeApplyPendingUpdate(Element* element) | 306 void CSSAnimations::maybeApplyPendingUpdate(Element* element) |
| 301 { | 307 { |
| 302 if (!m_pendingUpdate) { | 308 if (!m_pendingUpdate) { |
| 303 m_previousActiveInterpolationsForAnimations.clear(); | 309 m_previousActiveInterpolationsForAnimations.clear(); |
| 304 return; | 310 return; |
| 305 } | 311 } |
| 306 | 312 |
| 307 OwnPtrWillBeRawPtr<CSSAnimationUpdate> update = m_pendingUpdate.release(); | 313 OwnPtrWillBeRawPtr<CSSAnimationUpdate> update = m_pendingUpdate.release(); |
| 308 | 314 |
| 309 m_previousActiveInterpolationsForAnimations.swap(update->activeInterpolation
sForAnimations()); | 315 m_previousActiveInterpolationsForAnimations.swap(update->activeInterpolation
sForAnimations()); |
| 310 | 316 |
| 311 // FIXME: cancelling, pausing, unpausing animations all query compositingSta
te, which is not necessarily up to date here | 317 // FIXME: cancelling, pausing, unpausing animations all query compositingSta
te, which is not necessarily up to date here |
| 312 // since we call this from recalc style. | 318 // since we call this from recalc style. |
| 313 // https://code.google.com/p/chromium/issues/detail?id=339847 | 319 // https://code.google.com/p/chromium/issues/detail?id=339847 |
| 314 DisableCompositingQueryAsserts disabler; | 320 DisableCompositingQueryAsserts disabler; |
| 315 | 321 |
| 316 for (const AtomicString& animationName : update->cancelledAnimationNames())
{ | 322 for (const AtomicString& animationName : update->cancelledAnimationNames())
{ |
| 317 RefPtrWillBeRawPtr<AnimationPlayer> player = m_animations.take(animation
Name); | 323 RefPtrWillBeRawPtr<AnimationPlayer> player = m_animations.take(animation
Name).player; |
| 318 player->cancel(); | 324 player->cancel(); |
| 319 player->update(TimingUpdateOnDemand); | 325 player->update(TimingUpdateOnDemand); |
| 320 } | 326 } |
| 321 | 327 |
| 322 for (const AtomicString& animationName : update->animationsWithPauseToggled(
)) { | 328 for (const AtomicString& animationName : update->animationsWithPauseToggled(
)) { |
| 323 AnimationPlayer* player = m_animations.get(animationName); | 329 AnimationPlayer* player = m_animations.get(animationName).player.get(); |
| 324 if (player->paused()) | 330 if (player->paused()) |
| 325 player->unpause(); | 331 player->unpause(); |
| 326 else | 332 else |
| 327 player->pause(); | 333 player->pause(); |
| 328 if (player->outdated()) | 334 if (player->outdated()) |
| 329 player->update(TimingUpdateOnDemand); | 335 player->update(TimingUpdateOnDemand); |
| 330 } | 336 } |
| 331 | 337 |
| 332 for (const auto& timingUpdate : update->animationsWithTimingUpdates()) { | 338 for (const auto& entry : update->animationsWithUpdates()) { |
| 333 timingUpdate.player->source()->updateSpecifiedTiming(timingUpdate.newTim
ing); | 339 Animation* animation = toAnimation(entry.player->source()); |
| 334 timingUpdate.player->update(TimingUpdateOnDemand); | 340 |
| 341 animation->setEffect(entry.animation->effect()); |
| 342 animation->updateSpecifiedTiming(entry.animation->specifiedTiming()); |
| 343 |
| 344 auto& runningAnimation = m_animations.find(entry.name)->value; |
| 345 runningAnimation.styleRule = entry.styleRule; |
| 346 runningAnimation.styleChangeCounter = entry.styleChangeCounter; |
| 347 runningAnimation.specifiedTiming = entry.specifiedTiming; |
| 335 } | 348 } |
| 336 | 349 |
| 337 for (const auto& entry : update->newAnimations()) { | 350 for (const auto& entry : update->newAnimations()) { |
| 338 const InertAnimation* inertAnimation = entry.animation.get(); | 351 const InertAnimation* inertAnimation = entry.animation.get(); |
| 339 OwnPtrWillBeRawPtr<AnimationEventDelegate> eventDelegate = adoptPtrWillB
eNoop(new AnimationEventDelegate(element, entry.name)); | 352 OwnPtrWillBeRawPtr<AnimationEventDelegate> eventDelegate = adoptPtrWillB
eNoop(new AnimationEventDelegate(element, entry.name)); |
| 340 RefPtrWillBeRawPtr<Animation> animation = Animation::create(element, ine
rtAnimation->effect(), inertAnimation->specifiedTiming(), Animation::DefaultPrio
rity, eventDelegate.release()); | 353 RefPtrWillBeRawPtr<Animation> animation = Animation::create(element, ine
rtAnimation->effect(), inertAnimation->specifiedTiming(), Animation::DefaultPrio
rity, eventDelegate.release()); |
| 341 animation->setName(inertAnimation->name()); | 354 animation->setName(inertAnimation->name()); |
| 342 RefPtrWillBeRawPtr<AnimationPlayer> player = element->document().timelin
e().createAnimationPlayer(animation.get()); | 355 RefPtrWillBeRawPtr<AnimationPlayer> player = element->document().timelin
e().createAnimationPlayer(animation.get()); |
| 343 if (inertAnimation->paused()) | 356 if (inertAnimation->paused()) |
| 344 player->pause(); | 357 player->pause(); |
| 345 player->update(TimingUpdateOnDemand); | 358 player->update(TimingUpdateOnDemand); |
| 346 m_animations.set(entry.name, player.get()); | 359 |
| 360 RunningAnimation runningAnimation; |
| 361 runningAnimation.player = player; |
| 362 runningAnimation.specifiedTiming = entry.timing; |
| 363 runningAnimation.styleRule = entry.styleRule; |
| 364 runningAnimation.styleChangeCounter = entry.styleChangeCounter; |
| 365 |
| 366 m_animations.set(entry.name, runningAnimation); |
| 347 } | 367 } |
| 348 | 368 |
| 349 // Transitions that are run on the compositor only update main-thread state | 369 // Transitions that are run on the compositor only update main-thread state |
| 350 // lazily. However, we need the new state to know what the from state shoud | 370 // lazily. However, we need the new state to know what the from state shoud |
| 351 // be when transitions are retargeted. Instead of triggering complete style | 371 // be when transitions are retargeted. Instead of triggering complete style |
| 352 // recalculation, we find these cases by searching for new transitions that | 372 // recalculation, we find these cases by searching for new transitions that |
| 353 // have matching cancelled animation property IDs on the compositor. | 373 // have matching cancelled animation property IDs on the compositor. |
| 354 WillBeHeapHashMap<CSSPropertyID, std::pair<RefPtrWillBeMember<Animation>, do
uble>> retargetedCompositorTransitions; | 374 WillBeHeapHashMap<CSSPropertyID, std::pair<RefPtrWillBeMember<Animation>, do
uble>> retargetedCompositorTransitions; |
| 355 for (CSSPropertyID id : update->cancelledTransitions()) { | 375 for (CSSPropertyID id : update->cancelledTransitions()) { |
| 356 ASSERT(m_transitions.contains(id)); | 376 ASSERT(m_transitions.contains(id)); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 // ASSERT(player.finishedInternal() || !(activeAnimations && act
iveAnimations->isAnimationStyleChange())); | 546 // ASSERT(player.finishedInternal() || !(activeAnimations && act
iveAnimations->isAnimationStyleChange())); |
| 527 update->cancelTransition(id); | 547 update->cancelTransition(id); |
| 528 } | 548 } |
| 529 } | 549 } |
| 530 } | 550 } |
| 531 } | 551 } |
| 532 | 552 |
| 533 void CSSAnimations::cancel() | 553 void CSSAnimations::cancel() |
| 534 { | 554 { |
| 535 for (const auto& entry : m_animations) { | 555 for (const auto& entry : m_animations) { |
| 536 entry.value->cancel(); | 556 entry.value.player->cancel(); |
| 537 entry.value->update(TimingUpdateOnDemand); | 557 entry.value.player->update(TimingUpdateOnDemand); |
| 538 } | 558 } |
| 539 | 559 |
| 540 for (const auto& entry : m_transitions) { | 560 for (const auto& entry : m_transitions) { |
| 541 entry.value.player->cancel(); | 561 entry.value.player->cancel(); |
| 542 entry.value.player->update(TimingUpdateOnDemand); | 562 entry.value.player->update(TimingUpdateOnDemand); |
| 543 } | 563 } |
| 544 | 564 |
| 545 m_animations.clear(); | 565 m_animations.clear(); |
| 546 m_transitions.clear(); | 566 m_transitions.clear(); |
| 547 m_pendingUpdate = nullptr; | 567 m_pendingUpdate = nullptr; |
| 548 } | 568 } |
| 549 | 569 |
| 550 void CSSAnimations::calculateAnimationActiveInterpolations(CSSAnimationUpdate* u
pdate, const Element* animatingElement, double timelineCurrentTime) | 570 void CSSAnimations::calculateAnimationActiveInterpolations(CSSAnimationUpdate* u
pdate, const Element* animatingElement, double timelineCurrentTime) |
| 551 { | 571 { |
| 552 ActiveAnimations* activeAnimations = animatingElement ? animatingElement->ac
tiveAnimations() : nullptr; | 572 ActiveAnimations* activeAnimations = animatingElement ? animatingElement->ac
tiveAnimations() : nullptr; |
| 553 AnimationStack* animationStack = activeAnimations ? &activeAnimations->defau
ltStack() : nullptr; | 573 AnimationStack* animationStack = activeAnimations ? &activeAnimations->defau
ltStack() : nullptr; |
| 554 | 574 |
| 555 if (update->newAnimations().isEmpty() && update->suppressedAnimationAnimatio
nPlayers().isEmpty()) { | 575 if (update->newAnimations().isEmpty() && update->suppressedAnimationAnimatio
nPlayers().isEmpty()) { |
| 556 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> acti
veInterpolationsForAnimations(AnimationStack::activeInterpolations(animationStac
k, 0, 0, Animation::DefaultPriority, timelineCurrentTime)); | 576 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> acti
veInterpolationsForAnimations(AnimationStack::activeInterpolations(animationStac
k, 0, 0, Animation::DefaultPriority, timelineCurrentTime)); |
| 557 update->adoptActiveInterpolationsForAnimations(activeInterpolationsForAn
imations); | 577 update->adoptActiveInterpolationsForAnimations(activeInterpolationsForAn
imations); |
| 558 return; | 578 return; |
| 559 } | 579 } |
| 560 | 580 |
| 561 WillBeHeapVector<RawPtrWillBeMember<InertAnimation>> newAnimations; | 581 WillBeHeapVector<RawPtrWillBeMember<InertAnimation>> newAnimations; |
| 562 for (const auto& newAnimation : update->newAnimations()) | 582 for (const auto& newAnimation : update->newAnimations()) |
| 563 newAnimations.append(newAnimation.animation.get()); | 583 newAnimations.append(newAnimation.animation.get()); |
| 564 for (const auto& updatedAnimation : update->animationsWithTimingUpdates()) | 584 for (const auto& updatedAnimation : update->animationsWithUpdates()) |
| 565 newAnimations.append(updatedAnimation.animation.get()); // Animations wi
th timing updates use a temporary InertAnimation for the current frame. | 585 newAnimations.append(updatedAnimation.animation.get()); // Animations wi
th updates use a temporary InertAnimation for the current frame. |
| 566 | 586 |
| 567 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> activeIn
terpolationsForAnimations(AnimationStack::activeInterpolations(animationStack, &
newAnimations, &update->suppressedAnimationAnimationPlayers(), Animation::Defaul
tPriority, timelineCurrentTime)); | 587 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> activeIn
terpolationsForAnimations(AnimationStack::activeInterpolations(animationStack, &
newAnimations, &update->suppressedAnimationAnimationPlayers(), Animation::Defaul
tPriority, timelineCurrentTime)); |
| 568 update->adoptActiveInterpolationsForAnimations(activeInterpolationsForAnimat
ions); | 588 update->adoptActiveInterpolationsForAnimations(activeInterpolationsForAnimat
ions); |
| 569 } | 589 } |
| 570 | 590 |
| 571 void CSSAnimations::calculateTransitionActiveInterpolations(CSSAnimationUpdate*
update, const Element* animatingElement, double timelineCurrentTime) | 591 void CSSAnimations::calculateTransitionActiveInterpolations(CSSAnimationUpdate*
update, const Element* animatingElement, double timelineCurrentTime) |
| 572 { | 592 { |
| 573 ActiveAnimations* activeAnimations = animatingElement ? animatingElement->ac
tiveAnimations() : nullptr; | 593 ActiveAnimations* activeAnimations = animatingElement ? animatingElement->ac
tiveAnimations() : nullptr; |
| 574 AnimationStack* animationStack = activeAnimations ? &activeAnimations->defau
ltStack() : nullptr; | 594 AnimationStack* animationStack = activeAnimations ? &activeAnimations->defau
ltStack() : nullptr; |
| 575 | 595 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 } | 761 } |
| 742 | 762 |
| 743 void CSSAnimationUpdate::trace(Visitor* visitor) | 763 void CSSAnimationUpdate::trace(Visitor* visitor) |
| 744 { | 764 { |
| 745 #if ENABLE(OILPAN) | 765 #if ENABLE(OILPAN) |
| 746 visitor->trace(m_newTransitions); | 766 visitor->trace(m_newTransitions); |
| 747 visitor->trace(m_activeInterpolationsForAnimations); | 767 visitor->trace(m_activeInterpolationsForAnimations); |
| 748 visitor->trace(m_activeInterpolationsForTransitions); | 768 visitor->trace(m_activeInterpolationsForTransitions); |
| 749 visitor->trace(m_newAnimations); | 769 visitor->trace(m_newAnimations); |
| 750 visitor->trace(m_suppressedAnimationPlayers); | 770 visitor->trace(m_suppressedAnimationPlayers); |
| 751 visitor->trace(m_animationsWithTimingUpdates); | 771 visitor->trace(m_animationsWithUpdates); |
| 752 #endif | 772 #endif |
| 753 } | 773 } |
| 754 | 774 |
| 755 } // namespace blink | 775 } // namespace blink |
| OLD | NEW |