mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 1336863: Flush stylesheets in RestyleForCSSRuleChanges if not under an update. r=heycam
This also moves the NoteStyleSheetsChanged to RecordStylesheetChange, which makes more sense, and stopped special-casing author styles, since it's not needed now. MozReview-Commit-ID: 9WKFa0JxqlU --HG-- extra : rebase_source : 5803620c98309bd2fbb542158e69ef3ddcee9a4b
This commit is contained in:
parent
c4d69b8e6d
commit
e868552184
@ -4559,19 +4559,6 @@ nsIPresShell::RestyleForCSSRuleChanges()
|
||||
mPresContext->RebuildCounterStyles();
|
||||
}
|
||||
|
||||
// Tell Servo that the contents of style sheets have changed.
|
||||
//
|
||||
// NB: It's important to do so before bailing out.
|
||||
//
|
||||
// Even if we have no frames, we can end up styling those when creating
|
||||
// them, and it's important for Servo to know that it needs to use the
|
||||
// correct styles.
|
||||
// We don't do this notification if author styles are disabled, because
|
||||
// the ServoStyleSet has already taken care of it.
|
||||
if (mStyleSet->IsServo() && !mStyleSet->AsServo()->GetAuthorStyleDisabled()) {
|
||||
mStyleSet->AsServo()->NoteStyleSheetsChanged();
|
||||
}
|
||||
|
||||
Element* root = mDocument->GetRootElement();
|
||||
if (!mDidInitialize) {
|
||||
// Nothing to do here, since we have no frames yet
|
||||
@ -4608,6 +4595,11 @@ PresShell::RecordStyleSheetChange(StyleSheet* aStyleSheet)
|
||||
if (mStylesHaveChanged)
|
||||
return;
|
||||
|
||||
// Tell Servo that the contents of style sheets have changed.
|
||||
if (ServoStyleSet* set = mStyleSet->GetAsServo()) {
|
||||
set->NoteStyleSheetsChanged();
|
||||
}
|
||||
|
||||
if (aStyleSheet->IsGecko()) {
|
||||
// XXXheycam ServoStyleSheets don't support <style scoped> yet.
|
||||
Element* scopeElement = aStyleSheet->AsGecko()->GetScopeElement();
|
||||
|
@ -143,10 +143,12 @@ ServoStyleSet::SetAuthorStyleDisabled(bool aStyleDisabled)
|
||||
// call flush directly, since the PresShell won't.
|
||||
if (mAuthorStyleDisabled) {
|
||||
NoteStyleSheetsChanged();
|
||||
Servo_StyleSet_FlushStyleSheets(mRawSet.get());
|
||||
}
|
||||
// If we've just enabled, then PresShell will trigger the notification and
|
||||
// later flush when the stylesheet objects are enabled in JS.
|
||||
//
|
||||
// TODO(emilio): Users can have JS disabled, can't they? Will that affect that
|
||||
// notification on content documents?
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -838,6 +840,9 @@ void
|
||||
ServoStyleSet::NoteStyleSheetsChanged()
|
||||
{
|
||||
Servo_StyleSet_NoteStyleSheetsChanged(mRawSet.get(), mAuthorStyleDisabled);
|
||||
if (!mBatching) {
|
||||
Servo_StyleSet_FlushStyleSheets(mRawSet.get());
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
Loading…
Reference in New Issue
Block a user