mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 21:05:36 +00:00
Bug 1183786 - Part 2: Delay updating after prefs changed if detached. r=tn r=dholbert
This commit is contained in:
parent
9287574901
commit
0a5b83be7b
@ -948,6 +948,12 @@ nsPresContext::UpdateAfterPreferencesChanged()
|
||||
{
|
||||
mPrefChangedTimer = nullptr;
|
||||
|
||||
if (!mContainer) {
|
||||
// Delay updating until there is a container
|
||||
mNeedsPrefUpdate = true;
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> docShell(mContainer);
|
||||
if (docShell && nsIDocShellTreeItem::typeChrome == docShell->ItemType()) {
|
||||
return;
|
||||
@ -1569,7 +1575,15 @@ void
|
||||
nsPresContext::SetContainer(nsIDocShell* aDocShell)
|
||||
{
|
||||
if (aDocShell) {
|
||||
NS_ASSERTION(!(!!mContainer && mNeedsPrefUpdate),
|
||||
"Should only need pref update if mContainer is null.");
|
||||
mContainer = static_cast<nsDocShell*>(aDocShell);
|
||||
if (mNeedsPrefUpdate) {
|
||||
if (!mPrefChangedTimer) {
|
||||
InitTimer(mPrefChangedTimer, nsPresContext::PrefChangedUpdateTimerCallback, 0);
|
||||
}
|
||||
mNeedsPrefUpdate = false;
|
||||
}
|
||||
} else {
|
||||
mContainer = WeakPtr<nsDocShell>();
|
||||
}
|
||||
|
@ -1377,6 +1377,9 @@ protected:
|
||||
// Have we added quirk.css to the style set?
|
||||
unsigned mQuirkSheetAdded : 1;
|
||||
|
||||
// Is there a pref update to process once we have a container?
|
||||
unsigned mNeedsPrefUpdate : 1;
|
||||
|
||||
#ifdef RESTYLE_LOGGING
|
||||
// Should we output debug information about restyling for this document?
|
||||
bool mRestyleLoggingEnabled;
|
||||
|
Loading…
Reference in New Issue
Block a user