diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 34932f95f6cf..fc0a62ee3872 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -5385,6 +5385,11 @@ nsresult PresShell::SetResolutionAndScaleTo(float aResolution, MOZ_ASSERT(mResolution.isSome()); return NS_OK; } + + // GetResolution handles mResolution being nothing by returning 1 so this + // is checking that the resolution is actually changing. + bool resolutionUpdated = (aResolution != GetResolution()); + RenderingState state(this); state.mResolution = Some(aResolution); SetRenderingState(state); @@ -5393,7 +5398,7 @@ nsresult PresShell::SetResolutionAndScaleTo(float aResolution, } if (aOrigin == ResolutionChangeOrigin::Apz) { mResolutionUpdatedByApz = true; - } else { + } else if (resolutionUpdated) { mResolutionUpdated = true; } diff --git a/layout/base/crashtests/1676301-1.html b/layout/base/crashtests/1676301-1.html new file mode 100644 index 000000000000..9ca79823f819 --- /dev/null +++ b/layout/base/crashtests/1676301-1.html @@ -0,0 +1,16 @@ + + +
+ +