Skip to content

Commit

Permalink
Bug 1781936 - Propagate GeckoView settings on BrowsingContext replace…
Browse files Browse the repository at this point in the history
…ment. r=nika

This should be a better fix. GeckoView assumes these don't change on .top
unless they are explicitly set.

I don't have an Android build environment handy, but I'll try to confirm.

Also, remove an unused flag while at it.

Differential Revision: https://phabricator.services.mozilla.com/D153107
  • Loading branch information
emilio committed Jul 29, 2022
1 parent 0ee4394 commit a3f1633
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
10 changes: 10 additions & 0 deletions docshell/base/CanonicalBrowsingContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,16 @@ void CanonicalBrowsingContext::ReplacedBy(
txn.SetEmbedderColorScheme(GetEmbedderColorScheme());
txn.SetHasRestoreData(GetHasRestoreData());
txn.SetShouldDelayMediaFromStart(GetShouldDelayMediaFromStart());

// Propagate some settings on BrowsingContext replacement so they're not lost
// on bfcached navigations. These are important for GeckoView (see bug
// 1781936).
txn.SetAllowJavascript(GetAllowJavascript());
txn.SetForceEnableTrackingProtection(GetForceEnableTrackingProtection());
txn.SetUserAgentOverride(GetUserAgentOverride());
txn.SetSuspendMediaWhenInactive(GetSuspendMediaWhenInactive());
txn.SetDisplayMode(GetDisplayMode());

// As this is a different BrowsingContext, set InitialSandboxFlags to the
// current flags in the new context so that they also apply to any initial
// about:blank documents created in it.
Expand Down
1 change: 0 additions & 1 deletion docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext,
mTitleValidForCurrentURI(false),
mWillChangeProcess(false),
mIsNavigating(false),
mSuspendMediaWhenInactive(false),
mForcedAutodetection(false),
mCheckingSessionHistory(false),
mNeedToReportActiveAfterLoadingBecomesActive(false) {
Expand Down
4 changes: 0 additions & 4 deletions docshell/base/nsDocShell.h
Original file line number Diff line number Diff line change
Expand Up @@ -1362,10 +1362,6 @@ class nsDocShell final : public nsDocLoader,
// nsIWebNavigation navigation method.
bool mIsNavigating : 1;

// This flag indicates whether the media in this docshell should be suspended
// when the docshell is inactive.
bool mSuspendMediaWhenInactive : 1;

// Whether we have a pending encoding autodetection request from the
// menu for all encodings.
bool mForcedAutodetection : 1;
Expand Down

0 comments on commit a3f1633

Please sign in to comment.