[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser/tor-browser-68.2.0esr-9.5-1] Bug 1556017 - Fixing the off-by-one-pixel issue of find bar and devtool iframe for Letterboxing. r=johannh



commit e10f77aa1b2f91f861841118fa634bbf94429f31
Author: Tim Huang <tihuang@xxxxxxxxxxx>
Date:   Tue Jun 11 08:53:44 2019 +0000

    Bug 1556017 - Fixing the off-by-one-pixel issue of find bar and devtool iframe for Letterboxing. r=johannh
    
    This patch fixes the off-by-one-pixel issue of Letterboxing. For
    FindBar, it will be created when the user requests it and will be hidden
    if the user close it after that. The problem of the original approach is
    that it only observes the existance of the FindBar element but not the
    fact that whether or not it is visible. So, it will miscalculate the
    offset of FindBar after it has been created and closed.
    
    For devtools, the original approach adds one pixel offset for the
    separator. However, this one pixel offset is not required since there is
    no extra separator outside the devtools iframe. So, we don't need that
    and this patch removes this one pixel for the devtools.
    
    Differential Revision: https://phabricator.services.mozilla.com/D34156
    
    --HG--
    extra : moz-landing-system : lando
---
 toolkit/components/resistfingerprinting/RFPHelper.jsm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/toolkit/components/resistfingerprinting/RFPHelper.jsm b/toolkit/components/resistfingerprinting/RFPHelper.jsm
index a5d5bed86f98..f73ccf1797b0 100644
--- a/toolkit/components/resistfingerprinting/RFPHelper.jsm
+++ b/toolkit/components/resistfingerprinting/RFPHelper.jsm
@@ -408,12 +408,12 @@ class _RFPHelper {
 
       // If the findbar or devtools are out, we need to subtract their height (plus 1
       // for the separator) from the container height, because we need to adjust our
-      // letterboxing to acount for it; however it is not included in that dimension
+      // letterboxing to account for it; however it is not included in that dimension
       // (but rather is subtracted from the content height.)
-      let findBar = browserContainer.getElementsByClassName("findbar-container");
-      let findBarOffset = findBar.length ? findBar[0].clientHeight + 1 : 0;
+      let findBar = win.gFindBarInitialized ? win.gFindBar : undefined;
+      let findBarOffset = (findBar && !findBar.hidden) ? findBar.clientHeight + 1 : 0;
       let devtools = browserContainer.getElementsByClassName("devtools-toolbox-bottom-iframe");
-      let devtoolsOffset = devtools.length ? devtools[0].clientHeight + 1 : 0;
+      let devtoolsOffset = devtools.length ? devtools[0].clientHeight : 0;
 
       return {
         contentWidth,

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits