... |
... |
@@ -717,13 +717,7 @@ class _RFPHelper { |
717
|
717
|
borderRadius === 0 ? "hidden" : "",
|
718
|
718
|
"--letterboxing-border-radius": borderRadius,
|
719
|
719
|
});
|
720
|
|
-
|
721
|
|
- if (
|
722
|
|
- isResize &&
|
723
|
|
- this.letterboxingEnabled &&
|
724
|
|
- (parentWidth > lastRoundedSize.width ||
|
725
|
|
- parentHeight > lastRoundedSize.height)
|
726
|
|
- ) {
|
|
720
|
+ if (win.gBrowser.selectedBrowser == aBrowser) {
|
727
|
721
|
const updateStatus = async args => {
|
728
|
722
|
win.XULBrowserWindow.letterboxingStatus = args
|
729
|
723
|
? await win.document.l10n.formatValue(
|
... |
... |
@@ -733,9 +727,24 @@ class _RFPHelper { |
733
|
727
|
: "";
|
734
|
728
|
win.StatusPanel.update();
|
735
|
729
|
};
|
736
|
|
- updateStatus(lastRoundedSize);
|
737
|
|
- win.clearTimeout(win._letterboxingStatusTimeout);
|
738
|
|
- win._letterboxingStatusTimeout = win.setTimeout(updateStatus, 1000);
|
|
730
|
+ if (
|
|
731
|
+ isResize &&
|
|
732
|
+ this.letterboxingEnabled &&
|
|
733
|
+ (parentWidth > lastRoundedSize.width ||
|
|
734
|
+ parentHeight > lastRoundedSize.height)
|
|
735
|
+ ) {
|
|
736
|
+ const clazz = "letterboxingStatus";
|
|
737
|
+ const currentParent = win.document.getElementsByClassName(clazz)[0];
|
|
738
|
+ if (currentParent != browserParent) {
|
|
739
|
+ currentParent?.classList.remove(clazz);
|
|
740
|
+ browserParent.classList.add(clazz);
|
|
741
|
+ }
|
|
742
|
+ updateStatus(lastRoundedSize);
|
|
743
|
+ win.clearTimeout(win._letterboxingStatusTimeout);
|
|
744
|
+ win._letterboxingStatusTimeout = win.setTimeout(updateStatus, 1000);
|
|
745
|
+ } else {
|
|
746
|
+ updateStatus("");
|
|
747
|
+ }
|
739
|
748
|
}
|
740
|
749
|
}
|
741
|
750
|
|
... |
... |
@@ -840,9 +849,23 @@ class _RFPHelper { |
840
|
849
|
const resizeObserver = (aWindow._rfpResizeObserver =
|
841
|
850
|
new aWindow.ResizeObserver(entries => {
|
842
|
851
|
const context = { isResize: true };
|
843
|
|
- for (let { target } of entries) {
|
|
852
|
+ if (entries.length == 1) {
|
|
853
|
+ const { target } = entries[0];
|
|
854
|
+ if (!("_letterboxingNew" in target)) {
|
|
855
|
+ target._letterboxingNew = !entries[0].contentRect.width;
|
|
856
|
+ if (target._letterboxingNew) {
|
|
857
|
+ return;
|
|
858
|
+ }
|
|
859
|
+ context.isResize = false;
|
|
860
|
+ } else if (target._letterboxingNew) {
|
|
861
|
+ target._letterboxingNew = false;
|
|
862
|
+ context.isResize = false;
|
|
863
|
+ }
|
|
864
|
+ }
|
|
865
|
+
|
|
866
|
+ for (const { target } of entries) {
|
844
|
867
|
this._roundOrResetContentSize(
|
845
|
|
- target.querySelector("browser"),
|
|
868
|
+ target.getElementsByTagName("browser")[0],
|
846
|
869
|
context
|
847
|
870
|
);
|
848
|
871
|
}
|