Bug 1418433 - move the implementation of SetStylistStyleSheetsDirty to .cpp file.
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
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -1021,16 +1021,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
@@ -549,25 +549,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.