Disable OMTA for animations with a ScrollTimeline until it's implemented properly draft
authorBotond Ballo <botond@mozilla.com>
Wed, 27 Jul 2016 16:59:35 -0400
changeset 394554 46d99f451017530ba4d493fb164213b9c89c39da
parent 394553 2830bdb39f5c9fa7446b30fe2a0b626c9ff1e8b7
child 394555 88878d26a871901f2164edf15b8798fe84085673
push id24603
push userbballo@mozilla.com
push dateFri, 29 Jul 2016 23:28:33 +0000
milestone50.0a1
Disable OMTA for animations with a ScrollTimeline until it's implemented properly MozReview-Commit-ID: CKjuJDIGK0d
dom/animation/AnimationTimeline.h
dom/animation/DocumentTimeline.h
dom/animation/ScrollTimeline.h
layout/base/nsDisplayList.cpp
--- 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;
     }