Bug 1846141 - Don't propagate zoom on replacement for site-specific zoom. r=nika

As otherwise it can race with the front-end setting the right zoom.

This is a bit sketchy, I'm open to other potential solutions?

But we don't have access to per-site zoom prefs in Gecko, so...

Depends on D184922

Differential Revision: https://phabricator.services.mozilla.com/D184923
This commit is contained in:
Emilio Cobos Álvarez 2023-08-01 00:14:37 +00:00
Родитель 354ee3728d
Коммит db4ed173eb
2 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -331,8 +331,13 @@ void CanonicalBrowsingContext::ReplacedBy(
txn.SetDisplayMode(GetDisplayMode());
txn.SetForceDesktopViewport(GetForceDesktopViewport());
txn.SetIsUnderHiddenEmbedderElement(GetIsUnderHiddenEmbedderElement());
txn.SetFullZoom(GetFullZoom());
txn.SetTextZoom(GetTextZoom());
// When using site-specific zoom, we let the front-end manage it, otherwise it
// can cause weirdness like bug 1846141.
if (!StaticPrefs::browser_zoom_siteSpecific()) {
txn.SetFullZoom(GetFullZoom());
txn.SetTextZoom(GetTextZoom());
}
// Propagate the default load flags so that the TRR mode flags are forwarded
// to the new browsing context. See bug 1828643.

Просмотреть файл

@ -120,8 +120,8 @@ function handlePageShow(persisted) {
}
}
// If Fission is disabled, the pref is no-op.
SpecialPowers.pushPrefEnv({set: [["fission.bfcacheInParent", true]]}, () => {
// We want to test Gecko's zoom handling, not the front-end's.
SpecialPowers.pushPrefEnv({set: [["browser.zoom.siteSpecific", false]]}, () => {
window.open('file_zoom_restore_bfcache.html', '_blank', 'noopener');
});
</script>