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
This commit is contained in:
Timothy Nikkel 2020-09-23 15:04:07 +00:00
Родитель f95ea514e2
Коммит 75d2f29087
1 изменённых файлов: 7 добавлений и 1 удалений

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

@ -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;