Index: Source/core/animation/css/CSSAnimations.cpp |
diff --git a/Source/core/animation/css/CSSAnimations.cpp b/Source/core/animation/css/CSSAnimations.cpp |
index 8697d4311ba0503be1d3ad1c9b1ef16656b8054a..5721f8905d7c8fdf3d082b70835394be81fcf9bd 100644 |
--- a/Source/core/animation/css/CSSAnimations.cpp |
+++ b/Source/core/animation/css/CSSAnimations.cpp |
@@ -66,7 +66,7 @@ using PropertySet = HashSet<CSSPropertyID>; |
namespace { |
-static PassRefPtrWillBeRawPtr<StringKeyframeEffectModel> createKeyframeEffectModel(StyleResolver* resolver, const Element* animatingElement, Element& element, const ComputedStyle* style, const ComputedStyle* parentStyle, const AtomicString& name, TimingFunction* defaultTimingFunction) |
+static StringKeyframeEffectModel* createKeyframeEffectModel(StyleResolver* resolver, const Element* animatingElement, Element& element, const ComputedStyle* style, const ComputedStyle* parentStyle, const AtomicString& name, TimingFunction* defaultTimingFunction) |
{ |
// When the animating element is null, use its parent for scoping purposes. |
const Element* elementForScoping = animatingElement ? animatingElement : &element; |
@@ -80,7 +80,7 @@ static PassRefPtrWillBeRawPtr<StringKeyframeEffectModel> createKeyframeEffectMod |
PropertySet specifiedPropertiesForUseCounter; |
for (size_t i = 0; i < styleKeyframes.size(); ++i) { |
const StyleRuleKeyframe* styleKeyframe = styleKeyframes[i].get(); |
- RefPtrWillBeRawPtr<StringKeyframe> keyframe = StringKeyframe::create(); |
+ StringKeyframe* keyframe = StringKeyframe::create(); |
const Vector<double>& offsets = styleKeyframe->keys(); |
ASSERT(!offsets.isEmpty()); |
keyframe->setOffset(offsets[0]); |
@@ -108,7 +108,7 @@ static PassRefPtrWillBeRawPtr<StringKeyframeEffectModel> createKeyframeEffectMod |
keyframes.append(keyframe); |
// The last keyframe specified at a given offset is used. |
for (size_t j = 1; j < offsets.size(); ++j) { |
- keyframes.append(toStringKeyframe(keyframe->cloneWithOffset(offsets[j]).get())); |
+ keyframes.append(toStringKeyframe(keyframe->cloneWithOffset(offsets[j]))); |
} |
} |
@@ -133,14 +133,14 @@ static PassRefPtrWillBeRawPtr<StringKeyframeEffectModel> createKeyframeEffectMod |
keyframes.shrink(targetIndex + 1); |
// Add 0% and 100% keyframes if absent. |
- RefPtrWillBeRawPtr<StringKeyframe> startKeyframe = keyframes.isEmpty() ? nullptr : keyframes[0]; |
+ StringKeyframe* startKeyframe = keyframes.isEmpty() ? nullptr : keyframes[0]; |
if (!startKeyframe || keyframes[0]->offset() != 0) { |
startKeyframe = StringKeyframe::create(); |
startKeyframe->setOffset(0); |
startKeyframe->setEasing(defaultTimingFunction); |
keyframes.prepend(startKeyframe); |
} |
- RefPtrWillBeRawPtr<StringKeyframe> endKeyframe = keyframes[keyframes.size() - 1]; |
+ StringKeyframe* endKeyframe = keyframes[keyframes.size() - 1]; |
if (endKeyframe->offset() != 1) { |
endKeyframe = StringKeyframe::create(); |
endKeyframe->setOffset(1); |
@@ -172,7 +172,7 @@ static PassRefPtrWillBeRawPtr<StringKeyframeEffectModel> createKeyframeEffectMod |
} |
} |
- RefPtrWillBeRawPtr<StringKeyframeEffectModel> model = StringKeyframeEffectModel::create(keyframes, &keyframes[0]->easing()); |
+ StringKeyframeEffectModel* model = StringKeyframeEffectModel::create(keyframes, &keyframes[0]->easing()); |
model->forceConversionsToAnimatableValues(element, style); |
return model; |
} |
@@ -201,14 +201,14 @@ bool CSSAnimations::isTransitionAnimationForInspector(const Animation& animation |
return false; |
} |
-PassOwnPtrWillBeRawPtr<CSSAnimationUpdate> CSSAnimations::calculateUpdate(const Element* animatingElement, Element& element, const ComputedStyle& style, ComputedStyle* parentStyle, StyleResolver* resolver) |
+CSSAnimationUpdate* CSSAnimations::calculateUpdate(const Element* animatingElement, Element& element, const ComputedStyle& style, ComputedStyle* parentStyle, StyleResolver* resolver) |
{ |
- OwnPtrWillBeRawPtr<CSSAnimationUpdate> update = adoptPtrWillBeNoop(new CSSAnimationUpdate()); |
- calculateAnimationUpdate(update.get(), animatingElement, element, style, parentStyle, resolver); |
- calculateAnimationActiveInterpolations(update.get(), animatingElement, element.document().timeline().currentTimeInternal()); |
- calculateTransitionUpdate(update.get(), animatingElement, style); |
- calculateTransitionActiveInterpolations(update.get(), animatingElement, element.document().timeline().currentTimeInternal()); |
- return update->isEmpty() ? nullptr : update.release(); |
+ CSSAnimationUpdate* update = new CSSAnimationUpdate(); |
+ calculateAnimationUpdate(update, animatingElement, element, style, parentStyle, resolver); |
+ calculateAnimationActiveInterpolations(update, animatingElement, element.document().timeline().currentTimeInternal()); |
+ calculateTransitionUpdate(update, animatingElement, style); |
+ calculateTransitionActiveInterpolations(update, animatingElement, element.document().timeline().currentTimeInternal()); |
+ return update->isEmpty() ? nullptr : update; |
} |
void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate* update, const Element* animatingElement, Element& element, const ComputedStyle& style, ComputedStyle* parentStyle, StyleResolver* resolver) |
@@ -303,7 +303,7 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element) |
return; |
} |
- OwnPtrWillBeRawPtr<CSSAnimationUpdate> update = m_pendingUpdate.release(); |
+ CSSAnimationUpdate* update = m_pendingUpdate.release(); |
m_previousActiveInterpolationsForAnimations.swap(update->activeInterpolationsForAnimations()); |
@@ -313,7 +313,7 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element) |
DisableCompositingQueryAsserts disabler; |
for (const AtomicString& animationName : update->cancelledAnimationNames()) { |
- RefPtrWillBeRawPtr<Animation> animation = m_animations.take(animationName)->animation; |
+ Animation* animation = m_animations.take(animationName)->animation; |
animation->cancel(); |
animation->update(TimingUpdateOnDemand); |
} |
@@ -358,15 +358,15 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element) |
for (const auto& entry : update->newAnimations()) { |
const InertEffect* inertAnimation = entry.effect.get(); |
- OwnPtrWillBeRawPtr<AnimationEventDelegate> eventDelegate = adoptPtrWillBeNoop(new AnimationEventDelegate(element, entry.name)); |
- RefPtrWillBeRawPtr<KeyframeEffect> effect = KeyframeEffect::create(element, inertAnimation->model(), inertAnimation->specifiedTiming(), KeyframeEffect::DefaultPriority, eventDelegate.release()); |
+ AnimationEventDelegate* eventDelegate = new AnimationEventDelegate(element, entry.name); |
+ KeyframeEffect* effect = KeyframeEffect::create(element, inertAnimation->model(), inertAnimation->specifiedTiming(), KeyframeEffect::DefaultPriority, eventDelegate); |
effect->setName(inertAnimation->name()); |
- RefPtrWillBeRawPtr<Animation> animation = element->document().timeline().play(effect.get()); |
+ Animation* animation = element->document().timeline().play(effect); |
if (inertAnimation->paused()) |
animation->pause(); |
animation->update(TimingUpdateOnDemand); |
- m_animations.set(entry.name, adoptRefWillBeNoop(new RunningAnimation(animation, entry))); |
+ m_animations.set(entry.name, new RunningAnimation(animation, entry)); |
} |
// Transitions that are run on the compositor only update main-thread state |
@@ -374,14 +374,14 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element) |
// be when transitions are retargeted. Instead of triggering complete style |
// recalculation, we find these cases by searching for new transitions that |
// have matching cancelled animation property IDs on the compositor. |
- WillBeHeapHashMap<CSSPropertyID, std::pair<RefPtrWillBeMember<KeyframeEffect>, double>> retargetedCompositorTransitions; |
+ WillBeHeapHashMap<CSSPropertyID, std::pair<Member<KeyframeEffect>, double>> retargetedCompositorTransitions; |
for (CSSPropertyID id : update->cancelledTransitions()) { |
ASSERT(m_transitions.contains(id)); |
- RefPtrWillBeRawPtr<Animation> animation = m_transitions.take(id).animation; |
+ Animation* animation = m_transitions.take(id).animation; |
KeyframeEffect* effect = toKeyframeEffect(animation->source()); |
if (effect->hasActiveAnimationsOnCompositor(id) && update->newTransitions().find(id) != update->newTransitions().end() && !animation->limited()) |
- retargetedCompositorTransitions.add(id, std::pair<RefPtrWillBeMember<KeyframeEffect>, double>(effect, animation->startTimeInternal())); |
+ retargetedCompositorTransitions.add(id, std::pair<Member<KeyframeEffect>, double>(effect, animation->startTimeInternal())); |
animation->cancel(); |
// after cancelation, transitions must be downgraded or they'll fail |
// to be considered when retriggering themselves. This can happen if |
@@ -394,7 +394,7 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element) |
for (CSSPropertyID id : update->finishedTransitions()) { |
// This transition can also be cancelled and finished at the same time |
if (m_transitions.contains(id)) { |
- RefPtrWillBeRawPtr<Animation> animation = m_transitions.take(id).animation; |
+ Animation* animation = m_transitions.take(id).animation; |
// Transition must be downgraded |
if (animation->source() && animation->source()->isAnimation()) |
toKeyframeEffect(animation->source())->downgradeToNormal(); |
@@ -410,13 +410,13 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element) |
CSSPropertyID id = newTransition.id; |
InertEffect* inertAnimation = newTransition.effect.get(); |
- OwnPtrWillBeRawPtr<TransitionEventDelegate> eventDelegate = adoptPtrWillBeNoop(new TransitionEventDelegate(element, id)); |
+ TransitionEventDelegate* eventDelegate = new TransitionEventDelegate(element, id); |
- RefPtrWillBeRawPtr<EffectModel> model = inertAnimation->model(); |
+ EffectModel* model = inertAnimation->model(); |
if (retargetedCompositorTransitions.contains(id)) { |
- const std::pair<RefPtrWillBeMember<KeyframeEffect>, double>& oldTransition = retargetedCompositorTransitions.get(id); |
- RefPtrWillBeRawPtr<KeyframeEffect> oldAnimation = oldTransition.first; |
+ const std::pair<Member<KeyframeEffect>, double>& oldTransition = retargetedCompositorTransitions.get(id); |
+ KeyframeEffect* oldAnimation = oldTransition.first; |
double oldStartTime = oldTransition.second; |
double inheritedTime = isNull(oldStartTime) ? 0 : element->document().timeline().currentTimeInternal() - oldStartTime; |
@@ -424,14 +424,14 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element) |
const KeyframeVector& frames = oldEffect->getFrames(); |
AnimatableValueKeyframeVector newFrames; |
- newFrames.append(toAnimatableValueKeyframe(frames[0]->clone().get())); |
- newFrames.append(toAnimatableValueKeyframe(frames[1]->clone().get())); |
- newFrames.append(toAnimatableValueKeyframe(frames[2]->clone().get())); |
+ newFrames.append(toAnimatableValueKeyframe(frames[0]->clone())); |
+ newFrames.append(toAnimatableValueKeyframe(frames[1]->clone())); |
+ newFrames.append(toAnimatableValueKeyframe(frames[2]->clone())); |
newFrames[0]->clearPropertyValue(id); |
newFrames[1]->clearPropertyValue(id); |
- RefPtrWillBeRawPtr<InertEffect> inertAnimationForSampling = InertEffect::create(oldAnimation->model(), oldAnimation->specifiedTiming(), false, inheritedTime); |
- OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> sample = nullptr; |
+ InertEffect* inertAnimationForSampling = InertEffect::create(oldAnimation->model(), oldAnimation->specifiedTiming(), false, inheritedTime); |
+ HeapVector<Member<Interpolation>>* sample = nullptr; |
inertAnimationForSampling->sample(sample); |
if (sample && sample->size() == 1) { |
newFrames[0]->setPropertyValue(id, toLegacyStyleInterpolation(sample->at(0).get())->currentValue()); |
@@ -440,9 +440,9 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element) |
} |
} |
- RefPtrWillBeRawPtr<KeyframeEffect> transition = KeyframeEffect::create(element, model, inertAnimation->specifiedTiming(), KeyframeEffect::TransitionPriority, eventDelegate.release()); |
+ KeyframeEffect* transition = KeyframeEffect::create(element, model, inertAnimation->specifiedTiming(), KeyframeEffect::TransitionPriority, eventDelegate); |
transition->setName(inertAnimation->name()); |
- RefPtrWillBeRawPtr<Animation> animation = element->document().timeline().play(transition.get()); |
+ Animation* animation = element->document().timeline().play(transition); |
animation->update(TimingUpdateOnDemand); |
runningTransition.animation = animation; |
m_transitions.set(id, runningTransition); |
@@ -453,7 +453,7 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element) |
void CSSAnimations::calculateTransitionUpdateForProperty(CSSPropertyID id, const CSSTransitionData& transitionData, size_t transitionIndex, const ComputedStyle& oldStyle, const ComputedStyle& style, const TransitionMap* activeTransitions, CSSAnimationUpdate* update, const Element* element) |
{ |
- RefPtrWillBeRawPtr<AnimatableValue> to = nullptr; |
+ AnimatableValue* to = nullptr; |
if (activeTransitions) { |
TransitionMap::const_iterator activeTransitionIter = activeTransitions->find(id); |
if (activeTransitionIter != activeTransitions->end()) { |
@@ -471,10 +471,10 @@ void CSSAnimations::calculateTransitionUpdateForProperty(CSSPropertyID id, const |
if (!to) |
to = CSSAnimatableValueFactory::create(id, style); |
- RefPtrWillBeRawPtr<AnimatableValue> from = CSSAnimatableValueFactory::create(id, oldStyle); |
+ AnimatableValue* from = CSSAnimatableValueFactory::create(id, oldStyle); |
// If we have multiple transitions on the same property, we will use the |
// last one since we iterate over them in order. |
- if (AnimatableValue::usesDefaultInterpolation(to.get(), from.get())) |
+ if (AnimatableValue::usesDefaultInterpolation(to, from)) |
return; |
Timing timing = transitionData.convertToTiming(transitionIndex); |
@@ -490,25 +490,25 @@ void CSSAnimations::calculateTransitionUpdateForProperty(CSSPropertyID id, const |
timing.startDelay = 0; |
} |
- RefPtrWillBeRawPtr<AnimatableValueKeyframe> delayKeyframe = AnimatableValueKeyframe::create(); |
- delayKeyframe->setPropertyValue(id, from.get()); |
+ AnimatableValueKeyframe* delayKeyframe = AnimatableValueKeyframe::create(); |
+ delayKeyframe->setPropertyValue(id, from); |
delayKeyframe->setOffset(0); |
keyframes.append(delayKeyframe); |
- RefPtrWillBeRawPtr<AnimatableValueKeyframe> startKeyframe = AnimatableValueKeyframe::create(); |
- startKeyframe->setPropertyValue(id, from.get()); |
+ AnimatableValueKeyframe* startKeyframe = AnimatableValueKeyframe::create(); |
+ startKeyframe->setPropertyValue(id, from); |
startKeyframe->setOffset(startKeyframeOffset); |
startKeyframe->setEasing(timing.timingFunction.release()); |
timing.timingFunction = LinearTimingFunction::shared(); |
keyframes.append(startKeyframe); |
- RefPtrWillBeRawPtr<AnimatableValueKeyframe> endKeyframe = AnimatableValueKeyframe::create(); |
- endKeyframe->setPropertyValue(id, to.get()); |
+ AnimatableValueKeyframe* endKeyframe = AnimatableValueKeyframe::create(); |
+ endKeyframe->setPropertyValue(id, to); |
endKeyframe->setOffset(1); |
keyframes.append(endKeyframe); |
- RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> model = AnimatableValueKeyframeEffectModel::create(keyframes); |
- update->startTransition(id, from.get(), to.get(), InertEffect::create(model, timing, false, 0)); |
+ AnimatableValueKeyframeEffectModel* model = AnimatableValueKeyframeEffectModel::create(keyframes); |
+ update->startTransition(id, from, to, InertEffect::create(model, timing, false, 0)); |
ASSERT(!element->elementAnimations() || !element->elementAnimations()->isAnimationStyleChange()); |
} |
@@ -611,7 +611,7 @@ void CSSAnimations::calculateAnimationActiveInterpolations(CSSAnimationUpdate* u |
return; |
} |
- WillBeHeapVector<RawPtrWillBeMember<InertEffect>> newEffects; |
+ HeapVector<Member<InertEffect>> newEffects; |
for (const auto& newAnimation : update->newAnimations()) |
newEffects.append(newAnimation.effect.get()); |
for (const auto& updatedAnimation : update->animationsWithUpdates()) |
@@ -630,11 +630,11 @@ void CSSAnimations::calculateTransitionActiveInterpolations(CSSAnimationUpdate* |
if (update->newTransitions().isEmpty() && update->cancelledTransitions().isEmpty()) { |
activeInterpolationsForTransitions = AnimationStack::activeInterpolations(animationStack, 0, 0, KeyframeEffect::TransitionPriority, timelineCurrentTime); |
} else { |
- WillBeHeapVector<RawPtrWillBeMember<InertEffect>> newTransitions; |
+ HeapVector<Member<InertEffect>> newTransitions; |
for (const auto& entry : update->newTransitions()) |
newTransitions.append(entry.value.effect.get()); |
- WillBeHeapHashSet<RawPtrWillBeMember<const Animation>> cancelledAnimations; |
+ HeapHashSet<Member<const Animation>> cancelledAnimations; |
if (!update->cancelledTransitions().isEmpty()) { |
ASSERT(elementAnimations); |
const TransitionMap& transitionMap = elementAnimations->cssAnimations().m_transitions; |
@@ -788,25 +788,21 @@ bool CSSAnimations::isAllowedAnimation(CSSPropertyID property) |
DEFINE_TRACE(CSSAnimations) |
{ |
-#if ENABLE(OILPAN) |
visitor->trace(m_transitions); |
visitor->trace(m_pendingUpdate); |
visitor->trace(m_animations); |
visitor->trace(m_previousActiveInterpolationsForAnimations); |
-#endif |
} |
DEFINE_TRACE(CSSAnimationUpdate) |
{ |
-#if ENABLE(OILPAN) |
visitor->trace(m_newTransitions); |
visitor->trace(m_activeInterpolationsForAnimations); |
visitor->trace(m_activeInterpolationsForTransitions); |
visitor->trace(m_newAnimations); |
- visitor->trace(m_suppressedAnimations); |
visitor->trace(m_animationsWithUpdates); |
visitor->trace(m_animationsWithStyleUpdates); |
-#endif |
+ visitor->trace(m_suppressedAnimations); |
} |
} // namespace blink |