Bug 1701001 - Part 2: Add "is popup" field to browsing context. r=smaug
Add BrowsingContext::FieldValues.mIsPopupRequested, and pass "is popup" value calculated before opening window/tab to BrowsingContext::CreateDetached. Other code path that is unrelated to content-priv window.open uses the default value false. Differential Revision: https://phabricator.services.mozilla.com/D129411
This commit is contained in:
@@ -294,7 +294,7 @@ bool BrowsingContext::SameOriginWithTop() {
|
||||
already_AddRefed<BrowsingContext> BrowsingContext::CreateDetached(
|
||||
nsGlobalWindowInner* aParent, BrowsingContext* aOpener,
|
||||
BrowsingContextGroup* aSpecificGroup, const nsAString& aName, Type aType,
|
||||
bool aCreatedDynamically) {
|
||||
bool aIsPopupRequested, bool aCreatedDynamically) {
|
||||
if (aParent) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(aParent->GetWindowContext());
|
||||
MOZ_DIAGNOSTIC_ASSERT(aParent->GetBrowsingContext()->mType == aType);
|
||||
@@ -410,6 +410,8 @@ already_AddRefed<BrowsingContext> BrowsingContext::CreateDetached(
|
||||
|
||||
fields.mAllowJavascript = inherit ? inherit->GetAllowJavascript() : true;
|
||||
|
||||
fields.mIsPopupRequested = aIsPopupRequested;
|
||||
|
||||
if (!parentBC) {
|
||||
fields.mShouldDelayMediaFromStart =
|
||||
StaticPrefs::media_block_autoplay_until_in_foreground();
|
||||
@@ -454,7 +456,7 @@ already_AddRefed<BrowsingContext> BrowsingContext::CreateIndependent(
|
||||
"BCs created in the content process must be related to "
|
||||
"some BrowserChild");
|
||||
RefPtr<BrowsingContext> bc(
|
||||
CreateDetached(nullptr, nullptr, nullptr, u""_ns, aType));
|
||||
CreateDetached(nullptr, nullptr, nullptr, u""_ns, aType, false));
|
||||
bc->mWindowless = bc->IsContent();
|
||||
bc->mEmbeddedByThisProcess = true;
|
||||
bc->EnsureAttached();
|
||||
|
||||
Reference in New Issue
Block a user