зеркало из https://github.com/mozilla/gecko-dev.git
Don't call GetViewManager() if 'mShell' is null. b=408216 r+sr=roc a=blocking1.9
This commit is contained in:
Родитель
db9caefa16
Коммит
23d8566024
|
@ -739,16 +739,17 @@ void
|
|||
nsPresContext::PreferenceChanged(const char* aPrefName)
|
||||
{
|
||||
if (!nsCRT::strcmp(aPrefName, "layout.css.dpi")) {
|
||||
PRInt32 oldAppUnitsPerDevPixel = AppUnitsPerDevPixel();
|
||||
if (mDeviceContext->CheckDPIChange() && mShell) {
|
||||
mDeviceContext->FlushFontCache();
|
||||
|
||||
// Re-fetch the view manager's window dimensions in case there's a deferred
|
||||
// resize which hasn't affected our mVisibleArea yet
|
||||
nscoord oldWidthAppUnits, oldHeightAppUnits;
|
||||
nsIViewManager* vm = GetViewManager();
|
||||
vm->GetWindowDimensions(&oldWidthAppUnits, &oldHeightAppUnits);
|
||||
float oldWidthDevPixels = oldWidthAppUnits/AppUnitsPerDevPixel();
|
||||
float oldHeightDevPixels = oldHeightAppUnits/AppUnitsPerDevPixel();
|
||||
|
||||
if (mDeviceContext->CheckDPIChange() && mShell) {
|
||||
mDeviceContext->FlushFontCache();
|
||||
float oldWidthDevPixels = oldWidthAppUnits/oldAppUnitsPerDevPixel;
|
||||
float oldHeightDevPixels = oldHeightAppUnits/oldAppUnitsPerDevPixel;
|
||||
|
||||
nscoord width = NSToCoordRound(oldWidthDevPixels*AppUnitsPerDevPixel());
|
||||
nscoord height = NSToCoordRound(oldHeightDevPixels*AppUnitsPerDevPixel());
|
||||
|
|
Загрузка…
Ссылка в новой задаче