Bug 1436782: Insert the prefs sheet at the UA level. r?bholley
Since that's what it's effectively happening anyway.
MozReview-Commit-ID: AZGONTbCTNa
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -1297,16 +1297,19 @@ PresShell::Destroy()
}
if (mAccessibleCaretEventHub) {
mAccessibleCaretEventHub->Terminate();
mAccessibleCaretEventHub = nullptr;
}
// release our pref style sheet, if we have one still
+ //
+ // FIXME(emilio): Why do we need to do this? The stylist is getting nixed with
+ // us anyway.
RemovePreferenceStyles();
mIsDestroying = true;
// We can't release all the event content in
// mCurrentEventContentStack here since there might be code on the
// stack that will release the event content too. Double release
// bad!
@@ -1489,27 +1492,27 @@ PresShell::UpdatePreferenceStyles()
}
mStyleSet->BeginUpdate();
RemovePreferenceStyles();
// FIXME(emilio): This sheet is added as an user sheet, but parsed as an agent
// style sheet... Servo effectively inserts it as a UA sheet! See bug 1291390.
- mStyleSet->AppendStyleSheet(SheetType::User, newPrefSheet);
+ mStyleSet->AppendStyleSheet(SheetType::Agent, newPrefSheet);
mPrefStyleSheet = newPrefSheet;
mStyleSet->EndUpdate();
}
void
PresShell::RemovePreferenceStyles()
{
if (mPrefStyleSheet) {
- mStyleSet->RemoveStyleSheet(SheetType::User, mPrefStyleSheet);
+ mStyleSet->RemoveStyleSheet(SheetType::Agent, mPrefStyleSheet);
mPrefStyleSheet = nullptr;
}
}
void
PresShell::AddUserSheet(StyleSheet* aSheet)
{
// Make sure this does what nsDocumentViewer::CreateStyleSet does wrt