Bug 1456394 - Merge KeyframeEffectReadOnly and KeyframeEffect; r=bz,hiro

MozReview-Commit-ID: FvTMGjxfRXk

--HG--
extra : rebase_source : 8f7fd0903c9ca2f545dce2633eb797345a7517f8
This commit is contained in:
Brian Birtles 2018-05-07 11:08:59 +09:00
parent 9622b88217
commit 3184f30162
43 changed files with 249 additions and 355 deletions

View file

@ -703,7 +703,7 @@ Animation::Tick()
}
// Update layers if we are newly finished.
KeyframeEffectReadOnly* keyframeEffect = mEffect->AsKeyframeEffect();
KeyframeEffect* keyframeEffect = mEffect->AsKeyframeEffect();
if (keyframeEffect &&
!keyframeEffect->Properties().IsEmpty() &&
!mFinishedAtLastComposeStyle &&
@ -908,9 +908,9 @@ Animation::ShouldBeSynchronizedWithMainThread(
return false;
}
KeyframeEffectReadOnly* keyframeEffect = mEffect
? mEffect->AsKeyframeEffect()
: nullptr;
KeyframeEffect* keyframeEffect = mEffect
? mEffect->AsKeyframeEffect()
: nullptr;
if (!keyframeEffect) {
return false;
}
@ -1020,7 +1020,7 @@ Animation::WillComposeStyle()
MOZ_ASSERT(mEffect);
KeyframeEffectReadOnly* keyframeEffect = mEffect->AsKeyframeEffect();
KeyframeEffect* keyframeEffect = mEffect->AsKeyframeEffect();
if (keyframeEffect) {
keyframeEffect->WillComposeStyle();
}
@ -1085,7 +1085,7 @@ Animation::ComposeStyle(RawServoAnimationValueMap& aComposeResult,
}
}
KeyframeEffectReadOnly* keyframeEffect = mEffect->AsKeyframeEffect();
KeyframeEffect* keyframeEffect = mEffect->AsKeyframeEffect();
if (keyframeEffect) {
keyframeEffect->ComposeStyle(aComposeResult, aPropertiesToSkip);
}
@ -1410,7 +1410,7 @@ Animation::UpdateEffect()
if (mEffect) {
UpdateRelevance();
KeyframeEffectReadOnly* keyframeEffect = mEffect->AsKeyframeEffect();
KeyframeEffect* keyframeEffect = mEffect->AsKeyframeEffect();
if (keyframeEffect) {
keyframeEffect->NotifyAnimationTimingUpdated();
}
@ -1434,7 +1434,7 @@ Animation::PostUpdate()
return;
}
KeyframeEffectReadOnly* keyframeEffect = mEffect->AsKeyframeEffect();
KeyframeEffect* keyframeEffect = mEffect->AsKeyframeEffect();
if (!keyframeEffect) {
return;
}

View file

@ -363,7 +363,7 @@ public:
/**
* Updates various bits of state that we need to update as the result of
* running ComposeStyle().
* See the comment of KeyframeEffectReadOnly::WillComposeStyle for more detail.
* See the comment of KeyframeEffect::WillComposeStyle for more detail.
*/
void WillComposeStyle();

View file

@ -88,7 +88,7 @@ AnimationEffectReadOnly::SetSpecifiedTiming(const TimingParams& aTiming)
}
}
// For keyframe effects, NotifyEffectTimingUpdated above will eventually cause
// KeyframeEffectReadOnly::NotifyAnimationTimingUpdated to be called so it can
// KeyframeEffect::NotifyAnimationTimingUpdated to be called so it can
// update its registration with the target element as necessary.
}

View file

@ -26,7 +26,7 @@ namespace dom {
class Animation;
class AnimationEffectTimingReadOnly;
class KeyframeEffectReadOnly;
class KeyframeEffect;
struct ComputedTimingProperties;
class AnimationEffectReadOnly : public nsISupports,
@ -39,7 +39,7 @@ public:
AnimationEffectReadOnly(nsIDocument* aDocument,
AnimationEffectTimingReadOnly* aTiming);
virtual KeyframeEffectReadOnly* AsKeyframeEffect() { return nullptr; }
virtual KeyframeEffect* AsKeyframeEffect() { return nullptr; }
virtual ElementPropertyTransition* AsTransition() { return nullptr; }
virtual const ElementPropertyTransition* AsTransition() const

View file

@ -22,7 +22,7 @@ AnimationEffectTiming::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenPr
}
static inline void
PostSpecifiedTimingUpdated(KeyframeEffectReadOnly* aEffect)
PostSpecifiedTimingUpdated(KeyframeEffect* aEffect)
{
if (aEffect) {
aEffect->NotifySpecifiedTimingUpdated();

View file

@ -14,14 +14,14 @@
namespace mozilla {
namespace dom {
class KeyframeEffectReadOnly;
class KeyframeEffect;
class AnimationEffectTiming : public AnimationEffectTimingReadOnly
{
public:
AnimationEffectTiming(nsIDocument* aDocument,
const TimingParams& aTiming,
KeyframeEffectReadOnly* aEffect)
KeyframeEffect* aEffect)
: AnimationEffectTimingReadOnly(aDocument, aTiming)
, mEffect(aEffect) { }
@ -40,7 +40,7 @@ public:
void SetEasing(const nsAString& aEasing, ErrorResult& aRv);
private:
KeyframeEffectReadOnly* MOZ_NON_OWNING_REF mEffect;
KeyframeEffect* MOZ_NON_OWNING_REF mEffect;
};
} // namespace dom

View file

@ -78,7 +78,7 @@ AnimationUtils::IsOffscreenThrottlingEnabled()
AnimationUtils::EffectSetContainsAnimatedScale(EffectSet& aEffects,
const nsIFrame* aFrame)
{
for (const dom::KeyframeEffectReadOnly* effect : aEffects) {
for (const dom::KeyframeEffect* effect : aEffects) {
if (effect->ContainsAnimatedScale(aFrame)) {
return true;
}

View file

@ -38,7 +38,7 @@
using mozilla::dom::Animation;
using mozilla::dom::Element;
using mozilla::dom::KeyframeEffectReadOnly;
using mozilla::dom::KeyframeEffect;
namespace mozilla {
@ -81,7 +81,7 @@ enum class MatchForCompositor {
}
static MatchForCompositor
IsMatchForCompositor(const KeyframeEffectReadOnly& aEffect,
IsMatchForCompositor(const KeyframeEffect& aEffect,
nsCSSPropertyID aProperty,
const nsIFrame* aFrame)
{
@ -197,7 +197,7 @@ FindAnimationsForCompositor(const nsIFrame* aFrame,
}
bool foundRunningAnimations = false;
for (KeyframeEffectReadOnly* effect : *effects) {
for (KeyframeEffect* effect : *effects) {
MatchForCompositor matchResult =
IsMatchForCompositor(*effect, aProperty, aFrame);
@ -395,7 +395,7 @@ EffectCompositor::UpdateEffectProperties(const ComputedStyle* aStyle,
// result.
effectSet->MarkCascadeNeedsUpdate();
for (KeyframeEffectReadOnly* effect : *effectSet) {
for (KeyframeEffect* effect : *effectSet) {
effect->UpdateProperties(aStyle);
}
}
@ -404,14 +404,12 @@ EffectCompositor::UpdateEffectProperties(const ComputedStyle* aStyle,
namespace {
class EffectCompositeOrderComparator {
public:
bool Equals(const KeyframeEffectReadOnly* a,
const KeyframeEffectReadOnly* b) const
bool Equals(const KeyframeEffect* a, const KeyframeEffect* b) const
{
return a == b;
}
bool LessThan(const KeyframeEffectReadOnly* a,
const KeyframeEffectReadOnly* b) const
bool LessThan(const KeyframeEffect* a, const KeyframeEffect* b) const
{
MOZ_ASSERT(a->GetAnimation() && b->GetAnimation());
MOZ_ASSERT(
@ -444,8 +442,8 @@ EffectCompositor::GetServoAnimationRule(
}
// Get a list of effects sorted by composite order.
nsTArray<KeyframeEffectReadOnly*> sortedEffectList(effectSet->Count());
for (KeyframeEffectReadOnly* effect : *effectSet) {
nsTArray<KeyframeEffect*> sortedEffectList(effectSet->Count());
for (KeyframeEffect* effect : *effectSet) {
sortedEffectList.AppendElement(effect);
}
sortedEffectList.Sort(EffectCompositeOrderComparator());
@ -457,7 +455,7 @@ EffectCompositor::GetServoAnimationRule(
aCascadeLevel == CascadeLevel::Animations
? effectSet->PropertiesForAnimationsLevel().Inverse()
: effectSet->PropertiesForAnimationsLevel();
for (KeyframeEffectReadOnly* effect : sortedEffectList) {
for (KeyframeEffect* effect : sortedEffectList) {
effect->GetAnimation()->ComposeStyle(*aAnimationValues, propertiesToSkip);
}
@ -533,7 +531,7 @@ EffectCompositor::ClearIsRunningOnCompositor(const nsIFrame *aFrame,
return;
}
for (KeyframeEffectReadOnly* effect : *effects) {
for (KeyframeEffect* effect : *effects) {
effect->SetIsRunningOnCompositor(aProperty, false);
}
}
@ -607,7 +605,7 @@ EffectCompositor::GetOverriddenProperties(EffectSet& aEffectSet,
AutoTArray<nsCSSPropertyID, LayerAnimationInfo::kRecords> propertiesToTrack;
{
nsCSSPropertyIDSet propertiesToTrackAsSet;
for (KeyframeEffectReadOnly* effect : aEffectSet) {
for (KeyframeEffect* effect : aEffectSet) {
for (const AnimationProperty& property : effect->Properties()) {
if (nsCSSProps::PropHasFlags(property.mProperty,
CSSPropFlags::CanAnimateOnCompositor) &&
@ -647,8 +645,8 @@ EffectCompositor::UpdateCascadeResults(EffectSet& aEffectSet,
}
// Get a list of effects sorted by composite order.
nsTArray<KeyframeEffectReadOnly*> sortedEffectList(aEffectSet.Count());
for (KeyframeEffectReadOnly* effect : aEffectSet) {
nsTArray<KeyframeEffect*> sortedEffectList(aEffectSet.Count());
for (KeyframeEffect* effect : aEffectSet) {
sortedEffectList.AppendElement(effect);
}
sortedEffectList.Sort(EffectCompositeOrderComparator());
@ -695,7 +693,7 @@ EffectCompositor::UpdateCascadeResults(EffectSet& aEffectSet,
nsCSSPropertyIDSet propertiesForTransitionsLevel;
for (const KeyframeEffectReadOnly* effect : sortedEffectList) {
for (const KeyframeEffect* effect : sortedEffectList) {
MOZ_ASSERT(effect->GetAnimation(),
"Effects on a target element should have an Animation");
CascadeLevel cascadeLevel = effect->GetAnimation()->CascadeLevel();
@ -766,7 +764,7 @@ EffectCompositor::SetPerformanceWarning(
return;
}
for (KeyframeEffectReadOnly* effect : *effects) {
for (KeyframeEffect* effect : *effects) {
effect->SetPerformanceWarning(aProperty, aWarning);
}
}
@ -901,7 +899,7 @@ EffectCompositor::PreTraverseInSubtree(ServoTraversalFlags aFlags,
continue;
}
for (KeyframeEffectReadOnly* effect : *effects) {
for (KeyframeEffect* effect : *effects) {
effect->GetAnimation()->WillComposeStyle();
}
@ -977,7 +975,7 @@ EffectCompositor::PreTraverse(dom::Element* aElement,
if (effects) {
MaybeUpdateCascadeResults(aElement, aPseudoType);
for (KeyframeEffectReadOnly* effect : *effects) {
for (KeyframeEffect* effect : *effects) {
effect->GetAnimation()->WillComposeStyle();
}
}

View file

@ -149,7 +149,7 @@ EffectSet::GetEffectSetPropertyAtom(CSSPseudoElementType aPseudoType)
}
void
EffectSet::AddEffect(dom::KeyframeEffectReadOnly& aEffect)
EffectSet::AddEffect(dom::KeyframeEffect& aEffect)
{
if (mEffects.Contains(&aEffect)) {
return;
@ -160,7 +160,7 @@ EffectSet::AddEffect(dom::KeyframeEffectReadOnly& aEffect)
}
void
EffectSet::RemoveEffect(dom::KeyframeEffectReadOnly& aEffect)
EffectSet::RemoveEffect(dom::KeyframeEffect& aEffect)
{
if (!mEffects.Contains(&aEffect)) {
return;

View file

@ -66,8 +66,8 @@ public:
static void DestroyEffectSet(dom::Element* aElement,
CSSPseudoElementType aPseudoType);
void AddEffect(dom::KeyframeEffectReadOnly& aEffect);
void RemoveEffect(dom::KeyframeEffectReadOnly& aEffect);
void AddEffect(dom::KeyframeEffect& aEffect);
void RemoveEffect(dom::KeyframeEffect& aEffect);
void SetMayHaveOpacityAnimation() { mMayHaveOpacityAnim = true; }
bool MayHaveOpacityAnimation() const { return mMayHaveOpacityAnim; }
@ -75,7 +75,7 @@ public:
bool MayHaveTransformAnimation() const { return mMayHaveTransformAnim; }
private:
typedef nsTHashtable<nsRefPtrHashKey<dom::KeyframeEffectReadOnly>>
typedef nsTHashtable<nsRefPtrHashKey<dom::KeyframeEffect>>
OwningEffectSet;
public:
@ -136,7 +136,7 @@ public:
return *this;
}
dom::KeyframeEffectReadOnly* operator* ()
dom::KeyframeEffect* operator*()
{
MOZ_ASSERT(!Done());
return mHashIterator.Get()->GetKey();

View file

@ -54,33 +54,32 @@ PropertyValuePair::operator==(const PropertyValuePair& aOther) const
namespace dom {
NS_IMPL_CYCLE_COLLECTION_INHERITED(KeyframeEffectReadOnly,
NS_IMPL_CYCLE_COLLECTION_INHERITED(KeyframeEffect,
AnimationEffectReadOnly,
mTarget)
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(KeyframeEffectReadOnly,
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(KeyframeEffect,
AnimationEffectReadOnly)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(KeyframeEffectReadOnly)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(KeyframeEffect)
NS_INTERFACE_MAP_END_INHERITING(AnimationEffectReadOnly)
NS_IMPL_ADDREF_INHERITED(KeyframeEffectReadOnly, AnimationEffectReadOnly)
NS_IMPL_RELEASE_INHERITED(KeyframeEffectReadOnly, AnimationEffectReadOnly)
NS_IMPL_ADDREF_INHERITED(KeyframeEffect, AnimationEffectReadOnly)
NS_IMPL_RELEASE_INHERITED(KeyframeEffect, AnimationEffectReadOnly)
KeyframeEffectReadOnly::KeyframeEffectReadOnly(
KeyframeEffect::KeyframeEffect(
nsIDocument* aDocument,
const Maybe<OwningAnimationTarget>& aTarget,
const TimingParams& aTiming,
const KeyframeEffectParams& aOptions)
: KeyframeEffectReadOnly(aDocument, aTarget,
new AnimationEffectTimingReadOnly(aDocument,
aTiming),
aOptions)
: KeyframeEffect(aDocument, aTarget,
new AnimationEffectTiming(aDocument, aTiming, this),
aOptions)
{
}
KeyframeEffectReadOnly::KeyframeEffectReadOnly(
KeyframeEffect::KeyframeEffect(
nsIDocument* aDocument,
const Maybe<OwningAnimationTarget>& aTarget,
AnimationEffectTimingReadOnly* aTiming,
@ -94,20 +93,20 @@ KeyframeEffectReadOnly::KeyframeEffectReadOnly(
}
JSObject*
KeyframeEffectReadOnly::WrapObject(JSContext* aCx,
KeyframeEffect::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto)
{
return KeyframeEffectReadOnlyBinding::Wrap(aCx, this, aGivenProto);
return KeyframeEffectBinding::Wrap(aCx, this, aGivenProto);
}
IterationCompositeOperation KeyframeEffectReadOnly::IterationComposite(
IterationCompositeOperation KeyframeEffect::IterationComposite(
CallerType /*aCallerType*/) const
{
return mEffectOptions.mIterationComposite;
}
void
KeyframeEffectReadOnly::SetIterationComposite(
KeyframeEffect::SetIterationComposite(
const IterationCompositeOperation& aIterationComposite,
CallerType aCallerType)
{
@ -130,13 +129,13 @@ KeyframeEffectReadOnly::SetIterationComposite(
}
CompositeOperation
KeyframeEffectReadOnly::Composite() const
KeyframeEffect::Composite() const
{
return mEffectOptions.mComposite;
}
void
KeyframeEffectReadOnly::SetComposite(const CompositeOperation& aComposite)
KeyframeEffect::SetComposite(const CompositeOperation& aComposite)
{
if (mEffectOptions.mComposite == aComposite) {
return;
@ -157,7 +156,7 @@ KeyframeEffectReadOnly::SetComposite(const CompositeOperation& aComposite)
}
void
KeyframeEffectReadOnly::NotifySpecifiedTimingUpdated()
KeyframeEffect::NotifySpecifiedTimingUpdated()
{
// Use the same document for a pseudo element and its parent element.
// Use nullptr if we don't have mTarget, so disable the mutation batch.
@ -176,7 +175,7 @@ KeyframeEffectReadOnly::NotifySpecifiedTimingUpdated()
}
void
KeyframeEffectReadOnly::NotifyAnimationTimingUpdated()
KeyframeEffect::NotifyAnimationTimingUpdated()
{
UpdateTargetRegistration();
@ -243,9 +242,9 @@ KeyframesEqualIgnoringComputedOffsets(const nsTArray<Keyframe>& aLhs,
// https://drafts.csswg.org/web-animations/#dom-keyframeeffect-setkeyframes
void
KeyframeEffectReadOnly::SetKeyframes(JSContext* aContext,
JS::Handle<JSObject*> aKeyframes,
ErrorResult& aRv)
KeyframeEffect::SetKeyframes(JSContext* aContext,
JS::Handle<JSObject*> aKeyframes,
ErrorResult& aRv)
{
nsTArray<Keyframe> keyframes =
KeyframeUtils::GetKeyframesFromObject(aContext, mDocument, aKeyframes, aRv);
@ -259,7 +258,7 @@ KeyframeEffectReadOnly::SetKeyframes(JSContext* aContext,
void
KeyframeEffectReadOnly::SetKeyframes(
KeyframeEffect::SetKeyframes(
nsTArray<Keyframe>&& aKeyframes,
const ComputedStyle* aStyle)
{
@ -283,8 +282,7 @@ KeyframeEffectReadOnly::SetKeyframes(
}
const AnimationProperty*
KeyframeEffectReadOnly::GetEffectiveAnimationOfProperty(
nsCSSPropertyID aProperty) const
KeyframeEffect::GetEffectiveAnimationOfProperty(nsCSSPropertyID aProperty) const
{
EffectSet* effectSet =
EffectSet::GetEffectSet(mTarget->mElement, mTarget->mPseudoType);
@ -308,7 +306,7 @@ KeyframeEffectReadOnly::GetEffectiveAnimationOfProperty(
}
bool
KeyframeEffectReadOnly::HasAnimationOfProperty(nsCSSPropertyID aProperty) const
KeyframeEffect::HasAnimationOfProperty(nsCSSPropertyID aProperty) const
{
for (const AnimationProperty& property : mProperties) {
if (property.mProperty == aProperty) {
@ -342,7 +340,7 @@ SpecifiedKeyframeArraysAreEqual(const nsTArray<Keyframe>& aA,
#endif
void
KeyframeEffectReadOnly::UpdateProperties(const ComputedStyle* aStyle)
KeyframeEffect::UpdateProperties(const ComputedStyle* aStyle)
{
MOZ_ASSERT(aStyle);
@ -382,7 +380,7 @@ KeyframeEffectReadOnly::UpdateProperties(const ComputedStyle* aStyle)
void
KeyframeEffectReadOnly::EnsureBaseStyles(
KeyframeEffect::EnsureBaseStyles(
const ComputedStyle* aComputedValues,
const nsTArray<AnimationProperty>& aProperties)
{
@ -418,7 +416,7 @@ KeyframeEffectReadOnly::EnsureBaseStyles(
}
void
KeyframeEffectReadOnly::EnsureBaseStyle(
KeyframeEffect::EnsureBaseStyle(
const AnimationProperty& aProperty,
nsPresContext* aPresContext,
const ComputedStyle* aComputedStyle,
@ -451,7 +449,7 @@ KeyframeEffectReadOnly::EnsureBaseStyle(
}
void
KeyframeEffectReadOnly::WillComposeStyle()
KeyframeEffect::WillComposeStyle()
{
ComputedTiming computedTiming = GetComputedTiming();
mProgressOnLastCompose = computedTiming.mProgress;
@ -460,7 +458,7 @@ KeyframeEffectReadOnly::WillComposeStyle()
void
KeyframeEffectReadOnly::ComposeStyleRule(
KeyframeEffect::ComposeStyleRule(
RawServoAnimationValueMap& aAnimationValues,
const AnimationProperty& aProperty,
const AnimationPropertySegment& aSegment,
@ -476,7 +474,7 @@ KeyframeEffectReadOnly::ComposeStyleRule(
}
void
KeyframeEffectReadOnly::ComposeStyle(
KeyframeEffect::ComposeStyle(
RawServoAnimationValueMap& aComposeResult,
const nsCSSPropertyIDSet& aPropertiesToSkip)
{
@ -543,7 +541,7 @@ KeyframeEffectReadOnly::ComposeStyle(
}
bool
KeyframeEffectReadOnly::IsRunningOnCompositor() const
KeyframeEffect::IsRunningOnCompositor() const
{
// We consider animation is running on compositor if there is at least
// one property running on compositor.
@ -558,8 +556,8 @@ KeyframeEffectReadOnly::IsRunningOnCompositor() const
}
void
KeyframeEffectReadOnly::SetIsRunningOnCompositor(nsCSSPropertyID aProperty,
bool aIsRunning)
KeyframeEffect::SetIsRunningOnCompositor(nsCSSPropertyID aProperty,
bool aIsRunning)
{
MOZ_ASSERT(nsCSSProps::PropHasFlags(aProperty,
CSSPropFlags::CanAnimateOnCompositor),
@ -580,7 +578,7 @@ KeyframeEffectReadOnly::SetIsRunningOnCompositor(nsCSSPropertyID aProperty,
}
void
KeyframeEffectReadOnly::ResetIsRunningOnCompositor()
KeyframeEffect::ResetIsRunningOnCompositor()
{
for (AnimationProperty& property : mProperties) {
property.mIsRunningOnCompositor = false;
@ -624,7 +622,7 @@ KeyframeEffectParamsFromUnion(const OptionsType& aOptions,
}
/* static */ Maybe<OwningAnimationTarget>
KeyframeEffectReadOnly::ConvertTarget(
KeyframeEffect::ConvertTarget(
const Nullable<ElementOrCSSPseudoElement>& aTarget)
{
// Return value optimization.
@ -649,7 +647,7 @@ KeyframeEffectReadOnly::ConvertTarget(
template <class KeyframeEffectType, class OptionsType>
/* static */ already_AddRefed<KeyframeEffectType>
KeyframeEffectReadOnly::ConstructKeyframeEffect(
KeyframeEffect::ConstructKeyframeEffect(
const GlobalObject& aGlobal,
const Nullable<ElementOrCSSPseudoElement>& aTarget,
JS::Handle<JSObject*> aKeyframes,
@ -663,9 +661,8 @@ KeyframeEffectReadOnly::ConstructKeyframeEffect(
// matches the spec behavior.
//
// In Xray case, the new objects should be created using the document of
// the target global, but KeyframeEffect and KeyframeEffectReadOnly
// constructors are called in the caller's compartment to access
// `aKeyframes` object.
// the target global, but the KeyframeEffect constructors are called in the
// caller's compartment to access `aKeyframes` object.
nsIDocument* doc = AnimationUtils::GetDocumentFromGlobal(aGlobal.Get());
if (!doc) {
aRv.Throw(NS_ERROR_FAILURE);
@ -695,9 +692,9 @@ KeyframeEffectReadOnly::ConstructKeyframeEffect(
template<class KeyframeEffectType>
/* static */ already_AddRefed<KeyframeEffectType>
KeyframeEffectReadOnly::ConstructKeyframeEffect(const GlobalObject& aGlobal,
KeyframeEffectReadOnly& aSource,
ErrorResult& aRv)
KeyframeEffect::ConstructKeyframeEffect(const GlobalObject& aGlobal,
KeyframeEffect& aSource,
ErrorResult& aRv)
{
nsIDocument* doc = AnimationUtils::GetCurrentRealmDocument(aGlobal.Context());
if (!doc) {
@ -705,9 +702,9 @@ KeyframeEffectReadOnly::ConstructKeyframeEffect(const GlobalObject& aGlobal,
return nullptr;
}
// Create a new KeyframeEffectReadOnly object with aSource's target,
// Create a new KeyframeEffect object with aSource's target,
// iteration composite operation, composite operation, and spacing mode.
// The constructor creates a new AnimationEffect(ReadOnly) object by
// The constructor creates a new AnimationEffectTiming object by
// aSource's TimingParams.
// Note: we don't need to re-throw exceptions since the value specified on
// aSource's timing object can be assumed valid.
@ -729,7 +726,7 @@ KeyframeEffectReadOnly::ConstructKeyframeEffect(const GlobalObject& aGlobal,
}
nsTArray<AnimationProperty>
KeyframeEffectReadOnly::BuildProperties(const ComputedStyle* aStyle)
KeyframeEffect::BuildProperties(const ComputedStyle* aStyle)
{
MOZ_ASSERT(aStyle);
@ -766,7 +763,7 @@ KeyframeEffectReadOnly::BuildProperties(const ComputedStyle* aStyle)
}
void
KeyframeEffectReadOnly::UpdateTargetRegistration()
KeyframeEffect::UpdateTargetRegistration()
{
if (!mTarget) {
return;
@ -798,7 +795,7 @@ KeyframeEffectReadOnly::UpdateTargetRegistration()
}
void
KeyframeEffectReadOnly::UnregisterTarget()
KeyframeEffect::UnregisterTarget()
{
if (!mInEffectSet) {
return;
@ -824,8 +821,7 @@ KeyframeEffectReadOnly::UnregisterTarget()
}
void
KeyframeEffectReadOnly::RequestRestyle(
EffectCompositor::RestyleType aRestyleType)
KeyframeEffect::RequestRestyle(EffectCompositor::RestyleType aRestyleType)
{
if (!mTarget) {
return;
@ -839,7 +835,7 @@ KeyframeEffectReadOnly::RequestRestyle(
}
already_AddRefed<ComputedStyle>
KeyframeEffectReadOnly::GetTargetComputedStyle()
KeyframeEffect::GetTargetComputedStyle()
{
if (!GetRenderedDocument()) {
return nullptr;
@ -876,30 +872,40 @@ DumpAnimationProperties(nsTArray<AnimationProperty>& aAnimationProperties)
}
#endif
/* static */ already_AddRefed<KeyframeEffectReadOnly>
KeyframeEffectReadOnly::Constructor(
/* static */ already_AddRefed<KeyframeEffect>
KeyframeEffect::Constructor(
const GlobalObject& aGlobal,
const Nullable<ElementOrCSSPseudoElement>& aTarget,
JS::Handle<JSObject*> aKeyframes,
const UnrestrictedDoubleOrKeyframeEffectOptions& aOptions,
ErrorResult& aRv)
{
return ConstructKeyframeEffect<KeyframeEffectReadOnly>(aGlobal, aTarget,
aKeyframes, aOptions,
aRv);
return ConstructKeyframeEffect<KeyframeEffect>(aGlobal, aTarget,
aKeyframes, aOptions, aRv);
}
/* static */ already_AddRefed<KeyframeEffectReadOnly>
KeyframeEffectReadOnly::Constructor(const GlobalObject& aGlobal,
KeyframeEffectReadOnly& aSource,
ErrorResult& aRv)
/* static */ already_AddRefed<KeyframeEffect>
KeyframeEffect::Constructor(const GlobalObject& aGlobal,
KeyframeEffect& aSource,
ErrorResult& aRv)
{
return ConstructKeyframeEffect<KeyframeEffectReadOnly>(aGlobal, aSource, aRv);
return ConstructKeyframeEffect<KeyframeEffect>(aGlobal, aSource, aRv);
}
/* static */ already_AddRefed<KeyframeEffect>
KeyframeEffect::Constructor(
const GlobalObject& aGlobal,
const Nullable<ElementOrCSSPseudoElement>& aTarget,
JS::Handle<JSObject*> aKeyframes,
const UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions,
ErrorResult& aRv)
{
return ConstructKeyframeEffect<KeyframeEffect>(aGlobal, aTarget, aKeyframes,
aOptions, aRv);
}
void
KeyframeEffectReadOnly::GetTarget(
Nullable<OwningElementOrCSSPseudoElement>& aRv) const
KeyframeEffect::GetTarget(Nullable<OwningElementOrCSSPseudoElement>& aRv) const
{
if (!mTarget) {
aRv.SetNull();
@ -925,8 +931,7 @@ KeyframeEffectReadOnly::GetTarget(
}
void
KeyframeEffectReadOnly::SetTarget(
const Nullable<ElementOrCSSPseudoElement>& aTarget)
KeyframeEffect::SetTarget(const Nullable<ElementOrCSSPseudoElement>& aTarget)
{
Maybe<OwningAnimationTarget> newTarget = ConvertTarget(aTarget);
if (mTarget == newTarget) {
@ -993,7 +998,7 @@ CreatePropertyValue(nsCSSPropertyID aProperty,
}
void
KeyframeEffectReadOnly::GetProperties(
KeyframeEffect::GetProperties(
nsTArray<AnimationPropertyDetails>& aProperties,
ErrorResult& aRv) const
{
@ -1058,9 +1063,9 @@ KeyframeEffectReadOnly::GetProperties(
}
void
KeyframeEffectReadOnly::GetKeyframes(JSContext*& aCx,
nsTArray<JSObject*>& aResult,
ErrorResult& aRv)
KeyframeEffect::GetKeyframes(JSContext*& aCx,
nsTArray<JSObject*>& aResult,
ErrorResult& aRv)
{
MOZ_ASSERT(aResult.IsEmpty());
MOZ_ASSERT(!aRv.Failed());
@ -1176,7 +1181,7 @@ KeyframeEffectReadOnly::GetKeyframes(JSContext*& aCx,
}
/* static */ const TimeDuration
KeyframeEffectReadOnly::OverflowRegionRefreshInterval()
KeyframeEffect::OverflowRegionRefreshInterval()
{
// The amount of time we can wait between updating throttled animations
// on the main thread that influence the overflow region.
@ -1187,7 +1192,7 @@ KeyframeEffectReadOnly::OverflowRegionRefreshInterval()
}
bool
KeyframeEffectReadOnly::CanThrottle() const
KeyframeEffect::CanThrottle() const
{
// Unthrottle if we are not in effect or current. This will be the case when
// our owning animation has finished, is idle, or when we are in the delay
@ -1288,7 +1293,7 @@ KeyframeEffectReadOnly::CanThrottle() const
}
bool
KeyframeEffectReadOnly::CanThrottleTransformChanges(const nsIFrame& aFrame) const
KeyframeEffect::CanThrottleTransformChanges(const nsIFrame& aFrame) const
{
TimeStamp now = aFrame.PresContext()->RefreshDriver()->MostRecentRefresh();
@ -1305,7 +1310,7 @@ KeyframeEffectReadOnly::CanThrottleTransformChanges(const nsIFrame& aFrame) cons
}
bool
KeyframeEffectReadOnly::CanThrottleTransformChangesInScrollable(nsIFrame& aFrame) const
KeyframeEffect::CanThrottleTransformChangesInScrollable(nsIFrame& aFrame) const
{
// If the target element is not associated with any documents, we don't care
// it.
@ -1355,7 +1360,7 @@ KeyframeEffectReadOnly::CanThrottleTransformChangesInScrollable(nsIFrame& aFrame
}
nsIFrame*
KeyframeEffectReadOnly::GetStyleFrame() const
KeyframeEffect::GetStyleFrame() const
{
nsIFrame* frame = GetPrimaryFrame();
if (!frame) {
@ -1366,7 +1371,7 @@ KeyframeEffectReadOnly::GetStyleFrame() const
}
nsIFrame*
KeyframeEffectReadOnly::GetPrimaryFrame() const
KeyframeEffect::GetPrimaryFrame() const
{
nsIFrame* frame = nullptr;
if (!mTarget) {
@ -1387,7 +1392,7 @@ KeyframeEffectReadOnly::GetPrimaryFrame() const
}
nsIDocument*
KeyframeEffectReadOnly::GetRenderedDocument() const
KeyframeEffect::GetRenderedDocument() const
{
if (!mTarget) {
return nullptr;
@ -1396,7 +1401,7 @@ KeyframeEffectReadOnly::GetRenderedDocument() const
}
nsIPresShell*
KeyframeEffectReadOnly::GetPresShell() const
KeyframeEffect::GetPresShell() const
{
nsIDocument* doc = GetRenderedDocument();
if (!doc) {
@ -1406,8 +1411,7 @@ KeyframeEffectReadOnly::GetPresShell() const
}
/* static */ bool
KeyframeEffectReadOnly::IsGeometricProperty(
const nsCSSPropertyID aProperty)
KeyframeEffect::IsGeometricProperty(const nsCSSPropertyID aProperty)
{
MOZ_ASSERT(!nsCSSProps::IsShorthand(aProperty),
"Property should be a longhand property");
@ -1434,7 +1438,7 @@ KeyframeEffectReadOnly::IsGeometricProperty(
}
/* static */ bool
KeyframeEffectReadOnly::CanAnimateTransformOnCompositor(
KeyframeEffect::CanAnimateTransformOnCompositor(
const nsIFrame* aFrame,
AnimationPerformanceWarning::Type& aPerformanceWarning)
{
@ -1466,7 +1470,7 @@ KeyframeEffectReadOnly::CanAnimateTransformOnCompositor(
}
bool
KeyframeEffectReadOnly::ShouldBlockAsyncTransformAnimations(
KeyframeEffect::ShouldBlockAsyncTransformAnimations(
const nsIFrame* aFrame,
AnimationPerformanceWarning::Type& aPerformanceWarning) const
{
@ -1513,7 +1517,7 @@ KeyframeEffectReadOnly::ShouldBlockAsyncTransformAnimations(
}
bool
KeyframeEffectReadOnly::HasGeometricProperties() const
KeyframeEffect::HasGeometricProperties() const
{
for (const AnimationProperty& property : mProperties) {
if (IsGeometricProperty(property.mProperty)) {
@ -1525,7 +1529,7 @@ KeyframeEffectReadOnly::HasGeometricProperties() const
}
void
KeyframeEffectReadOnly::SetPerformanceWarning(
KeyframeEffect::SetPerformanceWarning(
nsCSSPropertyID aProperty,
const AnimationPerformanceWarning& aWarning)
{
@ -1548,7 +1552,7 @@ KeyframeEffectReadOnly::SetPerformanceWarning(
already_AddRefed<ComputedStyle>
KeyframeEffectReadOnly::CreateComputedStyleForAnimationValue(
KeyframeEffect::CreateComputedStyleForAnimationValue(
nsCSSPropertyID aProperty,
const AnimationValue& aValue,
nsPresContext* aPresContext,
@ -1569,7 +1573,7 @@ KeyframeEffectReadOnly::CreateComputedStyleForAnimationValue(
}
void
KeyframeEffectReadOnly::CalculateCumulativeChangeHint(const ComputedStyle* aComputedStyle)
KeyframeEffect::CalculateCumulativeChangeHint(const ComputedStyle* aComputedStyle)
{
mCumulativeChangeHint = nsChangeHint(0);
@ -1631,7 +1635,7 @@ KeyframeEffectReadOnly::CalculateCumulativeChangeHint(const ComputedStyle* aComp
}
void
KeyframeEffectReadOnly::SetAnimation(Animation* aAnimation)
KeyframeEffect::SetAnimation(Animation* aAnimation)
{
if (mAnimation == aAnimation) {
return;
@ -1656,7 +1660,7 @@ KeyframeEffectReadOnly::SetAnimation(Animation* aAnimation)
}
bool
KeyframeEffectReadOnly::CanIgnoreIfNotVisible() const
KeyframeEffect::CanIgnoreIfNotVisible() const
{
if (!AnimationUtils::IsOffscreenThrottlingEnabled()) {
return false;
@ -1669,7 +1673,7 @@ KeyframeEffectReadOnly::CanIgnoreIfNotVisible() const
}
void
KeyframeEffectReadOnly::MaybeUpdateFrameForCompositor()
KeyframeEffect::MaybeUpdateFrameForCompositor()
{
nsIFrame* frame = GetStyleFrame();
if (!frame) {
@ -1689,7 +1693,7 @@ KeyframeEffectReadOnly::MaybeUpdateFrameForCompositor()
}
void
KeyframeEffectReadOnly::MarkCascadeNeedsUpdate()
KeyframeEffect::MarkCascadeNeedsUpdate()
{
if (!mTarget) {
return;
@ -1704,7 +1708,7 @@ KeyframeEffectReadOnly::MarkCascadeNeedsUpdate()
}
/* static */ bool
KeyframeEffectReadOnly::HasComputedTimingChanged(
KeyframeEffect::HasComputedTimingChanged(
const ComputedTiming& aComputedTiming,
IterationCompositeOperation aIterationComposite,
const Nullable<double>& aProgressOnLastCompose,
@ -1720,7 +1724,7 @@ KeyframeEffectReadOnly::HasComputedTimingChanged(
}
bool
KeyframeEffectReadOnly::HasComputedTimingChanged() const
KeyframeEffect::HasComputedTimingChanged() const
{
ComputedTiming computedTiming = GetComputedTiming();
return HasComputedTimingChanged(computedTiming,
@ -1730,7 +1734,7 @@ KeyframeEffectReadOnly::HasComputedTimingChanged() const
}
bool
KeyframeEffectReadOnly::ContainsAnimatedScale(const nsIFrame* aFrame) const
KeyframeEffect::ContainsAnimatedScale(const nsIFrame* aFrame) const
{
if (!IsCurrent()) {
return false;
@ -1775,7 +1779,7 @@ KeyframeEffectReadOnly::ContainsAnimatedScale(const nsIFrame* aFrame) const
}
void
KeyframeEffectReadOnly::UpdateEffectSet(EffectSet* aEffectSet) const
KeyframeEffect::UpdateEffectSet(EffectSet* aEffectSet) const
{
if (!mInEffectSet) {
return;
@ -1804,54 +1808,5 @@ KeyframeEffectReadOnly::UpdateEffectSet(EffectSet* aEffectSet) const
}
}
KeyframeEffect::KeyframeEffect(nsIDocument* aDocument,
const Maybe<OwningAnimationTarget>& aTarget,
const TimingParams& aTiming,
const KeyframeEffectParams& aOptions)
: KeyframeEffectReadOnly(aDocument, aTarget,
new AnimationEffectTiming(aDocument, aTiming, this),
aOptions)
{
}
JSObject*
KeyframeEffect::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto)
{
return KeyframeEffectBinding::Wrap(aCx, this, aGivenProto);
}
/* static */ already_AddRefed<KeyframeEffect>
KeyframeEffect::Constructor(
const GlobalObject& aGlobal,
const Nullable<ElementOrCSSPseudoElement>& aTarget,
JS::Handle<JSObject*> aKeyframes,
const UnrestrictedDoubleOrKeyframeEffectOptions& aOptions,
ErrorResult& aRv)
{
return ConstructKeyframeEffect<KeyframeEffect>(aGlobal, aTarget, aKeyframes,
aOptions, aRv);
}
/* static */ already_AddRefed<KeyframeEffect>
KeyframeEffect::Constructor(const GlobalObject& aGlobal,
KeyframeEffectReadOnly& aSource,
ErrorResult& aRv)
{
return ConstructKeyframeEffect<KeyframeEffect>(aGlobal, aSource, aRv);
}
/* static */ already_AddRefed<KeyframeEffect>
KeyframeEffect::Constructor(
const GlobalObject& aGlobal,
const Nullable<ElementOrCSSPseudoElement>& aTarget,
JS::Handle<JSObject*> aKeyframes,
const UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions,
ErrorResult& aRv)
{
return ConstructKeyframeEffect<KeyframeEffect>(aGlobal, aTarget, aKeyframes,
aOptions, aRv);
}
} // namespace dom
} // namespace mozilla

View file

@ -112,34 +112,44 @@ namespace dom {
class Animation;
class KeyframeEffectReadOnly : public AnimationEffectReadOnly
class KeyframeEffect : public AnimationEffectReadOnly
{
public:
KeyframeEffectReadOnly(nsIDocument* aDocument,
const Maybe<OwningAnimationTarget>& aTarget,
const TimingParams& aTiming,
const KeyframeEffectParams& aOptions);
KeyframeEffect(nsIDocument* aDocument,
const Maybe<OwningAnimationTarget>& aTarget,
const TimingParams& aTiming,
const KeyframeEffectParams& aOptions);
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(KeyframeEffectReadOnly,
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(KeyframeEffect,
AnimationEffectReadOnly)
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
KeyframeEffectReadOnly* AsKeyframeEffect() override { return this; }
KeyframeEffect* AsKeyframeEffect() override { return this; }
// KeyframeEffectReadOnly interface
static already_AddRefed<KeyframeEffectReadOnly>
// KeyframeEffect interface
static already_AddRefed<KeyframeEffect>
Constructor(const GlobalObject& aGlobal,
const Nullable<ElementOrCSSPseudoElement>& aTarget,
JS::Handle<JSObject*> aKeyframes,
const UnrestrictedDoubleOrKeyframeEffectOptions& aOptions,
ErrorResult& aRv);
static already_AddRefed<KeyframeEffectReadOnly>
static already_AddRefed<KeyframeEffect>
Constructor(const GlobalObject& aGlobal,
KeyframeEffectReadOnly& aSource,
KeyframeEffect& aSource,
ErrorResult& aRv);
// Variant of Constructor that accepts a KeyframeAnimationOptions object
// for use with for Animatable.animate.
// Not exposed to content.
static already_AddRefed<KeyframeEffect>
Constructor(const GlobalObject& aGlobal,
const Nullable<ElementOrCSSPseudoElement>& aTarget,
JS::Handle<JSObject*> aKeyframes,
const UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions,
ErrorResult& aRv);
void GetTarget(Nullable<OwningElementOrCSSPseudoElement>& aRv) const;
@ -290,12 +300,12 @@ public:
uint64_t aCurrentIterationOnLastCompose);
protected:
KeyframeEffectReadOnly(nsIDocument* aDocument,
const Maybe<OwningAnimationTarget>& aTarget,
AnimationEffectTimingReadOnly* aTiming,
const KeyframeEffectParams& aOptions);
KeyframeEffect(nsIDocument* aDocument,
const Maybe<OwningAnimationTarget>& aTarget,
AnimationEffectTimingReadOnly* aTiming,
const KeyframeEffectParams& aOptions);
~KeyframeEffectReadOnly() override = default;
~KeyframeEffect() override = default;
static Maybe<OwningAnimationTarget>
ConvertTarget(const Nullable<ElementOrCSSPseudoElement>& aTarget);
@ -311,7 +321,7 @@ protected:
template<class KeyframeEffectType>
static already_AddRefed<KeyframeEffectType>
ConstructKeyframeEffect(const GlobalObject& aGlobal,
KeyframeEffectReadOnly& aSource,
KeyframeEffect& aSource,
ErrorResult& aRv);
// Build properties by recalculating from |mKeyframes| using |aComputedStyle|
@ -454,40 +464,6 @@ private:
}
};
class KeyframeEffect : public KeyframeEffectReadOnly
{
public:
KeyframeEffect(nsIDocument* aDocument,
const Maybe<OwningAnimationTarget>& aTarget,
const TimingParams& aTiming,
const KeyframeEffectParams& aOptions);
JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
static already_AddRefed<KeyframeEffect>
Constructor(const GlobalObject& aGlobal,
const Nullable<ElementOrCSSPseudoElement>& aTarget,
JS::Handle<JSObject*> aKeyframes,
const UnrestrictedDoubleOrKeyframeEffectOptions& aOptions,
ErrorResult& aRv);
static already_AddRefed<KeyframeEffect>
Constructor(const GlobalObject& aGlobal,
KeyframeEffectReadOnly& aSource,
ErrorResult& aRv);
// Variant of Constructor that accepts a KeyframeAnimationOptions object
// for use with for Animatable.animate.
// Not exposed to content.
static already_AddRefed<KeyframeEffect>
Constructor(const GlobalObject& aGlobal,
const Nullable<ElementOrCSSPseudoElement>& aTarget,
JS::Handle<JSObject*> aKeyframes,
const UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions,
ErrorResult& aRv);
};
} // namespace dom
} // namespace mozilla

View file

@ -6,7 +6,7 @@
Element.prototype.animate = function() {
throw 'Called animate() as defined in content document';
}
for (let name of ["KeyframeEffect", "KeyframeEffectReadOnly", "Animation"]) {
for (let name of ["KeyframeEffect", "Animation"]) {
this[name] = function() {
throw `Called overridden ${name} constructor`;
};

View file

@ -293,9 +293,9 @@ function runTest() {
aOptions.subtree ? div.parentNode : div,
aOptions.subtree);
var effect = new KeyframeEffectReadOnly(null,
{ opacity: [ 0, 1 ] },
{ duration: 100 * MS_PER_SEC });
var effect = new KeyframeEffect(null,
{ opacity: [ 0, 1 ] },
{ duration: 100 * MS_PER_SEC });
var anim = new Animation(effect, document.timeline);
anim.play();
assert_equals_records(observer.takeRecords(),

View file

@ -2,7 +2,7 @@
<head>
<meta charset=utf-8>
<title>Bug 1254419 - Test the values returned by
KeyframeEffectReadOnly.getProperties()</title>
KeyframeEffect.getProperties()</title>
<script type="application/javascript" src="../testharness.js"></script>
<script type="application/javascript" src="../testharnessreport.js"></script>
<script type="application/javascript" src="../testcommon.js"></script>

View file

@ -15,7 +15,7 @@
<script>
var target = document.getElementById("target");
var effect =
new KeyframeEffectReadOnly(
new KeyframeEffect(
target,
{ opacity: [0, 1] },
{

View file

@ -15,7 +15,7 @@
<script>
var target = document.getElementById("target");
var effect =
new KeyframeEffectReadOnly(
new KeyframeEffect(
target,
{ opacity: [0, 1] },
{

View file

@ -9,7 +9,7 @@
<script>
var target = document.getElementById("target");
var effect =
new KeyframeEffectReadOnly(
new KeyframeEffect(
target,
{ color: ["red", "blue"] },
{

View file

@ -9,7 +9,7 @@
<script>
var target = document.getElementById("target");
var effect =
new KeyframeEffectReadOnly(
new KeyframeEffect(
target,
{ color: ["red", "blue"] },
{

View file

@ -18,7 +18,7 @@
<script>
var target = document.getElementById("target");
var effect =
new KeyframeEffectReadOnly(
new KeyframeEffect(
target,
{ opacity: [0, 1], easing: "step-end" },
{

View file

@ -18,7 +18,7 @@
<script>
var target = document.getElementById("target");
var effect =
new KeyframeEffectReadOnly(
new KeyframeEffect(
target,
{ opacity: [0, 1], easing: "step-end" },
{

View file

@ -7,7 +7,7 @@
</body>
<script>
var div = document.createElement('div');
var effect = new KeyframeEffectReadOnly(div, { opacity: [0, 1] });
var effect = new KeyframeEffect(div, { opacity: [0, 1] });
requestAnimationFrame(() => {
document.body.appendChild(div);
document.documentElement.classList.remove("reftest-wait");

View file

@ -274,7 +274,7 @@ promise_test(function(t) {
test(function(t) {
var div = addDiv(t);
var effect = new KeyframeEffectReadOnly(div, {left: ["0px", "100px"]});
var effect = new KeyframeEffect(div, {left: ["0px", "100px"]});
assert_equals(effect.getComputedTiming().localTime, null,
'localTime for orphaned effect');
@ -555,7 +555,7 @@ test(function(t) {
test(function(t) {
var div = addDiv(t);
var effect = new KeyframeEffectReadOnly(div, {left: ["0px", "100px"]});
var effect = new KeyframeEffect(div, {left: ["0px", "100px"]});
assert_equals(effect.getComputedTiming().currentIteration, null,
'currentIteration for orphaned effect');

View file

@ -39,9 +39,9 @@ test(function(t) {
addStyle(t, { '.after::after': 'animation: anim 10s;' });
var div = addDiv(t, { class: 'after' });
var pseudoTarget = document.getAnimations()[0].effect.target;
var effect = new KeyframeEffectReadOnly(pseudoTarget,
{ background: ["blue", "red"] },
3 * MS_PER_SEC);
var effect = new KeyframeEffect(pseudoTarget,
{ background: ["blue", "red"] },
3 * MS_PER_SEC);
var newAnim = new Animation(effect, document.timeline);
newAnim.play();
var anims = document.getAnimations();
@ -52,7 +52,7 @@ test(function(t) {
assert_equals(newAnim.effect.target, pseudoTarget,
'The effect.target of the scripted-generated animation is ' +
'the same as the one from the argument of ' +
'KeyframeEffectReadOnly constructor');
'KeyframeEffect constructor');
assert_equals(anims[0].effect.target, newAnim.effect.target,
'Both animations return the same target object');
}, 'effect.target from the script-generated animation should return the same ' +

View file

@ -215,7 +215,7 @@ test(function(t) {
assert_equals(getKeyframes(div).length, 0,
"number of frames when @keyframes only has frames with " +
"non-animatable properties");
}, 'KeyframeEffectReadOnly.getKeyframes() returns no frames for various kinds'
}, 'KeyframeEffect.getKeyframes() returns no frames for various kinds'
+ ' of empty enimations');
test(function(t) {
@ -236,7 +236,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected frames for a simple'
}, 'KeyframeEffect.getKeyframes() returns expected frames for a simple'
+ ' animation');
test(function(t) {
@ -253,7 +253,7 @@ test(function(t) {
"value for 'easing' on ComputedKeyframe #" + i);
}
});
}, 'KeyframeEffectReadOnly.getKeyframes() returns frames with expected easing'
}, 'KeyframeEffect.getKeyframes() returns frames with expected easing'
+ ' values, when the easing comes from animation-timing-function on the'
+ ' element');
@ -270,7 +270,7 @@ test(function(t) {
"value of 'easing' on ComputedKeyframe #1");
assert_equals(frames[2].easing, "steps(1)",
"value of 'easing' on ComputedKeyframe #2");
}, 'KeyframeEffectReadOnly.getKeyframes() returns frames with expected easing'
}, 'KeyframeEffect.getKeyframes() returns frames with expected easing'
+ ' values, when the easing is specified on each keyframe');
test(function(t) {
@ -286,7 +286,7 @@ test(function(t) {
"value of 'easing' on ComputedKeyframe #1");
assert_equals(frames[2].easing, "steps(1, start)",
"value of 'easing' on ComputedKeyframe #2");
}, 'KeyframeEffectReadOnly.getKeyframes() returns frames with expected easing'
}, 'KeyframeEffect.getKeyframes() returns frames with expected easing'
+ ' values, when the easing is specified on some keyframes');
test(function(t) {
@ -309,7 +309,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected frames for a simple'
}, 'KeyframeEffect.getKeyframes() returns expected frames for a simple'
+ ' animation that specifies a single shorthand property');
test(function(t) {
@ -331,7 +331,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected frames for an ' +
}, 'KeyframeEffect.getKeyframes() returns expected frames for an ' +
'animation with a 0% keyframe and no 100% keyframe');
test(function(t) {
@ -353,7 +353,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected frames for an ' +
}, 'KeyframeEffect.getKeyframes() returns expected frames for an ' +
'animation with a 100% keyframe and no 0% keyframe');
test(function(t) {
@ -377,7 +377,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected frames for an ' +
}, 'KeyframeEffect.getKeyframes() returns expected frames for an ' +
'animation with no 0% or 100% keyframe but with a 50% keyframe');
test(function(t) {
@ -399,7 +399,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected frames for an ' +
}, 'KeyframeEffect.getKeyframes() returns expected frames for an ' +
'animation with a partially complete 100% keyframe (because the ' +
'!important rule is ignored)');
@ -425,7 +425,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected frames for an ' +
}, 'KeyframeEffect.getKeyframes() returns expected frames for an ' +
'animation with different properties on different keyframes, all ' +
'with the same easing function');
@ -451,7 +451,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected frames for an ' +
}, 'KeyframeEffect.getKeyframes() returns expected frames for an ' +
'animation with different properties on different keyframes, with ' +
'a different easing function on each');
@ -473,7 +473,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected frames for an ' +
}, 'KeyframeEffect.getKeyframes() returns expected frames for an ' +
'animation with multiple keyframes for the same time, and all with ' +
'the same easing function');
@ -498,7 +498,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected frames for an ' +
}, 'KeyframeEffect.getKeyframes() returns expected frames for an ' +
'animation with multiple keyframes for the same time and with ' +
'different easing functions');
@ -522,7 +522,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected frames for an ' +
}, 'KeyframeEffect.getKeyframes() returns expected frames for an ' +
'animation with multiple keyframes for the same time and with ' +
'different but equivalent easing functions');
@ -552,7 +552,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected frames for ' +
}, 'KeyframeEffect.getKeyframes() returns expected frames for ' +
'overlapping keyframes');
// Gecko-specific test case: We are specifically concerned here that the
@ -576,7 +576,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected values for ' +
}, 'KeyframeEffect.getKeyframes() returns expected values for ' +
'animations with filter properties and missing keyframes');
test(function(t) {
@ -597,7 +597,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected values for ' +
}, 'KeyframeEffect.getKeyframes() returns expected values for ' +
'animation with drop-shadow of filter property');
// Gecko-specific test case: We are specifically concerned here that the
@ -627,7 +627,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected values for ' +
}, 'KeyframeEffect.getKeyframes() returns expected values for ' +
'animations with text-shadow properties and missing keyframes');
// Gecko-specific test case: We are specifically concerned here that the
@ -663,7 +663,7 @@ test(function(t) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i
+ " after updating current style");
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected values for ' +
}, 'KeyframeEffect.getKeyframes() returns expected values for ' +
'animations with background-size properties and missing keyframes');
test(function(t) {
@ -683,7 +683,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected values for ' +
}, 'KeyframeEffect.getKeyframes() returns expected values for ' +
'animations with CSS variables as keyframe values');
test(function(t) {
@ -709,7 +709,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected values for ' +
}, 'KeyframeEffect.getKeyframes() returns expected values for ' +
'animations with CSS variables as keyframe values in a shorthand property');
test(function(t) {
@ -729,7 +729,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected values for ' +
}, 'KeyframeEffect.getKeyframes() returns expected values for ' +
'animations with a CSS variable which is overriden by the value in keyframe');
test(function(t) {
@ -749,7 +749,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected values for ' +
}, 'KeyframeEffect.getKeyframes() returns expected values for ' +
'animations with only custom property in a keyframe');
</script>

View file

@ -45,9 +45,9 @@ test(function(t) {
// Create additional animation on the pseudo-element from script
var pseudoTarget = document.getAnimations()[0].effect.target;
var effect = new KeyframeEffectReadOnly(pseudoTarget,
{ background: ["blue", "red"] },
3 * MS_PER_SEC);
var effect = new KeyframeEffect(pseudoTarget,
{ background: ["blue", "red"] },
3 * MS_PER_SEC);
var newAnimation = new Animation(effect, document.timeline);
newAnimation.id = 'scripted-anim';
newAnimation.play();

View file

@ -43,9 +43,9 @@ test(function(t) {
flushComputedStyle(div);
div.classList.add('change');
var pseudoTarget = document.getAnimations()[0].effect.target;
var effect = new KeyframeEffectReadOnly(pseudoTarget,
{ background: ["blue", "red"] },
3000);
var effect = new KeyframeEffect(pseudoTarget,
{ background: ["blue", "red"] },
3000);
var newAnim = new Animation(effect, document.timeline);
newAnim.play();
@ -57,7 +57,7 @@ test(function(t) {
assert_equals(newAnim.effect.target, pseudoTarget,
'The effect.target of the scripted-generated animation is ' +
'the same as the one from the argument of ' +
'KeyframeEffectReadOnly constructor');
'KeyframeEffect constructor');
assert_equals(anims[0].effect.target, newAnim.effect.target,
'Both the transition and the scripted-generated animation ' +
'return the same target object');

View file

@ -48,7 +48,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected frames for a simple'
}, 'KeyframeEffect.getKeyframes() returns expected frames for a simple'
+ ' transition');
test(function(t) {
@ -73,7 +73,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected frames for a simple'
}, 'KeyframeEffect.getKeyframes() returns expected frames for a simple'
+ ' transition with a non-default easing function');
test(function(t) {
@ -96,7 +96,7 @@ test(function(t) {
for (var i = 0; i < frames.length; i++) {
assert_frames_equal(frames[i], expected[i], "ComputedKeyframe #" + i);
}
}, 'KeyframeEffectReadOnly.getKeyframes() returns expected frames for a'
}, 'KeyframeEffect.getKeyframes() returns expected frames for a'
+ ' transition with a CSS variable endpoint');
</script>

View file

@ -16,9 +16,9 @@
test(function(t) {
var target = addDiv(t);
var anim = new Animation();
anim.effect = new KeyframeEffectReadOnly(target,
{ marginLeft: [ '0px', '100px' ] },
100 * MS_PER_SEC);
anim.effect = new KeyframeEffect(target,
{ marginLeft: [ '0px', '100px' ] },
100 * MS_PER_SEC);
anim.currentTime = 50 * MS_PER_SEC;
assert_equals(getComputedStyle(target).marginLeft, '50px');
}, 'After setting target effect on an animation with null effect, the ' +

View file

@ -3776,7 +3776,7 @@ Element::GetAnimationsUnsorted(Element* aElement,
return;
}
for (KeyframeEffectReadOnly* effect : *effects) {
for (KeyframeEffect* effect : *effects) {
MOZ_ASSERT(effect && effect->GetAnimation(),
"Only effects associated with an animation should be "
"added to an element's effect set");

View file

@ -385,8 +385,7 @@ nsAnimationReceiver::RecordAnimationMutation(Animation* aAnimation,
return;
}
mozilla::dom::KeyframeEffectReadOnly* keyframeEffect =
effect->AsKeyframeEffect();
mozilla::dom::KeyframeEffect* keyframeEffect = effect->AsKeyframeEffect();
if (!keyframeEffect) {
return;
}

View file

@ -614,8 +614,6 @@ var interfaceNamesInGlobalScope =
{name: "KeyEvent", insecureContext: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "KeyboardEvent", insecureContext: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "KeyframeEffectReadOnly", insecureContext: true, release: false},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "KeyframeEffect", insecureContext: true, release: false},
// IMPORTANT: Do not change this list without review from a DOM peer!

View file

@ -16,8 +16,8 @@
enum CompositeOperation { "replace", "add", "accumulate" };
// The following dictionary types are not referred to by other .webidl files,
// but we use it for manual JS->IDL and IDL->JS conversions in
// KeyframeEffectReadOnly's implementation.
// but we use it for manual JS->IDL and IDL->JS conversions in KeyframeEffect's
// implementation.
dictionary BasePropertyIndexedKeyframe {
(double? or sequence<double?>) offset = [];

View file

@ -20,24 +20,21 @@ dictionary KeyframeEffectOptions : AnimationEffectTimingProperties {
CompositeOperation composite = "replace";
};
// KeyframeEffectReadOnly should run in the caller's compartment to do custom
// KeyframeEffect should run in the caller's compartment to do custom
// processing on the `keyframes` object.
[Func="nsDocument::IsWebAnimationsEnabled",
RunConstructorInCallerCompartment,
HeaderFile="mozilla/dom/KeyframeEffect.h",
Constructor ((Element or CSSPseudoElement)? target,
object? keyframes,
optional (unrestricted double or KeyframeEffectOptions) options),
Constructor (KeyframeEffectReadOnly source)]
interface KeyframeEffectReadOnly : AnimationEffectReadOnly {
Constructor (KeyframeEffect source)]
interface KeyframeEffect : AnimationEffectReadOnly {
attribute (Element or CSSPseudoElement)? target;
[NeedsCallerType]
attribute IterationCompositeOperation iterationComposite;
attribute CompositeOperation composite;
// We use object instead of ComputedKeyframe so that we can put the
// property-value pairs on the object.
[Throws] sequence<object> getKeyframes();
attribute IterationCompositeOperation iterationComposite;
attribute CompositeOperation composite;
[Throws] sequence<object> getKeyframes ();
[Throws] void setKeyframes (object? keyframes);
};
// Non-standard extensions
@ -55,19 +52,6 @@ dictionary AnimationPropertyDetails {
required sequence<AnimationPropertyValueDetails> values;
};
partial interface KeyframeEffectReadOnly {
partial interface KeyframeEffect {
[ChromeOnly, Throws] sequence<AnimationPropertyDetails> getProperties();
};
// KeyframeEffect should run in the caller's compartment to do custom
// processing on the `keyframes` object.
[Func="nsDocument::IsWebAnimationsEnabled",
RunConstructorInCallerCompartment,
Constructor ((Element or CSSPseudoElement)? target,
object? keyframes,
optional (unrestricted double or KeyframeEffectOptions) options),
Constructor (KeyframeEffectReadOnly source)]
interface KeyframeEffect : KeyframeEffectReadOnly {
[Throws]
void setKeyframes (object? keyframes);
};

View file

@ -254,7 +254,7 @@ AnimationHelper::SampleAnimationForEachNode(
// FIXME Bug 1455476: We should do this optimizations for the case where
// the layer has multiple animations.
if (iEnd == 1 &&
!dom::KeyframeEffectReadOnly::HasComputedTimingChanged(
!dom::KeyframeEffect::HasComputedTimingChanged(
computedTiming,
iterCompositeOperation,
animData.mProgressOnLastCompose,

View file

@ -1850,7 +1850,7 @@ RestyleManager::AnimationsWithDestroyedFrame
// *compositor* at this point.
EffectSet* effectSet = EffectSet::GetEffectSet(element, aPseudoType);
if (effectSet) {
for (KeyframeEffectReadOnly* effect : *effectSet) {
for (KeyframeEffect* effect : *effectSet) {
effect->ResetIsRunningOnCompositor();
}
}

View file

@ -207,7 +207,7 @@ template<typename TestType>
static bool
HasMatchingAnimations(EffectSet* aEffects, TestType&& aTest)
{
for (KeyframeEffectReadOnly* effect : *aEffects) {
for (KeyframeEffect* effect : *aEffects) {
if (aTest(*effect)) {
return true;
}
@ -232,7 +232,7 @@ bool
nsLayoutUtils::HasCurrentTransitions(const nsIFrame* aFrame)
{
return HasMatchingAnimations(aFrame,
[](KeyframeEffectReadOnly& aEffect)
[](KeyframeEffect& aEffect)
{
// Since |aEffect| is current, it must have an associated Animation
// so we don't need to null-check the result of GetAnimation().
@ -281,7 +281,7 @@ nsLayoutUtils::HasAnimationOfProperty(EffectSet* aEffectSet,
}
return HasMatchingAnimations(aEffectSet,
[&aProperty](KeyframeEffectReadOnly& aEffect)
[&aProperty](KeyframeEffect& aEffect)
{
return (aEffect.IsInEffect() || aEffect.IsCurrent()) &&
aEffect.HasAnimationOfProperty(aProperty);
@ -298,7 +298,7 @@ nsLayoutUtils::HasAnimationOfProperty(const nsIFrame* aFrame,
}
return HasMatchingAnimations(aFrame,
[&aProperty](KeyframeEffectReadOnly& aEffect)
[&aProperty](KeyframeEffect& aEffect)
{
return (aEffect.IsInEffect() || aEffect.IsCurrent()) &&
aEffect.HasAnimationOfProperty(aProperty);
@ -318,7 +318,7 @@ nsLayoutUtils::HasEffectiveAnimation(const nsIFrame* aFrame,
return HasMatchingAnimations(effects,
[&aProperty](KeyframeEffectReadOnly& aEffect)
[&aProperty](KeyframeEffect& aEffect)
{
return (aEffect.IsInEffect() || aEffect.IsCurrent()) &&
aEffect.HasEffectiveAnimationOfProperty(aProperty);
@ -374,7 +374,7 @@ GetMinAndMaxScaleForAnimationProperty(const nsIFrame* aFrame,
// not yet finished or which are filling forwards).
MOZ_ASSERT(anim->IsRelevant());
dom::KeyframeEffectReadOnly* effect =
dom::KeyframeEffect* effect =
anim->GetEffect() ? anim->GetEffect()->AsKeyframeEffect() : nullptr;
MOZ_ASSERT(effect, "A playing animation should have a keyframe effect");
for (size_t propIdx = effect->Properties().Length(); propIdx-- != 0; ) {

View file

@ -698,7 +698,7 @@ AddAnimationsForProperty(nsIFrame* aFrame, nsDisplayListBuilder* aBuilder,
continue;
}
dom::KeyframeEffectReadOnly* keyframeEffect =
dom::KeyframeEffect* keyframeEffect =
anim->GetEffect() ? anim->GetEffect()->AsKeyframeEffect() : nullptr;
MOZ_ASSERT(keyframeEffect,
"A playing animation should have a keyframe effect");

View file

@ -37,7 +37,7 @@ using namespace mozilla::css;
using mozilla::dom::Animation;
using mozilla::dom::AnimationEffectReadOnly;
using mozilla::dom::AnimationPlayState;
using mozilla::dom::KeyframeEffectReadOnly;
using mozilla::dom::KeyframeEffect;
using mozilla::dom::CSSAnimation;
typedef mozilla::ComputedTiming::AnimationPhase AnimationPhase;
@ -370,8 +370,7 @@ public:
aTimingFunction,
aKeyframes);
}
void SetKeyframes(KeyframeEffectReadOnly& aEffect,
nsTArray<Keyframe>&& aKeyframes)
void SetKeyframes(KeyframeEffect& aEffect, nsTArray<Keyframe>&& aKeyframes)
{
aEffect.SetKeyframes(Move(aKeyframes), mComputedStyle);
}
@ -407,7 +406,7 @@ public:
return;
}
KeyframeEffectReadOnly* keyframeEffect = effect->AsKeyframeEffect();
KeyframeEffect* keyframeEffect = effect->AsKeyframeEffect();
if (!keyframeEffect) {
return;
}
@ -437,7 +436,7 @@ UpdateOldAnimationPropertiesWithNew(
animationChanged = oldEffect->SpecifiedTiming() != aNewTiming;
oldEffect->SetSpecifiedTiming(aNewTiming);
KeyframeEffectReadOnly* oldKeyframeEffect = oldEffect->AsKeyframeEffect();
KeyframeEffect* oldKeyframeEffect = oldEffect->AsKeyframeEffect();
if (oldKeyframeEffect) {
aBuilder.SetKeyframes(*oldKeyframeEffect, Move(aNewKeyframes));
}
@ -530,9 +529,8 @@ BuildAnimation(nsPresContext* aPresContext,
Maybe<OwningAnimationTarget> target;
target.emplace(aTarget.mElement, aTarget.mPseudoType);
KeyframeEffectParams effectOptions;
RefPtr<KeyframeEffectReadOnly> effect =
new KeyframeEffectReadOnly(aPresContext->Document(), target, timing,
effectOptions);
RefPtr<KeyframeEffect> effect =
new KeyframeEffect(aPresContext->Document(), target, timing, effectOptions);
aBuilder.SetKeyframes(*effect, Move(keyframes));

View file

@ -27,7 +27,6 @@ namespace css {
class Declaration;
} /* namespace css */
namespace dom {
class KeyframeEffectReadOnly;
class Promise;
} /* namespace dom */

View file

@ -41,7 +41,6 @@ using mozilla::TimeDuration;
using mozilla::dom::Animation;
using mozilla::dom::AnimationPlayState;
using mozilla::dom::CSSTransition;
using mozilla::dom::KeyframeEffectReadOnly;
using namespace mozilla;
using namespace mozilla::css;

View file

@ -33,7 +33,7 @@ struct StyleTransition;
namespace mozilla {
struct ElementPropertyTransition : public dom::KeyframeEffectReadOnly
struct ElementPropertyTransition : public dom::KeyframeEffect
{
ElementPropertyTransition(nsIDocument* aDocument,
Maybe<OwningAnimationTarget>& aTarget,
@ -41,7 +41,7 @@ struct ElementPropertyTransition : public dom::KeyframeEffectReadOnly
AnimationValue aStartForReversingTest,
double aReversePortion,
const KeyframeEffectParams& aEffectOptions)
: dom::KeyframeEffectReadOnly(aDocument, aTarget, aTiming, aEffectOptions)
: dom::KeyframeEffect(aDocument, aTarget, aTiming, aEffectOptions)
, mStartForReversingTest(aStartForReversingTest)
, mReversePortion(aReversePortion)
{ }

View file

@ -4,15 +4,3 @@
[KeyframeEffect interface: existence and properties of interface prototype object]
expected: FAIL
[KeyframeEffect interface: operation getKeyframes()]
expected: FAIL
[KeyframeEffect interface: attribute target]
expected: FAIL
[KeyframeEffect interface: attribute iterationComposite]
expected: FAIL
[KeyframeEffect interface: attribute composite]
expected: FAIL