Bug 1194811 Part 1 - Recompute the zoom constraints if the available screen area changes. r=botond

This commit is contained in:
Kartikaya Gupta 2015-08-26 14:41:12 -04:00
parent 3095fc0237
commit 2da6e500c4
3 changed files with 14 additions and 0 deletions

View File

@ -133,6 +133,13 @@ ZoomConstraintsClient::Observe(nsISupports* aSubject, const char* aTopic, const
return NS_OK;
}
void
ZoomConstraintsClient::ScreenSizeChanged()
{
ZCC_LOG("Got a screen-size change notification in %p\n", this);
RefreshZoomConstraints();
}
mozilla::layers::ZoomConstraints
ComputeZoomConstraintsFromViewportInfo(const nsViewportInfo& aViewportInfo)
{

View File

@ -33,6 +33,7 @@ private:
public:
void Init(nsIPresShell* aPresShell, nsIDocument *aDocument);
void Destroy();
void ScreenSizeChanged();
private:
void RefreshZoomConstraints();

View File

@ -1795,6 +1795,12 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
return NS_OK;
}
if (mZoomConstraintsClient) {
// If we have a ZoomConstraintsClient and the available screen area
// changed, then we might need to disable double-tap-to-zoom, so notify
// the ZCC to update itself.
mZoomConstraintsClient->ScreenSizeChanged();
}
if (mMobileViewportManager) {
// If we have a mobile viewport manager, request a reflow from it. It can
// recompute the final CSS viewport and trigger a call to