Disable OMTA for animations with a ScrollTimeline until it's implemented properly
draft
Disable OMTA for animations with a ScrollTimeline until it's implemented properly
MozReview-Commit-ID: CKjuJDIGK0d
--- a/dom/animation/AnimationTimeline.h
+++ b/dom/animation/AnimationTimeline.h
@@ -99,16 +99,18 @@ public:
* time.
*/
bool HasAnimations() const {
return !mAnimations.IsEmpty();
}
virtual void RemoveAnimation(Animation* aAnimation);
+ virtual bool SupportsOMTA() const = 0;
+
protected:
nsCOMPtr<nsIGlobalObject> mWindow;
// Animations observing this timeline
//
// We store them in (a) a hashset for quick lookup, and (b) an array
// to maintain a fixed sampling order.
//
--- a/dom/animation/DocumentTimeline.h
+++ b/dom/animation/DocumentTimeline.h
@@ -75,16 +75,18 @@ public:
void RemoveAnimation(Animation* aAnimation) override;
// nsARefreshObserver methods
void WillRefresh(TimeStamp aTime) override;
void NotifyRefreshDriverCreated(nsRefreshDriver* aDriver);
void NotifyRefreshDriverDestroying(nsRefreshDriver* aDriver);
+ bool SupportsOMTA() const override { return true; }
+
protected:
TimeStamp GetCurrentTimeStamp() const;
nsRefreshDriver* GetRefreshDriver() const;
nsCOMPtr<nsIDocument> mDocument;
// The most recently used refresh driver time. This is used in cases where
// we don't have a refresh driver (e.g. because we are in a display:none
--- a/dom/animation/ScrollTimeline.h
+++ b/dom/animation/ScrollTimeline.h
@@ -102,16 +102,18 @@ public:
// nsARefreshObserver methods
void WillRefresh(TimeStamp aTime) override;
void NotifyRefreshDriverCreated(nsRefreshDriver* aDriver);
void NotifyRefreshDriverDestroying(nsRefreshDriver* aDriver);
void SetScrollValues();
+ bool SupportsOMTA() const override { return false; }
+
protected:
nsRefreshDriver* GetRefreshDriver() const;
void CalculateTimeRange();
nsCOMPtr<nsIDocument> mDocument;
// The most recently used refresh driver time. This is used in cases where
// we don't have a refresh driver (e.g. because we are in a display:none
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -468,16 +468,19 @@ AddAnimationsForProperty(nsIFrame* aFram
"inconsistent property flags");
// Add from first to last (since last overrides)
for (size_t animIdx = 0; animIdx < aAnimations.Length(); animIdx++) {
dom::Animation* anim = aAnimations[animIdx];
if (!anim->IsPlaying()) {
continue;
}
+ if (!anim->GetTimeline()->SupportsOMTA()) {
+ continue;
+ }
dom::KeyframeEffectReadOnly* effect = anim->GetEffect();
MOZ_ASSERT(effect, "A playing animation should have an effect");
const AnimationProperty* property =
effect->GetAnimationOfProperty(aProperty);
if (!property) {
continue;
}