[tbb-commits] [tor-browser/tor-browser-52.0.2esr-7.0-2] Bug 1352305 - Part 1: Making the XULWindow will not be enforecd to be rounded dimensions if it is

gk at torproject.org gk at torproject.org
Wed Apr 12 08:15:31 UTC 2017


commit 9ee872b57e55ae672a30f087cf55bccef18f3646
Author: Tim Huang <tihuang at mozilla.com>
Date:   Mon Apr 10 11:03:22 2017 -0700

    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 a24318a..604c41a 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);





More information about the tbb-commits mailing list