Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: third_party/WebKit/Source/core/animation/KeyframeEffect.cpp

Issue 2236583003: Rename AnimationEffect to AnimationEffectReadOnly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@deprecated-assert
Patch Set: Rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
78 78
79 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme nt* element, const DictionarySequenceOrDictionary& effectInput, ExceptionState& exceptionState) 79 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme nt* element, const DictionarySequenceOrDictionary& effectInput, ExceptionState& exceptionState)
80 { 80 {
81 DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); 81 DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
82 if (element) 82 if (element)
83 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectNoTiming); 83 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectNoTiming);
84 return create(element, EffectInput::convert(element, effectInput, executionC ontext, exceptionState), Timing()); 84 return create(element, EffectInput::convert(element, effectInput, executionC ontext, exceptionState), Timing());
85 } 85 }
86 86
87 KeyframeEffect::KeyframeEffect(Element* target, EffectModel* model, const Timing & timing, Priority priority, EventDelegate* eventDelegate) 87 KeyframeEffect::KeyframeEffect(Element* target, EffectModel* model, const Timing & timing, Priority priority, EventDelegate* eventDelegate)
88 : AnimationEffect(timing, eventDelegate) 88 : AnimationEffectReadOnly(timing, eventDelegate)
89 , m_target(target) 89 , m_target(target)
90 , m_model(model) 90 , m_model(model)
91 , m_sampledEffect(nullptr) 91 , m_sampledEffect(nullptr)
92 , m_priority(priority) 92 , m_priority(priority)
93 { 93 {
94 } 94 }
95 95
96 KeyframeEffect::~KeyframeEffect() 96 KeyframeEffect::~KeyframeEffect()
97 { 97 {
98 } 98 }
99 99
100 void KeyframeEffect::attach(Animation* animation) 100 void KeyframeEffect::attach(Animation* animation)
101 { 101 {
102 if (m_target) { 102 if (m_target) {
103 m_target->ensureElementAnimations().animations().add(animation); 103 m_target->ensureElementAnimations().animations().add(animation);
104 m_target->setNeedsAnimationStyleRecalc(); 104 m_target->setNeedsAnimationStyleRecalc();
105 if (RuntimeEnabledFeatures::webAnimationsSVGEnabled() && m_target->isSVG Element()) 105 if (RuntimeEnabledFeatures::webAnimationsSVGEnabled() && m_target->isSVG Element())
106 toSVGElement(m_target)->setWebAnimationsPending(); 106 toSVGElement(m_target)->setWebAnimationsPending();
107 } 107 }
108 AnimationEffect::attach(animation); 108 AnimationEffectReadOnly::attach(animation);
109 } 109 }
110 110
111 void KeyframeEffect::detach() 111 void KeyframeEffect::detach()
112 { 112 {
113 if (m_target) 113 if (m_target)
114 m_target->elementAnimations()->animations().remove(animation()); 114 m_target->elementAnimations()->animations().remove(animation());
115 if (m_sampledEffect) 115 if (m_sampledEffect)
116 clearEffects(); 116 clearEffects();
117 AnimationEffect::detach(); 117 AnimationEffectReadOnly::detach();
118 } 118 }
119 119
120 void KeyframeEffect::specifiedTimingChanged() 120 void KeyframeEffect::specifiedTimingChanged()
121 { 121 {
122 if (animation()) { 122 if (animation()) {
123 // FIXME: Needs to consider groups when added. 123 // FIXME: Needs to consider groups when added.
124 DCHECK_EQ(animation()->effect(), this); 124 DCHECK_EQ(animation()->effect(), this);
125 animation()->setCompositorPending(true); 125 animation()->setCompositorPending(true);
126 } 126 }
127 } 127 }
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 DCHECK(m_target); 359 DCHECK(m_target);
360 DCHECK(animation()); 360 DCHECK(animation());
361 CompositorAnimations::attachCompositedLayers(*m_target, *animation()); 361 CompositorAnimations::attachCompositedLayers(*m_target, *animation());
362 } 362 }
363 363
364 DEFINE_TRACE(KeyframeEffect) 364 DEFINE_TRACE(KeyframeEffect)
365 { 365 {
366 visitor->trace(m_target); 366 visitor->trace(m_target);
367 visitor->trace(m_model); 367 visitor->trace(m_model);
368 visitor->trace(m_sampledEffect); 368 visitor->trace(m_sampledEffect);
369 AnimationEffect::trace(visitor); 369 AnimationEffectReadOnly::trace(visitor);
370 } 370 }
371 371
372 } // namespace blink 372 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698