Skip to content

Commit

Permalink
Bug 1373739 - Constrain widget size to screen size in headless mode. …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
spinda committed Jun 22, 2017
1 parent 10b555b commit 74d4d9f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions widget/headless/HeadlessWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 74d4d9f

Please sign in to comment.