diff --git a/layout/base/ZoomConstraintsClient.cpp b/layout/base/ZoomConstraintsClient.cpp index 648129fb3ca..61f896b467f 100644 --- a/layout/base/ZoomConstraintsClient.cpp +++ b/layout/base/ZoomConstraintsClient.cpp @@ -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) { diff --git a/layout/base/ZoomConstraintsClient.h b/layout/base/ZoomConstraintsClient.h index 87be1162697..4a2da9114e2 100644 --- a/layout/base/ZoomConstraintsClient.h +++ b/layout/base/ZoomConstraintsClient.h @@ -33,6 +33,7 @@ private: public: void Init(nsIPresShell* aPresShell, nsIDocument *aDocument); void Destroy(); + void ScreenSizeChanged(); private: void RefreshZoomConstraints(); diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index c596d76aa98..30c0b2075c4 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -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