Backed out 2 changesets (bug 1305237) for crashtest failures in 403574-1.xhtml and 1282985-1.svg a=backout
authorWes Kocher <wkocher@mozilla.com>
Mon, 02 Oct 2017 16:41:56 -0700
changeset 421818 f713d2b2eacaaf832fdca31b92699bad55e3e8c3
parent 421817 b0e17fa9eca1fd58040407e3b0a5ff82e12098de
child 421819 e6fd9d522e93bc9dd59e3cdb9dbb16c63a7f3cda
push idunknown
push userunknown
push dateunknown
reviewersbackout
bugs1305237, 403574, 1282985
milestone58.0a1
backs out96b5d596cc27684d9f5650aabdb5dc85e2d7537a
5fe72402746f60127bffffffab79aaac39792d12
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 2 changesets (bug 1305237) for crashtest failures in 403574-1.xhtml and 1282985-1.svg a=backout Backed out changeset 96b5d596cc27 (bug 1305237) Backed out changeset 5fe72402746f (bug 1305237) MozReview-Commit-ID: CjCWY73Hps1
docshell/base/nsDocShell.h
dom/base/nsDocument.cpp
dom/base/nsFrameLoader.cpp
dom/base/nsIDocument.h
dom/webidl/ChannelWrapper.webidl
ipc/glue/BackgroundUtils.cpp
netwerk/base/LoadInfo.cpp
netwerk/base/LoadInfo.h
netwerk/base/nsILoadInfo.idl
netwerk/ipc/NeckoChannelParams.ipdlh
toolkit/components/extensions/test/mochitest/file_simple_sandboxed_frame.html
toolkit/components/extensions/test/mochitest/file_simple_sandboxed_subframe.html
toolkit/components/extensions/test/mochitest/file_simple_xhr_frame2.html
toolkit/components/extensions/test/mochitest/mochitest-common.ini
toolkit/components/extensions/test/mochitest/test_ext_webrequest_frameId.html
toolkit/components/extensions/webrequest/ChannelWrapper.cpp
toolkit/components/extensions/webrequest/ChannelWrapper.h
toolkit/modules/addons/WebRequest.jsm
toolkit/modules/addons/WebRequestContent.js
toolkit/modules/tests/browser/browser.ini
toolkit/modules/tests/browser/browser_WebRequest.js
toolkit/modules/tests/browser/browser_WebRequest_ancestors.js
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -324,38 +324,16 @@ public:
    * This method steals the data from the passed-in array.
    */
   void SetAncestorPrincipals(
     nsTArray<nsCOMPtr<nsIPrincipal>>&& aAncestorPrincipals)
   {
     mAncestorPrincipals = mozilla::Move(aAncestorPrincipals);
   }
 
-  /**
-   * Get the list of ancestor outerWindowIDs for this docshell.  The list is meant
-   * to be the list of outer window IDs that correspond to the ancestorPrincipals
-   * above.   For each ancestor principal, we store the parent window ID.
-   */
-  const nsTArray<uint64_t>& AncestorOuterWindowIDs() const
-  {
-    return mAncestorOuterWindowIDs;
-  }
-
-  /**
-   * Set the list of ancestor outer window IDs for this docshell.  We call this
-   * from frameloader as well in order to keep the array matched with the
-   * ancestor principals.
-   *
-   * This method steals the data from the passed-in array.
-   */
-  void SetAncestorOuterWindowIDs(nsTArray<uint64_t>&& aAncestorOuterWindowIDs)
-  {
-    mAncestorOuterWindowIDs = mozilla::Move(aAncestorOuterWindowIDs);
-  }
-
 private:
   bool CanSetOriginAttributes();
 
 public:
   const mozilla::OriginAttributes&
   GetOriginAttributes()
   {
     return mOriginAttributes;
@@ -1152,18 +1130,16 @@ private:
   uint32_t mJSRunToCompletionDepth;
 
   // Whether or not touch events are overridden. Possible values are defined
   // as constants in the nsIDocShell.idl file.
   uint32_t mTouchEventsOverride;
 
   // Our list of ancestor principals.
   nsTArray<nsCOMPtr<nsIPrincipal>> mAncestorPrincipals;
-  // Our list of ancestor outerWindowIDs.
-  nsTArray<uint64_t> mAncestorOuterWindowIDs;
 
   // Separate function to do the actual name (i.e. not _top, _self etc.)
   // searching for FindItemWithName.
   nsresult DoFindItemWithName(const nsAString& aName,
                               nsIDocShellTreeItem* aRequestor,
                               nsIDocShellTreeItem* aOriginalRequestor,
                               bool aSkipTabGroup,
                               nsIDocShellTreeItem** aResult);
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -4964,17 +4964,16 @@ nsIDocument::SetContainer(nsDocShell* aC
     if (sameTypeRoot == aContainer) {
       static_cast<nsDocument*>(this)->SetIsTopLevelContentDocument(true);
     }
 
     static_cast<nsDocument*>(this)->SetIsContentDocument(true);
   }
 
   mAncestorPrincipals = aContainer->AncestorPrincipals();
-  mAncestorOuterWindowIDs = aContainer->AncestorOuterWindowIDs();
 }
 
 nsISupports*
 nsIDocument::GetContainer() const
 {
   return static_cast<nsIDocShell*>(mDocumentContainer);
 }
 
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -2706,34 +2706,24 @@ nsFrameLoader::MaybeCreateDocShell()
         // and not inherited by its parent.
         attrs.SyncAttributesWithPrivateBrowsing(isPrivate);
       }
     }
   }
 
   nsDocShell::Cast(mDocShell)->SetOriginAttributes(attrs);
 
-  // Typically there will be a window, however for some cases such as printing
-  // the document is cloned with a docshell that has no window.  We check
-  // IsStaticDocument to ensure we don't try to gather ancestors for those cases.
   if (!mDocShell->GetIsMozBrowser() &&
-      parentType == mDocShell->ItemType() &&
-      !doc->IsStaticDocument()) {
+      parentType == mDocShell->ItemType()) {
     // Propagate through the ancestor principals.
     nsTArray<nsCOMPtr<nsIPrincipal>> ancestorPrincipals;
     // Make a copy, so we can modify it.
     ancestorPrincipals = doc->AncestorPrincipals();
     ancestorPrincipals.InsertElementAt(0, doc->NodePrincipal());
     nsDocShell::Cast(mDocShell)->SetAncestorPrincipals(Move(ancestorPrincipals));
-
-    // Repeat for outer window IDs.
-    nsTArray<uint64_t> ancestorOuterWindowIDs;
-    ancestorOuterWindowIDs = doc->AncestorOuterWindowIDs();
-    ancestorOuterWindowIDs.InsertElementAt(0, doc->GetWindow()->WindowID());
-    nsDocShell::Cast(mDocShell)->SetAncestorOuterWindowIDs(Move(ancestorOuterWindowIDs));
   }
 
   ReallyLoadFrameScripts();
   InitializeBrowserAPI();
 
   nsCOMPtr<nsIObserverService> os = services::GetObserverService();
   if (os) {
     os->NotifyObservers(NS_ISUPPORTS_CAST(nsIFrameLoader*, this),
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -460,25 +460,16 @@ public:
    * before people stop asking us for this information.
    */
   const nsTArray<nsCOMPtr<nsIPrincipal>>& AncestorPrincipals() const
   {
     return mAncestorPrincipals;
   }
 
   /**
-   * Get the list of ancestor outerWindowIDs for a document that correspond to
-   * the ancestor principals (see above for more details).
-   */
-  const nsTArray<uint64_t>& AncestorOuterWindowIDs() const
-  {
-    return mAncestorOuterWindowIDs;
-  }
-
-  /**
    * Return the LoadGroup for the document. May return null.
    */
   already_AddRefed<nsILoadGroup> GetDocumentLoadGroup() const
   {
     nsCOMPtr<nsILoadGroup> group = do_QueryReferent(mDocumentLoadGroup);
     return group.forget();
   }
 
@@ -3620,18 +3611,16 @@ protected:
 
   // CSP violation reports that have been buffered up due to a call to
   // StartBufferingCSPViolations.
   nsTArray<nsCOMPtr<nsIRunnable>> mBufferedCSPViolations;
 
   // List of ancestor principals.  This is set at the point a document
   // is connected to a docshell and not mutated thereafter.
   nsTArray<nsCOMPtr<nsIPrincipal>> mAncestorPrincipals;
-  // List of ancestor outerWindowIDs that correspond to the ancestor principals.
-  nsTArray<uint64_t> mAncestorOuterWindowIDs;
 
   // Restyle root for servo's style system.
   //
   // We store this as an nsINode, rather than as an Element, so that we can store
   // the Document node as the restyle root if the entire document (along with all
   // document-level native-anonymous content) needs to be restyled.
   //
   // We also track which "descendant" bits (normal/animation-only/lazy-fc) the
--- a/dom/webidl/ChannelWrapper.webidl
+++ b/dom/webidl/ChannelWrapper.webidl
@@ -281,28 +281,16 @@ interface ChannelWrapper : EventTarget {
   /**
    * For cross-process requests, the <browser> or <iframe> element to which the
    * content loading this request belongs. For requests that don't originate
    * from a remote browser, this is null.
    */
   [Cached, Pure]
   readonly attribute nsISupports? browserElement;
 
-  /**
-   * Returns an array of objects that combine the url and frameId from the
-   * ancestorPrincipals and ancestorOuterWindowIDs on loadInfo.
-   * The immediate parent is the first entry, the last entry is always the top
-   * level frame.  It will be an empty list for toplevel window loads and
-   * non-subdocument resource loads within a toplevel window.  For the latter,
-   * originURL will provide information on what window is doing the load.  It
-   * will be null if the request is not associated with a window (e.g. XHR with
-   * mozBackgroundRequest = true).
-   */
-  [Cached, Frozen, GetterThrows, Pure]
-  readonly attribute sequence<MozFrameAncestorInfo>? frameAncestors;
 
   /**
    * For HTTP requests, returns an array of request headers which will be, or
    * have been, sent with this request.
    *
    * For non-HTTP requests, throws NS_ERROR_UNEXPECTED.
    */
   [Throws]
--- a/ipc/glue/BackgroundUtils.cpp
+++ b/ipc/glue/BackgroundUtils.cpp
@@ -365,23 +365,16 @@ LoadInfoToLoadInfoArgs(nsILoadInfo *aLoa
   nsTArray<RedirectHistoryEntryInfo> redirectChain;
   for (const nsCOMPtr<nsIRedirectHistoryEntry>& redirectEntry :
        aLoadInfo->RedirectChain()) {
     RedirectHistoryEntryInfo* entry = redirectChain.AppendElement();
     rv = RHEntryToRHEntryInfo(redirectEntry, entry);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
-  nsTArray<PrincipalInfo> ancestorPrincipals;
-  ancestorPrincipals.SetCapacity(aLoadInfo->AncestorPrincipals().Length());
-  for (const auto& principal : aLoadInfo->AncestorPrincipals()) {
-    rv = PrincipalToPrincipalInfo(principal, ancestorPrincipals.AppendElement());
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
   *aOptionalLoadInfoArgs =
     LoadInfoArgs(
       loadingPrincipalInfo,
       triggeringPrincipalInfo,
       principalToInheritInfo,
       sandboxedLoadingPrincipalInfo,
       optionalResultPrincipalURI,
       aLoadInfo->GetSecurityFlags(),
@@ -397,18 +390,16 @@ LoadInfoToLoadInfoArgs(nsILoadInfo *aLoa
       aLoadInfo->GetTopOuterWindowID(),
       aLoadInfo->GetFrameOuterWindowID(),
       aLoadInfo->GetEnforceSecurity(),
       aLoadInfo->GetInitialSecurityCheckDone(),
       aLoadInfo->GetIsInThirdPartyContext(),
       aLoadInfo->GetOriginAttributes(),
       redirectChainIncludingInternalRedirects,
       redirectChain,
-      ancestorPrincipals,
-      aLoadInfo->AncestorOuterWindowIDs(),
       aLoadInfo->CorsUnsafeHeaders(),
       aLoadInfo->GetForcePreflight(),
       aLoadInfo->GetIsPreflight(),
       aLoadInfo->GetForceHSTSPriming(),
       aLoadInfo->GetMixedContentWouldBlock(),
       aLoadInfo->GetIsHSTSPriming(),
       aLoadInfo->GetIsHSTSPrimingUpgrade()
       );
@@ -471,25 +462,16 @@ LoadInfoArgsToLoadInfo(const OptionalLoa
   RedirectHistoryArray redirectChain;
   for (const RedirectHistoryEntryInfo& entryInfo : loadInfoArgs.redirectChain()) {
     nsCOMPtr<nsIRedirectHistoryEntry> redirectHistoryEntry =
       RHEntryInfoToRHEntry(entryInfo);
     NS_ENSURE_SUCCESS(rv, rv);
     redirectChain.AppendElement(redirectHistoryEntry.forget());
   }
 
-  nsTArray<nsCOMPtr<nsIPrincipal>> ancestorPrincipals;
-  ancestorPrincipals.SetCapacity(loadInfoArgs.ancestorPrincipals().Length());
-  for (const PrincipalInfo& principalInfo : loadInfoArgs.ancestorPrincipals()) {
-    nsCOMPtr<nsIPrincipal> ancestorPrincipal =
-      PrincipalInfoToPrincipal(principalInfo, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
-    ancestorPrincipals.AppendElement(ancestorPrincipal.forget());
-  }
-
   nsCOMPtr<nsILoadInfo> loadInfo =
     new mozilla::LoadInfo(loadingPrincipal,
                           triggeringPrincipal,
                           principalToInherit,
                           sandboxedLoadingPrincipal,
                           resultPrincipalURI,
                           loadInfoArgs.securityFlags(),
                           loadInfoArgs.contentPolicyType(),
@@ -504,18 +486,16 @@ LoadInfoArgsToLoadInfo(const OptionalLoa
                           loadInfoArgs.topOuterWindowID(),
                           loadInfoArgs.frameOuterWindowID(),
                           loadInfoArgs.enforceSecurity(),
                           loadInfoArgs.initialSecurityCheckDone(),
                           loadInfoArgs.isInThirdPartyContext(),
                           loadInfoArgs.originAttributes(),
                           redirectChainIncludingInternalRedirects,
                           redirectChain,
-                          Move(ancestorPrincipals),
-                          loadInfoArgs.ancestorOuterWindowIDs(),
                           loadInfoArgs.corsUnsafeHeaders(),
                           loadInfoArgs.forcePreflight(),
                           loadInfoArgs.isPreflight(),
                           loadInfoArgs.forceHSTSPriming(),
                           loadInfoArgs.mixedContentWouldBlock(),
                           loadInfoArgs.isHSTSPriming(),
                           loadInfoArgs.isHSTSPrimingUpgrade()
                           );
--- a/netwerk/base/LoadInfo.cpp
+++ b/netwerk/base/LoadInfo.cpp
@@ -113,19 +113,16 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadin
       ComputeIsThirdPartyContext(contextOuter);
       mOuterWindowID = contextOuter->WindowID();
       nsCOMPtr<nsPIDOMWindowOuter> parent = contextOuter->GetScriptableParent();
       mParentOuterWindowID = parent ? parent->WindowID() : mOuterWindowID;
       mTopOuterWindowID = FindTopOuterWindowID(contextOuter);
     }
 
     mInnerWindowID = aLoadingContext->OwnerDoc()->InnerWindowID();
-    mAncestorPrincipals = aLoadingContext->OwnerDoc()->AncestorPrincipals();
-    mAncestorOuterWindowIDs = aLoadingContext->OwnerDoc()->AncestorOuterWindowIDs();
-    MOZ_DIAGNOSTIC_ASSERT(mAncestorPrincipals.Length() == mAncestorOuterWindowIDs.Length());
 
     // When the element being loaded is a frame, we choose the frame's window
     // for the window ID and the frame element's window as the parent
     // window. This is the behavior that Chrome exposes to add-ons.
     // NB: If the frameLoaderOwner doesn't have a frame loader, then the load
     // must be coming from an object (such as a plugin) that's loaded into it
     // instead of a document being loaded. In that case, treat this object like
     // any other non-document-loading element.
@@ -275,19 +272,16 @@ LoadInfo::LoadInfo(nsPIDOMWindowOuter* a
   nsCOMPtr<nsPIDOMWindowOuter> parent = aOuterWindow->GetScriptableParent();
   mParentOuterWindowID = parent ? parent->WindowID() : 0;
   mTopOuterWindowID = FindTopOuterWindowID(aOuterWindow);
 
   // get the docshell from the outerwindow, and then get the originattributes
   nsCOMPtr<nsIDocShell> docShell = aOuterWindow->GetDocShell();
   MOZ_ASSERT(docShell);
   mOriginAttributes = nsDocShell::Cast(docShell)->GetOriginAttributes();
-  mAncestorPrincipals = nsDocShell::Cast(docShell)->AncestorPrincipals();
-  mAncestorOuterWindowIDs = nsDocShell::Cast(docShell)->AncestorOuterWindowIDs();
-  MOZ_DIAGNOSTIC_ASSERT(mAncestorPrincipals.Length() == mAncestorOuterWindowIDs.Length());
 
 #ifdef DEBUG
   if (docShell->ItemType() == nsIDocShellTreeItem::typeChrome) {
     MOZ_ASSERT(mOriginAttributes.mPrivateBrowsingId == 0,
                "chrome docshell shouldn't have mPrivateBrowsingId set.");
   }
 #endif
 }
@@ -314,18 +308,16 @@ LoadInfo::LoadInfo(const LoadInfo& rhs)
   , mFrameOuterWindowID(rhs.mFrameOuterWindowID)
   , mEnforceSecurity(rhs.mEnforceSecurity)
   , mInitialSecurityCheckDone(rhs.mInitialSecurityCheckDone)
   , mIsThirdPartyContext(rhs.mIsThirdPartyContext)
   , mOriginAttributes(rhs.mOriginAttributes)
   , mRedirectChainIncludingInternalRedirects(
       rhs.mRedirectChainIncludingInternalRedirects)
   , mRedirectChain(rhs.mRedirectChain)
-  , mAncestorPrincipals(rhs.mAncestorPrincipals)
-  , mAncestorOuterWindowIDs(rhs.mAncestorOuterWindowIDs)
   , mCorsUnsafeHeaders(rhs.mCorsUnsafeHeaders)
   , mForcePreflight(rhs.mForcePreflight)
   , mIsPreflight(rhs.mIsPreflight)
   , mForceHSTSPriming(rhs.mForceHSTSPriming)
   , mMixedContentWouldBlock(rhs.mMixedContentWouldBlock)
   , mIsHSTSPriming(rhs.mIsHSTSPriming)
   , mIsHSTSPrimingUpgrade(rhs.mIsHSTSPrimingUpgrade)
 {
@@ -349,18 +341,16 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadin
                    uint64_t aTopOuterWindowID,
                    uint64_t aFrameOuterWindowID,
                    bool aEnforceSecurity,
                    bool aInitialSecurityCheckDone,
                    bool aIsThirdPartyContext,
                    const OriginAttributes& aOriginAttributes,
                    RedirectHistoryArray& aRedirectChainIncludingInternalRedirects,
                    RedirectHistoryArray& aRedirectChain,
-                   nsTArray<nsCOMPtr<nsIPrincipal>>&& aAncestorPrincipals,
-                   const nsTArray<uint64_t>& aAncestorOuterWindowIDs,
                    const nsTArray<nsCString>& aCorsUnsafeHeaders,
                    bool aForcePreflight,
                    bool aIsPreflight,
                    bool aForceHSTSPriming,
                    bool aMixedContentWouldBlock,
                    bool aIsHSTSPriming,
                    bool aIsHSTSPrimingUpgrade)
   : mLoadingPrincipal(aLoadingPrincipal)
@@ -378,18 +368,16 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadin
   , mOuterWindowID(aOuterWindowID)
   , mParentOuterWindowID(aParentOuterWindowID)
   , mTopOuterWindowID(aTopOuterWindowID)
   , mFrameOuterWindowID(aFrameOuterWindowID)
   , mEnforceSecurity(aEnforceSecurity)
   , mInitialSecurityCheckDone(aInitialSecurityCheckDone)
   , mIsThirdPartyContext(aIsThirdPartyContext)
   , mOriginAttributes(aOriginAttributes)
-  , mAncestorPrincipals(Move(aAncestorPrincipals))
-  , mAncestorOuterWindowIDs(aAncestorOuterWindowIDs)
   , mCorsUnsafeHeaders(aCorsUnsafeHeaders)
   , mForcePreflight(aForcePreflight)
   , mIsPreflight(aIsPreflight)
   , mForceHSTSPriming (aForceHSTSPriming)
   , mMixedContentWouldBlock(aMixedContentWouldBlock)
   , mIsHSTSPriming(aIsHSTSPriming)
   , mIsHSTSPrimingUpgrade(aIsHSTSPrimingUpgrade)
 {
@@ -921,28 +909,16 @@ LoadInfo::GetRedirectChain(JSContext* aC
 }
 
 const RedirectHistoryArray&
 LoadInfo::RedirectChain()
 {
   return mRedirectChain;
 }
 
-const nsTArray<nsCOMPtr<nsIPrincipal>>&
-LoadInfo::AncestorPrincipals()
-{
-  return mAncestorPrincipals;
-}
-
-const nsTArray<uint64_t>&
-LoadInfo::AncestorOuterWindowIDs()
-{
-  return mAncestorOuterWindowIDs;
-}
-
 void
 LoadInfo::SetCorsPreflightInfo(const nsTArray<nsCString>& aHeaders,
                                bool aForcePreflight)
 {
   MOZ_ASSERT(GetSecurityMode() == nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS);
   MOZ_ASSERT(!mInitialSecurityCheckDone);
   mCorsUnsafeHeaders = aHeaders;
   mForcePreflight = aForcePreflight;
--- a/netwerk/base/LoadInfo.h
+++ b/netwerk/base/LoadInfo.h
@@ -110,18 +110,16 @@ private:
            uint64_t aTopOuterWindowID,
            uint64_t aFrameOuterWindowID,
            bool aEnforceSecurity,
            bool aInitialSecurityCheckDone,
            bool aIsThirdPartyRequest,
            const OriginAttributes& aOriginAttributes,
            RedirectHistoryArray& aRedirectChainIncludingInternalRedirects,
            RedirectHistoryArray& aRedirectChain,
-           nsTArray<nsCOMPtr<nsIPrincipal>>&& aAncestorPrincipals,
-           const nsTArray<uint64_t>& aAncestorOuterWindowIDs,
            const nsTArray<nsCString>& aUnsafeHeaders,
            bool aForcePreflight,
            bool aIsPreflight,
            bool aForceHSTSPriming,
            bool aMixedContentWouldBlock,
            bool aIsHSTSPriming,
            bool aIsHSTSPrimingUpgrade);
   LoadInfo(const LoadInfo& rhs);
@@ -165,18 +163,16 @@ private:
   uint64_t                         mTopOuterWindowID;
   uint64_t                         mFrameOuterWindowID;
   bool                             mEnforceSecurity;
   bool                             mInitialSecurityCheckDone;
   bool                             mIsThirdPartyContext;
   OriginAttributes                 mOriginAttributes;
   RedirectHistoryArray             mRedirectChainIncludingInternalRedirects;
   RedirectHistoryArray             mRedirectChain;
-  nsTArray<nsCOMPtr<nsIPrincipal>> mAncestorPrincipals;
-  nsTArray<uint64_t>               mAncestorOuterWindowIDs;
   nsTArray<nsCString>              mCorsUnsafeHeaders;
   bool                             mForcePreflight;
   bool                             mIsPreflight;
 
   bool                             mForceHSTSPriming : 1;
   bool                             mMixedContentWouldBlock : 1;
   bool                             mIsHSTSPriming: 1;
   bool                             mIsHSTSPrimingUpgrade: 1;
--- a/netwerk/base/nsILoadInfo.idl
+++ b/netwerk/base/nsILoadInfo.idl
@@ -18,18 +18,16 @@ interface nsIURI;
 #include "mozilla/LoadTainting.h"
 #include "nsStringFwd.h"
 %}
 
 [ref] native nsIRedirectHistoryEntryArray(const nsTArray<nsCOMPtr<nsIRedirectHistoryEntry>>);
 native OriginAttributes(mozilla::OriginAttributes);
 [ref] native const_OriginAttributesRef(const mozilla::OriginAttributes);
 [ref] native StringArrayRef(const nsTArray<nsCString>);
-[ref] native Uint64ArrayRef(const nsTArray<uint64_t>);
-[ref] native PrincipalArrayRef(const nsTArray<nsCOMPtr<nsIPrincipal>>);
 
 typedef unsigned long nsSecurityFlags;
 
 /**
  * The LoadInfo object contains information about a network load, why it
  * was started, and how we plan on using the resulting response.
  * If a network request is redirected, the new channel will receive a new
  * LoadInfo object. The new object will contain mostly the same
@@ -640,46 +638,16 @@ interface nsILoadInfo : nsISupports
    * A C++-friendly version of redirectChain.
    * Please note that this array has the same lifetime as the
    * loadInfo object - use with caution!
    */
   [noscript, notxpcom, nostdcall, binaryname(RedirectChain)]
   nsIRedirectHistoryEntryArray binaryRedirectChain();
 
   /**
-   * An array of nsIPrincipals which stores the principals of the parent frames,
-   * not including the frame loading this request.  The closest ancestor is at
-   * index zero and the top level ancestor is at the last index.
-   *
-   * The ancestorPrincipals[0] entry for an iframe load will be the principal of
-   * the iframe element's owner document.
-   * The ancestorPrincipals[0] entry for an image loaded in an iframe will be the
-   * principal of the iframe element's owner document.
-   *
-   * See nsIDocument::AncestorPrincipals for more information.
-   *
-   * Please note that this array has the same lifetime as the
-   * loadInfo object - use with caution!
-   */
-  [noscript, notxpcom, nostdcall]
-  PrincipalArrayRef AncestorPrincipals();
-
-
-  /**
-   * An array of outerWindowIDs which correspond to nsILoadInfo::AncestorPrincipals
-   * above.  AncestorOuterWindowIDs[0] is the outerWindowID of the frame
-   * associated with the principal at ancestorPrincipals[0], and so forth.
-   *
-   * Please note that this array has the same lifetime as the
-   * loadInfo object - use with caution!
-   */
-  [noscript, notxpcom, nostdcall]
-  Uint64ArrayRef AncestorOuterWindowIDs();
-
-  /**
    * Sets the list of unsafe headers according to CORS spec, as well as
    * potentially forces a preflight.
    * Note that you do not need to set the Content-Type header. That will be
    * automatically detected as needed.
    *
    * Only call this function when using the SEC_REQUIRE_CORS_DATA_INHERITS mode.
    */
   [noscript, notxpcom, nostdcall]
--- a/netwerk/ipc/NeckoChannelParams.ipdlh
+++ b/netwerk/ipc/NeckoChannelParams.ipdlh
@@ -54,24 +54,16 @@ struct LoadInfoArgs
   uint64_t                    topOuterWindowID;
   uint64_t                    frameOuterWindowID;
   bool                        enforceSecurity;
   bool                        initialSecurityCheckDone;
   bool                        isInThirdPartyContext;
   OriginAttributes            originAttributes;
   RedirectHistoryEntryInfo[]  redirectChainIncludingInternalRedirects;
   RedirectHistoryEntryInfo[]  redirectChain;
-
-  /**
-   * Ancestor data for use with the WebRequest API.
-   * See nsILoadInfo.idl for details.
-   */
-  PrincipalInfo[]             ancestorPrincipals;
-  uint64_t[]                  ancestorOuterWindowIDs;
-
   nsCString[]                 corsUnsafeHeaders;
   bool                        forcePreflight;
   bool                        isPreflight;
   bool                        forceHSTSPriming;
   bool                        mixedContentWouldBlock;
   bool                        isHSTSPriming;
   bool                        isHSTSPrimingUpgrade;
 };
--- a/toolkit/components/extensions/test/mochitest/file_simple_sandboxed_frame.html
+++ b/toolkit/components/extensions/test/mochitest/file_simple_sandboxed_frame.html
@@ -7,17 +7,12 @@
 <body>
 
 <script>
 "use strict";
 
 let req = new XMLHttpRequest();
 req.open("GET", "/xhr_sandboxed");
 req.send();
-
-let sandbox = document.createElement("iframe");
-sandbox.setAttribute("sandbox", "allow-scripts");
-sandbox.setAttribute("src", "file_simple_sandboxed_subframe.html");
-document.documentElement.appendChild(sandbox);
 </script>
 <img src="file_image_great.png"/>
 </body>
 </html>
deleted file mode 100644
--- a/toolkit/components/extensions/test/mochitest/file_simple_sandboxed_subframe.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<head>
-<meta charset="utf-8">
-</head>
-<body>
-
-</body>
-</html>
--- a/toolkit/components/extensions/test/mochitest/file_simple_xhr_frame2.html
+++ b/toolkit/components/extensions/test/mochitest/file_simple_xhr_frame2.html
@@ -13,12 +13,11 @@ let req = new XMLHttpRequest();
 req.open("GET", "/xhr_resource_2");
 req.send();
 
 let sandbox = document.createElement("iframe");
 sandbox.setAttribute("sandbox", "allow-scripts");
 sandbox.setAttribute("src", "file_simple_sandboxed_frame.html");
 document.documentElement.appendChild(sandbox);
 </script>
-<img src="file_image_redirect.png"/>
-<iframe src="data:text/plain,webRequestTest"/>
+<img src="file_image_bad.png#2"/>
 </body>
 </html>
--- a/toolkit/components/extensions/test/mochitest/mochitest-common.ini
+++ b/toolkit/components/extensions/test/mochitest/mochitest-common.ini
@@ -35,17 +35,16 @@ support-files =
   file_style_redirect.css
   file_script_good.js
   file_script_bad.js
   file_script_redirect.js
   file_script_xhr.js
   file_remote_frame.html
   file_sample.html
   file_simple_sandboxed_frame.html
-  file_simple_sandboxed_subframe.html
   file_simple_xhr.html
   file_simple_xhr_frame.html
   file_simple_xhr_frame2.html
   redirect_auto.sjs
   redirection.sjs
   file_privilege_escalation.html
   file_ext_test_api_injection.js
   file_permission_xhr.html
--- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_frameId.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_frameId.html
@@ -40,129 +40,68 @@ let extensionData = {
 let expected = {
   "file_simple_xhr.html": {
     type: "main_frame",
     toplevel: true,
   },
   "file_image_good.png": {
     type: "image",
     toplevel: true,
-    origin: "file_simple_xhr.html",
   },
   "example.txt": {
     type: "xmlhttprequest",
     toplevel: true,
-    origin: "file_simple_xhr.html",
   },
-  // sub frames will have the origin and first ancestor is the
-  // parent document
   "file_simple_xhr_frame.html": {
     type: "sub_frame",
     toplevelParent: true,
-    origin: "file_simple_xhr.html",
-    parent: "file_simple_xhr.html",
-  },
-  // a resource in a sub frame will have origin of the subframe,
-  // but the ancestor chain starts with the parent document
-  "xhr_resource": {
-    type: "xmlhttprequest",
-    origin: "file_simple_xhr_frame.html",
-    parent: "file_simple_xhr.html",
   },
   "file_image_bad.png": {
     type: "image",
-    depth: 2,
-    origin: "file_simple_xhr_frame.html",
-    parent: "file_simple_xhr.html",
+  },
+  "xhr_resource": {
+    type: "xmlhttprequest",
   },
   "file_simple_xhr_frame2.html": {
     type: "sub_frame",
-    depth: 2,
-    origin: "file_simple_xhr_frame.html",
-    parent: "file_simple_xhr_frame.html",
   },
-  "file_image_redirect.png": {
+  "file_image_bad.png#2": {
     type: "image",
-    depth: 2,
-    origin: "file_simple_xhr_frame2.html",
-    parent: "file_simple_xhr_frame.html",
   },
   "xhr_resource_2": {
     type: "xmlhttprequest",
-    depth: 2,
-    origin: "file_simple_xhr_frame2.html",
-    parent: "file_simple_xhr_frame.html",
   },
-  // Last frame tests content policy frame ancestors.
-  "webRequestTest": {
-    type: "sub_frame",
-    depth: 3,
-    origin: "file_simple_xhr_frame2.html",
-    parent: "file_simple_xhr_frame2.html",
-  },
-  // This is loaded in a sandbox iframe.  originUrl is not availabe for that,
-  // and requests within a sandboxed iframe will additionally have an empty
-  // url on their immediate parent/ancestor.
+  // This is loaded in a sandbox iframe.
   "file_simple_sandboxed_frame.html": {
     type: "sub_frame",
-    depth: 3,
-    parent: "file_simple_xhr_frame2.html",
   },
   "xhr_sandboxed": {
     type: "xmlhttprequest",
     sandboxed: true,
-    depth: 3,
-    parent: "",
   },
   "file_image_great.png": {
     type: "image",
     sandboxed: true,
-    depth: 3,
-    parent: "",
-  },
-  "file_simple_sandboxed_subframe.html": {
-    type: "sub_frame",
-    depth: 4,
-    parent: "",
   },
 };
 
 function checkDetails(details) {
   let url = new URL(details.url);
-  let filename = url.pathname.split(url.protocol == "data:" ? "," : "/").pop();
+  let filename = url.pathname.split("/").pop();
   let expect = expected[filename];
   is(expect.type, details.type, `${details.type} type matches`);
-  if (details.parentFrameId == -1) {
-    is(details.frameAncestors.length, 0, "no ancestors for main_frame requests");
-  } else if (details.parentFrameId == 0) {
-    is(details.frameAncestors.length, 1, "one ancestors for sub_frame requests");
-  } else {
-    ok(details.frameAncestors.length > 1, "have multiple ancestors for deep subframe requests");
-    is(details.frameAncestors.length, expect.depth, "have multiple ancestors for deep subframe requests");
-  }
-  if (details.parentFrameId > -1) {
-    ok(!expect.origin || details.originUrl.includes(expect.origin), "origin url is correct");
-    is(details.frameAncestors[0].frameId, details.parentFrameId, "first ancestor matches request.parentFrameId");
-    ok(details.frameAncestors[0].url.includes(expect.parent), "ancestor parent page correct");
-    is(details.frameAncestors[details.frameAncestors.length - 1].frameId, 0, "last ancestor is always zero");
-    // All our tests should be somewhere within the frame that we set topframe in the query string.  That
-    // frame will always be the last ancestor.
-    ok(details.frameAncestors[details.frameAncestors.length - 1].url.includes("topframe=true"), "last ancestor is always topframe");
-  }
   if (expect.toplevel) {
     is(details.frameId, 0, "expect load at top level");
     is(details.parentFrameId, -1, "expect top level frame to have no parent");
   } else if (details.type == "sub_frame") {
     ok(details.frameId > 0, "expect sub_frame to load into a new frame");
     if (expect.toplevelParent) {
       is(details.parentFrameId, 0, "expect sub_frame to have top level parent");
-      is(details.frameAncestors.length, 1, "one ancestor for top sub_frame request");
     } else {
       ok(details.parentFrameId > 0, "expect sub_frame to have parent");
-      ok(details.frameAncestors.length > 1, "sub_frame has ancestors");
     }
     expect.subframeId = details.frameId;
     expect.parentId = details.parentFrameId;
   } else if (expect.sandboxed) {
     is(details.documentUrl, undefined, "null principal documentUrl for sandboxed request");
   } else {
     // get the parent frame.
     let purl = new URL(details.documentUrl);
@@ -177,27 +116,28 @@ add_task(async function test_webRequest_
   // Clear the image cache, since it gets in the way otherwise.
   let imgTools = SpecialPowers.Cc["@mozilla.org/image/tools;1"].getService(SpecialPowers.Ci.imgITools);
   let cache = imgTools.getImgCacheForDocument(document);
   cache.clearCache(false);
 
   let extension = ExtensionTestUtils.loadExtension(extensionData);
   await extension.startup();
 
-  let a = addLink(`file_simple_xhr.html?topframe=true&nocache=${Math.random()}`);
+  let a = addLink(`file_simple_xhr.html?nocache=${Math.random()}`);
   a.click();
 
   for (let i = 0; i < Object.keys(expected).length; i++) {
     checkDetails(await extension.awaitMessage("onBeforeRequest"));
   }
 
   let closed = extension.awaitMessage("tab-closed");
   extension.sendMessage("close-tab");
   await closed;
   await extension.unload();
 });
+
 </script>
 </head>
 <body>
 <div id="test">Sample text</div>
 
 </body>
 </html>
--- a/toolkit/components/extensions/webrequest/ChannelWrapper.cpp
+++ b/toolkit/components/extensions/webrequest/ChannelWrapper.cpp
@@ -564,70 +564,16 @@ ChannelWrapper::ParentWindowId() const
     } else {
       parentID = loadInfo->GetParentOuterWindowID();
     }
     return NormalizeWindowID(loadInfo, parentID);
   }
   return -1;
 }
 
-void
-ChannelWrapper::GetFrameAncestors(dom::Nullable<nsTArray<dom::MozFrameAncestorInfo>>& aFrameAncestors, ErrorResult& aRv) const
-{
-  nsCOMPtr<nsILoadInfo> loadInfo = GetLoadInfo();
-  if (!loadInfo || WindowId(loadInfo) == 0) {
-    aFrameAncestors.SetNull();
-    return;
-  }
-
-  nsresult rv = GetFrameAncestors(loadInfo, aFrameAncestors.SetValue());
-  if (NS_FAILED(rv)) {
-    aRv.Throw(rv);
-  }
-}
-
-nsresult
-ChannelWrapper::GetFrameAncestors(nsILoadInfo* aLoadInfo, nsTArray<dom::MozFrameAncestorInfo>& aFrameAncestors) const
-{
-  const nsTArray<nsCOMPtr<nsIPrincipal>>& ancestorPrincipals = aLoadInfo->AncestorPrincipals();
-  const nsTArray<uint64_t>& ancestorOuterWindowIDs = aLoadInfo->AncestorOuterWindowIDs();
-  uint32_t size = ancestorPrincipals.Length();
-  MOZ_DIAGNOSTIC_ASSERT(size == ancestorOuterWindowIDs.Length());
-  if (size != ancestorOuterWindowIDs.Length()) {
-    return NS_ERROR_UNEXPECTED;
-  }
-
-  bool subFrame = aLoadInfo->GetExternalContentPolicyType() == nsIContentPolicy::TYPE_SUBDOCUMENT;
-  if (!aFrameAncestors.SetCapacity(subFrame ? size : size + 1, fallible)) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
-  // The immediate parent is always the first element in the ancestor arrays, however
-  // SUBDOCUMENTs do not have their immediate parent included, so we inject it here.
-  // This will force wrapper.parentWindowId == wrapper.frameAncestors[0].frameId to
-  // always be true.  All ather requests already match this way.
-  if (subFrame) {
-    auto ancestor = aFrameAncestors.AppendElement();
-    GetDocumentURL(ancestor->mUrl);
-    ancestor->mFrameId = ParentWindowId();
-  }
-
-  for (uint32_t i = 0; i < size; ++i) {
-    auto ancestor = aFrameAncestors.AppendElement();
-    nsCOMPtr<nsIURI> uri;
-    MOZ_TRY(ancestorPrincipals[i]->GetURI(getter_AddRefs(uri)));
-    if (!uri) {
-      return NS_ERROR_UNEXPECTED;
-    }
-    MOZ_TRY(uri->GetSpec(ancestor->mUrl));
-    ancestor->mFrameId = NormalizeWindowID(aLoadInfo, ancestorOuterWindowIDs[i]);
-  }
-  return NS_OK;
-}
-
 /*****************************************************************************
  * Response filtering
  *****************************************************************************/
 
 void
 ChannelWrapper::RegisterTraceableChannel(const WebExtensionPolicy& aAddon, nsITabParent* aTabParent)
 {
   mAddonEntries.Put(aAddon.Id(), aTabParent);
@@ -770,17 +716,17 @@ ChannelWrapper::GetStatusLine(nsCString&
 
 already_AddRefed<nsIURI>
 ChannelWrapper::FinalURI() const
 {
   nsCOMPtr<nsIURI> uri;
   if (nsCOMPtr<nsIChannel> chan = MaybeChannel()) {
     NS_GetFinalChannelURI(chan, getter_AddRefs(uri));
   }
-  return uri.forget();
+  return uri.forget();;
 }
 
 void
 ChannelWrapper::GetFinalURL(nsString& aRetVal) const
 {
   if (HaveChannel()) {
     aRetVal = FinalURLInfo().Spec();
   }
--- a/toolkit/components/extensions/webrequest/ChannelWrapper.h
+++ b/toolkit/components/extensions/webrequest/ChannelWrapper.h
@@ -185,18 +185,16 @@ public:
     }
     return nullptr;
   }
 
   int64_t WindowId() const;
 
   int64_t ParentWindowId() const;
 
-  void GetFrameAncestors(dom::Nullable<nsTArray<dom::MozFrameAncestorInfo>>& aFrameAncestors, ErrorResult& aRv) const;
-
   bool IsSystemLoad() const;
 
   void GetOriginURL(nsCString& aRetVal) const;
 
   void GetDocumentURL(nsCString& aRetVal) const;
 
   already_AddRefed<nsIURI> GetOriginURI() const;
 
@@ -259,18 +257,16 @@ private:
 
 
   const URLInfo& FinalURLInfo() const;
   const URLInfo* DocumentURLInfo() const;
 
 
   uint64_t WindowId(nsILoadInfo* aLoadInfo) const;
 
-  nsresult GetFrameAncestors(nsILoadInfo* aLoadInfo, nsTArray<dom::MozFrameAncestorInfo>& aFrameAncestors) const;
-
   static uint64_t GetNextId()
   {
     static uint64_t sNextId = 1;
     return ++sNextId;
   }
 
   void CheckEventListeners();
 
--- a/toolkit/modules/addons/WebRequest.jsm
+++ b/toolkit/modules/addons/WebRequest.jsm
@@ -166,17 +166,17 @@ class ResponseHeaderChanger extends Head
 }
 
 const MAYBE_CACHED_EVENTS = new Set([
   "onResponseStarted", "onBeforeRedirect", "onCompleted", "onErrorOccurred",
 ]);
 
 const OPTIONAL_PROPERTIES = [
   "requestHeaders", "responseHeaders", "statusCode", "statusLine", "error", "redirectUrl",
-  "requestBody", "scheme", "realm", "isProxy", "challenger", "proxyInfo", "ip", "frameAncestors",
+  "requestBody", "scheme", "realm", "isProxy", "challenger", "proxyInfo", "ip",
 ];
 
 function serializeRequestData(eventName) {
   let data = {
     requestId: this.requestId,
     url: this.url,
     originUrl: this.originUrl,
     documentUrl: this.documentUrl,
--- a/toolkit/modules/addons/WebRequestContent.js
+++ b/toolkit/modules/addons/WebRequestContent.js
@@ -113,17 +113,16 @@ var ContentPolicy = {
     }
 
     if (!ids.length) {
       return Ci.nsIContentPolicy.ACCEPT;
     }
 
     let windowId = 0;
     let parentWindowId = -1;
-    let frameAncestors = [];
     let mm = Services.cpmm;
 
     function getWindowId(window) {
       return window.QueryInterface(Ci.nsIInterfaceRequestor)
         .getInterface(Ci.nsIDOMWindowUtils)
         .outerWindowID;
     }
 
@@ -148,28 +147,16 @@ var ContentPolicy = {
           doc = node;
         }
         window = doc.defaultView;
       }
 
       windowId = getWindowId(window);
       if (window.parent !== window) {
         parentWindowId = getWindowId(window.parent);
-
-        for (let frame = window.parent; ; frame = frame.parent) {
-          frameAncestors.push({
-            url: frame.document.documentURIObject.spec,
-            frameId: getWindowId(frame),
-          });
-          if (frame === frame.parent) {
-            // Set the last frameId to zero for top level frame.
-            frameAncestors[frameAncestors.length - 1].frameId = 0;
-            break;
-          }
-        }
       }
 
       let ir = window.QueryInterface(Ci.nsIInterfaceRequestor)
                      .getInterface(Ci.nsIDocShell)
                      .QueryInterface(Ci.nsIInterfaceRequestor);
       try {
         // If e10s is disabled, this throws NS_NOINTERFACE for closed tabs.
         mm = ir.getInterface(Ci.nsIContentFrameMessageManager);
@@ -180,19 +167,16 @@ var ContentPolicy = {
       }
     }
 
     let data = {ids,
                 url,
                 type: WebRequestCommon.typeForPolicyType(policyType),
                 windowId,
                 parentWindowId};
-    if (frameAncestors.length > 0) {
-      data.frameAncestors = frameAncestors;
-    }
     if (requestOrigin) {
       data.originUrl = requestOrigin.spec;
     }
     mm.sendAsyncMessage("WebRequest:ShouldLoad", data);
 
     return Ci.nsIContentPolicy.ACCEPT;
   },
 
--- a/toolkit/modules/tests/browser/browser.ini
+++ b/toolkit/modules/tests/browser/browser.ini
@@ -30,15 +30,14 @@ support-files =
 [browser_FinderHighlighter.js]
 skip-if = debug || os = "linux"
 support-files = file_FinderSample.html
 [browser_Geometry.js]
 [browser_InlineSpellChecker.js]
 [browser_WebNavigation.js]
 skip-if = true # Superseded by WebExtension tests
 [browser_WebRequest.js]
-[browser_WebRequest_ancestors.js]
 [browser_WebRequest_cookies.js]
 [browser_WebRequest_filtering.js]
 [browser_PageMetadata.js]
 [browser_PromiseMessage.js]
 [browser_RemotePageManager.js]
 [browser_Troubleshoot.js]
--- a/toolkit/modules/tests/browser/browser_WebRequest.js
+++ b/toolkit/modules/tests/browser/browser_WebRequest.js
@@ -39,21 +39,16 @@ function onBeforeRequest(details) {
     is(details.browser, expected_browser, "correct <browser> element");
     checkType(details);
 
     windowIDs.set(details.url, details.windowId);
     if (details.url.indexOf("page2") != -1) {
       let page1id = windowIDs.get(URL);
       ok(details.windowId != page1id, "sub-frame gets its own window ID");
       is(details.parentWindowId, page1id, "parent window id is correct");
-
-      is(details.frameAncestors.length, 1, "correctly has only one ancestor");
-      let ancestor = details.frameAncestors[0];
-      ok(ancestor.url.includes("page1"), "parent window url seems correct");
-      is(ancestor.frameId, page1id, "parent window id is correct");
     }
   }
   if (details.url.indexOf("_bad.") != -1) {
     return {cancel: true};
   }
   return undefined;
 }
 
deleted file mode 100644
--- a/toolkit/modules/tests/browser/browser_WebRequest_ancestors.js
+++ /dev/null
@@ -1,54 +0,0 @@
-"use strict";
-
-var { interfaces: Ci, classes: Cc, utils: Cu, results: Cr } = Components;
-
-Cu.importGlobalProperties(["XMLHttpRequest"]);
-
-var {WebRequest} = Cu.import("resource://gre/modules/WebRequest.jsm", {});
-var {PromiseUtils} = Cu.import("resource://gre/modules/PromiseUtils.jsm", {});
-
-add_task(async function test_ancestors_exist() {
-  let deferred = PromiseUtils.defer();
-  function onBeforeRequest(details) {
-    info(`onBeforeRequest ${details.url}`);
-    ok(typeof details.frameAncestors === "object", `ancestors exists [${typeof details.frameAncestors}]`);
-    deferred.resolve();
-  }
-
-  WebRequest.onBeforeRequest.addListener(onBeforeRequest, {urls: new MatchPatternSet(["http://mochi.test/test/*"])}, ["blocking"]);
-
-  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "http://mochi.test:8888/test/");
-  await deferred.promise;
-  await BrowserTestUtils.removeTab(tab);
-
-  WebRequest.onBeforeRequest.removeListener(onBeforeRequest);
-});
-
-add_task(async function test_ancestors_null() {
-  let deferred = PromiseUtils.defer();
-  function onBeforeRequest(details) {
-    info(`onBeforeRequest ${details.url}`);
-    ok(details.frameAncestors === undefined, "ancestors do not exist");
-    deferred.resolve();
-  }
-
-  WebRequest.onBeforeRequest.addListener(onBeforeRequest, null, ["blocking"]);
-
-  function fetch(url) {
-    return new Promise((resolve, reject) => {
-      let xhr = new XMLHttpRequest();
-      xhr.mozBackgroundRequest = true;
-      xhr.open("GET", url);
-      xhr.onload = () => { resolve(xhr.responseText); };
-      xhr.onerror = () => { reject(xhr.status); };
-      // use a different contextId to avoid auth cache.
-      xhr.setOriginAttributes({userContextId: 1});
-      xhr.send();
-    });
-  }
-
-  await fetch("http://mochi.test:8888/test/");
-  await deferred.promise;
-
-  WebRequest.onBeforeRequest.removeListener(onBeforeRequest);
-});