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

[tor-commits] [Git][tpo/applications/mullvad-browser][mullvad-browser-150.0a1-16.0-2] fixup! BB 32308: Use direct browser sizing for letterboxing.



Title: GitLab

henry pushed to branch mullvad-browser-150.0a1-16.0-2 at The Tor Project / Applications / Mullvad Browser

Commits:

  • fbb6188c
    by Henry Wilkes at 2026-04-28T09:56:05+01:00
    fixup! BB 32308: Use direct browser sizing for letterboxing.
    
    BB 44685: Use border radius for letterboxing. This allows us to drop
    browserDecorator.
    
    BB 44847: Drop the custom sidebar border radius logic since upstream now
    permanently uses a rounded corner for the browserContainer element when
    the sidebar is shown. We move the letterboxing background styling to
    browserContainer as well, so it does not leak out the corners.
    

3 changed files:

Changes:

  • browser/components/tabbrowser/content/tabbrowser.js
    ... ... @@ -2684,10 +2684,6 @@
    2684 2684
           stack.className = "browserStack";
    
    2685 2685
           stack.appendChild(b);
    
    2686 2686
     
    
    2687
    -      let decorator = document.createXULElement("hbox");
    
    2688
    -      decorator.className = "browserDecorator";
    
    2689
    -      stack.appendChild(decorator);
    
    2690
    -
    
    2691 2687
           let browserContainer = document.createXULElement("vbox");
    
    2692 2688
           browserContainer.className = "browserContainer";
    
    2693 2689
           browserContainer.appendChild(stack);
    

  • toolkit/components/resistfingerprinting/RFPHelper.sys.mjs
    ... ... @@ -26,8 +26,6 @@ const kPrefLetterboxingRememberSize =
    26 26
     const kTopicDOMWindowOpened = "domwindowopened";
    
    27 27
     const kTopicDOMWindowClosed = "domwindowclosed";
    
    28 28
     
    
    29
    -const kTopicFullscreenNavToolbox = "fullscreen-nav-toolbox";
    
    30
    -
    
    31 29
     const kPrefVerticalTabs = "sidebar.verticalTabs";
    
    32 30
     
    
    33 31
     const kPrefResizeWarnings = "privacy.resistFingerprinting.resizeWarnings";
    
    ... ... @@ -166,7 +164,6 @@ class _RFPHelper {
    166 164
         Services.prefs.addObserver(kPrefLetterboxing, this);
    
    167 165
         Services.prefs.addObserver(kPrefLetterboxingVcenter, this);
    
    168 166
         Services.prefs.addObserver(kPrefVerticalTabs, this);
    
    169
    -    Services.obs.addObserver(this, kTopicFullscreenNavToolbox);
    
    170 167
     
    
    171 168
         XPCOMUtils.defineLazyPreferenceGetter(
    
    172 169
           this,
    
    ... ... @@ -202,7 +199,6 @@ class _RFPHelper {
    202 199
         Services.prefs.removeObserver(kPrefLetterboxingVcenter, this);
    
    203 200
         Services.prefs.removeObserver(kPrefLetterboxing, this);
    
    204 201
         Services.prefs.removeObserver(kPrefVerticalTabs, this);
    
    205
    -    Services.obs.removeObserver(this, kTopicFullscreenNavToolbox);
    
    206 202
         // Remove the RFP observers, swallowing exceptions if they weren't present
    
    207 203
         this._removeLanguagePrefObservers();
    
    208 204
       }
    
    ... ... @@ -224,15 +220,6 @@ class _RFPHelper {
    224 220
           case kTopicDOMWindowClosed:
    
    225 221
             this._handleDOMWindowClosed(subject);
    
    226 222
             break;
    
    227
    -      case kTopicFullscreenNavToolbox:
    
    228
    -        // The `subject` is the gNavToolbox.
    
    229
    -        // Record whether the toobox has been hidden when the browser (not
    
    230
    -        // content) is in fullscreen.
    
    231
    -        subject.ownerGlobal.gBrowser.tabbox.classList.toggle(
    
    232
    -          "letterboxing-nav-toolbox-hidden",
    
    233
    -          data === "hidden"
    
    234
    -        );
    
    235
    -        break;
    
    236 223
           default:
    
    237 224
             break;
    
    238 225
         }
    
    ... ... @@ -728,14 +715,6 @@ class _RFPHelper {
    728 715
             gapVertical >= this._letterboxingBorderRadius ||
    
    729 716
               gapHorizontal >= this._letterboxingBorderRadius
    
    730 717
           );
    
    731
    -      // When the Letterboxing area is top-aligned, only show the sidebar corner
    
    732
    -      // if there is enough horizontal space.
    
    733
    -      // The factor of 4 is from the horizontal centre-alignment and wanting
    
    734
    -      // enough space for twice the corner radius.
    
    735
    -      browserParent.classList.toggle(
    
    736
    -        "letterboxing-show-sidebar-corner",
    
    737
    -        gapHorizontal >= 4 * this._letterboxingBorderRadius
    
    738
    -      );
    
    739 718
           if (win.gBrowser.selectedBrowser == aBrowser) {
    
    740 719
             const updateStatus = async args => {
    
    741 720
               win.XULBrowserWindow.letterboxingStatus = args
    
    ... ... @@ -797,10 +776,7 @@ class _RFPHelper {
    797 776
     
    
    798 777
       _resetContentSize(aBrowser) {
    
    799 778
         aBrowser.parentElement.classList.add("exclude-letterboxing");
    
    800
    -    aBrowser.parentElement.classList.remove(
    
    801
    -      "letterboxing-show-outline",
    
    802
    -      "letterboxing-show-sidebar-corner"
    
    803
    -    );
    
    779
    +    aBrowser.parentElement.classList.remove("letterboxing-show-outline");
    
    804 780
       }
    
    805 781
     
    
    806 782
       _updateSizeForTabsInWindow(aWindow) {
    

  • toolkit/components/resistfingerprinting/content/letterboxing.css
    ... ... @@ -66,45 +66,12 @@
    66 66
         }
    
    67 67
       }
    
    68 68
     
    
    69
    -  background: var(--letterboxing-bgcolor);
    
    70
    -
    
    71
    -  &:has(.deck-selected .browserContainer:not(.responsive-mode) > .browserStack:not(.exclude-letterboxing).letterboxing-show-outline) {
    
    72
    -    /* Letterboxing outline is visible for the current tab. Replace the usual
    
    73
    -     * outline to match the Letterboxing outline. For most scenarios, this
    
    74
    -     * should be mostly the same colour as when Letterboxing is not visible. But
    
    75
    -     * it may make a difference for some theme combinations. */
    
    76
    -    outline-color: var(--letterboxing-outline-color);
    
    77
    -    outline-width: var(--letterboxing-outline-width);
    
    78
    -  }
    
    79
    -
    
    80 69
       /* Override the --tabpanel-background-color. */
    
    81 70
       /* TODO: FIX this for newtab pages. tor-browser#44085 */
    
    82 71
       --tabpanel-background-color: transparent;
    
    83 72
     
    
    84
    -  /* stylelint-disable-next-line media-query-no-invalid */
    
    85
    -  @media -moz-pref("sidebar.revamp") {
    
    86
    -    :root:not([inDOMFullscreen]) &[sidebar-shown]:not(.letterboxing-nav-toolbox-hidden):is(
    
    87
    -      /* When the Letterboxing area is aligned to the top, show the rounded
    
    88
    -       * corner if there is enough vertical space between the sidebar and the
    
    89
    -       * browser element, which is not rounded at the top. */
    
    90
    -      :not(.letterboxing-vcenter):has(.deck-selected .browserContainer:not(.responsive-mode) > .browserStack:not(.exclude-letterboxing).letterboxing-show-sidebar-corner),
    
    91
    -      /* When the Letterboxing area is aligned to the centre, show the rounded
    
    92
    -       * corner if the Letterboxing border is shown. */
    
    93
    -      .letterboxing-vcenter:has(.deck-selected .browserContainer:not(.responsive-mode) > .browserStack:not(.exclude-letterboxing).letterboxing-show-outline)
    
    94
    -    ) {
    
    95
    -      /* stylelint-disable-next-line media-query-no-invalid */
    
    96
    -      @media -moz-pref("sidebar.position_start") {
    
    97
    -        border-start-start-radius: var(--letterboxing-border-radius);
    
    98
    -      }
    
    99
    -
    
    100
    -      /* stylelint-disable-next-line media-query-no-invalid */
    
    101
    -      @media not -moz-pref("sidebar.position_start") {
    
    102
    -        border-start-end-radius: var(--letterboxing-border-radius);
    
    103
    -      }
    
    104
    -    }
    
    105
    -  }
    
    106
    -
    
    107 73
       .browserContainer {
    
    74
    +    background: var(--letterboxing-bgcolor);
    
    108 75
         /*
    
    109 76
          * From Firefox 115 on, .browserContainer layout is flex / column,
    
    110 77
          * and without this trick the .browserStack's resize observer
    
    ... ... @@ -119,29 +86,22 @@
    119 86
       }
    
    120 87
     }
    
    121 88
     
    
    122
    -.browserContainer:not(.responsive-mode) > .browserStack:not(.exclude-letterboxing) {
    
    123
    -  :root:not([inDOMFullscreen]) .letterboxing.letterboxing-ready & {
    
    89
    +.letterboxing .deck-selected .browserContainer:not(.responsive-mode):has(> .browserStack:not(.exclude-letterboxing).letterboxing-show-outline) {
    
    90
    +  /* Letterboxing outline is visible for the current tab. Replace the usual
    
    91
    +   * outline to match the Letterboxing outline. For most scenarios, this
    
    92
    +   * should be mostly the same colour as when Letterboxing is not visible. But
    
    93
    +   * it may make a difference for some theme combinations. */
    
    94
    +  outline-color: var(--letterboxing-outline-color);
    
    95
    +  outline-width: var(--letterboxing-outline-width);
    
    96
    +}
    
    97
    +
    
    98
    +.letterboxing .browserContainer:not(.responsive-mode) > .browserStack:not(.exclude-letterboxing) {
    
    99
    +  :root:not([inDOMFullscreen]) .letterboxing-ready & {
    
    124 100
         place-content: var(--letterboxing-vertical-alignment) center;
    
    125 101
       }
    
    126 102
     
    
    127
    -  :root:not([inDOMFullscreen]) .letterboxing &.letterboxing-show-outline {
    
    103
    +  :root:not([inDOMFullscreen]) &.letterboxing-show-outline {
    
    128 104
         browser {
    
    129
    -      /* We use clip-path rather than border-radius because border-radius on its
    
    130
    -       * own leads to rendering artefacts in the corners (tested with GNOME).
    
    131
    -       * See tor-browser#44214 (comment 3262962). */
    
    132
    -      /* TODO: Use border-radius once bugzilla bug 1991874 is resolved. */
    
    133
    -      clip-path: rect(
    
    134
    -        auto auto auto auto round var(--letterboxing-border-radius-top) var(--letterboxing-border-radius-top) var(--letterboxing-border-radius)
    
    135
    -          var(--letterboxing-border-radius)
    
    136
    -      );
    
    137
    -    }
    
    138
    -
    
    139
    -    .browserDecorator {
    
    140
    -      /* Need a separate browserDecorator element because the clip-path on the
    
    141
    -       * browser would exclude the outline and box-shadow. */
    
    142
    -      /* TODO: Move these rules to the browser element once bugzilla bug 1991874
    
    143
    -       * is resolved, and drop browserDecorator. */
    
    144
    -      display: block;
    
    145 105
           border-radius: var(--letterboxing-border-radius-top) var(--letterboxing-border-radius-top) var(--letterboxing-border-radius)
    
    146 106
             var(--letterboxing-border-radius);
    
    147 107
           /* NOTE: The top outline will not be visible when this is aligned to the
    
    ... ... @@ -175,11 +135,3 @@
    175 135
         max-width: calc(var(--letterboxing-width) * 0.5);
    
    176 136
       }
    
    177 137
     }
    178
    -
    
    179
    -.browserDecorator {
    
    180
    -  display: none;
    
    181
    -  pointer-events: none;
    
    182
    -  background: transparent;
    
    183
    -  position: relative;
    
    184
    -  z-index: 1;
    
    185
    -}

  • _______________________________________________
    tor-commits mailing list -- tor-commits@xxxxxxxxxxxxxxxxxxxx
    To unsubscribe send an email to tor-commits-leave@xxxxxxxxxxxxxxxxxxxx