Commit 011405bf authored by Sean Feng's avatar Sean Feng
Browse files

Bug 1785227 - Consider all browsing context as non-synthetic when we don't...

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
parent 485c5054
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -738,7 +738,8 @@ void BrowsingContext::SetEmbedderElement(Element* aEmbedder) {
                                "browsing-context-did-set-embedder", nullptr);
    }

    if (IsEmbedderTypeObjectOrEmbed()) {
    if (nsContentUtils::ShouldHideObjectOrEmbedImageDocument() &&
        IsEmbedderTypeObjectOrEmbed()) {
      Unused << SetSyntheticDocumentContainer(true);
    }
  }
+3 −1
Original line number Diff line number Diff line
@@ -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 {