From 75d2f29087e2338bac040776a358d9213c6a98ad Mon Sep 17 00:00:00 2001 From: Timothy Nikkel Date: Wed, 23 Sep 2020 15:04:07 +0000 Subject: [PATCH] Bug 1665332. Make sure to initialize all fields of the ZoomConstraints to the correct values on ZoomConstraintsClient in all cases. r=kats The default constructor initializes the two bools to true. Differential Revision: https://phabricator.services.mozilla.com/D91103 --- layout/base/ZoomConstraintsClient.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/layout/base/ZoomConstraintsClient.cpp b/layout/base/ZoomConstraintsClient.cpp index fc595ddaaf7f..34d4323ff012 100644 --- a/layout/base/ZoomConstraintsClient.cpp +++ b/layout/base/ZoomConstraintsClient.cpp @@ -40,7 +40,10 @@ using namespace mozilla::dom; using namespace mozilla::layers; ZoomConstraintsClient::ZoomConstraintsClient() - : mDocument(nullptr), mPresShell(nullptr) {} + : mDocument(nullptr), + mPresShell(nullptr), + mZoomConstraints(false, false, CSSToParentLayerScale(1.f), + CSSToParentLayerScale(1.f)) {} ZoomConstraintsClient::~ZoomConstraintsClient() = default; @@ -186,6 +189,9 @@ static mozilla::layers::ZoomConstraints ComputeZoomConstraintsFromViewportInfo( } void ZoomConstraintsClient::RefreshZoomConstraints() { + mZoomConstraints = ZoomConstraints(false, false, CSSToParentLayerScale(1.f), + CSSToParentLayerScale(1.f)); + nsIWidget* widget = GetWidget(mPresShell); if (!widget) { return;