Bug 1785227 - Consider all browsing context as non-synthetic when we don't want to hide image document for <object> and <embed> r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D154997
This commit is contained in:
Sean Feng
2022-08-18 20:04:59 +00:00
parent 3c3b05233c
commit 1307dfe1f4
2 changed files with 5 additions and 2 deletions

View File

@@ -122,7 +122,8 @@ void WindowContext::AppendChildBrowsingContext(
MOZ_DIAGNOSTIC_ASSERT(!mChildren.Contains(aBrowsingContext));
mChildren.AppendElement(aBrowsingContext);
if (!aBrowsingContext->IsEmbedderTypeObjectOrEmbed()) {
if (!nsContentUtils::ShouldHideObjectOrEmbedImageDocument() ||
!aBrowsingContext->IsEmbedderTypeObjectOrEmbed()) {
mNonSyntheticChildren.AppendElement(aBrowsingContext);
}
@@ -150,6 +151,7 @@ void WindowContext::RemoveChildBrowsingContext(
void WindowContext::UpdateChildSynthetic(BrowsingContext* aBrowsingContext,
bool aIsSynthetic) {
MOZ_ASSERT(nsContentUtils::ShouldHideObjectOrEmbedImageDocument());
if (aIsSynthetic) {
mNonSyntheticChildren.RemoveElement(aBrowsingContext);
} else {