From 58739f9a897d4493435a5bf3b5f6cf697afe75ed Mon Sep 17 00:00:00 2001 From: Tim Huang Date: Mon, 10 Apr 2017 11:03:22 -0700 Subject: [PATCH] Bug 1352305 - Part 1: Making the XULWindow will not be enforecd to be rounded dimensions if it is a window without a primary content when fingerprinting resistance is enabled. r?ehsan This patch making the nsXULWindow::ForceRoundedDimensions() will only be called when this window is a window which has a primary content when fingerprinting resistance is enabled. This will fix the problem that dialog windows are incorrectly resized after fingerprinting resistance is enabled. MozReview-Commit-ID: 6WD6c38CTPv --- xpfe/appshell/nsXULWindow.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xpfe/appshell/nsXULWindow.cpp b/xpfe/appshell/nsXULWindow.cpp index e0dcd047e2473..9a05283971923 100644 --- a/xpfe/appshell/nsXULWindow.cpp +++ b/xpfe/appshell/nsXULWindow.cpp @@ -1129,8 +1129,13 @@ void nsXULWindow::OnChromeLoaded() int32_t specWidth = -1, specHeight = -1; bool gotSize = false; + bool isContent = false; - if (nsContentUtils::ShouldResistFingerprinting()) { + GetHasPrimaryContent(&isContent); + + // If this window has a primary content and fingerprinting resistance is + // enabled, we enforce this window to rounded dimensions. + if (isContent && nsContentUtils::ShouldResistFingerprinting()) { ForceRoundedDimensions(); } else if (!mIgnoreXULSize) { gotSize = LoadSizeFromXUL(specWidth, specHeight); -- GitLab