morgan pushed to branch tor-browser-128.9.0esr-14.5-1 at The Tor Project / 
Applications / Tor Browser


Commits:
41fd3b34 by hackademix at 2025-04-14T18:21:08+02:00
fixup! BB 41919: Letterboxing, add temporarily visible web content-size 
indicator on window resizing.

BB 43632: Letterboxing, always show the correct size for the active tab on 
resizing.
BB 43642: New tab shows letterboxing size indicator.

- - - - -


2 changed files:

- browser/themes/shared/tabbrowser/content-area.css
- toolkit/components/resistfingerprinting/RFPHelper.sys.mjs


Changes:

=====================================
browser/themes/shared/tabbrowser/content-area.css
=====================================
@@ -124,6 +124,7 @@
     direction: ltr;
   }
 
+  .browserStack:not(.letterboxingStatus) &[type=letterboxingStatus],
   .exclude-letterboxing &[type=letterboxingStatus],
   &[inactive],
   :root[inDOMFullscreen] &:not([type=overLink]) {


=====================================
toolkit/components/resistfingerprinting/RFPHelper.sys.mjs
=====================================
@@ -717,13 +717,7 @@ class _RFPHelper {
           borderRadius === 0 ? "hidden" : "",
         "--letterboxing-border-radius": borderRadius,
       });
-
-      if (
-        isResize &&
-        this.letterboxingEnabled &&
-        (parentWidth > lastRoundedSize.width ||
-          parentHeight > lastRoundedSize.height)
-      ) {
+      if (win.gBrowser.selectedBrowser == aBrowser) {
         const updateStatus = async args => {
           win.XULBrowserWindow.letterboxingStatus = args
             ? await win.document.l10n.formatValue(
@@ -733,9 +727,24 @@ class _RFPHelper {
             : "";
           win.StatusPanel.update();
         };
-        updateStatus(lastRoundedSize);
-        win.clearTimeout(win._letterboxingStatusTimeout);
-        win._letterboxingStatusTimeout = win.setTimeout(updateStatus, 1000);
+        if (
+          isResize &&
+          this.letterboxingEnabled &&
+          (parentWidth > lastRoundedSize.width ||
+            parentHeight > lastRoundedSize.height)
+        ) {
+          const clazz = "letterboxingStatus";
+          const currentParent = win.document.getElementsByClassName(clazz)[0];
+          if (currentParent != browserParent) {
+            currentParent?.classList.remove(clazz);
+            browserParent.classList.add(clazz);
+          }
+          updateStatus(lastRoundedSize);
+          win.clearTimeout(win._letterboxingStatusTimeout);
+          win._letterboxingStatusTimeout = win.setTimeout(updateStatus, 1000);
+        } else {
+          updateStatus("");
+        }
       }
     }
 
@@ -840,9 +849,23 @@ class _RFPHelper {
     const resizeObserver = (aWindow._rfpResizeObserver =
       new aWindow.ResizeObserver(entries => {
         const context = { isResize: true };
-        for (let { target } of entries) {
+        if (entries.length == 1) {
+          const { target } = entries[0];
+          if (!("_letterboxingNew" in target)) {
+            target._letterboxingNew = !entries[0].contentRect.width;
+            if (target._letterboxingNew) {
+              return;
+            }
+            context.isResize = false;
+          } else if (target._letterboxingNew) {
+            target._letterboxingNew = false;
+            context.isResize = false;
+          }
+        }
+
+        for (const { target } of entries) {
           this._roundOrResetContentSize(
-            target.querySelector("browser"),
+            target.getElementsByTagName("browser")[0],
             context
           );
         }



View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/41fd3b3401a25d6a8f4c4ad3da5925f1e174a3bc

-- 
View it on GitLab: 
https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/41fd3b3401a25d6a8f4c4ad3da5925f1e174a3bc
You're receiving this email because of your account on gitlab.torproject.org.


_______________________________________________
tbb-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to