Bug 1451467 Check for nullptr mDocument->GetWindow() in a few more places in nsPresContext. r=smaug

--HG--
extra : rebase_source : a6ac4af614b261ec44162011daddfff0c8536f0c
This commit is contained in:
Ben Kelly 2018-04-05 18:33:00 +03:00
parent a9fd0592af
commit e8a484cfaa

View File

@ -1787,8 +1787,10 @@ nsPresContext::ThemeChangedInternal()
// Recursively notify all remote leaf descendants that the
// system theme has changed.
nsContentUtils::CallOnAllRemoteChildren(mDocument->GetWindow(),
NotifyThemeChanged, nullptr);
if (nsPIDOMWindowOuter* window = mDocument->GetWindow()) {
nsContentUtils::CallOnAllRemoteChildren(window,
NotifyThemeChanged, nullptr);
}
}
void
@ -2118,9 +2120,11 @@ NotifyTabSizeModeChanged(TabParent* aTab, void* aArg)
void
nsPresContext::SizeModeChanged(nsSizeMode aSizeMode)
{
nsContentUtils::CallOnAllRemoteChildren(mDocument->GetWindow(),
NotifyTabSizeModeChanged,
&aSizeMode);
if (nsPIDOMWindowOuter* window = mDocument->GetWindow()) {
nsContentUtils::CallOnAllRemoteChildren(window,
NotifyTabSizeModeChanged,
&aSizeMode);
}
MediaFeatureValuesChangedAllDocuments({ MediaFeatureChangeReason::SizeModeChange });
}