Bug 1340322 - Part 4: Make BuildAnimations() independent from nsStyleDisplay r=birtles.
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Mon, 06 Mar 2017 09:48:44 +0900
changeset 345973 ab3ba7fa8608999e3c7107e7de0a4c48ca75915b
parent 345972 ce3017376156099b7218884c60817d1a3c07910f
child 345974 4d1293edbdb7f161be04646ac367303b2d03b35a
push id31451
push usercbook@mozilla.com
push dateMon, 06 Mar 2017 09:52:09 +0000
treeherdermozilla-central@7099e03837e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1340322
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1340322 - Part 4: Make BuildAnimations() independent from nsStyleDisplay r=birtles. MozReview-Commit-ID: JiV2WxBVH3i
layout/style/nsAnimationManager.cpp
--- a/layout/style/nsAnimationManager.cpp
+++ b/layout/style/nsAnimationManager.cpp
@@ -1008,26 +1008,26 @@ CSSAnimationBuilder::GetComputedValue(ns
 
   return result;
 }
 
 static nsAnimationManager::OwningCSSAnimationPtrArray
 BuildAnimations(nsPresContext* aPresContext,
                 nsStyleContext* aStyleContext,
                 const NonOwningAnimationTarget& aTarget,
+                const nsStyleAutoArray<StyleAnimation>& aStyleAnimations,
+                uint32_t aStyleAnimationNameCount,
                 nsAnimationManager::CSSAnimationCollection* aCollection)
 {
   nsAnimationManager::OwningCSSAnimationPtrArray result;
 
-  const nsStyleDisplay *disp = aStyleContext->StyleDisplay();
-
   CSSAnimationBuilder builder(aStyleContext, aTarget);
 
-  for (size_t animIdx = disp->mAnimationNameCount; animIdx-- != 0;) {
-    const StyleAnimation& src = disp->mAnimations[animIdx];
+  for (size_t animIdx = aStyleAnimationNameCount; animIdx-- != 0;) {
+    const StyleAnimation& src = aStyleAnimations[animIdx];
 
     // CSS Animations whose animation-name does not match a @keyframes rule do
     // not generate animation events. This includes when the animation-name is
     // "none" which is represented by an empty name in the StyleAnimation.
     // Since such animations neither affect style nor dispatch events, we do
     // not generate a corresponding CSSAnimation for them.
     if (src.GetName().IsEmpty()) {
       continue;
@@ -1080,16 +1080,18 @@ nsAnimationManager::UpdateAnimations(nsS
 
   // Build the updated animations list, extracting matching animations from
   // the existing collection as we go.
   OwningCSSAnimationPtrArray newAnimations;
   if (!aStyleContext->IsInDisplayNoneSubtree()) {
     newAnimations = BuildAnimations(mPresContext,
                                     aStyleContext,
                                     target,
+                                    disp->mAnimations,
+                                    disp->mAnimationNameCount,
                                     collection);
   }
 
   if (newAnimations.IsEmpty()) {
     if (collection) {
       collection->Destroy();
     }
     return;