Bug 1297899 - Part 7: Move PostRestyleEventForLazyConstruction up to RestyleManager. r?bholley draft
authorCameron McCormack <cam@mcc.id.au>
Mon, 13 Feb 2017 11:21:33 +0800
changeset 482521 c544ae4c154fd34ad09fed587ffb49567857f1e2
parent 482520 6e364104360676f2599d51bfbe15f78d1edd7d76
child 482522 1fc5541d2b2d69c602bbf11996ddfde30a32d8c0
push id45090
push userbmo:cam@mcc.id.au
push dateMon, 13 Feb 2017 03:22:33 +0000
reviewersbholley
bugs1297899
milestone54.0a1
Bug 1297899 - Part 7: Move PostRestyleEventForLazyConstruction up to RestyleManager. r?bholley MozReview-Commit-ID: 8M5wgCJp6PT
layout/base/GeckoRestyleManager.h
layout/base/RestyleManager.h
layout/base/RestyleManagerInlines.h
layout/base/ServoRestyleManager.cpp
--- a/layout/base/GeckoRestyleManager.h
+++ b/layout/base/GeckoRestyleManager.h
@@ -320,21 +320,16 @@ public:
    *                        descendants.
    * @param aRestyleHintData: Additional data to go with aRestyleHint.
    */
   void PostRestyleEvent(Element* aElement,
                         nsRestyleHint aRestyleHint,
                         nsChangeHint aMinChangeHint,
                         const RestyleHintData* aRestyleHintData = nullptr);
 
-  void PostRestyleEventForLazyConstruction()
-  {
-    PostRestyleEventInternal(true);
-  }
-
 public:
   /**
    * Asynchronously clear style data from the root frame downwards and ensure
    * it will all be rebuilt. This is safe to call anytime; it will schedule
    * a restyle and take effect next time style changes are flushed.
    * This method is used to recompute the style data when some change happens
    * outside of any style rules, like a color preference change or a change
    * in a system font size, or to fix things up when an optimization in the
--- a/layout/base/RestyleManager.h
+++ b/layout/base/RestyleManager.h
@@ -135,22 +135,23 @@ public:
   /**
    * Return the current AnimationsWithDestroyedFrame struct, or null if we're
    * not currently in a restyling operation.
    */
   AnimationsWithDestroyedFrame* GetAnimationsWithDestroyedFrame() {
     return mAnimationsWithDestroyedFrame;
   }
 
+  void PostRestyleEventForLazyConstruction() { PostRestyleEventInternal(true); }
+
   MOZ_DECL_STYLO_METHODS(GeckoRestyleManager, ServoRestyleManager)
 
   inline void PostRestyleEvent(dom::Element* aElement,
                                nsRestyleHint aRestyleHint,
                                nsChangeHint aMinChangeHint);
-  inline void PostRestyleEventForLazyConstruction();
   inline void RebuildAllStyleData(nsChangeHint aExtraHint,
                                   nsRestyleHint aRestyleHint);
   inline void PostRebuildAllStyleDataEvent(nsChangeHint aExtraHint,
                                            nsRestyleHint aRestyleHint);
   inline void ProcessPendingRestyles();
   inline void ContentInserted(nsINode* aContainer,
                               nsIContent* aChild);
   inline void ContentAppended(nsIContent* aContainer,
--- a/layout/base/RestyleManagerInlines.h
+++ b/layout/base/RestyleManagerInlines.h
@@ -20,22 +20,16 @@ void
 RestyleManager::PostRestyleEvent(dom::Element* aElement,
                                  nsRestyleHint aRestyleHint,
                                  nsChangeHint aMinChangeHint)
 {
   MOZ_STYLO_FORWARD(PostRestyleEvent, (aElement, aRestyleHint, aMinChangeHint));
 }
 
 void
-RestyleManager::PostRestyleEventForLazyConstruction()
-{
-  MOZ_STYLO_FORWARD(PostRestyleEventForLazyConstruction, ());
-}
-
-void
 RestyleManager::RebuildAllStyleData(nsChangeHint aExtraHint,
                                     nsRestyleHint aRestyleHint)
 {
   MOZ_STYLO_FORWARD(RebuildAllStyleData, (aExtraHint, aRestyleHint));
 }
 
 void
 RestyleManager::PostRebuildAllStyleDataEvent(nsChangeHint aExtraHint,
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -80,22 +80,16 @@ ServoRestyleManager::PostRestyleEvent(El
   if (aRestyleHint || aMinChangeHint) {
     Servo_NoteExplicitHints(aElement, aRestyleHint, aMinChangeHint);
   }
 
   PostRestyleEventInternal(false);
 }
 
 void
-ServoRestyleManager::PostRestyleEventForLazyConstruction()
-{
-  PostRestyleEventInternal(true);
-}
-
-void
 ServoRestyleManager::RebuildAllStyleData(nsChangeHint aExtraHint,
                                          nsRestyleHint aRestyleHint)
 {
   // TODO(emilio, bz): We probably need to do some actual restyling here too.
   NS_WARNING("stylo: ServoRestyleManager::RebuildAllStyleData is incomplete");
   StyleSet()->RebuildData();
 }