mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 1325728 - Use Gecko's existing mechanism to coordinate flushing the Stylist. r=heycam
This commit is contained in:
parent
1527e17416
commit
3e1898e903
@ -39,14 +39,15 @@ SERVO_BINDING_FUNC(Servo_StyleSheet_GetRules, ServoCssRulesStrong,
|
||||
SERVO_BINDING_FUNC(Servo_StyleSet_Init, RawServoStyleSetOwned)
|
||||
SERVO_BINDING_FUNC(Servo_StyleSet_Drop, void, RawServoStyleSetOwned set)
|
||||
SERVO_BINDING_FUNC(Servo_StyleSet_AppendStyleSheet, void,
|
||||
RawServoStyleSetBorrowed set, RawServoStyleSheetBorrowed sheet)
|
||||
RawServoStyleSetBorrowed set, RawServoStyleSheetBorrowed sheet, bool flush)
|
||||
SERVO_BINDING_FUNC(Servo_StyleSet_PrependStyleSheet, void,
|
||||
RawServoStyleSetBorrowed set, RawServoStyleSheetBorrowed sheet)
|
||||
RawServoStyleSetBorrowed set, RawServoStyleSheetBorrowed sheet, bool flush)
|
||||
SERVO_BINDING_FUNC(Servo_StyleSet_RemoveStyleSheet, void,
|
||||
RawServoStyleSetBorrowed set, RawServoStyleSheetBorrowed sheet)
|
||||
RawServoStyleSetBorrowed set, RawServoStyleSheetBorrowed sheet, bool flush)
|
||||
SERVO_BINDING_FUNC(Servo_StyleSet_InsertStyleSheetBefore, void,
|
||||
RawServoStyleSetBorrowed set, RawServoStyleSheetBorrowed sheet,
|
||||
RawServoStyleSheetBorrowed reference)
|
||||
RawServoStyleSheetBorrowed reference, bool flush)
|
||||
SERVO_BINDING_FUNC(Servo_StyleSet_FlushStyleSheets, void, RawServoStyleSetBorrowed set)
|
||||
SERVO_BINDING_FUNC(Servo_StyleSet_NoteStyleSheetsChanged, void,
|
||||
RawServoStyleSetBorrowed set)
|
||||
|
||||
|
@ -85,7 +85,7 @@ ServoStyleSet::EndUpdate()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// ... do something ...
|
||||
Servo_StyleSet_FlushStyleSheets(mRawSet.get());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -249,7 +249,7 @@ ServoStyleSet::AppendStyleSheet(SheetType aType,
|
||||
mSheets[aType].AppendElement(aSheet);
|
||||
|
||||
// Maintain a mirrored list of sheets on the servo side.
|
||||
Servo_StyleSet_AppendStyleSheet(mRawSet.get(), aSheet->RawSheet());
|
||||
Servo_StyleSet_AppendStyleSheet(mRawSet.get(), aSheet->RawSheet(), !mBatching);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -266,7 +266,7 @@ ServoStyleSet::PrependStyleSheet(SheetType aType,
|
||||
mSheets[aType].InsertElementAt(0, aSheet);
|
||||
|
||||
// Maintain a mirrored list of sheets on the servo side.
|
||||
Servo_StyleSet_PrependStyleSheet(mRawSet.get(), aSheet->RawSheet());
|
||||
Servo_StyleSet_PrependStyleSheet(mRawSet.get(), aSheet->RawSheet(), !mBatching);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -282,7 +282,7 @@ ServoStyleSet::RemoveStyleSheet(SheetType aType,
|
||||
mSheets[aType].RemoveElement(aSheet);
|
||||
|
||||
// Maintain a mirrored list of sheets on the servo side.
|
||||
Servo_StyleSet_RemoveStyleSheet(mRawSet.get(), aSheet->RawSheet());
|
||||
Servo_StyleSet_RemoveStyleSheet(mRawSet.get(), aSheet->RawSheet(), !mBatching);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -297,14 +297,18 @@ ServoStyleSet::ReplaceSheets(SheetType aType,
|
||||
// probably by aligning the representations better between engines.
|
||||
|
||||
for (ServoStyleSheet* sheet : mSheets[aType]) {
|
||||
Servo_StyleSet_RemoveStyleSheet(mRawSet.get(), sheet->RawSheet());
|
||||
Servo_StyleSet_RemoveStyleSheet(mRawSet.get(), sheet->RawSheet(), false);
|
||||
}
|
||||
|
||||
mSheets[aType].Clear();
|
||||
mSheets[aType].AppendElements(aNewSheets);
|
||||
|
||||
for (ServoStyleSheet* sheet : mSheets[aType]) {
|
||||
Servo_StyleSet_AppendStyleSheet(mRawSet.get(), sheet->RawSheet());
|
||||
Servo_StyleSet_AppendStyleSheet(mRawSet.get(), sheet->RawSheet(), false);
|
||||
}
|
||||
|
||||
if (!mBatching) {
|
||||
Servo_StyleSet_FlushStyleSheets(mRawSet.get());
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
@ -329,7 +333,7 @@ ServoStyleSet::InsertStyleSheetBefore(SheetType aType,
|
||||
|
||||
// Maintain a mirrored list of sheets on the servo side.
|
||||
Servo_StyleSet_InsertStyleSheetBefore(mRawSet.get(), aNewSheet->RawSheet(),
|
||||
aReferenceSheet->RawSheet());
|
||||
aReferenceSheet->RawSheet(), !mBatching);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -372,9 +376,9 @@ ServoStyleSet::AddDocStyleSheet(ServoStyleSheet* aSheet,
|
||||
mSheets[SheetType::Doc].SafeElementAt(index + 1);
|
||||
if (followingSheet) {
|
||||
Servo_StyleSet_InsertStyleSheetBefore(mRawSet.get(), aSheet->RawSheet(),
|
||||
followingSheet->RawSheet());
|
||||
followingSheet->RawSheet(), !mBatching);
|
||||
} else {
|
||||
Servo_StyleSet_AppendStyleSheet(mRawSet.get(), aSheet->RawSheet());
|
||||
Servo_StyleSet_AppendStyleSheet(mRawSet.get(), aSheet->RawSheet(), !mBatching);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user