mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1888494 - Make CanonicalBrowsingContext::FixupAndLoadURIString check set the correct TRR mode r=nika
It would seem sometimes in Firefox 77 we regressed the ability to set the TRR mode for a browsing context when opening a new tab. I confirmed that this bug didn't happen in Fx 77 when setting the `browser.tabs.documentchannel.parent-initiated` pref to `false`. The nsIWebNavigation::LOAD_FLAGS_DISABLE_TRR is correctly passed into CanonicalBrowsingContext, but it doesn't end up getting used. This sets the appropriate DefaultLoadFlags for BrowsingContext when the LOAD_FLAGS_DISABLE_TRR or LOAD_TRR_ONLY_MODE flags are present in nsDocShellLoadState::LoadFlags() Differential Revision: https://phabricator.services.mozilla.com/D220550
This commit is contained in:
parent
c0daebf34e
commit
458409e041
@ -1980,6 +1980,17 @@ nsresult BrowsingContext::LoadURI(nsDocShellLoadState* aLoadState,
|
||||
"Targeting occurs in InternalLoad");
|
||||
aLoadState->AssertProcessCouldTriggerLoadIfSystem();
|
||||
|
||||
// When this tab sets these load flags, we disable or force TRR for the
|
||||
// browsing context ensuring subsequent navigations will keep the same
|
||||
// TRR mode.
|
||||
if (aLoadState->HasLoadFlags(nsIWebNavigation::LOAD_FLAGS_DISABLE_TRR)) {
|
||||
Unused << SetDefaultLoadFlags(GetDefaultLoadFlags() |
|
||||
nsIRequest::LOAD_TRR_DISABLED_MODE);
|
||||
} else if (aLoadState->HasLoadFlags(nsIWebNavigation::LOAD_FLAGS_FORCE_TRR)) {
|
||||
Unused << SetDefaultLoadFlags(GetDefaultLoadFlags() |
|
||||
nsIRequest::LOAD_TRR_ONLY_MODE);
|
||||
}
|
||||
|
||||
if (mDocShell) {
|
||||
nsCOMPtr<nsIDocShell> docShell = mDocShell;
|
||||
return docShell->LoadURI(aLoadState, aSetNavigating);
|
||||
|
@ -253,7 +253,10 @@ interface nsIWebNavigation : nsISupports
|
||||
const unsigned long LOAD_FLAGS_IS_REDIRECT = 0x800000;
|
||||
|
||||
/**
|
||||
* These flags force TRR modes 1 or 3 for the load.
|
||||
* These flags force TRR_DISABLED_MODE or TRR_ONLY_MODE on the
|
||||
* browsingContext's defaultLoadFlags.
|
||||
* The basic use case for this is the captive portal login tab
|
||||
* that needs skip TRR even when the browser defaults to TRR-only mode.
|
||||
*/
|
||||
const unsigned long LOAD_FLAGS_DISABLE_TRR = 0x1000000;
|
||||
const unsigned long LOAD_FLAGS_FORCE_TRR = 0x2000000;
|
||||
|
Loading…
Reference in New Issue
Block a user