Bug 1255362 - Null-check GetContainer() before using it in image-related ConfigureLayer() methods. r=mstange a=Tomcat

This commit is contained in:
Seth Fowler 2016-03-11 15:12:07 +08:00
Родитель 1c95c143d4
Коммит c963068948
3 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -2817,7 +2817,9 @@ nsDisplayBackgroundImage::ConfigureLayer(ImageLayer* aLayer,
// asynchronously, this is not enough. Bug 1183378 will provide a more
// complete fix, but this solution is safe in more cases than simply relying
// on the intrinsic size.
IntSize containerSize = aLayer->GetContainer()->GetCurrentSize();
IntSize containerSize = aLayer->GetContainer()
? aLayer->GetContainer()->GetCurrentSize()
: IntSize(imageWidth, imageHeight);
const LayoutDevicePoint p = mImageLayerDestRect.TopLeft();
Matrix transform = Matrix::Translation(p.x, p.y);

Просмотреть файл

@ -1711,7 +1711,9 @@ nsDisplayImage::ConfigureLayer(ImageLayer* aLayer,
// asynchronously, this is not enough. Bug 1183378 will provide a more
// complete fix, but this solution is safe in more cases than simply relying
// on the intrinsic size.
IntSize containerSize = aLayer->GetContainer()->GetCurrentSize();
IntSize containerSize = aLayer->GetContainer()
? aLayer->GetContainer()->GetCurrentSize()
: IntSize(imageWidth, imageHeight);
const LayoutDevicePoint p = destRect.TopLeft();
Matrix transform = Matrix::Translation(p.x, p.y);

Просмотреть файл

@ -488,7 +488,9 @@ nsDisplayXULImage::ConfigureLayer(ImageLayer* aLayer,
// asynchronously, this is not enough. Bug 1183378 will provide a more
// complete fix, but this solution is safe in more cases than simply relying
// on the intrinsic size.
IntSize containerSize = aLayer->GetContainer()->GetCurrentSize();
IntSize containerSize = aLayer->GetContainer()
? aLayer->GetContainer()->GetCurrentSize()
: IntSize(imageWidth, imageHeight);
const LayoutDevicePoint p = destRect.TopLeft();
Matrix transform = Matrix::Translation(p.x, p.y);