Bug 1439428 - Make EffectCompositor::UpdateCascadeResults public. r? draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Fri, 23 Feb 2018 09:05:26 +0900 (2018-02-23)
changeset 758771 7ad7459af8a837781b8b95f6d6972f170a8ca9e7
parent 758710 169b1ba48437d5ddc0a4a1828177770b598f7c05
child 758772 b33a9abafcb155e2f2d7ce88b7547c164792caa6
push id100167
push userhikezoe@mozilla.com
push dateFri, 23 Feb 2018 00:37:49 +0000 (2018-02-23)
bugs1439428
milestone60.0a1
Bug 1439428 - Make EffectCompositor::UpdateCascadeResults public. r? We will call the function directly in a sequential task in the case where we already detected that !important styles for animations has been changed in parallel traversal. MozReview-Commit-ID: 7j6CfONYD08
dom/animation/EffectCompositor.h
--- a/dom/animation/EffectCompositor.h
+++ b/dom/animation/EffectCompositor.h
@@ -216,16 +216,39 @@ public:
   // This method does NOT detect if other styles that apply above the
   // animation level of the cascade have changed.
   static void
   MaybeUpdateCascadeResults(StyleBackendType aBackendType,
                             dom::Element* aElement,
                             CSSPseudoElementType aPseudoType,
                             nsStyleContext* aStyleContext);
 
+  // Update the mPropertiesWithImportantRules and
+  // mPropertiesForAnimationsLevel members of the given EffectSet, and also
+  // request any restyles required by changes to the cascade result.
+  //
+  // NOTE: This can be expensive so we should only call it if styles that apply
+  // above the animation level of the cascade might have changed. For all
+  // other cases we should call MaybeUpdateCascadeResults.
+  //
+  // This is typically reserved for internal callers but is public here since
+  // when we detect changes to the cascade on the Servo side we can't call
+  // MarkCascadeNeedsUpdate during the traversal so instead we call this as part
+  // of a follow-up sequential task.
+  //
+  // As with MaybeUpdateCascadeResults, |aStyleContext| is only used
+  // when |aBackendType| is StyleBackendType::Gecko. When |aBackendType| is
+  // StyleBackendType::Servo, it is ignored.
+  static void
+  UpdateCascadeResults(StyleBackendType aBackendType,
+                       EffectSet& aEffectSet,
+                       dom::Element* aElement,
+                       CSSPseudoElementType aPseudoType,
+                       nsStyleContext* aStyleContext);
+
   // Helper to fetch the corresponding element and pseudo-type from a frame.
   //
   // For frames corresponding to pseudo-elements, the returned element is the
   // element on which we store the animations (i.e. the EffectSet and/or
   // AnimationCollection), *not* the generated content.
   //
   // Returns an empty result when a suitable element cannot be found including
   // when the frame represents a pseudo-element on which we do not support
@@ -288,34 +311,16 @@ private:
   // stored on the (pseudo-)element indicated by |aElement| and |aPseudoType|.
   static nsCSSPropertyIDSet
   GetOverriddenProperties(StyleBackendType aBackendType,
                           EffectSet& aEffectSet,
                           dom::Element* aElement,
                           CSSPseudoElementType aPseudoType,
                           nsStyleContext* aStyleContext);
 
-  // Update the mPropertiesWithImportantRules and
-  // mPropertiesForAnimationsLevel members of the given EffectSet, and also
-  // request any restyles required by changes to the cascade result.
-  //
-  // This can be expensive so we should only call it if styles that apply
-  // above the animation level of the cascade might have changed. For all
-  // other cases we should call MaybeUpdateCascadeResults.
-  //
-  // As with MaybeUpdateCascadeResults, |aStyleContext| is only used
-  // when |aBackendType| is StyleBackendType::Gecko. When |aBackendType| is
-  // StyleBackendType::Servo, it is ignored.
-  static void
-  UpdateCascadeResults(StyleBackendType aBackendType,
-                       EffectSet& aEffectSet,
-                       dom::Element* aElement,
-                       CSSPseudoElementType aPseudoType,
-                       nsStyleContext* aStyleContext);
-
   static nsPresContext* GetPresContext(dom::Element* aElement);
 
   nsPresContext* mPresContext;
 
   // Elements with a pending animation restyle. The associated bool value is
   // true if a pending animation restyle has also been dispatched. For
   // animations that can be throttled, we will add an entry to the hashtable to
   // indicate that the style rule on the element is out of date but without