Bug 1418433 - Move the implementation of SetStylistStyleSheetsDirty to .cpp file. r=heycam, a=gchang
authorJeremy Chen <jeremychen@mozilla.com>
Wed, 29 Nov 2017 10:56:15 +0000
changeset 442681 25f3d0651a78a6d30dfe4237d5d41d3d653b463e
parent 442680 005f0819a0cdbb88070d7fd1a8fa24e6903354c8
child 442682 d23f5b4bf54978803f0c4b5312b00b209d12b55d
push id8299
push userryanvm@gmail.com
push dateSun, 03 Dec 2017 18:46:48 +0000
treeherdermozilla-beta@43f74013ae08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam, gchang
bugs1418433
milestone58.0
Bug 1418433 - Move the implementation of SetStylistStyleSheetsDirty to .cpp file. r=heycam, a=gchang This is a pre-patch for the real fix of Bug 1418433. In the real fix, we'll add a IncrementUndisplayedRestyleGeneration() call into SetStylistStyleSheetsDirty(). However, the IncrementUndisplayedRestyleGeneration() call needs get through some deep structures in nsPresContext, RestyleManager,... etc., and doing so means we need to move bunches of related include files, forward declarations, from .cpp file to .h file, which doesn't make sense. Instead, we move the implementation parts of SetStylistStyleSheetsDirty() to .cpp file (since it is now a bit more complicated than it was), so we can use the existing include files in the .cpp file to add IncrementUndisplayedRestyleGeneration() call (this is in a following patch). MozReview-Commit-ID: 3Vp9qyCf8NA
layout/style/ServoStyleSet.cpp
layout/style/ServoStyleSet.h
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -1144,16 +1144,28 @@ ServoStyleSet::MarkOriginsDirty(OriginFl
 {
   SetStylistStyleSheetsDirty();
   Servo_StyleSet_NoteStyleSheetsChanged(mRawSet.get(),
                                         mAuthorStyleDisabled,
                                         aChangedOrigins);
 }
 
 void
+ServoStyleSet::SetStylistStyleSheetsDirty()
+{
+  mStylistState |= StylistState::StyleSheetsDirty;
+}
+
+void
+ServoStyleSet::SetStylistXBLStyleSheetsDirty()
+{
+  mStylistState |= StylistState::XBLStyleSheetsDirty;
+}
+
+void
 ServoStyleSet::RecordStyleSheetChange(
     ServoStyleSheet* aSheet,
     StyleSheet::ChangeType aChangeType)
 {
   switch (aChangeType) {
     case StyleSheet::ChangeType::RuleAdded:
     case StyleSheet::ChangeType::RuleRemoved:
     case StyleSheet::ChangeType::RuleChanged:
--- a/layout/style/ServoStyleSet.h
+++ b/layout/style/ServoStyleSet.h
@@ -556,25 +556,19 @@ private:
    * changed since the last.  Calling this will ensure that the Stylist
    * rebuilds its selector maps.
    */
   void MarkOriginsDirty(OriginFlags aChangedOrigins);
 
   /**
    * Note that the stylist needs a style flush due to style sheet changes.
    */
-  void SetStylistStyleSheetsDirty()
-  {
-    mStylistState |= StylistState::StyleSheetsDirty;
-  }
+  void SetStylistStyleSheetsDirty();
 
-  void SetStylistXBLStyleSheetsDirty()
-  {
-    mStylistState |= StylistState::XBLStyleSheetsDirty;
-  }
+  void SetStylistXBLStyleSheetsDirty();
 
   bool StylistNeedsUpdate() const
   {
     return mStylistState != StylistState::NotDirty;
   }
 
   /**
    * Update the stylist as needed to ensure style data is up-to-date.