ma1 pushed to branch base-browser-115.7.0esr-13.5-1 at The Tor Project / Applications / Tor Browser

Commits:

3 changed files:

Changes:

  • browser/base/content/browser.css
    ... ... @@ -127,6 +127,11 @@ body {
    127 127
       -moz-window-dragging: drag;
    
    128 128
     }
    
    129 129
     
    
    130
    +/**
    
    131
    +  Never modify the following selector without synchronizing
    
    132
    +  LETTERBOX_CSS_SELECTOR in RFPHelper.sys.jsm, where
    
    133
    +  --letterboxing-width & --letterboxing-height are actually set.
    
    134
    +**/
    
    130 135
     .letterboxing .browserContainer {
    
    131 136
       /*
    
    132 137
       From Firefox 115 on, .browserContainer layout is flex / column,
    
    ... ... @@ -137,6 +142,14 @@ body {
    137 142
       background: var(--letterboxing-bgcolor);
    
    138 143
     }
    
    139 144
     
    
    145
    +.browserDecorator {
    
    146
    +  display: none;
    
    147
    +  pointer-events: none;
    
    148
    +  background: transparent;
    
    149
    +  position: relative;
    
    150
    +  z-index: 1;
    
    151
    +}
    
    152
    +
    
    140 153
     .letterboxing {
    
    141 154
       --letterboxing-border-radius: 8px;
    
    142 155
       --letterboxing-border-top-radius: 0;
    
    ... ... @@ -145,6 +158,7 @@ body {
    145 158
       --letterboxing-bgcolor: var(--tabpanel-background-color);
    
    146 159
       --letterboxing-gradient-color1: var(--letterboxing-bgcolor);
    
    147 160
       --letterboxing-gradient-color2: color-mix(in srgb, var(--chrome-content-separator-color) 50%, var(--letterboxing-bgcolor));
    
    161
    +  --letterboxing-border-color: var(--letterboxing-bgcolor);
    
    148 162
     }
    
    149 163
     
    
    150 164
     .letterboxing.letterboxing-vcenter .browserContainer:not(.responsive-mode) > .browserStack:not(.exclude-letterboxing) {
    
    ... ... @@ -154,7 +168,26 @@ body {
    154 168
     
    
    155 169
     .letterboxing.letterboxing-gradient .browserContainer {
    
    156 170
       background: linear-gradient(283deg, var(--letterboxing-gradient-color1) 0%, var(--letterboxing-gradient-color2) 100%), var(--letterboxing-bgcolor);
    
    157
    -  box-shadow: rgba(0, 0, 0, 0.5) 0px -1px 2px;
    
    171
    +}
    
    172
    +
    
    173
    +:root:not([inDOMFullscreen]) .letterboxing .browserContainer:not(.responsive-mode)
    
    174
    +  > .browserStack:not(.exclude-letterboxing)
    
    175
    +  > .browserDecorator {
    
    176
    +  display: initial;
    
    177
    +  visibility: visible;
    
    178
    +  border-radius: var(--letterboxing-border-radius);
    
    179
    +  border-top-left-radius: var(--letterboxing-border-top-radius);
    
    180
    +  border-top-right-radius: var(--letterboxing-border-top-radius);
    
    181
    +  box-shadow: var(--letterboxing-border-color) 0px 0px .1px inset, var(--letterboxing-border-color) 0 0 .1px;
    
    182
    +  border: .1px solid var(--letterboxing-border-color);
    
    183
    +  outline: .1px solid var(--letterboxing-bgcolor);
    
    184
    +  height: calc(var(--letterboxing-height) + 1px);
    
    185
    +  top: -1px;
    
    186
    +}
    
    187
    +
    
    188
    +.letterboxing-vcenter .browserDecorator {
    
    189
    +  height: auto !important;
    
    190
    +  top: 0 !important;
    
    158 191
     }
    
    159 192
     
    
    160 193
     /*
    
    ... ... @@ -167,6 +200,7 @@ body {
    167 200
       place-self: end left;
    
    168 201
       left: 0;
    
    169 202
       right: 0;
    
    203
    +  z-index: 2;
    
    170 204
       --letterboxing-status-left-radius: var(--letterboxing-border-radius);
    
    171 205
       --letterboxing-status-right-radius: 0;
    
    172 206
     }
    
    ... ... @@ -184,18 +218,19 @@ body {
    184 218
     .letterboxing .browserContainer:not(.responsive-mode) > .browserStack:not(.exclude-letterboxing)
    
    185 219
     #statuspanel-label {
    
    186 220
       border-radius: 0 0 var(--letterboxing-status-right-radius) var(--letterboxing-status-left-radius);
    
    221
    +  margin: 0;
    
    222
    +  border: 1px solid var(--letterboxing-border-color);
    
    223
    +  max-width: calc(var(--letterboxing-width) * .5);
    
    187 224
     }
    
    188 225
     
    
    189
    -/**
    
    190
    -  Never modify the following selector without synchronizing
    
    191
    -  LETTERBOX_CSS_SELECTOR in RFPHelper.jsm!
    
    192
    -**/
    
    193 226
     .letterboxing .browserContainer:not(.responsive-mode) > .browserStack:not(.exclude-letterboxing) > browser {
    
    194
    -  /* width & height to be dynamically set by RFPHelper.jsm */
    
    195 227
       box-shadow: 0px 4px 8px 0px var(--letterboxing-shadow-color);
    
    196 228
       border-radius: var(--letterboxing-border-radius);
    
    197 229
       border-top-left-radius: var(--letterboxing-border-top-radius);
    
    198 230
       border-top-right-radius: var(--letterboxing-border-top-radius);
    
    231
    +  width: var(--letterboxing-width) !important;
    
    232
    +  height: var(--letterboxing-height) !important;
    
    233
    +  background: var(--letterboxing-gradient-color2);
    
    199 234
     }
    
    200 235
     
    
    201 236
     :root:not([inDOMFullscreen]) .letterboxing.letterboxing-ready .browserContainer:not(.responsive-mode)
    

  • browser/base/content/tabbrowser.js
    ... ... @@ -2238,6 +2238,10 @@
    2238 2238
           stack.className = "browserStack";
    
    2239 2239
           stack.appendChild(b);
    
    2240 2240
     
    
    2241
    +      let decorator = document.createXULElement("hbox");
    
    2242
    +      decorator.className = "browserDecorator";
    
    2243
    +      stack.appendChild(decorator);
    
    2244
    +
    
    2241 2245
           let browserContainer = document.createXULElement("vbox");
    
    2242 2246
           browserContainer.className = "browserContainer";
    
    2243 2247
           browserContainer.appendChild(notificationbox);
    

  • toolkit/components/resistfingerprinting/RFPHelper.sys.mjs
    ... ... @@ -447,8 +447,7 @@ class _RFPHelper {
    447 447
           // find the rule applying the default letterboxing styles to browsers
    
    448 448
           // preemptively in order to beat race conditions on tab/window creation
    
    449 449
           const LETTERBOX_CSS_URL = "chrome://browser/content/browser.css";
    
    450
    -      const LETTERBOX_CSS_SELECTOR =
    
    451
    -        ".letterboxing .browserContainer:not(.responsive-mode) > .browserStack:not(.exclude-letterboxing) > browser";
    
    450
    +      const LETTERBOX_CSS_SELECTOR = ".letterboxing .browserContainer";
    
    452 451
           for (let ss of document.styleSheets) {
    
    453 452
             if (ss.href !== LETTERBOX_CSS_URL) {
    
    454 453
               continue;
    
    ... ... @@ -572,8 +571,8 @@ class _RFPHelper {
    572 571
           const r = (width, height) => {
    
    573 572
             lastRoundedSize = {width, height};
    
    574 573
             return {
    
    575
    -          width: `var(--rdm-width, ${width}px)`,
    
    576
    -          height: `var(--rdm-height, ${height}px)`,
    
    574
    +          "--letterboxing-width": `var(--rdm-width, ${width}px)`,
    
    575
    +          "--letterboxing-height": `var(--rdm-height, ${height}px)`,
    
    577 576
             }
    
    578 577
           };
    
    579 578
     
    
    ... ... @@ -637,7 +636,7 @@ class _RFPHelper {
    637 636
             for (let [name, value] of Object.entries(props)) {
    
    638 637
               if (style[name] !== value) {
    
    639 638
                 this.push(() => {
    
    640
    -              style.setProperty(name, value, "important");
    
    639
    +              style.setProperty(name, value);
    
    641 640
                 });
    
    642 641
               }
    
    643 642
             }
    
    ... ... @@ -668,8 +667,11 @@ class _RFPHelper {
    668 667
             ? // optional UI components such as the notification box, the find bar
    
    669 668
               // or devtools are constraining this browser's size: recompute custom
    
    670 669
               roundDimensions(parentWidth, parentHeight)
    
    671
    -        : { width: "", height: "" }; // otherwise we can keep the default (rounded) size
    
    672
    -    styleChanges.queueIfNeeded(aBrowser, roundedInline);
    
    670
    +        : {
    
    671
    +          "--letterboxing-width": "",
    
    672
    +          "--letterboxing-height": "",
    
    673
    +        }; // otherwise we can keep the default (rounded) size
    
    674
    +    styleChanges.queueIfNeeded(browserParent, roundedInline);
    
    673 675
     
    
    674 676
         if (lastRoundedSize) {
    
    675 677
           // check wether the letterboxing margin is less than the border radius, and if so flatten the borders