Bug 1373739 - Constrain widget size to screen size in headless mode. r=jrmuizel

Every other widget backend ensures widget size is bounded to screen size, but
this check was missing from headless.

MozReview-Commit-ID: 6bKIAkdRxoO

--HG--
extra : rebase_source : 6494a347aba323b977b845a1b70555fb1ab53864
This commit is contained in:
Michael Smith 2017-06-22 15:31:32 -07:00
Родитель f0a3973e54
Коммит f2f89289d9
1 изменённых файлов: 5 добавлений и 2 удалений

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

@ -161,8 +161,11 @@ HeadlessWidget::Resize(double aWidth,
double aHeight,
bool aRepaint)
{
mBounds.SizeTo(LayoutDeviceIntSize(NSToIntRound(aWidth),
NSToIntRound(aHeight)));
int32_t width = NSToIntRound(aWidth);
int32_t height = NSToIntRound(aHeight);
ConstrainSize(&width, &height);
mBounds.SizeTo(LayoutDeviceIntSize(width, height));
if (mLayerManager) {
RefPtr<gfxContext> ctx = CreateDefaultTarget(IntSize(mBounds.width, mBounds.height));
mLayerManager->AsBasicLayerManager()->SetDefaultTarget(ctx);