Bug 1383876 - Part 1: Remove GroupedSHistory and Prerendering logic from C++ code, r=freesamael, r=smaug
authorNika Layzell <nika@thelayzells.com>
Thu, 14 Dec 2017 16:03:14 -0600
changeset 399101 156c6bee175292f31da108aae281a413d61600e6
parent 399100 4880c627fc412cacbef674c461dc3f2d6cc3e5c4
child 399102 156088fcf75b204490765b88ce77c9c7047df2fe
push id98894
push usernika@thelayzells.com
push dateFri, 12 Jan 2018 22:56:19 +0000
treeherdermozilla-inbound@6d9855f7bfdb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfreesamael, smaug
bugs1383876
milestone59.0a1
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
Bug 1383876 - Part 1: Remove GroupedSHistory and Prerendering logic from C++ code, r=freesamael, r=smaug MozReview-Commit-ID: 2aHA6NcQPGk
docshell/base/PendingGlobalHistoryEntry.cpp
docshell/base/PendingGlobalHistoryEntry.h
docshell/base/moz.build
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
docshell/base/nsIDocShell.idl
docshell/shistory/moz.build
docshell/shistory/nsIGroupedSHistory.idl
docshell/shistory/nsIPartialSHistory.idl
docshell/shistory/nsIPartialSHistoryListener.idl
docshell/shistory/nsISHistory.idl
docshell/shistory/nsSHistory.cpp
docshell/shistory/nsSHistory.h
dom/base/GroupedSHistory.cpp
dom/base/GroupedSHistory.h
dom/base/Link.cpp
dom/base/PartialSHistory.cpp
dom/base/PartialSHistory.h
dom/base/WebKitCSSMatrix.cpp
dom/base/moz.build
dom/base/nsContentSink.cpp
dom/base/nsDocument.cpp
dom/base/nsFrameLoader.cpp
dom/base/nsFrameLoader.h
dom/base/nsGkAtomList.h
dom/base/nsGlobalWindowInner.cpp
dom/base/nsGlobalWindowInner.h
dom/base/nsGlobalWindowOuter.cpp
dom/base/nsGlobalWindowOuter.h
dom/base/nsHistory.cpp
dom/base/nsIDocument.h
dom/base/nsIFrameLoader.idl
dom/base/nsObjectLoadingContent.cpp
dom/base/nsStyleLinkElement.cpp
dom/base/nsStyleLinkElement.h
dom/bindings/BindingUtils.cpp
dom/bindings/BindingUtils.h
dom/bindings/Bindings.conf
dom/bindings/Codegen.py
dom/bindings/parser/WebIDL.py
dom/bindings/test/TestCodeGen.webidl
dom/html/nsGenericHTMLFrameElement.cpp
dom/html/nsGenericHTMLFrameElement.h
dom/interfaces/base/nsITabParent.idl
dom/ipc/PBrowser.ipdl
dom/ipc/PTabContext.ipdlh
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
dom/ipc/TabContext.cpp
dom/ipc/TabContext.h
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
dom/webidl/AudioBufferSourceNode.webidl
dom/webidl/AudioContext.webidl
dom/webidl/AudioScheduledSourceNode.webidl
dom/webidl/Element.webidl
dom/webidl/External.webidl
dom/webidl/FrameLoader.webidl
dom/webidl/HTMLCanvasElement.webidl
dom/webidl/HTMLMediaElement.webidl
dom/webidl/HTMLObjectElement.webidl
dom/webidl/History.webidl
dom/webidl/Location.webidl
dom/webidl/Navigator.webidl
dom/webidl/Notification.webidl
dom/webidl/RTCPeerConnection.webidl
dom/webidl/Screen.webidl
dom/webidl/ScreenOrientation.webidl
dom/webidl/SpeechRecognition.webidl
dom/webidl/SpeechSynthesis.webidl
dom/webidl/Window.webidl
dom/webidl/XULElement.webidl
dom/xul/nsXULElement.cpp
dom/xul/nsXULElement.h
js/xpconnect/src/XPCJSContext.cpp
layout/style/nsDOMCSSAttrDeclaration.h
deleted file mode 100644
--- a/docshell/base/PendingGlobalHistoryEntry.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/PendingGlobalHistoryEntry.h"
-
-namespace mozilla {
-
-namespace dom {
-
-void
-PendingGlobalHistoryEntry::VisitURI(nsIURI* aURI,
-                             nsIURI* aLastVisitedURI,
-                             nsIURI* aReferrerURI,
-                             uint32_t aFlags)
-{
-  URIVisit visit;
-  visit.mURI = aURI;
-  visit.mLastVisitedURI = aLastVisitedURI;
-  visit.mReferrerURI = aReferrerURI;
-  visit.mFlags = aFlags;
-  mVisits.AppendElement(Move(visit));
-}
-
-void
-PendingGlobalHistoryEntry::SetURITitle(nsIURI* aURI,
-                                const nsAString& aTitle)
-{
-  URITitle title;
-  title.mURI = aURI;
-  title.mTitle.Assign(aTitle);
-  mTitles.AppendElement(title);
-}
-
-nsresult
-PendingGlobalHistoryEntry::ApplyChanges(IHistory* aHistory)
-{
-  nsresult rv;
-  for (const URIVisit& visit : mVisits) {
-    rv = aHistory->VisitURI(visit.mURI, visit.mLastVisitedURI, visit.mFlags);
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-  mVisits.Clear();
-
-  for (const URITitle& title : mTitles) {
-    rv = aHistory->SetURITitle(title.mURI, title.mTitle);
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-  mTitles.Clear();
-
-  return NS_OK;
-}
-
-nsresult
-PendingGlobalHistoryEntry::ApplyChanges(nsIGlobalHistory2* aHistory)
-{
-  nsresult rv;
-  for (const URIVisit& visit : mVisits) {
-    bool redirect = (visit.mFlags & IHistory::REDIRECT_TEMPORARY) ||
-      (visit.mFlags & IHistory::REDIRECT_PERMANENT);
-    bool toplevel = (visit.mFlags & IHistory::TOP_LEVEL);
-
-    rv = aHistory->AddURI(visit.mURI, redirect, toplevel, visit.mReferrerURI);
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-  mVisits.Clear();
-
-  for (const URITitle& title : mTitles) {
-    rv = aHistory->SetPageTitle(title.mURI, title.mTitle);
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-  mTitles.Clear();
-
-  return NS_OK;
-}
-
-} // namespace dom
-
-} // namespace mozilla
deleted file mode 100644
--- a/docshell/base/PendingGlobalHistoryEntry.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PendingGlobalHistoryEntry_h_
-#define mozilla_dom_PendingGlobalHistoryEntry_h_
-
-#include "mozilla/IHistory.h"
-#include "nsIGlobalHistory2.h"
-#include "nsIURI.h"
-#include "nsCOMPtr.h"
-#include "nsString.h"
-#include "nsTArray.h"
-
-namespace mozilla {
-
-namespace dom {
-
-// This class acts as a wrapper around a IHistory, in that it can be used to
-// record a series of operations on the IHistory, and then play them back at a
-// later time. This is used in Prerendering in order to record the Global
-// History changes being made by the prerendering docshell and then play them
-// back when the docshell is finished rendering.
-//
-// This class also handles applying the changes to nsIGlobalHistory2.
-class PendingGlobalHistoryEntry
-{
-public:
-  void VisitURI(nsIURI* aURI,
-                nsIURI* aLastVisitedURI,
-                nsIURI* aReferrerURI,
-                uint32_t aFlags);
-
-  void SetURITitle(nsIURI* aURI,
-                   const nsAString& aTitle);
-
-  nsresult ApplyChanges(IHistory* aHistory);
-
-  nsresult ApplyChanges(nsIGlobalHistory2* aHistory);
-
-private:
-  struct URIVisit
-  {
-    nsCOMPtr<nsIURI> mURI;
-    nsCOMPtr<nsIURI> mLastVisitedURI;
-    nsCOMPtr<nsIURI> mReferrerURI;
-    uint32_t mFlags = 0;
-  };
-  struct URITitle
-  {
-    nsCOMPtr<nsIURI> mURI;
-    nsString mTitle;
-  };
-  nsTArray<URIVisit> mVisits;
-  nsTArray<URITitle> mTitles;
-};
-
-} // namespace dom
-
-} // namespace mozilla
-
-#endif // mozilla_dom_PendingGlobalHistoryEntry_h_
-
--- a/docshell/base/moz.build
+++ b/docshell/base/moz.build
@@ -75,35 +75,30 @@ EXPORTS += [
     'SerializedLoadContext.h',
 ]
 
 EXPORTS.mozilla += [
     'IHistory.h',
     'LoadContext.h',
 ]
 
-EXPORTS.mozilla.dom += [
-    'PendingGlobalHistoryEntry.h',
-]
-
 UNIFIED_SOURCES += [
     'LoadContext.cpp',
     'nsAboutRedirector.cpp',
     'nsDefaultURIFixup.cpp',
     'nsDocShell.cpp',
     'nsDocShellEditorData.cpp',
     'nsDocShellEnumerator.cpp',
     'nsDocShellLoadInfo.cpp',
     'nsDocShellTransferableHooks.cpp',
     'nsDocShellTreeOwner.cpp',
     'nsDSURIContentListener.cpp',
     'nsPingListener.cpp',
     'nsRefreshTimer.cpp',
     'nsWebNavigationInfo.cpp',
-    'PendingGlobalHistoryEntry.cpp',
     'SerializedLoadContext.cpp',
 ]
 
 if not CONFIG['MOZ_PLACES']:
     UNIFIED_SOURCES += ['nsDownloadHistory.cpp']
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -36,17 +36,16 @@
 #include "mozilla/dom/ClientHandle.h"
 #include "mozilla/dom/ClientInfo.h"
 #include "mozilla/dom/ClientManager.h"
 #include "mozilla/dom/ClientSource.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/DocGroup.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/HTMLAnchorElement.h"
-#include "mozilla/dom/PendingGlobalHistoryEntry.h"
 #include "mozilla/dom/PerformanceNavigation.h"
 #include "mozilla/dom/PermissionMessageUtils.h"
 #include "mozilla/dom/ProfileTimelineMarkerBinding.h"
 #include "mozilla/dom/ScreenOrientation.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/TabChild.h"
 #include "mozilla/dom/TabGroup.h"
 #include "mozilla/dom/ToJSValue.h"
@@ -362,17 +361,16 @@ nsDocShell::nsDocShell()
   , mAllowContentRetargetingOnChildren(true)
   , mUseErrorPages(false)
   , mObserveErrorPages(true)
   , mAllowAuth(true)
   , mAllowKeywordFixup(false)
   , mIsOffScreenBrowser(false)
   , mIsActive(true)
   , mDisableMetaRefreshWhenInactive(false)
-  , mIsPrerendered(false)
   , mIsAppTab(false)
   , mUseGlobalHistory(false)
   , mUseRemoteTabs(false)
   , mUseTrackingProtection(false)
   , mDeviceSizeIsPageSize(false)
   , mWindowDraggingAllowed(false)
   , mInFrameSwap(false)
   , mInheritPrivateBrowsingId(true)
@@ -1021,17 +1019,16 @@ nsDocShell::LoadURI(nsIURI* aURI,
                       -1, // XXXbaku
                       headersStream,
                       loadType,
                       nullptr, // No SHEntry
                       aFirstParty,
                       srcdoc,
                       sourceDocShell,
                       baseURI,
-                      false,
                       nullptr,  // No nsIDocShell
                       nullptr); // No nsIRequest
 }
 
 NS_IMETHODIMP
 nsDocShell::LoadStream(nsIInputStream* aStream, nsIURI* aURI,
                        const nsACString& aContentType,
                        const nsACString& aContentCharset,
@@ -2986,22 +2983,18 @@ nsDocShell::SetDocLoaderParent(nsDocLoad
       SetAllowImages(value);
     }
     SetAllowMedia(parentAsDocShell->GetAllowMedia() && mAllowMedia);
     if (mAllowWindowControl && NS_SUCCEEDED(parentAsDocShell->GetAllowWindowControl(&value))) {
       SetAllowWindowControl(value);
     }
     SetAllowContentRetargeting(mAllowContentRetargeting &&
       parentAsDocShell->GetAllowContentRetargetingOnChildren());
-    if (parentAsDocShell->GetIsPrerendered()) {
-      SetIsPrerendered();
-    }
     if (NS_SUCCEEDED(parentAsDocShell->GetIsActive(&value))) {
-      // a prerendered docshell is not active yet
-      SetIsActive(value && !mIsPrerendered);
+      SetIsActive(value);
     }
     if (NS_SUCCEEDED(parentAsDocShell->GetCustomUserAgent(customUserAgent)) &&
         !customUserAgent.IsEmpty()) {
       SetCustomUserAgent(customUserAgent);
     }
     if (NS_FAILED(parentAsDocShell->GetAllowDNSPrefetch(&value))) {
       value = false;
     }
@@ -5019,17 +5012,17 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, 
   NS_ENSURE_SUCCESS(rv, rv);
 
   return InternalLoad(errorPageURI, nullptr, Nothing(), false, nullptr,
                       mozilla::net::RP_Unset,
                       nsContentUtils::GetSystemPrincipal(), nullptr,
                       INTERNAL_LOAD_FLAGS_NONE, EmptyString(),
                       nullptr, VoidString(), nullptr, -1, nullptr,
                       LOAD_ERROR_PAGE, nullptr, true, VoidString(), this,
-                      nullptr, false, nullptr, nullptr);
+                      nullptr, nullptr, nullptr);
 }
 
 NS_IMETHODIMP
 nsDocShell::Reload(uint32_t aReloadFlags)
 {
   if (!IsNavigationAllowed()) {
     return NS_OK; // JS may not handle returning of an error code
   }
@@ -5128,17 +5121,16 @@ nsDocShell::Reload(uint32_t aReloadFlags
                       -1,              // No post data length
                       nullptr,         // No headers data
                       loadType,        // Load type
                       nullptr,         // No SHEntry
                       true,
                       srcdoc,          // srcdoc argument for iframe
                       this,            // For reloads we are the source
                       baseURI,
-                      false,
                       nullptr,         // No nsIDocShell
                       nullptr);        // No nsIRequest
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
@@ -5841,31 +5833,16 @@ nsDocShell::SetIsActive(bool aIsActive)
   // We disallow setting active on chrome docshells.
   if (mItemType == nsIDocShellTreeItem::typeChrome) {
     return NS_ERROR_INVALID_ARG;
   }
 
   // Keep track ourselves.
   mIsActive = aIsActive;
 
-  // Clear prerender flag if necessary.
-  if (mIsPrerendered && aIsActive) {
-    MOZ_ASSERT(mPrerenderGlobalHistory.get());
-    mIsPrerendered = false;
-    nsCOMPtr<IHistory> history = services::GetHistoryService();
-    nsresult rv = NS_OK;
-    if (history) {
-      rv = mPrerenderGlobalHistory->ApplyChanges(history);
-    } else if (mGlobalHistory) {
-      rv = mPrerenderGlobalHistory->ApplyChanges(mGlobalHistory);
-    }
-    mPrerenderGlobalHistory = nullptr;
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
   // Tell the PresShell about it.
   nsCOMPtr<nsIPresShell> pshell = GetPresShell();
   if (pshell) {
     pshell->SetIsActive(aIsActive);
   }
 
   // Tell the window about it
   if (mScriptGlobal) {
@@ -5929,34 +5906,16 @@ nsDocShell::SetIsActive(bool aIsActive)
 NS_IMETHODIMP
 nsDocShell::GetIsActive(bool* aIsActive)
 {
   *aIsActive = mIsActive;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDocShell::SetIsPrerendered()
-{
-  MOZ_ASSERT(!mIsPrerendered,
-             "SetIsPrerendered() called on already prerendered docshell");
-  SetIsActive(false);
-  mIsPrerendered = true;
-  mPrerenderGlobalHistory = mozilla::MakeUnique<PendingGlobalHistoryEntry>();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsDocShell::GetIsPrerendered(bool* aIsPrerendered)
-{
-  *aIsPrerendered = mIsPrerendered;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsDocShell::SetIsAppTab(bool aIsAppTab)
 {
   mIsAppTab = aIsAppTab;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::GetIsAppTab(bool* aIsAppTab)
@@ -8568,18 +8527,17 @@ nsDocShell::RestoreFromHistory()
     bool allowContentRetargetingOnChildren =
       childShell->GetAllowContentRetargetingOnChildren();
 
     uint32_t defaultLoadFlags;
     childShell->GetDefaultLoadFlags(&defaultLoadFlags);
 
     // this.AddChild(child) calls child.SetDocLoaderParent(this), meaning that
     // the child inherits our state. Among other things, this means that the
-    // child inherits our mIsActive, mIsPrerendered and mPrivateBrowsingId,
-    // which is what we want.
+    // child inherits our mIsActive mPrivateBrowsingId, which is what we want.
     AddChild(childItem);
 
     childShell->SetAllowPlugins(allowPlugins);
     childShell->SetAllowJavascript(allowJavascript);
     childShell->SetAllowMetaRedirects(allowRedirects);
     childShell->SetAllowSubframes(allowSubframes);
     childShell->SetAllowImages(allowImages);
     childShell->SetAllowMedia(allowMedia);
@@ -9259,18 +9217,17 @@ public:
                     nsIInputStream* aPostData,
                     int64_t aPostDataLength,
                     nsIInputStream* aHeadersData,
                     uint32_t aLoadType,
                     nsISHEntry* aSHEntry,
                     bool aFirstParty,
                     const nsAString& aSrcdoc,
                     nsIDocShell* aSourceDocShell,
-                    nsIURI* aBaseURI,
-                    bool aCheckForPrerender)
+                    nsIURI* aBaseURI)
     : mozilla::Runnable("InternalLoadEvent")
     , mSrcdoc(aSrcdoc)
     , mDocShell(aDocShell)
     , mURI(aURI)
     , mOriginalURI(aOriginalURI)
     , mResultPrincipalURI(aResultPrincipalURI)
     , mLoadReplace(aLoadReplace)
     , mReferrer(aReferrer)
@@ -9281,17 +9238,16 @@ public:
     , mPostDataLength(aPostDataLength)
     , mHeadersData(aHeadersData)
     , mSHEntry(aSHEntry)
     , mFlags(aFlags)
     , mLoadType(aLoadType)
     , mFirstParty(aFirstParty)
     , mSourceDocShell(aSourceDocShell)
     , mBaseURI(aBaseURI)
-    , mCheckForPrerender(aCheckForPrerender)
   {
     // Make sure to keep null things null as needed
     if (aTypeHint) {
       mTypeHint = aTypeHint;
     } else {
       mTypeHint.SetIsVoid(true);
     }
   }
@@ -9305,17 +9261,17 @@ public:
                                    mReferrerPolicy,
                                    mTriggeringPrincipal, mPrincipalToInherit,
                                    mFlags, EmptyString(),
                                    mTypeHint.IsVoid() ? nullptr
                                                       : mTypeHint.get(),
                                    VoidString(), mPostData, mPostDataLength,
                                    mHeadersData, mLoadType, mSHEntry,
                                    mFirstParty, mSrcdoc, mSourceDocShell,
-                                   mBaseURI, mCheckForPrerender, nullptr,
+                                   mBaseURI, nullptr,
                                    nullptr);
   }
 
 private:
   nsCString mTypeHint;
   nsString mSrcdoc;
 
   RefPtr<nsDocShell> mDocShell;
@@ -9331,17 +9287,16 @@ private:
   int64_t mPostDataLength;
   nsCOMPtr<nsIInputStream> mHeadersData;
   nsCOMPtr<nsISHEntry> mSHEntry;
   uint32_t mFlags;
   uint32_t mLoadType;
   bool mFirstParty;
   nsCOMPtr<nsIDocShell> mSourceDocShell;
   nsCOMPtr<nsIURI> mBaseURI;
-  bool mCheckForPrerender;
 };
 
 /**
  * Returns true if we started an asynchronous load (i.e., from the network), but
  * the document we're loading there hasn't yet become this docshell's active
  * document.
  *
  * When JustStartedNetworkLoad is true, you should be careful about modifying
@@ -9383,17 +9338,16 @@ nsDocShell::InternalLoad(nsIURI* aURI,
                          int64_t aPostDataLength,
                          nsIInputStream* aHeadersData,
                          uint32_t aLoadType,
                          nsISHEntry* aSHEntry,
                          bool aFirstParty,
                          const nsAString& aSrcdoc,
                          nsIDocShell* aSourceDocShell,
                          nsIURI* aBaseURI,
-                         bool aCheckForPrerender,
                          nsIDocShell** aDocShell,
                          nsIRequest** aRequest)
 {
   MOZ_ASSERT(aTriggeringPrincipal, "need a valid TriggeringPrincipal");
 
   nsresult rv = NS_OK;
   mOriginalUriString.Truncate();
 
@@ -9763,17 +9717,16 @@ nsDocShell::InternalLoad(nsIURI* aURI,
                                         aPostDataLength,
                                         aHeadersData,
                                         aLoadType,
                                         aSHEntry,
                                         aFirstParty,
                                         aSrcdoc,
                                         aSourceDocShell,
                                         aBaseURI,
-                                        aCheckForPrerender,
                                         aDocShell,
                                         aRequest);
       if (rv == NS_ERROR_NO_CONTENT) {
         // XXXbz except we never reach this code!
         if (isNewWindow) {
           //
           // At this point, a new window has been created, but the
           // URI did not have any data associated with it...
@@ -9849,17 +9802,17 @@ nsDocShell::InternalLoad(nsIURI* aURI,
 
       // Do this asynchronously
       nsCOMPtr<nsIRunnable> ev =
         new InternalLoadEvent(this, aURI, aOriginalURI, aResultPrincipalURI,
                               aLoadReplace, aReferrer, aReferrerPolicy,
                               aTriggeringPrincipal, principalToInherit,
                               aFlags, aTypeHint, aPostData, aPostDataLength,
                               aHeadersData, aLoadType, aSHEntry, aFirstParty,
-                              aSrcdoc, aSourceDocShell, aBaseURI, false);
+                              aSrcdoc, aSourceDocShell, aBaseURI);
       return DispatchToTabGroup(TaskCategory::Other, ev.forget());
     }
 
     // Just ignore this load attempt
     return NS_OK;
   }
 
   // If a source docshell has been passed, check to see if we are sandboxed
@@ -10228,35 +10181,16 @@ nsDocShell::InternalLoad(nsIURI* aURI,
     bool shouldLoad;
     rv = browserChrome3->ShouldLoadURI(this, aURI, aReferrer, !!aPostData,
                                        aTriggeringPrincipal, &shouldLoad);
     if (NS_SUCCEEDED(rv) && !shouldLoad) {
       return NS_OK;
     }
   }
 
-  if (browserChrome3 && aCheckForPrerender) {
-    nsCOMPtr<nsIRunnable> ev =
-      new InternalLoadEvent(this, aURI, aOriginalURI, aResultPrincipalURI,
-                            aLoadReplace, aReferrer, aReferrerPolicy,
-                            aTriggeringPrincipal, principalToInherit,
-                            aFlags, aTypeHint, aPostData, aPostDataLength,
-                            aHeadersData, aLoadType, aSHEntry, aFirstParty,
-                            aSrcdoc, aSourceDocShell, aBaseURI, false);
-    // We don't need any success handler since in that case
-    // OnPartialSHistoryDeactive would be called, and it would ensure
-    // docshell loads about:blank.
-    bool shouldSwitch = false;
-    rv = browserChrome3->ShouldSwitchToPrerenderedDocument(
-      aURI, mCurrentURI, nullptr, ev, &shouldSwitch);
-    if (NS_SUCCEEDED(rv) && shouldSwitch) {
-      return NS_OK;
-    }
-  }
-
   // Whenever a top-level browsing context is navigated, the user agent MUST
   // lock the orientation of the document to the document's default
   // orientation. We don't explicitly check for a top-level browsing context
   // here because orientation is only set on top-level browsing contexts.
   if (OrientationLock() != eScreenOrientation_None) {
 #ifdef DEBUG
     nsCOMPtr<nsIDocShellTreeItem> parent;
     GetSameTypeParent(getter_AddRefs(parent));
@@ -12473,17 +12407,16 @@ nsDocShell::LoadHistoryEntry(nsISHEntry*
                     -1,                 // Post data stream length
                     nullptr,            // No headers stream
                     aLoadType,          // Load type
                     aEntry,             // SHEntry
                     true,
                     srcdoc,
                     nullptr,            // Source docshell, see comment above
                     baseURI,
-                    false,
                     nullptr,            // No nsIDocShell
                     nullptr);           // No nsIRequest
   return rv;
 }
 
 NS_IMETHODIMP
 nsDocShell::GetShouldSaveLayoutState(bool* aShould)
 {
@@ -12775,17 +12708,17 @@ nsDocShell::AddURIVisit(nsIURI* aURI,
   // Only content-type docshells save URI visits.  Also don't do
   // anything here if we're not supposed to use global history.
   if (mItemType != typeContent || !mUseGlobalHistory || UsePrivateBrowsing()) {
     return;
   }
 
   nsCOMPtr<IHistory> history = services::GetHistoryService();
 
-  if (mPrerenderGlobalHistory || history) {
+  if (history) {
     uint32_t visitURIFlags = 0;
 
     if (!IsFrame()) {
       visitURIFlags |= IHistory::TOP_LEVEL;
     }
 
     if (aChannelRedirectFlags & nsIChannelEventSink::REDIRECT_TEMPORARY) {
       visitURIFlags |= IHistory::REDIRECT_TEMPORARY;
@@ -12805,24 +12738,17 @@ nsDocShell::AddURIVisit(nsIURI* aURI,
     // 408 is special cased, since may actually indicate a temporary
     // connection problem.
     else if (aResponseStatus != 408 &&
              ((aResponseStatus >= 400 && aResponseStatus <= 501) ||
               aResponseStatus == 505)) {
       visitURIFlags |= IHistory::UNRECOVERABLE_ERROR;
     }
 
-    if (mPrerenderGlobalHistory) {
-      mPrerenderGlobalHistory->VisitURI(aURI,
-                                        aPreviousURI,
-                                        aReferrerURI,
-                                        visitURIFlags);
-    } else {
-      (void)history->VisitURI(aURI, aPreviousURI, visitURIFlags);
-    }
+    (void)history->VisitURI(aURI, aPreviousURI, visitURIFlags);
   } else if (mGlobalHistory) {
     // Falls back to sync global history interface.
     (void)mGlobalHistory->AddURI(aURI,
                                  !!aChannelRedirectFlags,
                                  !IsFrame(),
                                  aReferrerURI);
   }
 }
@@ -13780,17 +13706,16 @@ nsDocShell::OnLinkClickSync(nsIContent* 
                              aPostDataStreamLength,     // Post data stream length
                              aHeadersDataStream,        // Headers stream
                              loadType,                  // Load type
                              nullptr,                   // No SHEntry
                              true,                      // first party site
                              VoidString(),              // No srcdoc
                              this,                      // We are the source
                              nullptr,                   // baseURI not needed
-                             true,                      // Check for prerendered doc
                              aDocShell,                 // DocShell out-param
                              aRequest);                 // Request out-param
   if (NS_SUCCEEDED(rv)) {
     nsPingListener::DispatchPings(this, aContent, aURI, referer, refererPolicy);
   }
   return rv;
 }
 
@@ -14210,19 +14135,17 @@ nsDocShell::HasUnloadedParent()
   return false;
 }
 
 void
 nsDocShell::UpdateGlobalHistoryTitle(nsIURI* aURI)
 {
   if (mUseGlobalHistory && !UsePrivateBrowsing()) {
     nsCOMPtr<IHistory> history = services::GetHistoryService();
-    if (mPrerenderGlobalHistory) {
-      mPrerenderGlobalHistory->SetURITitle(aURI, mTitle);
-    } else if (history) {
+    if (history) {
       history->SetURITitle(aURI, mTitle);
     } else if (mGlobalHistory) {
       mGlobalHistory->SetPageTitle(aURI, nsString(mTitle));
     }
   }
 }
 
 bool
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -66,17 +66,16 @@
 namespace mozilla {
 class Encoding;
 class HTMLEditor;
 enum class TaskCategory;
 namespace dom {
 class ClientInfo;
 class ClientSource;
 class EventTarget;
-class PendingGlobalHistoryEntry;
 typedef uint32_t ScreenOrientationInternal;
 } // namespace dom
 } // namespace mozilla
 
 class nsIClipboardDragDropHookList;
 class nsICommandManager;
 class nsIContentViewer;
 class nsIController;
@@ -906,17 +905,16 @@ private: // data members
   nsString mCustomUserAgent;
   nsCString mOriginalUriString;
   nsWeakPtr mOnePermittedSandboxedNavigator;
   nsWeakPtr mOpener;
   nsTObserverArray<nsWeakPtr> mPrivacyObservers;
   nsTObserverArray<nsWeakPtr> mReflowObservers;
   nsTObserverArray<nsWeakPtr> mScrollObservers;
   mozilla::OriginAttributes mOriginAttributes;
-  mozilla::UniquePtr<mozilla::dom::PendingGlobalHistoryEntry> mPrerenderGlobalHistory;
   mozilla::UniquePtr<mozilla::dom::ClientSource> mInitialClientSource;
   RefPtr<nsDOMNavigationTiming> mTiming;
   RefPtr<nsDSURIContentListener> mContentListener;
   RefPtr<nsGlobalWindowOuter> mScriptGlobal;
   nsCOMPtr<nsIPrincipal> mParentCharsetPrincipal;
   nsCOMPtr<nsILoadURIDelegate> mLoadURIDelegate;
   nsCOMPtr<nsIMutableArray> mRefreshURIList;
   nsCOMPtr<nsIMutableArray> mSavedRefreshURIList;
@@ -1108,17 +1106,16 @@ private: // data members
   bool mAllowContentRetargetingOnChildren : 1;
   bool mUseErrorPages : 1;
   bool mObserveErrorPages : 1;
   bool mAllowAuth : 1;
   bool mAllowKeywordFixup : 1;
   bool mIsOffScreenBrowser : 1;
   bool mIsActive : 1;
   bool mDisableMetaRefreshWhenInactive : 1;
-  bool mIsPrerendered : 1;
   bool mIsAppTab : 1;
   bool mUseGlobalHistory : 1;
   bool mUseRemoteTabs : 1;
   bool mUseTrackingProtection : 1;
   bool mDeviceSizeIsPageSize : 1;
   bool mWindowDraggingAllowed : 1;
   bool mInFrameSwap : 1;
   bool mInheritPrivateBrowsingId : 1;
--- a/docshell/base/nsIDocShell.idl
+++ b/docshell/base/nsIDocShell.idl
@@ -214,17 +214,16 @@ interface nsIDocShell : nsIDocShellTreeI
                               in long long aPostDataStreamLength,
                               in nsIInputStream aHeadersStream,
                               in unsigned long aLoadFlags,
                               in nsISHEntry aSHEntry,
                               in boolean aFirstParty,
                               in AString aSrcdoc,
                               in nsIDocShell aSourceDocShell,
                               in nsIURI aBaseURI,
-                              in boolean aCheckForPrerender,
                               out nsIDocShell aDocShell,
                               out nsIRequest aRequest);
 
   /**
    * Do either a history.pushState() or history.replaceState() operation,
    * depending on the value of aReplace.
    */
   [implicit_jscontext]
@@ -673,27 +672,16 @@ interface nsIDocShell : nsIDocShellTreeI
   /**
    * Sets whether a docshell is active. An active docshell is one that is
    * visible, and thus is not a good candidate for certain optimizations
    * like image frame discarding. Docshells are active unless told otherwise.
    */
   attribute boolean isActive;
 
   /**
-   * Puts the docshell in prerendering mode. noscript because we want only
-   * native code to be able to put a docshell in prerendering.
-   */
-  [noscript] void SetIsPrerendered();
-
-  /**
-   * Whether this docshell is in prerender mode.
-   */
-  [infallible] readonly attribute boolean isPrerendered;
-
-  /**
    * The ID of the docshell in the session history.
    */
   readonly attribute nsIDPtr historyID;
 
   /**
    * Helper method for accessing this value from C++
    */
   [noscript, notxpcom] nsID HistoryID();
--- a/docshell/shistory/moz.build
+++ b/docshell/shistory/moz.build
@@ -1,19 +1,16 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 XPIDL_SOURCES += [
     'nsIBFCacheEntry.idl',
-    'nsIGroupedSHistory.idl',
-    'nsIPartialSHistory.idl',
-    'nsIPartialSHistoryListener.idl',
     'nsISHContainer.idl',
     'nsISHEntry.idl',
     'nsISHistory.idl',
     'nsISHistoryInternal.idl',
     'nsISHistoryListener.idl',
     'nsISHTransaction.idl',
 ]
 
deleted file mode 100644
--- a/docshell/shistory/nsIGroupedSHistory.idl
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIFrameLoader;
-interface nsIPartialSHistory;
-
-/**
- * nsIGroupedSHistory represent a combined session history across multiple
- * root docshells (usually browser tabs). The participating nsISHistory can
- * either be in chrome process or in content process, but nsIGroupedSHistory
- * itself lives in chrome process. The communication is proxyed through
- * nsIPartialSHistory.
- */
-[scriptable, builtinclass, uuid(813e498d-73a8-449a-be09-6187e62c5352)]
-interface nsIGroupedSHistory : nsISupports
-{
-  // The total number of entries of all its partial session histories.
-  [infallible] readonly attribute unsigned long count;
-
-  /**
-   * The currently active frameloader controlled by this nsIGroupedSHistory.
-   */
-  readonly attribute nsIFrameLoader activeFrameLoader;
-
-  /**
-   * Remove all partial histories after currently active one (if any) and then
-   * append the given partial session history to the end of the list.
-   */
-  void appendPartialSHistory(in nsIPartialSHistory aPartialHistory);
-
-  /**
-   * Notify the grouped session history that the active partial session history
-   * has been modified.
-   *
-   * @param aPartialHistory The partial history which was updated
-   * @param aTruncate If this parameter is true, all partial session histories
-   *                  after this one will be removed.
-   */
-  void handleSHistoryUpdate(in nsIPartialSHistory aPartialHistory, in boolean aTruncate);
-
-  /**
-   * Find the proper partial session history and navigate to the entry
-   * corresponding to the given global index. Note it doesn't swap frameloaders,
-   * but rather return the target loader for the caller to swap.
-   *
-   * This function may throw NS_ERROR_NOT_AVAILABLE if the frameloader to swap
-   * to is dead.
-   *
-   * @param  aGlobalIndex
-   *         The global index to navigate to.
-   * @return The frameloader which needs to be swapped in, or null if no
-   *         frameloader needs to be swapped.
-   */
-  nsIFrameLoader gotoIndex(in unsigned long aGlobalIndex);
-
-  /**
-   * Close the FrameLoaderOwners of the inactive PartialSHistories in this GlobalSHistory.
-   * This does not remove the PartialSHistories from the GroupedSHistory.
-   */
-  void closeInactiveFrameLoaderOwners();
-
-  /**
-   * Add a partialSHistory as a "prerendering" partialSHistory. This
-   * partialSHistory's tab will have its lifetime managed by the
-   * GroupedSHistory, and will be closed when closeInactiveFrameLoaderOwners is
-   * called, or whenever a SHistory update is received.
-   */
-  void addPrerenderingPartialSHistory(in nsIPartialSHistory aPrerendering, in long aId);
-
-  /**
-   * Switch to the prerendering partialSHistory identified by aId, appending it after the current partialSHistory.
-   */
-  [implicit_jscontext] nsISupports activatePrerendering(in long aId);
-
-  /**
-   * Cancel the prerendering with the given ID.
-   */
-  void cancelPrerendering(in long aId);
-};
deleted file mode 100644
--- a/docshell/shistory/nsIPartialSHistory.idl
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIGroupedSHistory;
-interface nsIFrameLoader;
-
-/**
- * nsIPartialSHistory represents a part of nsIGroupedSHistory. It associates to
- * a "partial" nsISHistory in either local or remote process.
- */
-[scriptable, builtinclass, uuid(5cd75e28-838c-4a0a-972e-6005f736ef7a)]
-interface nsIPartialSHistory : nsISupports
-{
-  // The number of entries of its corresponding nsISHistory.
-  [infallible] readonly attribute unsigned long count;
-
-  // The current global index of the active shentry in this partialSHistory.
-  [infallible] readonly attribute long globalIndex;
-
-  // If it's part of a grouped session history, globalIndexOffset denotes the
-  // number of entries ahead.
-  [infallible] readonly attribute unsigned long globalIndexOffset;
-
-  // The frameloader which owns this partial session history.
-  readonly attribute nsIFrameLoader ownerFrameLoader;
-
-  // The groupedSHistory which this partialSHistory is a part of, or null.
-  readonly attribute nsIGroupedSHistory groupedSHistory;
-
-  // The current state of the nsIPartialSHistory, whether it is active,
-  // inactive, or currently prerendering.
-  const long STATE_INACTIVE = 0;
-  const long STATE_ACTIVE = 1;
-  const long STATE_PRERENDER = 2;
-
-  [infallible] attribute long activeState;
-
-  /**
-   * Notify that it's been added to a grouped session history. It also implies
-   * it's becoming the active partial history of the group.
-   *
-   * @param aGroup                 The GroupedSHistory which this partialSHistory
-   *                               is joining.
-   *
-   * @param aOffset                The number of entries in preceding partial
-   *                               session histories.
-   */
-  void onAttachGroupedSHistory(in nsIGroupedSHistory aGroup, in unsigned long aOffset);
-
-  /**
-   * This method is used by the TabParent to notify the PartialSHistory
-   * that the state of its corresponding nsISHistory in the content process
-   * has been updated. It is unused in the in-process case.
-   *
-   * @param aCount      The number of entries in the associated session history.
-   * @param aLocalIndex The local index of the currently active entry in the
-   *                    associated session history
-   */
-  void handleSHistoryUpdate(in unsigned long aCount, in unsigned long aLocalIndex, in boolean aTruncate);
-
-  /**
-   * Notify that the partial session history has been swapped in as the active
-   * session history. Only an active session history can possibly add / remove /
-   * replace its history entries.
-   *
-   * @param aGlobalLength      The up-to-date global length.
-   * @param aTargetLocalIndex  The local index to navigate to.
-   */
-  void onActive(in unsigned long aGlobalLength, in unsigned long aTargetLocalIndex);
-
-  /**
-   * Notify that the partial session history has been swapped out and is no
-   * longer active.
-   */
-  void onDeactive();
-};
deleted file mode 100644
--- a/docshell/shistory/nsIPartialSHistoryListener.idl
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include "nsISupports.idl"
-
-/**
- * Listener to handle cross partial nsISHistory navigation requests.
- */
-[scriptable, uuid(be0cd2b6-6f03-4366-9fe2-184c914ff3df)]
-interface nsIPartialSHistoryListener : nsISupports
-{
-  /**
-   * Called when the navigation target belongs to another nsISHistory within
-   * the same nsIGroupedSHistory, and it needs to initiate cross nsISHistory
-   * navigation.
-   *
-   * @param aIndex The index of complete history to navigate to.
-   */
-   void onRequestCrossBrowserNavigation(in unsigned long aIndex);
-};
--- a/docshell/shistory/nsISHistory.idl
+++ b/docshell/shistory/nsISHistory.idl
@@ -3,17 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 interface nsISHEntry;
 interface nsISHistoryListener;
 interface nsISimpleEnumerator;
-interface nsIPartialSHistoryListener;
 
 /**
  * An interface to the primary properties of the Session History
  * component. In an embedded browser environment, the nsIWebBrowser
  * object creates an instance of session history for each open window.
  * A handle to the session history object can be obtained from
  * nsIWebNavigation. In a non-embedded situation, the  owner of the
  * session history component must create a instance of it and set
@@ -37,61 +36,29 @@ interface nsISHistory: nsISupports
    * bfcache around the currently active SHEntry.
    *
    * We try to keep viewers for SHEntries between index - VIEWER_WINDOW and
    * index + VIEWER_WINDOW alive.
    */
   const long VIEWER_WINDOW = 3;
 
   /**
-   * An attribute denoting whether the nsISHistory is associated to a grouped
-   * session history.
-   *
-   * The abstraction of grouped session history is implemented at
-   * nsIWebNavigation level, so those canGoBack / canGoForward / gotoIndex
-   * functions work transparently;
-   *
-   * On the other hand, nsISHistory works on partial session history directly.
-   * Unless otherwise specified, count / index attributes and parameters all
-   * indicate local count / index, so we won't mess up docshell.
-   */
-   readonly attribute bool isPartial;
-
-  /**
    * A readonly property of the interface that returns 
    * the number of toplevel documents currently available
    * in session history.
    */
    readonly attribute long count;
 
   /**
-   * If isPartial, globalCount denotes the total number of entries in the
-   * grouped session history; Otherwise it has the same value as count.
-   */
-   readonly attribute long globalCount;
-
-  /**
-   * A readonly property which represents the difference between global indices
-   * of grouped session history and local indices of this particular session
-   * history object.
-   */
-   readonly attribute long globalIndexOffset;
-
-  /**
    * A readonly property of the interface that returns
    * the index of the current document in session history.
    */
    readonly attribute long index;
 
   /**
-   * A readonly property which equals index + globalIndexOffset.
-   */
-   readonly attribute long globalIndex;
-
-  /**
    * A readonly property of the interface that returns
    * the index of the last document that started to load and
    * didn't finished yet. When document finishes the loading
    * value -1 is returned.
    */
    readonly attribute long requestedIndex;
 
   /**
@@ -169,22 +136,16 @@ interface nsISHistory: nsISupports
    * @note                    A listener object must implement 
    *                          nsISHistoryListener and nsSupportsWeakReference
    * @see nsISHistoryListener
    * @see nsSupportsWeakReference
    */ 
    void removeSHistoryListener(in nsISHistoryListener aListener);
 
   /**
-   * Set the listener to handle cross nsISHistory navigation when it works
-   * in "partial" mode.
-   */
-   void setPartialSHistoryListener(in nsIPartialSHistoryListener aListener);
-
-  /**
    * Called to obtain a enumerator for all the  documents stored in
    * session history. The enumerator object thus returned by this method
    * can be traversed using nsISimpleEnumerator. 
    *
    * @note  To access individual history entries of the enumerator, perform the
    *        following steps:
    *        1) Call nsISHistory->GetSHistoryEnumerator() to obtain handle 
    *           the nsISimpleEnumerator object.
@@ -210,33 +171,9 @@ interface nsISHistory: nsISupports
    * @param aEntry            The entry to obtain the index of.
    *
    * @return                  <code>NS_OK</code> index for the history entry
    *                          is obtained successfully.
    *                          <code>NS_ERROR_FAILURE</code> Error in obtaining
    *                          index for the given history entry.
    */
    long getIndexOfEntry(in nsISHEntry aEntry);
-
-  /**
-   * Called when this nsISHistory has became the active history of a grouped
-   * session history.
-   *
-   * @param globalLength      The up to date number of entries in the grouped
-   *                          session history.
-   * @param targetIndex       The local index to navigate to.
-   */
-   void onPartialSHistoryActive(in long globalLength, in long targetIndex);
-
-  /**
-   * Called when this nsISHistory has became inactive history of a grouped
-   * session history.
-   */
-   void onPartialSHistoryDeactive();
-
-  /**
-   * Called when it's attached to a nsIGroupedSHistory instance.
-   *
-   * @param offset            The number of entries in the grouped session
-   *                          history before this session history object.
-   */
-   void onAttachGroupedSHistory(in long offset);
 };
--- a/docshell/shistory/nsSHistory.cpp
+++ b/docshell/shistory/nsSHistory.cpp
@@ -230,20 +230,17 @@ nsSHistory::EvictContentViewerForTransac
     RemoveDynEntries(index, container);
   }
 }
 
 nsSHistory::nsSHistory()
   : mIndex(-1)
   , mLength(0)
   , mRequestedIndex(-1)
-  , mGlobalIndexOffset(0)
-  , mEntriesInFollowingPartialHistories(0)
   , mRootDocShell(nullptr)
-  , mIsPartial(false)
 {
   // Add this new SHistory object to the list
   gSHistoryList.insertBack(this);
 }
 
 nsSHistory::~nsSHistory()
 {
 }
@@ -661,121 +658,47 @@ nsSHistory::AddEntry(nsISHEntry* aSHEntr
 
   // A little tricky math here...  Basically when adding an object regardless of
   // what the length was before, it should always be set back to the current and
   // lop off the forward.
   mLength = (++mIndex + 1);
   NOTIFY_LISTENERS(OnLengthChanged, (mLength));
   NOTIFY_LISTENERS(OnIndexChanged, (mIndex));
 
-  // Much like how mLength works above, when changing our entries, all following
-  // partial histories should be purged, so we just reset the number to zero.
-  mEntriesInFollowingPartialHistories = 0;
-
   // If this is the very first transaction, initialize the list
   if (!mListRoot) {
     mListRoot = txn;
   }
 
   // Purge History list if it is too long
   if (gHistoryMaxSize >= 0 && mLength > gHistoryMaxSize) {
     PurgeHistory(mLength - gHistoryMaxSize);
   }
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsSHistory::GetIsPartial(bool* aResult)
-{
-  NS_ENSURE_ARG_POINTER(aResult);
-  *aResult = mIsPartial;
-  return NS_OK;
-}
-
 /* Get size of the history list */
 NS_IMETHODIMP
 nsSHistory::GetCount(int32_t* aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
   *aResult = mLength;
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsSHistory::GetGlobalCount(int32_t* aResult)
-{
-  NS_ENSURE_ARG_POINTER(aResult);
-  *aResult = mGlobalIndexOffset + mLength + mEntriesInFollowingPartialHistories;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSHistory::GetGlobalIndexOffset(int32_t* aResult)
-{
-  NS_ENSURE_ARG_POINTER(aResult);
-  *aResult = mGlobalIndexOffset;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSHistory::OnPartialSHistoryActive(int32_t aGlobalLength, int32_t aTargetIndex)
-{
-  NS_ENSURE_TRUE(mRootDocShell && mIsPartial, NS_ERROR_UNEXPECTED);
-
-  int32_t extraLength = aGlobalLength - mLength - mGlobalIndexOffset;
-  NS_ENSURE_TRUE(extraLength >= 0, NS_ERROR_UNEXPECTED);
-
-  if (extraLength != mEntriesInFollowingPartialHistories) {
-    mEntriesInFollowingPartialHistories = extraLength;
-  }
-
-  return RestoreToEntryAtIndex(aTargetIndex);
-}
-
-NS_IMETHODIMP
-nsSHistory::OnPartialSHistoryDeactive()
-{
-  NS_ENSURE_TRUE(mRootDocShell && mIsPartial, NS_ERROR_UNEXPECTED);
-
-  // Ensure the deactive docshell loads about:blank.
-  nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(mRootDocShell);
-  nsCOMPtr<nsIURI> currentURI;
-  webNav->GetCurrentURI(getter_AddRefs(currentURI));
-  if (NS_IsAboutBlank(currentURI)) {
-    return NS_OK;
-  }
-
-  // At this point we've swapped out to an invisble tab, and can not prompt here.
-  // The check should have been done in nsDocShell::InternalLoad, so we'd
-  // just force docshell to load about:blank.
-  if (NS_FAILED(mRootDocShell->ForceCreateAboutBlankContentViewer(nullptr))) {
-    return NS_ERROR_FAILURE;
-  }
-
-  return NS_OK;
-}
-
 /* Get index of the history list */
 NS_IMETHODIMP
 nsSHistory::GetIndex(int32_t* aResult)
 {
   NS_PRECONDITION(aResult, "null out param?");
   *aResult = mIndex;
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsSHistory::GetGlobalIndex(int32_t* aResult)
-{
-  NS_PRECONDITION(aResult, "null out param?");
-  *aResult = mIndex + mGlobalIndexOffset;
-  return NS_OK;
-}
-
 /* Get the requestedIndex */
 NS_IMETHODIMP
 nsSHistory::GetRequestedIndex(int32_t* aResult)
 {
   NS_PRECONDITION(aResult, "null out param?");
   *aResult = mRequestedIndex;
   return NS_OK;
 }
@@ -1017,19 +940,16 @@ nsSHistory::PurgeHistory(int32_t aEntrie
     if (mListRoot) {
       mListRoot->SetPrev(nullptr);
     }
     cnt++;
   }
   mLength -= cnt;
   mIndex -= cnt;
 
-  // All following partial histories will be deleted in this case.
-  mEntriesInFollowingPartialHistories = 0;
-
   // Now if we were not at the end of the history, mIndex could have
   // become far too negative.  If so, just set it to -1.
   if (mIndex < -1) {
     mIndex = -1;
   }
 
   NOTIFY_LISTENERS(OnLengthChanged, (mLength));
   NOTIFY_LISTENERS(OnIndexChanged, (mIndex))
@@ -1063,23 +983,16 @@ nsSHistory::RemoveSHistoryListener(nsISH
 {
   // Make sure the listener that wants to be removed is the
   // one we have in store.
   nsWeakPtr listener = do_GetWeakReference(aListener);
   mListeners.RemoveElement(listener);
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsSHistory::SetPartialSHistoryListener(nsIPartialSHistoryListener* aListener)
-{
-  mPartialHistoryListener = do_GetWeakReference(aListener);
-  return NS_OK;
-}
-
 /* Replace an entry in the History list at a particular index.
  * Do not update index or count.
  */
 NS_IMETHODIMP
 nsSHistory::ReplaceEntry(int32_t aIndex, nsISHEntry* aReplaceEntry)
 {
   NS_ENSURE_ARG(aReplaceEntry);
   nsresult rv;
@@ -1148,42 +1061,32 @@ nsSHistory::EvictAllContentViewers()
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHistory::GetCanGoBack(bool* aCanGoBack)
 {
   NS_ENSURE_ARG_POINTER(aCanGoBack);
 
-  if (mGlobalIndexOffset) {
-    *aCanGoBack = true;
-    return NS_OK;
-  }
-
   int32_t index = -1;
   NS_ENSURE_SUCCESS(GetIndex(&index), NS_ERROR_FAILURE);
   if (index > 0) {
     *aCanGoBack = true;
     return NS_OK;
   }
 
   *aCanGoBack = false;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSHistory::GetCanGoForward(bool* aCanGoForward)
 {
   NS_ENSURE_ARG_POINTER(aCanGoForward);
 
-  if (mEntriesInFollowingPartialHistories) {
-    *aCanGoForward = true;
-    return NS_OK;
-  }
-
   int32_t index = -1;
   int32_t count = -1;
   NS_ENSURE_SUCCESS(GetIndex(&index), NS_ERROR_FAILURE);
   NS_ENSURE_SUCCESS(GetCount(&count), NS_ERROR_FAILURE);
   if (index >= 0 && index < (count - 1)) {
     *aCanGoForward = true;
     return NS_OK;
   }
@@ -1766,17 +1669,16 @@ nsSHistory::RemoveDuplicate(int32_t aInd
     // NB: We don't need to guard on mRequestedIndex being nonzero here,
     // because either they're strictly greater than aIndex which is at least
     // zero, or they are equal to aIndex in which case aKeepNext must be true
     // if aIndex is zero.
     if (mRequestedIndex > aIndex || (mRequestedIndex == aIndex && !aKeepNext)) {
       mRequestedIndex = mRequestedIndex - 1;
     }
     --mLength;
-    mEntriesInFollowingPartialHistories = 0;
     NOTIFY_LISTENERS(OnLengthChanged, (mLength));
     return true;
   }
   return false;
 }
 
 NS_IMETHODIMP_(void)
 nsSHistory::RemoveEntries(nsTArray<nsID>& aIDs, int32_t aStartIndex)
@@ -1926,22 +1828,19 @@ nsSHistory::LoadURI(const char16_t* aURI
                     nsIInputStream* aPostStream,
                     nsIInputStream* aExtraHeaderStream,
                     nsIPrincipal* aTriggeringPrincipal)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSHistory::GotoIndex(int32_t aGlobalIndex)
+nsSHistory::GotoIndex(int32_t aIndex)
 {
-  // We provide abstraction of grouped session history for nsIWebNavigation
-  // functions, so the index passed in here is global index.
-  return LoadEntry(aGlobalIndex - mGlobalIndexOffset, nsIDocShellLoadInfo::loadHistory,
-                   HIST_CMD_GOTOINDEX);
+  return LoadEntry(aIndex, nsIDocShellLoadInfo::loadHistory, HIST_CMD_GOTOINDEX);
 }
 
 nsresult
 nsSHistory::LoadNextPossibleEntry(int32_t aNewIndex, long aLoadType,
                                   uint32_t aHistCmd)
 {
   mRequestedIndex = -1;
   if (aNewIndex < mIndex) {
@@ -1958,60 +1857,45 @@ nsSHistory::LoadEntry(int32_t aIndex, lo
 {
   if (!mRootDocShell) {
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsIURI> nextURI;
   nsCOMPtr<nsISHEntry> prevEntry;
   nsCOMPtr<nsISHEntry> nextEntry;
-  bool isCrossBrowserNavigation = false;
   if (aIndex < 0 || aIndex >= mLength) {
-    if (aIndex + mGlobalIndexOffset < 0) {
-      // The global index is negative.
-      return NS_ERROR_FAILURE;
-    }
-
-    if (aIndex - mLength >= mEntriesInFollowingPartialHistories) {
-      // The global index exceeds max possible value.
-      return NS_ERROR_FAILURE;
-    }
-
-    // The global index is valid. Mark that we're going to navigate to another
-    // partial history, but wait until we've notified all listeners before
-    // actually do so.
-    isCrossBrowserNavigation = true;
-  } else {
-    // This is a normal local history navigation.
-    // Keep note of requested history index in mRequestedIndex.
-    mRequestedIndex = aIndex;
-
-    GetEntryAtIndex(mIndex, false, getter_AddRefs(prevEntry));
-    GetEntryAtIndex(mRequestedIndex, false, getter_AddRefs(nextEntry));
-    if (!nextEntry || !prevEntry) {
-      mRequestedIndex = -1;
-      return NS_ERROR_FAILURE;
-    }
-
-    // Remember that this entry is getting loaded at this point in the sequence
-    nsCOMPtr<nsISHEntryInternal> entryInternal = do_QueryInterface(nextEntry);
-
-    if (entryInternal) {
-      entryInternal->SetLastTouched(++gTouchCounter);
-    }
-
-    // Get the uri for the entry we are about to visit
-    nextEntry->GetURI(getter_AddRefs(nextURI));
+    // The index is out of range
+    return NS_ERROR_FAILURE;
   }
 
-  MOZ_ASSERT(isCrossBrowserNavigation || (prevEntry && nextEntry && nextURI),
-    "prevEntry, nextEntry and nextURI can be null only if isCrossBrowserNavigation is set");
+  // This is a normal local history navigation.
+  // Keep note of requested history index in mRequestedIndex.
+  mRequestedIndex = aIndex;
+
+  GetEntryAtIndex(mIndex, false, getter_AddRefs(prevEntry));
+  GetEntryAtIndex(mRequestedIndex, false, getter_AddRefs(nextEntry));
+  if (!nextEntry || !prevEntry) {
+    mRequestedIndex = -1;
+    return NS_ERROR_FAILURE;
+  }
 
-  // Send appropriate listener notifications. Note nextURI could be null in case
-  // of grouped session history navigation.
+  // Remember that this entry is getting loaded at this point in the sequence
+  nsCOMPtr<nsISHEntryInternal> entryInternal = do_QueryInterface(nextEntry);
+
+  if (entryInternal) {
+    entryInternal->SetLastTouched(++gTouchCounter);
+  }
+
+  // Get the uri for the entry we are about to visit
+  nextEntry->GetURI(getter_AddRefs(nextURI));
+
+  MOZ_ASSERT((prevEntry && nextEntry && nextURI), "prevEntry, nextEntry and nextURI can't be null");
+
+  // Send appropriate listener notifications.
   bool canNavigate = true;
   if (aHistCmd == HIST_CMD_BACK) {
     // We are going back one entry. Send GoBack notifications
     NOTIFY_LISTENERS_CANCELABLE(OnHistoryGoBack, canNavigate,
                                 (nextURI, &canNavigate));
   } else if (aHistCmd == HIST_CMD_FORWARD) {
     // We are going forward. Send GoForward notification
     NOTIFY_LISTENERS_CANCELABLE(OnHistoryGoForward, canNavigate,
@@ -2024,33 +1908,16 @@ nsSHistory::LoadEntry(int32_t aIndex, lo
 
   if (!canNavigate) {
     // If the listener asked us not to proceed with
     // the operation, simply return.
     mRequestedIndex = -1;
     return NS_OK;  // XXX Maybe I can return some other error code?
   }
 
-  if (isCrossBrowserNavigation) {
-    nsCOMPtr<nsIPartialSHistoryListener> listener =
-      do_QueryReferent(mPartialHistoryListener);
-    if (!listener) {
-      return NS_ERROR_FAILURE;
-    }
-
-    // CreateAboutBlankContentViewer would check for permit unload, fire proper
-    // pagehide / unload events and transfer content viewer ownership to SHEntry.
-    if (NS_FAILED(mRootDocShell->CreateAboutBlankContentViewer(nullptr))) {
-      return NS_ERROR_FAILURE;
-    }
-
-    return listener->OnRequestCrossBrowserNavigation(aIndex +
-                                                     mGlobalIndexOffset);
-  }
-
   if (mRequestedIndex == mIndex) {
     // Possibly a reload case
     return InitiateLoad(nextEntry, mRootDocShell, aLoadType);
   }
 
   // Going back or forward.
   bool differenceFound = false;
   nsresult rv = LoadDifferingEntries(prevEntry, nextEntry, mRootDocShell,
@@ -2231,35 +2098,16 @@ NS_IMETHODIMP
 nsSHistory::GetSHistoryEnumerator(nsISimpleEnumerator** aEnumerator)
 {
   NS_ENSURE_ARG_POINTER(aEnumerator);
   RefPtr<nsSHEnumerator> iterator = new nsSHEnumerator(this);
   iterator.forget(aEnumerator);
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsSHistory::OnAttachGroupedSHistory(int32_t aOffset)
-{
-  NS_ENSURE_TRUE(!mIsPartial && mRootDocShell, NS_ERROR_UNEXPECTED);
-  NS_ENSURE_TRUE(aOffset >= 0, NS_ERROR_ILLEGAL_VALUE);
-
-  mIsPartial = true;
-  mGlobalIndexOffset = aOffset;
-
-  // The last attached history is always at the end of the group.
-  mEntriesInFollowingPartialHistories = 0;
-
-  // Setting grouped history info may change canGoBack / canGoForward.
-  // Send a location change to update these values.
-  mRootDocShell->DispatchLocationChangeEvent();
-  return NS_OK;
-
-}
-
 nsSHEnumerator::nsSHEnumerator(nsSHistory* aSHistory) : mIndex(-1)
 {
   mSHistory = aSHistory;
 }
 
 nsSHEnumerator::~nsSHEnumerator()
 {
   mSHistory = nullptr;
--- a/docshell/shistory/nsSHistory.h
+++ b/docshell/shistory/nsSHistory.h
@@ -4,17 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsSHistory_h
 #define nsSHistory_h
 
 #include "nsCOMPtr.h"
 #include "nsExpirationTracker.h"
-#include "nsIPartialSHistoryListener.h"
 #include "nsISHistory.h"
 #include "nsISHistoryInternal.h"
 #include "nsISimpleEnumerator.h"
 #include "nsIWebNavigation.h"
 #include "nsSHEntryShared.h"
 #include "nsTObserverArray.h"
 #include "nsWeakReference.h"
 
@@ -177,34 +176,22 @@ private:
   // Track all bfcache entries and evict on expiration.
   mozilla::UniquePtr<HistoryTracker> mHistoryTracker;
 
   nsCOMPtr<nsISHTransaction> mListRoot;
   int32_t mIndex;
   int32_t mLength;
   int32_t mRequestedIndex;
 
-  // The number of entries before this session history object.
-  int32_t mGlobalIndexOffset;
-
-  // The number of entries after this session history object.
-  int32_t mEntriesInFollowingPartialHistories;
-
   // Session History listeners
   nsAutoTObserverArray<nsWeakPtr, 2> mListeners;
 
-  // Partial session history listener
-  nsWeakPtr mPartialHistoryListener;
-
   // Weak reference. Do not refcount this.
   nsIDocShell* mRootDocShell;
 
-  // Set to true if attached to a grouped session history.
-  bool mIsPartial;
-
   // Max viewers allowed total, across all SHistory objects
   static int32_t sHistoryMaxTotalViewers;
 };
 
 class nsSHEnumerator : public nsISimpleEnumerator
 {
 public:
   NS_DECL_ISUPPORTS
deleted file mode 100644
--- a/dom/base/GroupedSHistory.cpp
+++ /dev/null
@@ -1,354 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "GroupedSHistory.h"
-
-#include "mozilla/dom/Promise.h"
-#include "TabParent.h"
-#include "PartialSHistory.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION_CLASS(GroupedSHistory)
-
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(GroupedSHistory)
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mPartialHistories)
-  tmp->mPrerenderingHistories.Clear();
-NS_IMPL_CYCLE_COLLECTION_UNLINK_END
-
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(GroupedSHistory)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPartialHistories)
-  for (GroupedSHistory::PrerenderingHistory& h : tmp->mPrerenderingHistories) {
-    ImplCycleCollectionTraverse(cb, h.mPartialHistory, "mPrerenderingHistories[i]->mPartialHistory", 0);
-  }
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(GroupedSHistory)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(GroupedSHistory)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(GroupedSHistory)
-  NS_INTERFACE_MAP_ENTRY(nsIGroupedSHistory)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIGroupedSHistory)
-NS_INTERFACE_MAP_END
-
-GroupedSHistory::GroupedSHistory()
-  : mCount(0),
-    mIndexOfActivePartialHistory(-1)
-{
-}
-
-NS_IMETHODIMP
-GroupedSHistory::GetCount(uint32_t* aResult)
-{
-  MOZ_ASSERT(aResult);
-  *aResult = mCount;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-GroupedSHistory::AppendPartialSHistory(nsIPartialSHistory* aPartialHistory)
-{
-  if (!aPartialHistory) {
-    return NS_ERROR_INVALID_POINTER;
-  }
-
-  nsCOMPtr<nsIPartialSHistory> partialHistory(aPartialHistory);
-  if (!partialHistory || mPartialHistories.Contains(partialHistory)) {
-    return NS_ERROR_FAILURE;
-  }
-
-  // Remove all items after active one and deactive it, unless it's the first
-  // call and no active partial history has been set yet.
-  if (mIndexOfActivePartialHistory >= 0) {
-    PurgePartialHistories(mIndexOfActivePartialHistory);
-    nsCOMPtr<nsIPartialSHistory> prevPartialHistory =
-      mPartialHistories[mIndexOfActivePartialHistory];
-    if (NS_WARN_IF(!prevPartialHistory)) {
-      // Cycle collected?
-      return NS_ERROR_UNEXPECTED;
-    }
-    prevPartialHistory->OnDeactive();
-  }
-
-  // Attach the partial history.
-  uint32_t offset = mCount;
-  mCount += partialHistory->GetCount();
-  mPartialHistories.AppendElement(partialHistory);
-  partialHistory->OnAttachGroupedSHistory(this, offset);
-  mIndexOfActivePartialHistory = mPartialHistories.Count() - 1;
-
-  // Remove the prerendered documents, as there was a history navigation
-  PurgePrerendering();
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-GroupedSHistory::HandleSHistoryUpdate(nsIPartialSHistory* aPartial, bool aTruncate)
-{
-  if (!aPartial) {
-    return NS_ERROR_INVALID_POINTER;
-  }
-  nsCOMPtr<nsIPartialSHistory> partialHistory = aPartial;
-
-  int32_t index = partialHistory->GetGlobalIndex();
-  // Get the lower and upper bounds for the viewer window
-  int32_t lower = index - nsISHistory::VIEWER_WINDOW;
-  int32_t upper = index + nsISHistory::VIEWER_WINDOW;
-  for (uint32_t i = 0; i < mPartialHistories.Length(); ++i) {
-    nsIPartialSHistory* pHistory = mPartialHistories[i];
-    // Skip the active partial history.
-    if (pHistory == partialHistory) {
-      continue;
-    }
-
-    // Check if the given partialshistory entry is too far away in history, and
-    // if it is, close it.
-    int32_t thisCount = pHistory->GetCount();
-    int32_t thisOffset = pHistory->GetGlobalIndexOffset();
-    if ((thisOffset > upper) || ((thisCount + thisOffset) < lower)) {
-      nsCOMPtr<nsIFrameLoader> loader;
-      pHistory->GetOwnerFrameLoader(getter_AddRefs(loader));
-      if (loader && !loader->GetIsDead()) {
-        loader->RequestFrameLoaderClose();
-      }
-    }
-  }
-
-  // Remove the prerendered documents, as there was a history navigation
-  PurgePrerendering();
-
-  // If we should be truncating, make sure to purge any partialSHistories which
-  // follow the one being updated.
-  if (aTruncate) {
-    int32_t index = mPartialHistories.IndexOf(partialHistory);
-    if (NS_WARN_IF(index != mIndexOfActivePartialHistory) ||
-        NS_WARN_IF(index < 0)) {
-      // Non-active or not attached partialHistory
-      return NS_ERROR_UNEXPECTED;
-    }
-
-    PurgePartialHistories(index);
-
-    // Update global count.
-    uint32_t count = partialHistory->GetCount();
-    uint32_t offset = partialHistory->GetGlobalIndexOffset();
-    mCount = count + offset;
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-GroupedSHistory::GotoIndex(uint32_t aGlobalIndex,
-                           nsIFrameLoader** aTargetLoaderToSwap)
-{
-  MOZ_ASSERT(aTargetLoaderToSwap);
-  *aTargetLoaderToSwap = nullptr;
-
-  nsCOMPtr<nsIPartialSHistory> currentPartialHistory =
-    mPartialHistories[mIndexOfActivePartialHistory];
-  if (!currentPartialHistory) {
-    // Cycle collected?
-    return NS_ERROR_UNEXPECTED;
-  }
-
-  for (uint32_t i = 0; i < mPartialHistories.Length(); i++) {
-    nsCOMPtr<nsIPartialSHistory> partialHistory = mPartialHistories[i];
-    if (NS_WARN_IF(!partialHistory)) {
-      // Cycle collected?
-      return NS_ERROR_UNEXPECTED;
-    }
-
-    // Examine index range.
-    uint32_t offset = partialHistory->GetGlobalIndexOffset();
-    uint32_t count = partialHistory->GetCount();
-    if (offset <= aGlobalIndex && (offset + count) > aGlobalIndex) {
-      uint32_t targetIndex = aGlobalIndex - offset;
-
-      // Check if we are trying to swap to a dead frameloader, and return
-      // NS_ERROR_NOT_AVAILABLE if we are.
-      nsCOMPtr<nsIFrameLoader> frameLoader;
-      partialHistory->GetOwnerFrameLoader(getter_AddRefs(frameLoader));
-      if (!frameLoader || frameLoader->GetIsDead()) {
-        return NS_ERROR_NOT_AVAILABLE;
-      }
-
-      if ((size_t)mIndexOfActivePartialHistory == i) {
-        return NS_OK;
-      }
-      mIndexOfActivePartialHistory = i;
-      if (NS_FAILED(currentPartialHistory->OnDeactive()) ||
-          NS_FAILED(partialHistory->OnActive(mCount, targetIndex))) {
-        return NS_ERROR_FAILURE;
-      }
-
-      // Return the target frameloader to the caller.
-      frameLoader.forget(aTargetLoaderToSwap);
-      return NS_OK;
-    }
-  }
-
-  // Index not found.
-  NS_WARNING("Out of index request!");
-  return NS_ERROR_FAILURE;
-}
-
-void
-GroupedSHistory::PurgePartialHistories(uint32_t aLastPartialIndexToKeep)
-{
-  uint32_t lastIndex = mPartialHistories.Length() - 1;
-  if (aLastPartialIndexToKeep >= lastIndex) {
-    // Nothing to remove.
-    return;
-  }
-
-  // Close tabs.
-  for (uint32_t i = lastIndex; i > aLastPartialIndexToKeep; i--) {
-    nsCOMPtr<nsIPartialSHistory> partialHistory = mPartialHistories[i];
-    if (!partialHistory) {
-      // Cycle collected?
-      return;
-    }
-
-    nsCOMPtr<nsIFrameLoader> loader;
-    partialHistory->GetOwnerFrameLoader(getter_AddRefs(loader));
-    loader->RequestFrameLoaderClose();
-  }
-
-  // Remove references.
-  mPartialHistories.RemoveElementsAt(aLastPartialIndexToKeep + 1,
-                                     lastIndex - aLastPartialIndexToKeep);
-}
-
-/* static */ bool
-GroupedSHistory::GroupedHistoryEnabled() {
-  static bool sGroupedSHistoryEnabled = false;
-  static bool sGroupedSHistoryPrefCached = false;
-  if (!sGroupedSHistoryPrefCached) {
-    sGroupedSHistoryPrefCached = true;
-    Preferences::AddBoolVarCache(&sGroupedSHistoryEnabled,
-                                 "browser.groupedhistory.enabled",
-                                 false);
-  }
-
-  return sGroupedSHistoryEnabled;
-}
-
-void
-GroupedSHistory::PurgePrerendering()
-{
-  nsTArray<PrerenderingHistory> histories = Move(mPrerenderingHistories);
-  // Remove the frameloaders which are owned by the prerendering history, and
-  // remove them from mPrerenderingHistories.
-  for (uint32_t i = 0; i < histories.Length(); ++i) {
-    nsCOMPtr<nsIFrameLoader> loader;
-    histories[i].mPartialHistory->GetOwnerFrameLoader(getter_AddRefs(loader));
-    if (loader) {
-      loader->RequestFrameLoaderClose();
-    }
-  }
-  MOZ_ASSERT(mPrerenderingHistories.IsEmpty());
-}
-
-NS_IMETHODIMP
-GroupedSHistory::CloseInactiveFrameLoaderOwners()
-{
-  MOZ_ASSERT(mIndexOfActivePartialHistory >= 0);
-  // Remove inactive frameloaders which are participating in the grouped shistory
-  for (uint32_t i = 0; i < mPartialHistories.Length(); ++i) {
-    if (i != static_cast<uint32_t>(mIndexOfActivePartialHistory)) {
-      nsCOMPtr<nsIFrameLoader> loader;
-      mPartialHistories[i]->GetOwnerFrameLoader(getter_AddRefs(loader));
-      loader->RequestFrameLoaderClose();
-    }
-  }
-
-  PurgePrerendering();
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-GroupedSHistory::AddPrerenderingPartialSHistory(nsIPartialSHistory* aPrerendering, int32_t aId)
-{
-  NS_ENSURE_TRUE(aPrerendering && aId, NS_ERROR_UNEXPECTED);
-  aPrerendering->SetActiveState(nsIPartialSHistory::STATE_PRERENDER);
-  PrerenderingHistory history = { aPrerendering, aId };
-  mPrerenderingHistories.AppendElement(history);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-GroupedSHistory::GetActiveFrameLoader(nsIFrameLoader** aFrameLoader)
-{
-  if (mIndexOfActivePartialHistory >= 0) {
-    return mPartialHistories[mIndexOfActivePartialHistory]->GetOwnerFrameLoader(aFrameLoader);
-  }
-  return NS_ERROR_NOT_AVAILABLE;
-}
-
-NS_IMETHODIMP
-GroupedSHistory::ActivatePrerendering(int32_t aId, JSContext* aCx, nsISupports** aPromise)
-{
-  NS_ENSURE_TRUE(aId && aCx && aPromise, NS_ERROR_UNEXPECTED);
-
-  // Look for an entry with the given aId in mPrerenderingHistories.
-  for (uint32_t i = 0; i < mPrerenderingHistories.Length(); ++i) {
-    if (mPrerenderingHistories[i].mId == aId) {
-      nsCOMPtr<nsIPartialSHistory> partialHistory = mPrerenderingHistories[i].mPartialHistory;
-      mPrerenderingHistories.RemoveElementAt(i);
-
-      nsCOMPtr<nsIFrameLoader> fl;
-      partialHistory->GetOwnerFrameLoader(getter_AddRefs(fl));
-      NS_ENSURE_TRUE(fl, NS_ERROR_FAILURE);
-
-      nsCOMPtr<nsIFrameLoader> activeFl;
-      GetActiveFrameLoader(getter_AddRefs(activeFl));
-      NS_ENSURE_TRUE(activeFl, NS_ERROR_FAILURE);
-
-      nsresult rv = fl->MakePrerenderedLoaderActive();
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      return activeFl->AppendPartialSHistoryAndSwap(fl, aPromise);
-    }
-  }
-
-  // Generate a rejected promise as the entry was not found.
-  nsCOMPtr<nsIGlobalObject> go = xpc::NativeGlobal(JS::CurrentGlobalOrNull(aCx));
-  if (NS_WARN_IF(!go)) {
-    return NS_ERROR_FAILURE;
-  }
-  ErrorResult rv;
-  RefPtr<Promise> promise = Promise::Reject(go, aCx, JS::UndefinedHandleValue, rv);
-  if (NS_WARN_IF(rv.Failed())) {
-    return NS_ERROR_FAILURE;
-  }
-  promise.forget(aPromise);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-GroupedSHistory::CancelPrerendering(int32_t aId)
-{
-  for (uint32_t i = 0; i < mPrerenderingHistories.Length(); ++i) {
-    if (mPrerenderingHistories[i].mId == aId) {
-      nsCOMPtr<nsIPartialSHistory> partialHistory = mPrerenderingHistories[i].mPartialHistory;
-      nsCOMPtr<nsIFrameLoader> fl;
-      partialHistory->GetOwnerFrameLoader(getter_AddRefs(fl));
-      if (fl) {
-        fl->RequestFrameLoaderClose();
-      }
-      mPrerenderingHistories.RemoveElementAt(i);
-    }
-  }
-
-  return NS_OK;
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/base/GroupedSHistory.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef GroupedSHistory_h
-#define GroupedSHistory_h
-
-#include "nsIFrameLoader.h"
-#include "nsIGroupedSHistory.h"
-#include "nsIPartialSHistory.h"
-#include "nsTArray.h"
-#include "nsCOMArray.h"
-#include "nsCOMPtr.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsWeakReference.h"
-
-namespace mozilla {
-namespace dom {
-
-
-/**
- * GroupedSHistory connects session histories across multiple frameloaders.
- * Each frameloader has a PartialSHistory, and GroupedSHistory has an array
- * refering to all participating PartialSHistory(s).
- *
- * The following figure illustrates the idea. In this case, the GroupedSHistory
- * is composed of 3 frameloaders, and the active one is frameloader 1.
- * GroupedSHistory is always attached to the active frameloader.
- *
- *            +----------------------------------------------------+
- *            |                                                    |
- *            |                                                    v
- *  +------------------+      +-------------------+       +-----------------+
- *  |  FrameLoader 1   |      | PartialSHistory 1 |       | GroupedSHistory |
- *  |     (active)     |----->|     (active)      |<--+---|                 |
- *  +------------------+      +-------------------+   |   +-----------------+
- *                                                    |
- *  +------------------+      +-------------------+   |
- *  |  FrameLoader 2   |      | PartialSHistory 2 |   |
- *  |    (inactive)    |----->|    (inactive)     |<--+
- *  +------------------+      +-------------------+   |
- *                                                    |
- *  +------------------+      +-------------------+   |
- *  |  FrameLoader 3   |      | PartialSHistory 3 |   |
- *  |    (inactive)    |----->|    (inactive)     |<--+
- *  +------------------+      +-------------------+
- *
- * If a history navigation leads to frameloader 3, it becomes the active one,
- * and GroupedSHistory is re-attached to frameloader 3.
- *
- *  +------------------+      +-------------------+
- *  |  FrameLoader 1   |      | PartialSHistory 1 |
- *  |    (inactive)    |----->|    (inactive)     |<--+
- *  +------------------+      +-------------------+   |
- *                                                    |
- *  +------------------+      +-------------------+   |
- *  |  FrameLoader 2   |      | PartialSHistory 2 |   |
- *  |    (inactive)    |----->|    (inactive)     |<--+
- *  +------------------+      +-------------------+   |
- *                                                    |
- *  +------------------+      +-------------------+   |   +-----------------+
- *  |  FrameLoader 3   |      | PartialSHistory 3 |   |   | GroupedSHistory |
- *  |     (active)     |----->|     (active)      |<--+---|                 |
- *  +------------------+      +-------------------+       +-----------------+
- *            |                                                    ^
- *            |                                                    |
- *            +----------------------------------------------------+
- */
-class GroupedSHistory final : public nsIGroupedSHistory
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS(GroupedSHistory)
-  NS_DECL_NSIGROUPEDSHISTORY
-  GroupedSHistory();
-
-  /**
-   * Get the value of preference "browser.groupedhistory.enabled" to determine
-   * if grouped session history should be enabled.
-   */
-  static bool GroupedHistoryEnabled();
-
-private:
-  ~GroupedSHistory() {}
-
-  /**
-   * Remove all partial histories and close tabs after the given index (of
-   * mPartialHistories, not the index of session history entries).
-   */
-  void PurgePartialHistories(uint32_t aLastPartialIndexToKeep);
-
-  /**
-   * Remove the frameloaders which are owned by the prerendering history, and
-   * remove them from mPrerenderingHistories.
-   */
-  void PurgePrerendering();
-
-  // The total number of entries in all partial histories.
-  uint32_t mCount;
-
-  // The index of currently active partial history in mPartialHistories.
-  // Use int32_t as we have invalid index and nsCOMArray also uses int32_t.
-  int32_t mIndexOfActivePartialHistory;
-
-  // All participating nsIPartialSHistory objects.
-  nsCOMArray<nsIPartialSHistory> mPartialHistories;
-
-  // All nsIPartialSHistories which are being prerendered.
-  struct PrerenderingHistory
-  {
-    nsCOMPtr<nsIPartialSHistory> mPartialHistory;
-    int32_t mId;
-  };
-  nsTArray<PrerenderingHistory> mPrerenderingHistories;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif /* GroupedSHistory_h */
--- a/dom/base/Link.cpp
+++ b/dom/base/Link.cpp
@@ -183,24 +183,16 @@ Link::TryDNSPrefetchOrPreconnectOrPrefet
     nsCOMPtr<nsIURI> uri(GetURI());
     if (uri && mElement->OwnerDoc()) {
       mElement->OwnerDoc()->MaybePreconnect(uri,
         mElement->AttrValueToCORSMode(mElement->GetParsedAttr(nsGkAtoms::crossorigin)));
       return;
     }
   }
 
-  if (linkTypes & nsStyleLinkElement::ePRERENDER) {
-    nsCOMPtr<nsIURI> uri(GetURI());
-    if (uri && mElement->OwnerDoc()) {
-      mElement->OwnerDoc()->PrerenderHref(uri);
-      return;
-    }
-  }
-
   if (linkTypes & nsStyleLinkElement::eDNS_PREFETCH) {
     if (nsHTMLDNSPrefetch::IsAllowed(mElement->OwnerDoc())) {
       nsHTMLDNSPrefetch::PrefetchLow(this);
     }
   }
 }
 
 void
deleted file mode 100644
--- a/dom/base/PartialSHistory.cpp
+++ /dev/null
@@ -1,359 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "PartialSHistory.h"
-
-#include "nsIWebNavigation.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION(PartialSHistory, mOwnerFrameLoader, mGroupedSHistory)
-NS_IMPL_CYCLE_COLLECTING_ADDREF(PartialSHistory)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(PartialSHistory)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PartialSHistory)
-  NS_INTERFACE_MAP_ENTRY(nsIPartialSHistory)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIPartialSHistory)
-  NS_INTERFACE_MAP_ENTRY(nsISHistoryListener)
-  NS_INTERFACE_MAP_ENTRY(nsIPartialSHistoryListener)
-  NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
-NS_INTERFACE_MAP_END
-
-PartialSHistory::PartialSHistory(nsIFrameLoader* aOwnerFrameLoader)
-  : mCount(0),
-    mGlobalIndexOffset(0),
-    mActive(nsIPartialSHistory::STATE_ACTIVE),
-    mOwnerFrameLoader(aOwnerFrameLoader)
-{
-  MOZ_ASSERT(aOwnerFrameLoader);
-}
-
-already_AddRefed<nsISHistory>
-PartialSHistory::GetSessionHistory()
-{
-  if (!mOwnerFrameLoader) {
-    // Cycle collected?
-    return nullptr;
-  }
-
-  nsCOMPtr<nsIDocShell> docShell;
-  mOwnerFrameLoader->GetDocShell(getter_AddRefs(docShell));
-  if (!docShell) {
-    return nullptr;
-  }
-
-  nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(docShell));
-  nsCOMPtr<nsISHistory> shistory;
-  webNav->GetSessionHistory(getter_AddRefs(shistory));
-  return shistory.forget();
-}
-
-already_AddRefed<TabParent>
-PartialSHistory::GetTabParent()
-{
-  if (!mOwnerFrameLoader) {
-    // Cycle collected?
-    return nullptr;
-  }
-
-  nsCOMPtr<nsITabParent> tabParent;
-  mOwnerFrameLoader->GetTabParent(getter_AddRefs(tabParent));
-  return RefPtr<TabParent>(static_cast<TabParent*>(tabParent.get())).forget();
-}
-
-NS_IMETHODIMP
-PartialSHistory::GetCount(uint32_t* aResult)
-{
-  if (!aResult) {
-    return NS_ERROR_INVALID_POINTER;
-  }
-
-  // If we have direct reference to nsISHistory, simply pass through.
-  nsCOMPtr<nsISHistory> shistory(GetSessionHistory());
-  if (shistory) {
-    int32_t count;
-    nsresult rv = shistory->GetCount(&count);
-    if (NS_FAILED(rv) || count < 0) {
-      *aResult = 0;
-      return NS_ERROR_FAILURE;
-    }
-    *aResult = count;
-    return NS_OK;
-  }
-
-  // Otherwise use the cached value.
-  *aResult = mCount;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PartialSHistory::GetGlobalIndex(int32_t* aResult)
-{
-  if (!aResult) {
-    return NS_ERROR_INVALID_POINTER;
-  }
-
-  nsCOMPtr<nsISHistory> shistory = GetSessionHistory();
-  if (shistory) {
-    int32_t idx;
-    nsresult rv = shistory->GetIndex(&idx);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    *aResult = idx + GetGlobalIndexOffset();
-    return NS_OK;
-  }
-
-  *aResult = mIndex + GetGlobalIndexOffset();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PartialSHistory::GetGlobalIndexOffset(uint32_t* aResult)
-{
-  if (!aResult) {
-    return NS_ERROR_INVALID_POINTER;
-  }
-
-  // If we have direct reference to nsISHistory, simply pass through.
-  nsCOMPtr<nsISHistory> shistory(GetSessionHistory());
-  if (shistory) {
-    int32_t offset;
-    nsresult rv = shistory->GetGlobalIndexOffset(&offset);
-    if (NS_FAILED(rv) || offset < 0) {
-      *aResult = 0;
-      return NS_ERROR_FAILURE;
-    }
-    *aResult = offset;
-    return NS_OK;
-  }
-
-  // Otherwise use the cached value.
-  *aResult = mGlobalIndexOffset;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PartialSHistory::GetOwnerFrameLoader(nsIFrameLoader** aResult)
-{
-  nsCOMPtr<nsIFrameLoader> loader(mOwnerFrameLoader);
-  loader.forget(aResult);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PartialSHistory::OnAttachGroupedSHistory(nsIGroupedSHistory* aGroup, uint32_t aOffset)
-{
-  MOZ_ASSERT(!mGroupedSHistory, "Only may join a single GroupedSHistory");
-
-  mActive = nsIPartialSHistory::STATE_ACTIVE;
-  mGlobalIndexOffset = aOffset;
-  mGroupedSHistory = aGroup;
-
-  // If we have direct reference to nsISHistory, simply pass through.
-  nsCOMPtr<nsISHistory> shistory(GetSessionHistory());
-  if (shistory) {
-    // nsISHistory uses int32_t
-    if (aOffset > INT32_MAX) {
-      return NS_ERROR_FAILURE;
-    }
-    return shistory->OnAttachGroupedSHistory(aOffset);
-  }
-
-  // Otherwise notify through TabParent.
-  RefPtr<TabParent> tabParent(GetTabParent());
-  if (!tabParent) {
-    // We have neither shistory nor tabParent?
-    NS_WARNING("Unable to get shitory nor tabParent!");
-    return NS_ERROR_UNEXPECTED;
-  }
-  Unused << tabParent->SendNotifyAttachGroupedSHistory(aOffset);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PartialSHistory::HandleSHistoryUpdate(uint32_t aCount, uint32_t aIndex, bool aTruncate)
-{
-  // Update our local cache of mCount and mIndex
-  mCount = aCount;
-  mIndex = aIndex;
-  return SHistoryDidUpdate(aTruncate);
-}
-
-nsresult
-PartialSHistory::SHistoryDidUpdate(bool aTruncate /* = false */)
-{
-  if (!mOwnerFrameLoader) {
-    // Cycle collected?
-    return NS_ERROR_UNEXPECTED;
-  }
-
-  if (!mGroupedSHistory) {
-    // It's OK if we don't have a grouped history, that just means that we
-    // aren't in a grouped shistory, so we don't need to do anything.
-    return NS_OK;
-  }
-
-  mGroupedSHistory->HandleSHistoryUpdate(this, aTruncate);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PartialSHistory::OnActive(uint32_t aGlobalLength, uint32_t aTargetLocalIndex)
-{
-  MOZ_ASSERT(mGroupedSHistory);
-
-  mActive = nsIPartialSHistory::STATE_ACTIVE;
-
-  // In-process case.
-  nsCOMPtr<nsISHistory> shistory(GetSessionHistory());
-  if (shistory) {
-    // nsISHistory uses int32_t
-    if (aGlobalLength > INT32_MAX || aTargetLocalIndex > INT32_MAX) {
-      return NS_ERROR_FAILURE;
-    }
-    return shistory->OnPartialSHistoryActive(aGlobalLength, aTargetLocalIndex);
-  }
-
-  // Cross-process case.
-  RefPtr<TabParent> tabParent(GetTabParent());
-  if (!tabParent) {
-    // We have neither shistory nor tabParent?
-    NS_WARNING("Unable to get shitory nor tabParent!");
-    return NS_ERROR_UNEXPECTED;
-  }
-  Unused << tabParent->SendNotifyPartialSHistoryActive(aGlobalLength,
-                                                       aTargetLocalIndex);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PartialSHistory::OnDeactive()
-{
-  MOZ_ASSERT(mGroupedSHistory);
-
-  mActive = nsIPartialSHistory::STATE_INACTIVE;
-
-  // In-process case.
-  nsCOMPtr<nsISHistory> shistory(GetSessionHistory());
-  if (shistory) {
-    if (NS_FAILED(shistory->OnPartialSHistoryDeactive())) {
-      return NS_ERROR_FAILURE;
-    }
-    return NS_OK;
-  }
-
-  // Cross-process case.
-  RefPtr<TabParent> tabParent(GetTabParent());
-  if (!tabParent) {
-    // We have neither shistory nor tabParent?
-    NS_WARNING("Unable to get shitory nor tabParent!");
-    return NS_ERROR_UNEXPECTED;
-  }
-  Unused << tabParent->SendNotifyPartialSHistoryDeactive();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PartialSHistory::GetActiveState(int32_t* aActive)
-{
-  *aActive = mActive;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PartialSHistory::SetActiveState(int32_t aActive)
-{
-  mActive = aActive;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PartialSHistory::GetGroupedSHistory(nsIGroupedSHistory** aGrouped)
-{
-  nsCOMPtr<nsIGroupedSHistory> shistory = mGroupedSHistory;
-  shistory.forget(aGrouped);
-  return NS_OK;
-}
-
-/*******************************************************************************
- * nsIPartialSHistoryListener
- ******************************************************************************/
-
-NS_IMETHODIMP
-PartialSHistory::OnRequestCrossBrowserNavigation(uint32_t aIndex)
-{
-  if (!mOwnerFrameLoader) {
-    // Cycle collected?
-    return NS_ERROR_UNEXPECTED;
-  }
-
-  nsCOMPtr<nsISupports> promise;
-  return mOwnerFrameLoader->RequestGroupedHistoryNavigation(aIndex, getter_AddRefs(promise));
-}
-
-/*******************************************************************************
- * nsISHistoryListener
- ******************************************************************************/
-
-NS_IMETHODIMP
-PartialSHistory::OnLengthChanged(int32_t aCount)
-{
-  return SHistoryDidUpdate(/* aTruncate = */ true);
-}
-
-NS_IMETHODIMP
-PartialSHistory::OnIndexChanged(int32_t aIndex)
-{
-  return SHistoryDidUpdate(/* aTruncate = */ false);
-}
-
-NS_IMETHODIMP
-PartialSHistory::OnHistoryNewEntry(nsIURI *aNewURI, int32_t aOldIndex)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-PartialSHistory::OnHistoryGoBack(nsIURI *aBackURI, bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-PartialSHistory::OnHistoryGoForward(nsIURI *aForwardURI, bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-PartialSHistory::OnHistoryReload(nsIURI *aReloadURI, uint32_t aReloadFlags, bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-PartialSHistory::OnHistoryGotoIndex(int32_t aIndex, nsIURI *aGotoURI, bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-PartialSHistory::OnHistoryPurge(int32_t aNumEntries, bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-PartialSHistory::OnHistoryReplaceEntry(int32_t aIndex)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/base/PartialSHistory.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef PartialSHistory_h
-#define PartialSHistory_h
-
-#include "nsCycleCollectionParticipant.h"
-#include "nsFrameLoader.h"
-#include "nsIGroupedSHistory.h"
-#include "nsIPartialSHistoryListener.h"
-#include "nsIPartialSHistory.h"
-#include "nsISHistory.h"
-#include "nsISHistoryListener.h"
-#include "TabParent.h"
-
-namespace mozilla {
-namespace dom {
-
-class PartialSHistory final : public nsIPartialSHistory,
-                              public nsISHistoryListener,
-                              public nsIPartialSHistoryListener,
-                              public nsSupportsWeakReference
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(PartialSHistory, nsIPartialSHistory)
-  NS_DECL_NSIPARTIALSHISTORY
-  NS_DECL_NSIPARTIALSHISTORYLISTENER
-  NS_DECL_NSISHISTORYLISTENER
-
-  /**
-   * Note that PartialSHistory must be constructed after frameloader has
-   * created a valid docshell or tabparent.
-   */
-  explicit PartialSHistory(nsIFrameLoader* aOwnerFrameLoader);
-
-private:
-  ~PartialSHistory() {}
-  already_AddRefed<nsISHistory> GetSessionHistory();
-  already_AddRefed<TabParent> GetTabParent();
-
-  nsresult SHistoryDidUpdate(bool aTruncate = false);
-
-  // The cache of number of entries in corresponding nsISHistory. It's only
-  // used for remote process case. If nsISHistory is in-process, mCount will not
-  // be used at all.
-  uint32_t mCount;
-
-  // The current local index of the active document in this partial SHistory.
-  uint32_t mIndex;
-
-  // The cache of globalIndexOffset in corresponding nsISHistory. It's only
-  // used for remote process case.
-  uint32_t mGlobalIndexOffset;
-
-  // One of the possible active states from nsIPartialSHistory
-  int32_t mActive;
-
-  // The frameloader which owns this PartialSHistory.
-  nsCOMPtr<nsIFrameLoader> mOwnerFrameLoader;
-
-  // The GroupedSHistory which this PartialSHistory is part of, or null.
-  nsCOMPtr<nsIGroupedSHistory> mGroupedSHistory;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif /* PartialSHistory_h */
--- a/dom/base/WebKitCSSMatrix.cpp
+++ b/dom/base/WebKitCSSMatrix.cpp
@@ -6,16 +6,17 @@
 
 #include "mozilla/dom/WebKitCSSMatrix.h"
 
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/WebKitCSSMatrixBinding.h"
 #include "mozilla/Preferences.h"
 #include "nsPresContext.h"
 #include "RuleNodeCacheConditions.h"
+#include "nsGlobalWindowInner.h"
 
 namespace mozilla {
 namespace dom {
 
 static const double sRadPerDegree = 2.0 * M_PI / 360.0;
 
 static bool
 IsStyledByServo(JSContext* aContext)
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -180,31 +180,29 @@ EXPORTS.mozilla.dom += [
     'DOMStringList.h',
     'DOMTokenListSupportedTokens.h',
     'Element.h',
     'ElementInlines.h',
     'EventSource.h',
     'FormData.h',
     'FragmentOrElement.h',
     'FromParser.h',
-    'GroupedSHistory.h',
     'IdleDeadline.h',
     'IdleRequest.h',
     'IDTracker.h',
     'ImageEncoder.h',
     'ImageTracker.h',
     'IntlUtils.h',
     'Link.h',
     'Location.h',
     'NameSpaceConstants.h',
     'Navigator.h',
     'NodeInfo.h',
     'NodeInfoInlines.h',
     'NodeIterator.h',
-    'PartialSHistory.h',
     'Pose.h',
     'ProcessGlobal.h',
     'ResponsiveImageSelector.h',
     'SameProcessMessageQueue.h',
     'ScreenOrientation.h',
     'Selection.h',
     'ShadowRoot.h',
     'StructuredCloneBlob.h',
@@ -256,17 +254,16 @@ UNIFIED_SOURCES += [
     'DOMQuad.cpp',
     'DOMRect.cpp',
     'DOMRequest.cpp',
     'DOMStringList.cpp',
     'Element.cpp',
     'EventSource.cpp',
     'FormData.cpp',
     'FragmentOrElement.cpp',
-    'GroupedSHistory.cpp',
     'IdleDeadline.cpp',
     'IdleRequest.cpp',
     'IDTracker.cpp',
     'ImageEncoder.cpp',
     'ImageTracker.cpp',
     'IntlUtils.cpp',
     'Link.cpp',
     'Location.cpp',
@@ -338,17 +335,16 @@ UNIFIED_SOURCES += [
     'nsTreeSanitizer.cpp',
     'nsViewportInfo.cpp',
     'nsWindowMemoryReporter.cpp',
     'nsWindowRoot.cpp',
     'nsWrapperCache.cpp',
     'nsXHTMLContentSerializer.cpp',
     'nsXMLContentSerializer.cpp',
     'nsXMLNameSpaceMap.cpp',
-    'PartialSHistory.cpp',
     'Pose.cpp',
     'PostMessageEvent.cpp',
     'ProcessGlobal.cpp',
     'ResponsiveImageSelector.cpp',
     'SameProcessMessageQueue.cpp',
     'ScreenOrientation.cpp',
     'Selection.cpp',
     'SelectionChangeListener.cpp',
--- a/dom/base/nsContentSink.cpp
+++ b/dom/base/nsContentSink.cpp
@@ -725,24 +725,16 @@ nsContentSink::ProcessLinkFromHeader(con
   if (nsContentUtils::PrefetchPreloadEnabled(mDocShell)) {
     // prefetch href if relation is "next" or "prefetch"
     if ((linkTypes & nsStyleLinkElement::eNEXT) ||
         (linkTypes & nsStyleLinkElement::ePREFETCH) ||
         (linkTypes & nsStyleLinkElement::ePRELOAD)) {
       PrefetchPreloadHref(aHref, mDocument, linkTypes, aAs, aType, aMedia);
     }
 
-    if (linkTypes & nsStyleLinkElement::ePRERENDER) {
-      nsCOMPtr<nsIURI> href;
-      nsresult rv = NS_NewURI(getter_AddRefs(href), aHref);
-      if (NS_SUCCEEDED(rv)) {
-        mDocument->PrerenderHref(href);
-      }
-    }
-
     if (!aHref.IsEmpty() && (linkTypes & nsStyleLinkElement::eDNS_PREFETCH)) {
       PrefetchDNS(aHref);
     }
 
     if (!aHref.IsEmpty() && (linkTypes & nsStyleLinkElement::ePRECONNECT)) {
       Preconnect(aHref, aCrossOrigin);
     }
   }
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3318,88 +3318,16 @@ nsIDocument::NoteScriptTrackingStatus(co
 }
 
 bool
 nsIDocument::IsScriptTracking(const nsACString& aURL) const
 {
   return mTrackingScripts.Contains(aURL);
 }
 
-bool
-nsIDocument::PrerenderHref(nsIURI* aHref)
-{
-  MOZ_ASSERT(aHref);
-
-  static bool sPrerenderEnabled = false;
-  static bool sPrerenderPrefCached = false;
-  if (!sPrerenderPrefCached) {
-    sPrerenderPrefCached = true;
-    Preferences::AddBoolVarCache(&sPrerenderEnabled,
-                                 "dom.linkPrerender.enabled",
-                                 false);
-  }
-
-  // Check if prerender is enabled
-  if (!sPrerenderEnabled) {
-    return false;
-  }
-
-  nsCOMPtr<nsIURI> referrer = GetDocumentURI();
-  bool urisMatch = false;
-  aHref->EqualsExceptRef(referrer, &urisMatch);
-  if (urisMatch) {
-    // Prerender current document isn't quite meaningful, and we may not be able
-    // to load it out of process.
-    return false;
-  }
-
-  nsCOMPtr<nsIDocShell> docShell = GetDocShell();
-  nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(docShell);
-  NS_ENSURE_TRUE(webNav, false);
-
-  bool canGoForward = false;
-  nsresult rv = webNav->GetCanGoForward(&canGoForward);
-  if (NS_FAILED(rv) || canGoForward) {
-    // Skip prerender on history navigation as we don't support it yet.
-    // Remove this check once bug 1323650 is implemented.
-    return false;
-  }
-
-  // Check if the document is in prerender state. We don't prerender in a
-  // prerendered document.
-  if (docShell->GetIsPrerendered()) {
-    return false;
-  }
-
-  // We currently do not support prerendering in documents loaded within the
-  // chrome process.
-  if (!XRE_IsContentProcess()) {
-    return false;
-  }
-
-  // Adopting an prerendered document is similar to performing a load within a
-  // different docshell, as the prerendering must have occurred in a different
-  // docshell.
-  if (!docShell->GetIsOnlyToplevelInTabGroup()) {
-    return false;
-  }
-
-  TabChild* tabChild = TabChild::GetFrom(docShell);
-  NS_ENSURE_TRUE(tabChild, false);
-
-  nsCOMPtr<nsIWebBrowserChrome3> wbc3;
-  tabChild->GetWebBrowserChrome(getter_AddRefs(wbc3));
-  NS_ENSURE_TRUE(wbc3, false);
-
-  rv = wbc3->StartPrerenderingDocument(aHref, referrer, NodePrincipal());
-  NS_ENSURE_SUCCESS(rv, false);
-
-  return true;
-}
-
 NS_IMETHODIMP
 nsDocument::GetApplicationCache(nsIApplicationCache **aApplicationCache)
 {
   NS_IF_ADDREF(*aApplicationCache = mApplicationCache);
 
   return NS_OK;
 }
 
@@ -12350,23 +12278,16 @@ nsDocument::GetVisibilityState() const
   // 1)  Are we in bfcache (!IsVisible())?  If so, nothing else matters.
   // 2)  Do we have an outer window?  If not, we're hidden.  Note that we don't
   //     want to use GetWindow here because it does weird groveling for windows
   //     in some cases.
   // 3)  Is our outer window background?  If so, we're hidden.
   // Otherwise, we're visible.
   if (!IsVisible() || !mWindow || !mWindow->GetOuterWindow() ||
       mWindow->GetOuterWindow()->IsBackground()) {
-
-    // Check if the document is in prerender state.
-    nsCOMPtr<nsIDocShell> docshell = GetDocShell();
-    if (docshell && docshell->GetIsPrerendered()) {
-      return dom::VisibilityState::Prerender;
-    }
-
     return dom::VisibilityState::Hidden;
   }
 
   return dom::VisibilityState::Visible;
 }
 
 /* virtual */ void
 nsDocument::PostVisibilityUpdateEvent()
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -50,18 +50,16 @@
 #include "NullPrincipal.h"
 #include "nsIScriptError.h"
 #include "nsGlobalWindow.h"
 #include "nsPIWindowRoot.h"
 #include "nsLayoutUtils.h"
 #include "nsMappedAttributes.h"
 #include "nsView.h"
 #include "nsBaseWidget.h"
-#include "GroupedSHistory.h"
-#include "PartialSHistory.h"
 #include "nsQueryObject.h"
 
 #include "nsIURI.h"
 #include "nsIURL.h"
 #include "nsNetUtil.h"
 
 #include "nsGkAtoms.h"
 #include "nsNameSpaceManager.h"
@@ -92,19 +90,19 @@
 #include "jsapi.h"
 #include "mozilla/dom/HTMLIFrameElement.h"
 #include "nsSandboxFlags.h"
 #include "mozilla/layers/CompositorBridgeChild.h"
 #include "mozilla/dom/CustomEvent.h"
 
 #include "mozilla/dom/ipc/StructuredCloneData.h"
 #include "mozilla/WebBrowserPersistLocalDocument.h"
-#include "mozilla/dom/GroupedHistoryEvent.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/PromiseNativeHandler.h"
+#include "mozilla/dom/GroupedHistoryEvent.h"
 
 #include "mozilla/dom/HTMLBodyElement.h"
 
 #include "ContentPrincipal.h"
 
 #ifdef XP_WIN
 #include "mozilla/plugins/PPluginWidgetParent.h"
 #include "../plugins/ipc/PluginWidgetParent.h"
@@ -143,18 +141,17 @@ typedef FrameMetrics::ViewID ViewID;
 // of shells can rapidly become huge and run us out of memory.  To solve that,
 // we'd need to re-institute a fixed version of bug 98158.
 #define MAX_DEPTH_CONTENT_FRAMES 10
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsFrameLoader,
                                       mDocShell,
                                       mMessageManager,
                                       mChildMessageManager,
-                                      mOpener,
-                                      mPartialSHistory)
+                                      mOpener)
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsFrameLoader)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsFrameLoader)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsFrameLoader)
   NS_INTERFACE_MAP_ENTRY(nsIFrameLoader)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIFrameLoader)
   NS_INTERFACE_MAP_ENTRY(nsIWebBrowserPersistable)
@@ -165,17 +162,16 @@ nsFrameLoader::nsFrameLoader(Element* aO
   : mOwnerContent(aOwner)
   , mDetachedSubdocFrame(nullptr)
   , mOpener(aOpener)
   , mRemoteBrowser(nullptr)
   , mChildID(0)
   , mJSPluginID(aJSPluginID)
   , mEventMode(EVENT_MODE_NORMAL_DISPATCH)
   , mBrowserChangingProcessBlockers(nullptr)
-  , mIsPrerendered(false)
   , mDepthTooGreat(false)
   , mIsTopLevelContent(false)
   , mDestroyCalled(false)
   , mNeedsAsyncDestroy(false)
   , mInSwap(false)
   , mInShow(false)
   , mHideCalled(false)
   , mNetworkCreated(aNetworkCreated)
@@ -364,145 +360,16 @@ nsFrameLoader::LoadURI(nsIURI* aURI, nsI
   rv = doc->InitializeFrameLoader(this);
   if (NS_FAILED(rv)) {
     mURIToLoad = nullptr;
     mTriggeringPrincipal = nullptr;
   }
   return rv;
 }
 
-void
-nsFrameLoader::SetIsPrerendered(ErrorResult& aRv)
-{
-  nsresult rv = SetIsPrerendered();
-  if (NS_FAILED(rv)) {
-    aRv.Throw(rv);
-  }
-}
-
-NS_IMETHODIMP
-nsFrameLoader::SetIsPrerendered()
-{
-  MOZ_ASSERT(!mDocShell, "Please call SetIsPrerendered before docShell is created");
-  mIsPrerendered = true;
-
-  return NS_OK;
-}
-
-void
-nsFrameLoader::MakePrerenderedLoaderActive(ErrorResult& aRv)
-{
-  nsresult rv = MakePrerenderedLoaderActive();
-  if (NS_FAILED(rv)) {
-    aRv.Throw(rv);
-  }
-}
-
-NS_IMETHODIMP
-nsFrameLoader::MakePrerenderedLoaderActive()
-{
-  MOZ_ASSERT(mIsPrerendered, "This frameloader was not in prerendered mode.");
-
-  mIsPrerendered = false;
-  if (IsRemoteFrame()) {
-    if (!mRemoteBrowser) {
-      NS_WARNING("Missing remote browser.");
-      return NS_ERROR_FAILURE;
-    }
-
-    mRemoteBrowser->SetDocShellIsActive(true);
-  } else {
-    if (!mDocShell) {
-      NS_WARNING("Missing docshell.");
-      return NS_ERROR_FAILURE;
-    }
-
-    nsresult rv = mDocShell->SetIsActive(true);
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
-  return NS_OK;
-}
-
-already_AddRefed<nsIPartialSHistory>
-nsFrameLoader::GetPartialSHistory()
-{
-  nsCOMPtr<nsIPartialSHistory> partialSHistory;
-  MOZ_ALWAYS_SUCCEEDS(GetPartialSHistory(getter_AddRefs(partialSHistory)));
-  return partialSHistory.forget();
-}
-
-NS_IMETHODIMP
-nsFrameLoader::GetPartialSHistory(nsIPartialSHistory** aResult)
-{
-  if (mRemoteBrowser && !mPartialSHistory) {
-    // For remote case we can lazy initialize PartialSHistory since
-    // it doens't need to be registered as a listener to nsISHistory directly.
-    mPartialSHistory = new PartialSHistory(this);
-  }
-
-  nsCOMPtr<nsIPartialSHistory> partialHistory(mPartialSHistory);
-  partialHistory.forget(aResult);
-  return NS_OK;
-}
-
-already_AddRefed<nsIGroupedSHistory>
-nsFrameLoader::EnsureGroupedSHistory(ErrorResult& aRv)
-{
-  nsCOMPtr<nsIGroupedSHistory> result;
-  nsresult rv = EnsureGroupedSHistory(getter_AddRefs(result));
-  if (NS_FAILED(rv)) {
-    aRv.Throw(rv);
-  }
-  return result.forget();
-}
-
-NS_IMETHODIMP
-nsFrameLoader::EnsureGroupedSHistory(nsIGroupedSHistory** aResult)
-{
-  nsCOMPtr<nsIPartialSHistory> partialHistory;
-  GetPartialSHistory(getter_AddRefs(partialHistory));
-  MOZ_ASSERT(partialHistory);
-
-  nsCOMPtr<nsIGroupedSHistory> groupedHistory;
-  partialHistory->GetGroupedSHistory(getter_AddRefs(groupedHistory));
-  if (!groupedHistory) {
-    groupedHistory = new GroupedSHistory();
-    groupedHistory->AppendPartialSHistory(partialHistory);
-
-#ifdef DEBUG
-    nsCOMPtr<nsIGroupedSHistory> test;
-    GetGroupedSHistory(getter_AddRefs(test));
-    MOZ_ASSERT(test == groupedHistory, "GroupedHistory must match");
-#endif
-  }
-
-  groupedHistory.forget(aResult);
-  return NS_OK;
-}
-
-already_AddRefed<nsIGroupedSHistory>
-nsFrameLoader::GetGroupedSHistory()
-{
-  nsCOMPtr<nsIGroupedSHistory> groupedSHistory;
-  MOZ_ALWAYS_SUCCEEDS(GetGroupedSHistory(getter_AddRefs(groupedSHistory)));
-  return groupedSHistory.forget();
-}
-
-NS_IMETHODIMP
-nsFrameLoader::GetGroupedSHistory(nsIGroupedSHistory** aResult)
-{
-  nsCOMPtr<nsIGroupedSHistory> groupedSHistory;
-  if (mPartialSHistory) {
-    mPartialSHistory->GetGroupedSHistory(getter_AddRefs(groupedSHistory));
-  }
-  groupedSHistory.forget(aResult);
-  return NS_OK;
-}
-
 bool
 nsFrameLoader::SwapBrowsersAndNotify(nsFrameLoader* aOther)
 {
   // Cache the owner content before calling SwapBrowsers, which will change
   // these member variables.
   RefPtr<mozilla::dom::Element> primaryContent = mOwnerContent;
   RefPtr<mozilla::dom::Element> secondaryContent = aOther->mOwnerContent;
 
@@ -530,203 +397,16 @@ nsFrameLoader::SwapBrowsersAndNotify(nsF
                                      eventInit);
   event->SetTrusted(true);
   bool dummy;
   primaryContent->DispatchEvent(event, &dummy);
 
   return true;
 }
 
-class AppendPartialSHistoryAndSwapHelper : public PromiseNativeHandler
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS(AppendPartialSHistoryAndSwapHelper)
-
-  AppendPartialSHistoryAndSwapHelper(nsFrameLoader* aThis,
-                                     nsFrameLoader* aOther,
-                                     Promise* aPromise)
-    : mThis(aThis), mOther(aOther), mPromise(aPromise) {}
-
-  void
-  ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) override
-  {
-    nsCOMPtr<nsIGroupedSHistory> otherGroupedHistory;
-    mOther->GetGroupedSHistory(getter_AddRefs(otherGroupedHistory));
-    MOZ_ASSERT(!otherGroupedHistory,
-               "Cannot append a GroupedSHistory owner to another.");
-    if (otherGroupedHistory) {
-      mPromise->MaybeRejectWithUndefined();
-      return;
-    }
-
-    // Append ourselves.
-    nsresult rv;
-    nsCOMPtr<nsIGroupedSHistory> groupedSHistory;
-    rv = mThis->EnsureGroupedSHistory(getter_AddRefs(groupedSHistory));
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      mPromise->MaybeRejectWithUndefined();
-      return;
-    }
-
-    // Append the other.
-    nsCOMPtr<nsIPartialSHistory> otherPartialSHistory;
-    MOZ_ALWAYS_SUCCEEDS(mOther->GetPartialSHistory(getter_AddRefs(otherPartialSHistory)));
-    rv = groupedSHistory->AppendPartialSHistory(otherPartialSHistory);
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      mPromise->MaybeRejectWithUndefined();
-      return;
-    }
-
-    // Swap the browsers and fire the BrowserChangedProcess event.
-    if (mThis->SwapBrowsersAndNotify(mOther)) {
-      mPromise->MaybeResolveWithUndefined();
-    } else {
-      mPromise->MaybeRejectWithUndefined();
-    }
-  }
-
-  void
-  RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) override
-  {
-    mPromise->MaybeRejectWithUndefined();
-  }
-
-private:
-  ~AppendPartialSHistoryAndSwapHelper() {}
-  RefPtr<nsFrameLoader> mThis;
-  RefPtr<nsFrameLoader> mOther;
-  RefPtr<Promise> mPromise;
-};
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(AppendPartialSHistoryAndSwapHelper)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(AppendPartialSHistoryAndSwapHelper)
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AppendPartialSHistoryAndSwapHelper)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-NS_IMPL_CYCLE_COLLECTION(AppendPartialSHistoryAndSwapHelper,
-                         mThis, mPromise)
-
-class RequestGroupedHistoryNavigationHelper : public PromiseNativeHandler
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS(RequestGroupedHistoryNavigationHelper)
-
-  RequestGroupedHistoryNavigationHelper(nsFrameLoader* aThis,
-                                        uint32_t aGlobalIndex,
-                                        Promise* aPromise)
-    : mThis(aThis), mGlobalIndex(aGlobalIndex), mPromise(aPromise) {}
-
-  void
-  ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) override
-  {
-    if (NS_WARN_IF(!mThis->mOwnerContent)) {
-      mPromise->MaybeRejectWithUndefined();
-      return;
-    }
-
-    nsCOMPtr<nsIGroupedSHistory> groupedSHistory;
-    mThis->GetGroupedSHistory(getter_AddRefs(groupedSHistory));
-    if (NS_WARN_IF(!groupedSHistory)) {
-      mPromise->MaybeRejectWithUndefined();
-      return;
-    }
-
-    // Navigate the loader to the new index
-    nsCOMPtr<nsIFrameLoader> otherLoader;
-    nsresult rv = groupedSHistory->GotoIndex(mGlobalIndex, getter_AddRefs(otherLoader));
-
-    // Check if the gotoIndex failed because the target frameloader is dead. We
-    // need to perform a navigateAndRestoreByIndex and then return to recover.
-    if (rv == NS_ERROR_NOT_AVAILABLE) {
-      // Get the nsIXULBrowserWindow so that we can call NavigateAndRestoreByIndex on it.
-      nsCOMPtr<nsIDocShell> docShell = mThis->mOwnerContent->OwnerDoc()->GetDocShell();
-      if (NS_WARN_IF(!docShell)) {
-        mPromise->MaybeRejectWithUndefined();
-        return;
-      }
-
-      nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
-      docShell->GetTreeOwner(getter_AddRefs(treeOwner));
-      if (NS_WARN_IF(!treeOwner)) {
-        mPromise->MaybeRejectWithUndefined();
-        return;
-      }
-
-      nsCOMPtr<nsIXULWindow> window = do_GetInterface(treeOwner);
-      if (NS_WARN_IF(!window)) {
-        mPromise->MaybeRejectWithUndefined();
-        return;
-      }
-
-      nsCOMPtr<nsIXULBrowserWindow> xbw;
-      window->GetXULBrowserWindow(getter_AddRefs(xbw));
-      if (NS_WARN_IF(!xbw)) {
-        mPromise->MaybeRejectWithUndefined();
-        return;
-      }
-
-      nsCOMPtr<nsIBrowser> ourBrowser = do_QueryInterface(mThis->mOwnerContent);
-      if (NS_WARN_IF(!ourBrowser)) {
-        mPromise->MaybeRejectWithUndefined();
-        return;
-      }
-
-      rv = xbw->NavigateAndRestoreByIndex(ourBrowser, mGlobalIndex);
-      if (NS_WARN_IF(NS_FAILED(rv))) {
-        mPromise->MaybeRejectWithUndefined();
-        return;
-      }
-      mPromise->MaybeResolveWithUndefined();
-      return;
-    }
-
-    // Check for any other type of failure
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      mPromise->MaybeRejectWithUndefined();
-      return;
-    }
-
-    // Perform the swap.
-    nsFrameLoader* other = static_cast<nsFrameLoader*>(otherLoader.get());
-    if (!other || other == mThis) {
-      mPromise->MaybeRejectWithUndefined();
-      return;
-    }
-
-    // Swap the browsers and fire the BrowserChangedProcess event.
-    if (mThis->SwapBrowsersAndNotify(other)) {
-      mPromise->MaybeResolveWithUndefined();
-    } else {
-      mPromise->MaybeRejectWithUndefined();
-    }
-  }
-
-  void
-  RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) override
-  {
-    mPromise->MaybeRejectWithUndefined();
-  }
-
-private:
-  ~RequestGroupedHistoryNavigationHelper() {}
-  RefPtr<nsFrameLoader> mThis;
-  uint32_t mGlobalIndex;
-  RefPtr<Promise> mPromise;
-};
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(RequestGroupedHistoryNavigationHelper)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(RequestGroupedHistoryNavigationHelper)
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(RequestGroupedHistoryNavigationHelper)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-NS_IMPL_CYCLE_COLLECTION(RequestGroupedHistoryNavigationHelper,
-                         mThis, mPromise)
-
 already_AddRefed<Promise>
 nsFrameLoader::FireWillChangeProcessEvent()
 {
   AutoJSAPI jsapi;
   if (NS_WARN_IF(!jsapi.Init(mOwnerContent->GetOwnerGlobal()))) {
     return nullptr;
   }
   JSContext* cx = jsapi.cx();
@@ -753,104 +433,16 @@ nsFrameLoader::FireWillChangeProcessEven
 
   mBrowserChangingProcessBlockers = nullptr;
 
   ErrorResult rv;
   RefPtr<Promise> allPromise = Promise::All(global, blockers, rv);
   return allPromise.forget();
 }
 
-already_AddRefed<Promise>
-nsFrameLoader::AppendPartialSHistoryAndSwap(nsIFrameLoader& aOther, ErrorResult& aRv)
-{
-  nsresult rv = SetIsPrerendered();
-  if (NS_FAILED(rv)) {
-    aRv.Throw(rv);
-    return nullptr;
-  }
-
-  if (&aOther == this) {
-    return nullptr;
-  }
-
-  RefPtr<nsFrameLoader> otherLoader = static_cast<nsFrameLoader*>(&aOther);
-
-  RefPtr<Promise> ready = FireWillChangeProcessEvent();
-  if (NS_WARN_IF(!ready)) {
-    aRv.Throw(NS_ERROR_FAILURE);
-    return nullptr;
-  }
-
-  // This promise will be resolved when the swap has finished, we return it now
-  // and pass it to our helper so our helper can resolve it.
-  RefPtr<Promise> complete = Promise::Create(mOwnerContent->GetOwnerGlobal(), aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-
-  // Attach our handler to the ready promise, and make it fulfil the complete
-  // promise when we are done.
-  RefPtr<AppendPartialSHistoryAndSwapHelper> helper =
-    new AppendPartialSHistoryAndSwapHelper(this, otherLoader, complete);
-  ready->AppendNativeHandler(helper);
-  return complete.forget();
-}
-
-NS_IMETHODIMP
-nsFrameLoader::AppendPartialSHistoryAndSwap(nsIFrameLoader* aOther, nsISupports** aPromise)
-{
-  if (!aOther) {
-    return NS_ERROR_INVALID_POINTER;
-  }
-
-  ErrorResult rv;
-  RefPtr<Promise> complete = AppendPartialSHistoryAndSwap(*aOther, rv);
-  if (rv.Failed()) {
-    return rv.StealNSResult();
-  }
-  complete.forget(aPromise);
-  return NS_OK;
-}
-
-already_AddRefed<Promise>
-nsFrameLoader::RequestGroupedHistoryNavigation(uint32_t aGlobalIndex, ErrorResult& aRv)
-{
-  RefPtr<Promise> ready = FireWillChangeProcessEvent();
-  if (NS_WARN_IF(!ready)) {
-    aRv.Throw(NS_ERROR_FAILURE);
-    return nullptr;
-  }
-
-  // This promise will be resolved when the swap has finished, we return it now
-  // and pass it to our helper so our helper can resolve it.
-  RefPtr<Promise> complete = Promise::Create(mOwnerContent->GetOwnerGlobal(), aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-
-  // Attach our handler to the ready promise, and make it fulfil the complete
-  // promise when we are done.
-  RefPtr<RequestGroupedHistoryNavigationHelper> helper =
-    new RequestGroupedHistoryNavigationHelper(this, aGlobalIndex, complete);
-  ready->AppendNativeHandler(helper);
-  return complete.forget();
-}
-
-NS_IMETHODIMP
-nsFrameLoader::RequestGroupedHistoryNavigation(uint32_t aGlobalIndex, nsISupports** aPromise)
-{
-  ErrorResult rv;
-  RefPtr<Promise> complete = RequestGroupedHistoryNavigation(aGlobalIndex, rv);
-  if (rv.Failed()) {
-    return rv.StealNSResult();
-  }
-  complete.forget(aPromise);
-  return NS_OK;
-}
-
 void
 nsFrameLoader::AddProcessChangeBlockingPromise(Promise& aPromise, ErrorResult& aRv)
 {
   if (NS_WARN_IF(!mBrowserChangingProcessBlockers)) {
     aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
   } else {
     mBrowserChangingProcessBlockers->AppendElement(&aPromise);
   }
@@ -2217,29 +1809,16 @@ nsFrameLoader::StartDestroy()
   // Let our window know that we are gone
   if (mDocShell) {
     nsCOMPtr<nsPIDOMWindowOuter> win_private(mDocShell->GetWindow());
     if (win_private) {
       win_private->SetFrameElementInternal(nullptr);
     }
   }
 
-  // Destroy the other frame loader owners now that we are being destroyed.
-  if (mPartialSHistory &&
-      mPartialSHistory->GetActiveState() == nsIPartialSHistory::STATE_ACTIVE) {
-    nsCOMPtr<nsIGroupedSHistory> groupedSHistory;
-    GetGroupedSHistory(getter_AddRefs(groupedSHistory));
-    if (groupedSHistory) {
-      NS_DispatchToCurrentThread(NS_NewRunnableFunction(
-        "nsFrameLoader::StartDestroy", [groupedSHistory]() {
-          groupedSHistory->CloseInactiveFrameLoaderOwners();
-        }));
-    }
-  }
-
   nsCOMPtr<nsIRunnable> destroyRunnable = new nsFrameLoaderDestroyRunnable(this);
   if (mNeedsAsyncDestroy || !doc ||
       NS_FAILED(doc->FinalizeFrameLoader(this, destroyRunnable))) {
     NS_DispatchToCurrentThread(destroyRunnable);
   }
 }
 
 nsresult
@@ -2512,21 +2091,16 @@ nsFrameLoader::MaybeCreateDocShell()
   nsCOMPtr<nsIDocShell> docShell = doc->GetDocShell();
   nsCOMPtr<nsIWebNavigation> parentAsWebNav = do_QueryInterface(docShell);
   NS_ENSURE_STATE(parentAsWebNav);
 
   // Create the docshell...
   mDocShell = do_CreateInstance("@mozilla.org/docshell;1");
   NS_ENSURE_TRUE(mDocShell, NS_ERROR_FAILURE);
 
-  if (mIsPrerendered) {
-    nsresult rv = mDocShell->SetIsPrerendered();
-    NS_ENSURE_SUCCESS(rv,rv);
-  }
-
   if (!mNetworkCreated) {
     if (mDocShell) {
       mDocShell->SetCreatedDynamically(true);
     }
   }
 
   // Get the frame name and tell the docshell about it.
   NS_ENSURE_TRUE(mDocShell, NS_ERROR_FAILURE);
@@ -2621,25 +2195,16 @@ nsFrameLoader::MaybeCreateDocShell()
       !mOwnerContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disablehistory)) {
     nsresult rv;
     nsCOMPtr<nsISHistory> sessionHistory =
       do_CreateInstance(NS_SHISTORY_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(mDocShell));
     webNav->SetSessionHistory(sessionHistory);
-
-
-    if (GroupedSHistory::GroupedHistoryEnabled()) {
-      mPartialSHistory = new PartialSHistory(this);
-      nsCOMPtr<nsISHistoryListener> listener(do_QueryInterface(mPartialSHistory));
-      nsCOMPtr<nsIPartialSHistoryListener> partialListener(do_QueryInterface(mPartialSHistory));
-      sessionHistory->AddSHistoryListener(listener);
-      sessionHistory->SetPartialSHistoryListener(partialListener);
-    }
   }
 
   OriginAttributes attrs;
   if (docShell->ItemType() == mDocShell->ItemType()) {
     attrs = nsDocShell::Cast(docShell)->GetOriginAttributes();
   }
 
   // Inherit origin attributes from parent document if
@@ -4041,17 +3606,16 @@ nsFrameLoader::GetNewTabContext(MutableT
         root->ShowAccelerators() ? UIStateChangeType_Set : UIStateChangeType_Clear;
       showFocusRings =
         root->ShowFocusRings() ? UIStateChangeType_Set : UIStateChangeType_Clear;
     }
   }
 
   bool tabContextUpdated =
     aTabContext->SetTabContext(OwnerIsMozBrowserFrame(),
-                               mIsPrerendered,
                                showAccelerators,
                                showFocusRings,
                                attrs,
                                presentationURLStr);
   NS_ENSURE_STATE(tabContextUpdated);
 
   return NS_OK;
 }
--- a/dom/base/nsFrameLoader.h
+++ b/dom/base/nsFrameLoader.h
@@ -22,17 +22,16 @@
 #include "nsFrameMessageManager.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/Attributes.h"
 #include "nsStubMutationObserver.h"
 #include "Units.h"
 #include "nsIWebBrowserPersistable.h"
 #include "nsIFrame.h"
-#include "nsIGroupedSHistory.h"
 #include "nsPluginTags.h"
 
 class nsIURI;
 class nsSubDocumentFrame;
 class nsView;
 class nsIInProcessContentFrameMessageManager;
 class AutoResetInShow;
 class AutoResetInFrameSwap;
@@ -69,18 +68,16 @@ typedef struct _GtkWidget GtkWidget;
 class nsFrameLoader final : public nsIFrameLoader,
                             public nsIWebBrowserPersistable,
                             public nsStubMutationObserver,
                             public mozilla::dom::ipc::MessageManagerCallback,
                             public nsWrapperCache
 {
   friend class AutoResetInShow;
   friend class AutoResetInFrameSwap;
-  friend class AppendPartialSHistoryAndSwapHelper;
-  friend class RequestGroupedHistoryNavigationHelper;
   typedef mozilla::dom::PBrowserParent PBrowserParent;
   typedef mozilla::dom::TabParent TabParent;
   typedef mozilla::layout::RenderFrameParent RenderFrameParent;
 
 public:
   static nsFrameLoader* Create(mozilla::dom::Element* aOwner,
                                nsPIDOMWindowOuter* aOpener,
                                bool aNetworkCreated,
@@ -119,26 +116,16 @@ public:
    * @param aURI The URI to load.
    * @param aTriggeringPrincipal The triggering principal for the load. May be
    *        null, in which case the node principal of the owner content will be
    *        used.
    */
   nsresult LoadURI(nsIURI* aURI, nsIPrincipal* aTriggeringPrincipal,
                    bool aOriginalSrc);
 
-  void SetIsPrerendered(mozilla::ErrorResult& aRv);
-
-  void MakePrerenderedLoaderActive(mozilla::ErrorResult& aRv);
-
-  already_AddRefed<mozilla::dom::Promise>
-  AppendPartialSHistoryAndSwap(nsIFrameLoader& aOther, mozilla::ErrorResult& aRv);
-
-  already_AddRefed<mozilla::dom::Promise>
-  RequestGroupedHistoryNavigation(uint32_t aGlobalIndex, mozilla::ErrorResult& aRv);
-
   void AddProcessChangeBlockingPromise(mozilla::dom::Promise& aPromise, mozilla::ErrorResult& aRv);
 
   void Destroy(mozilla::ErrorResult& aRv);
 
   void ActivateRemoteFrame(mozilla::ErrorResult& aRv);
 
   void DeactivateRemoteFrame(mozilla::ErrorResult& aRv);
 
@@ -168,38 +155,32 @@ public:
 
   void RequestUpdatePosition(mozilla::ErrorResult& aRv);
 
   void Print(uint64_t aOuterWindowID,
              nsIPrintSettings* aPrintSettings,
              nsIWebProgressListener* aProgressListener,
              mozilla::ErrorResult& aRv);
 
-  already_AddRefed<nsIGroupedSHistory> EnsureGroupedSHistory(mozilla::ErrorResult& aRv);
-
   void StartPersistence(uint64_t aOuterWindowID,
                         nsIWebBrowserPersistDocumentReceiver* aRecv,
                         mozilla::ErrorResult& aRv);
 
   // WebIDL getters
 
   already_AddRefed<nsIMessageSender> GetMessageManager();
 
   uint32_t EventMode() const { return mEventMode; }
 
   already_AddRefed<Element> GetOwnerElement();
 
   uint32_t LazyWidth() const;
 
   uint32_t LazyHeight() const;
 
-  already_AddRefed<nsIPartialSHistory> GetPartialSHistory();
-
-  already_AddRefed<nsIGroupedSHistory> GetGroupedSHistory();
-
   uint64_t ChildID() const { return mChildID; }
 
   bool ClampScrollPosition() const { return mClampScrollPosition; }
 
   bool ClipSubdocument() const { return mClipSubdocument; }
 
   bool DepthTooGreat() const { return mDepthTooGreat; }
 
@@ -480,23 +461,20 @@ private:
 
   // See nsIFrameLoader.idl. EVENT_MODE_NORMAL_DISPATCH automatically
   // forwards some input events to out-of-process content.
   uint32_t mEventMode;
 
   // Holds the last known size of the frame.
   mozilla::ScreenIntSize mLazySize;
 
-  nsCOMPtr<nsIPartialSHistory> mPartialSHistory;
-
   // A stack-maintained reference to an array of promises which are blocking
   // grouped history navigation
   nsTArray<RefPtr<mozilla::dom::Promise>>* mBrowserChangingProcessBlockers;
 
-  bool mIsPrerendered : 1;
   bool mDepthTooGreat : 1;
   bool mIsTopLevelContent : 1;
   bool mDestroyCalled : 1;
   bool mNeedsAsyncDestroy : 1;
   bool mInSwap : 1;
   bool mInShow : 1;
   bool mHideCalled : 1;
   // True when the object is created for an element which the parser has
--- a/dom/base/nsGkAtomList.h
+++ b/dom/base/nsGkAtomList.h
@@ -1124,17 +1124,16 @@ GK_ATOM(popupsinherittooltip, "popupsinh
 GK_ATOM(position, "position")
 GK_ATOM(poster, "poster")
 GK_ATOM(pre, "pre")
 GK_ATOM(preceding, "preceding")
 GK_ATOM(precedingSibling, "preceding-sibling")
 GK_ATOM(predicate, "predicate")
 GK_ATOM(prefix, "prefix")
 GK_ATOM(preload, "preload")
-GK_ATOM(prerendered, "prerendered")
 GK_ATOM(mozpresentation, "mozpresentation")
 GK_ATOM(preserve, "preserve")
 GK_ATOM(preserveSpace, "preserve-space")
 GK_ATOM(preventdefault, "preventdefault")
 GK_ATOM(primary, "primary")
 GK_ATOM(print, "print")
 GK_ATOM(priority, "priority")
 GK_ATOM(processingInstruction, "processing-instruction")
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -7565,23 +7565,16 @@ nsGlobalWindowInner::ClearDocumentDepend
 /* static */
 JSObject*
 nsGlobalWindowInner::CreateNamedPropertiesObject(JSContext *aCx,
                                                  JS::Handle<JSObject*> aProto)
 {
   return WindowNamedPropertiesHandler::Create(aCx, aProto);
 }
 
-bool
-nsGlobalWindowInner::GetIsPrerendered()
-{
-  nsIDocShell* docShell = GetDocShell();
-  return docShell && docShell->GetIsPrerendered();
-}
-
 void
 nsGlobalWindowInner::RedefineProperty(JSContext* aCx, const char* aPropName,
                                       JS::Handle<JS::Value> aValue,
                                       ErrorResult& aError)
 {
   JS::Rooted<JSObject*> thisObj(aCx, GetWrapperPreserveColor());
   if (!thisObj) {
     aError.Throw(NS_ERROR_UNEXPECTED);
--- a/dom/base/nsGlobalWindowInner.h
+++ b/dom/base/nsGlobalWindowInner.h
@@ -1161,18 +1161,16 @@ public:
 
   // Helper Functions
   already_AddRefed<nsIDocShellTreeOwner> GetTreeOwner();
   already_AddRefed<nsIWebBrowserChrome> GetWebBrowserChrome();
   bool IsPrivateBrowsing();
 
   void FireOfflineStatusEventIfChanged();
 
-  bool GetIsPrerendered();
-
 public:
   // Inner windows only.
   nsresult ScheduleNextIdleObserverCallback();
   uint32_t GetFuzzTimeMS();
   nsresult ScheduleActiveTimerCallback();
   uint32_t FindInsertionIndex(IdleObserverHolder* aIdleObserver);
   virtual nsresult RegisterIdleObserver(nsIIdleObserver* aIdleObserverPtr) override;
   nsresult FindIndexOfElementToRemove(nsIIdleObserver* aIdleObserver,
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -7596,23 +7596,16 @@ nsGlobalWindowOuter::InitWasOffline()
 int16_t
 nsGlobalWindowOuter::Orientation(CallerType aCallerType) const
 {
   return nsContentUtils::ResistFingerprinting(aCallerType) ?
            0 : WindowOrientationObserver::OrientationAngle();
 }
 #endif
 
-bool
-nsGlobalWindowOuter::GetIsPrerendered()
-{
-  nsIDocShell* docShell = GetDocShell();
-  return docShell && docShell->GetIsPrerendered();
-}
-
 void
 nsPIDOMWindowOuter::SetLargeAllocStatus(LargeAllocStatus aStatus)
 {
   MOZ_ASSERT(mLargeAllocStatus == LargeAllocStatus::NONE);
   mLargeAllocStatus = aStatus;
 }
 
 bool
--- a/dom/base/nsGlobalWindowOuter.h
+++ b/dom/base/nsGlobalWindowOuter.h
@@ -903,18 +903,16 @@ public:
   bool IsPrivateBrowsing();
 
   bool PopupWhitelisted();
   PopupControlState RevisePopupAbuseLevel(PopupControlState);
   void     FireAbuseEvents(const nsAString &aPopupURL,
                            const nsAString &aPopupWindowName,
                            const nsAString &aPopupWindowFeatures);
 
-  bool GetIsPrerendered();
-
 private:
   void ReportLargeAllocStatus();
 
 public:
   void FlushPendingNotifications(mozilla::FlushType aType);
 
   // Outer windows only.
   void EnsureReflowFlushAndPaint();
--- a/dom/base/nsHistory.cpp
+++ b/dom/base/nsHistory.cpp
@@ -73,17 +73,17 @@ nsHistory::GetLength(ErrorResult& aRv) c
   nsCOMPtr<nsISHistory> sHistory = GetSessionHistory();
   if (!sHistory) {
     aRv.Throw(NS_ERROR_FAILURE);
 
     return 0;
   }
 
   int32_t len;
-  nsresult rv = sHistory->GetGlobalCount(&len);
+  nsresult rv = sHistory->GetCount(&len);
 
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
 
     return 0;
   }
 
   return len >= 0 ? len : 0;
@@ -205,18 +205,18 @@ nsHistory::Go(int32_t aDelta, ErrorResul
   if (!webnav) {
     aRv.Throw(NS_ERROR_FAILURE);
 
     return;
   }
 
   int32_t curIndex = -1;
   int32_t len = 0;
-  session_history->GetGlobalIndex(&curIndex);
-  session_history->GetGlobalCount(&len);
+  session_history->GetIndex(&curIndex);
+  session_history->GetCount(&len);
 
   int32_t index = curIndex + aDelta;
   if (index > -1 && index < len)
     webnav->GotoIndex(index);
 
   // Ignore the return value from GotoIndex(), since returning errors
   // from GotoIndex() can lead to exceptions and a possible leak
   // of history length
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -3113,18 +3113,16 @@ public:
   AbstractMainThreadFor(mozilla::TaskCategory aCategory) override;
 
   // The URLs passed to these functions should match what
   // JS::DescribeScriptedCaller() returns, since these APIs are used to
   // determine whether some code is being called from a tracking script.
   void NoteScriptTrackingStatus(const nsACString& aURL, bool isTracking);
   bool IsScriptTracking(const nsACString& aURL) const;
 
-  bool PrerenderHref(nsIURI* aHref);
-
   // For more information on Flash classification, see
   // toolkit/components/url-classifier/flash-block-lists.rst
   virtual mozilla::dom::FlashClassification DocumentFlashClassification() = 0;
   virtual bool IsThirdParty() = 0;
 
   bool IsScopedStyleEnabled();
 
   nsINode* GetServoRestyleRoot() const
--- a/dom/base/nsIFrameLoader.idl
+++ b/dom/base/nsIFrameLoader.idl
@@ -12,18 +12,16 @@ interface nsIFrame;
 interface nsSubDocumentFrame;
 interface nsIMessageSender;
 interface nsIVariant;
 interface nsIDOMElement;
 interface nsITabParent;
 interface nsILoadContext;
 interface nsIPrintSettings;
 interface nsIWebProgressListener;
-interface nsIGroupedSHistory;
-interface nsIPartialSHistory;
 
 [builtinclass, uuid(1645af04-1bc7-4363-8f2c-eb9679220ab1)]
 interface nsIFrameLoader : nsISupports
 {
   /**
    * Get the docshell from the frame loader.
    */
   readonly attribute nsIDocShell docShell;
@@ -49,41 +47,16 @@ interface nsIFrameLoader : nsISupports
 
   /**
    * Loads the specified URI in this frame. Behaves identically to loadFrame,
    * except that this method allows specifying the URI to load.
    */
   void loadURI(in nsIURI aURI, in boolean originalSrc);
 
   /**
-   * Puts the frameloader in prerendering mode.
-   */
-  void setIsPrerendered();
-
-  /**
-   * Make the prerendered frameloader being active (and clear isPrerendered flag).
-   */
-  void makePrerenderedLoaderActive();
-
-  /**
-   * Append partial session history from another frame loader.
-   *
-   * @return A promise which will be resolved when the navigation is complete.
-   */
-  nsISupports appendPartialSHistoryAndSwap(in nsIFrameLoader aOther);
-
-  /**
-   * If grouped session history is applied, use this function to navigate to
-   * an entry of session history object of another frameloader.
-   *
-   * @return A promise which will be resolved when the navigation is complete.
-   */
-  nsISupports requestGroupedHistoryNavigation(in unsigned long aGlobalIndex);
-
-  /**
    * Adds a blocking promise for the current cross process navigation.
    * This method can only be called while the "BrowserWillChangeProcess" event
    * is being fired.
    */
   [implicit_jscontext]
   void addProcessChangeBlockingPromise(in jsval aPromise);
 
   /**
@@ -166,21 +139,16 @@ interface nsIFrameLoader : nsISupports
    *                       set to prevent prompting.
    * @param aProgressListener optional print progress listener.
    */
   void print(in unsigned long long aOuterWindowID,
              in nsIPrintSettings aPrintSettings,
              in nsIWebProgressListener aProgressListener);
 
   /**
-   * Ensure that the current nsIFrameLoader has a GroupedSHistory.
-   */
-  nsIGroupedSHistory ensureGroupedSHistory();
-
-  /**
    * The default event mode automatically forwards the events
    * handled in EventStateManager::HandleCrossProcessEvent to
    * the child content process when these events are targeted to
    * the remote browser element.
    *
    * Used primarly for input events (mouse, keyboard)
    */
   const unsigned long EVENT_MODE_NORMAL_DISPATCH = 0x00000000;
@@ -240,27 +208,16 @@ interface nsIFrameLoader : nsISupports
    * The last known height of the frame. Reading this property will not trigger
    * a reflow, and therefore may not reflect the current state of things. It
    * should only be used in asynchronous APIs where values are not guaranteed
    * to be up-to-date when received.
    */
   readonly attribute unsigned long lazyHeight;
 
   /**
-   * The partial session history.
-   */
-  readonly attribute nsIPartialSHistory partialSHistory;
-
-  /**
-   * The grouped session history composed of multiple session history objects
-   * across root docshells.
-   */
-  readonly attribute nsIGroupedSHistory groupedSHistory;
-
-  /**
    * Is `true` if the frameloader is dead (destroy has been called on it)
    */
   [infallible] readonly attribute boolean isDead;
 };
 
 %{C++
 class nsFrameLoader;
 %}
@@ -272,21 +229,16 @@ interface nsIFrameLoaderOwner : nsISuppo
 {
   /**
    * The frame loader owned by this nsIFrameLoaderOwner
    */
   [binaryname(FrameLoaderXPCOM)] readonly attribute nsIFrameLoader frameLoader;
   [noscript, notxpcom] alreadyAddRefed_nsFrameLoader GetFrameLoader();
 
   /**
-   * Puts the FrameLoaderOwner in prerendering mode.
-   */
-  void setIsPrerendered();
-
-  /**
    * This method is used internally by SwapFrameLoaders to set the frame loader
    * on the target nsFrameLoader.
    *
    * Avoid using this method outside of that context, and instead prefer using
    * SwapFrameLoaders.
    */
   [noscript, notxpcom] void
   internalSetFrameLoader(in nsIFrameLoader aNewFrameLoader);
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -1141,22 +1141,16 @@ nsObjectLoadingContent::GetFrameLoader()
 }
 
 void
 nsObjectLoadingContent::PresetOpenerWindow(mozIDOMWindowProxy* aWindow, mozilla::ErrorResult& aRv)
 {
   aRv.Throw(NS_ERROR_FAILURE);
 }
 
-NS_IMETHODIMP
-nsObjectLoadingContent::SetIsPrerendered()
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 void
 nsObjectLoadingContent::InternalSetFrameLoader(nsIFrameLoader* aNewFrameLoader)
 {
   MOZ_CRASH("You shouldn't be calling this function, it doesn't make any sense on this type.");
 }
 
 NS_IMETHODIMP
 nsObjectLoadingContent::GetActualType(nsACString& aType)
--- a/dom/base/nsStyleLinkElement.cpp
+++ b/dom/base/nsStyleLinkElement.cpp
@@ -147,18 +147,16 @@ static uint32_t ToLinkMask(const nsAStri
   else if (aLink.EqualsLiteral("next"))
     return nsStyleLinkElement::eNEXT;
   else if (aLink.EqualsLiteral("alternate"))
     return nsStyleLinkElement::eALTERNATE;
   else if (aLink.EqualsLiteral("preconnect"))
     return nsStyleLinkElement::ePRECONNECT;
   else if (aLink.EqualsLiteral("preload"))
     return nsStyleLinkElement::ePRELOAD;
-  else if (aLink.EqualsLiteral("prerender"))
-    return nsStyleLinkElement::ePRERENDER;
   else
     return 0;
 }
 
 uint32_t nsStyleLinkElement::ParseLinkTypes(const nsAString& aTypes)
 {
   uint32_t linkMask = 0;
   nsAString::const_iterator start, done;
--- a/dom/base/nsStyleLinkElement.h
+++ b/dom/base/nsStyleLinkElement.h
@@ -59,17 +59,17 @@ public:
 
   enum RelValue {
     ePREFETCH =     0x00000001,
     eDNS_PREFETCH = 0x00000002,
     eSTYLESHEET =   0x00000004,
     eNEXT =         0x00000008,
     eALTERNATE =    0x00000010,
     ePRECONNECT =   0x00000020,
-    ePRERENDER =    0x00000040,
+    // NOTE: 0x40 is unused
     ePRELOAD =      0x00000080
   };
 
   // The return value is a bitwise or of 0 or more RelValues.
   static uint32_t ParseLinkTypes(const nsAString& aTypes);
 
   static bool CheckPreloadAttrs(const nsAttrValue& aAs, const nsAString& aType,
                                 const nsAString& aMedia, nsIDocument* aDocument);
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -2867,53 +2867,16 @@ IsNonExposedGlobal(JSContext* aCx, JSObj
   if ((aNonExposedGlobals & GlobalNames::WorkletGlobalScope) &&
       !strcmp(name, "WorkletGlobalScope")) {
     return true;
   }
 
   return false;
 }
 
-void
-HandlePrerenderingViolation(nsPIDOMWindowInner* aWindow)
-{
-  // Freeze the window and its workers, and its children too.
-  aWindow->Freeze();
-
-  // Suspend event handling on the document
-  nsCOMPtr<nsIDocument> doc = aWindow->GetExtantDoc();
-  if (doc) {
-    doc->SuppressEventHandling();
-  }
-}
-
-bool
-EnforceNotInPrerendering(JSContext* aCx, JSObject* aObj)
-{
-  JS::Rooted<JSObject*> thisObj(aCx, js::CheckedUnwrap(aObj));
-  if (!thisObj) {
-    // Without a this object, we cannot check the safety.
-    return true;
-  }
-  nsGlobalWindowInner* window = xpc::WindowGlobalOrNull(thisObj);
-  if (!window) {
-    // Without a window, we cannot check the safety.
-    return true;
-  }
-
-  if (window->GetIsPrerendered()) {
-    HandlePrerenderingViolation(window->AsInner());
-    // When the bindings layer sees a false return value, it returns false form
-    // the JSNative in order to trigger an uncatchable exception.
-    return false;
-  }
-
-  return true;
-}
-
 bool
 GenericBindingGetter(JSContext* cx, unsigned argc, JS::Value* vp)
 {
   JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
   const JSJitInfo *info = FUNCTION_VALUE_TO_JITINFO(args.calleev());
   prototypes::ID protoID = static_cast<prototypes::ID>(info->protoID);
   if (!args.thisv().isObject()) {
     return ThrowInvalidThis(cx, args, false, protoID);
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -3255,31 +3255,16 @@ ConvertExceptionToPromise(JSContext* cx,
                           JS::MutableHandle<JS::Value> rval);
 
 #ifdef DEBUG
 void
 AssertReturnTypeMatchesJitinfo(const JSJitInfo* aJitinfo,
                                JS::Handle<JS::Value> aValue);
 #endif
 
-// This function is called by the bindings layer for methods/getters/setters
-// that are not safe to be called in prerendering mode.  It checks to make sure
-// that the |this| object is not running in a global that is in prerendering
-// mode.  Otherwise, it aborts execution of timers and event handlers, and
-// returns false which gets converted to an uncatchable exception by the
-// bindings layer.
-bool
-EnforceNotInPrerendering(JSContext* aCx, JSObject* aObj);
-
-// Handles the violation of a blacklisted action in prerendering mode by
-// aborting the scripts, and preventing timers and event handlers from running
-// in the window in the future.
-void
-HandlePrerenderingViolation(nsPIDOMWindowInner* aWindow);
-
 bool
 CallerSubsumes(JSObject* aObject);
 
 MOZ_ALWAYS_INLINE bool
 CallerSubsumes(JS::Handle<JS::Value> aValue)
 {
   if (!aValue.isObject()) {
     return true;
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -1741,26 +1741,22 @@ addExternalIface('MozRDFResource', nativ
 addExternalIface('MozTreeView', nativeType='nsITreeView',
                   headerFile='nsITreeView.h', notflattened=True)
 addExternalIface('MozWakeLockListener', headerFile='nsIDOMWakeLockListener.h')
 addExternalIface('nsIBrowserDOMWindow', nativeType='nsIBrowserDOMWindow',
                  notflattened=True)
 addExternalIface('nsIDOMCrypto', nativeType='nsIDOMCrypto',
                  headerFile='Crypto.h')
 addExternalIface('nsIFile', nativeType='nsIFile', notflattened=True)
-addExternalIface('nsIGroupedSHistory', nativeType='nsIGroupedSHistory',
-                 notflattened=True)
 addExternalIface('nsILoadGroup', nativeType='nsILoadGroup',
                  headerFile='nsILoadGroup.h', notflattened=True)
 addExternalIface('nsIMessageBroadcaster', nativeType='nsIMessageBroadcaster',
                  headerFile='nsIMessageManager.h', notflattened=True)
 addExternalIface('nsIMessageSender', nativeType='nsIMessageSender',
                  headerFile='nsIMessageManager.h', notflattened=True)
-addExternalIface('nsIPartialSHistory', nativeType='nsIPartialSHistory',
-                 notflattened=True)
 addExternalIface('nsIPrintSettings', nativeType='nsIPrintSettings',
                  notflattened=True)
 addExternalIface('nsISelectionListener', nativeType='nsISelectionListener')
 addExternalIface('nsIStreamListener', nativeType='nsIStreamListener', notflattened=True)
 addExternalIface('nsITransportProvider', nativeType='nsITransportProvider')
 addExternalIface('nsITreeSelection', nativeType='nsITreeSelection',
                  notflattened=True)
 addExternalIface('nsISupports', nativeType='nsISupports')
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -7720,33 +7720,16 @@ class CGPerSignatureCall(CGThing):
         self.extendedAttributes = descriptor.getExtendedAttributes(idlNode,
                                                                    getter=getter,
                                                                    setter=setter)
         self.arguments = arguments
         self.argCount = len(arguments)
         self.isConstructor = isConstructor
         cgThings = []
 
-        # Here, we check if the current getter, setter, method, interface or
-        # inherited interfaces have the UnsafeInPrerendering extended attribute
-        # and if so, we add a check to make sure it is safe.
-        if (idlNode.getExtendedAttribute("UnsafeInPrerendering") or
-            descriptor.interface.getExtendedAttribute("UnsafeInPrerendering") or
-            any(i.getExtendedAttribute("UnsafeInPrerendering")
-                for i in descriptor.interface.getInheritedInterfaces())):
-                cgThings.append(CGGeneric(dedent(
-                    """
-                    if (!mozilla::dom::EnforceNotInPrerendering(cx, obj)) {
-                        // Return false from the JSNative in order to trigger
-                        // an uncatchable exception.
-                        MOZ_ASSERT(!JS_IsExceptionPending(cx));
-                        return false;
-                    }
-                    """)))
-
         deprecated = (idlNode.getExtendedAttribute("Deprecated") or
                       (idlNode.isStatic() and descriptor.interface.getExtendedAttribute("Deprecated")))
         if deprecated:
             cgThings.append(CGGeneric(dedent(
                 """
                 DeprecationWarning(cx, obj, nsIDocument::e%s);
                 """ % deprecated[0])))
 
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -1719,17 +1719,16 @@ class IDLInterface(IDLInterfaceOrNamespa
                                           "an interface member and on the "
                                           "interface itself",
                                           [member.location, attr.location])
                     member.addExtendedAttributes([attr])
             elif (identifier == "NeedResolve" or
                   identifier == "OverrideBuiltins" or
                   identifier == "ChromeOnly" or
                   identifier == "Unforgeable" or
-                  identifier == "UnsafeInPrerendering" or
                   identifier == "LegacyEventInit" or
                   identifier == "ProbablyShortLivingWrapper" or
                   identifier == "LegacyUnenumerableNamedProperties" or
                   identifier == "NonOrdinaryGetPrototypeOf"):
                 # Known extended attributes that do not take values
                 if not attr.noArguments():
                     raise WebIDLError("[%s] must take no arguments" % identifier,
                                       [attr.location])
@@ -4346,17 +4345,16 @@ class IDLAttribute(IDLInterfaceMember):
               identifier == "SetterCanOOM" or
               identifier == "CanOOM" or
               identifier == "GetterCanOOM" or
               identifier == "ChromeOnly" or
               identifier == "Func" or
               identifier == "SecureContext" or
               identifier == "Frozen" or
               identifier == "NewObject" or
-              identifier == "UnsafeInPrerendering" or
               identifier == "NeedsSubjectPrincipal" or
               identifier == "SetterNeedsSubjectPrincipal" or
               identifier == "GetterNeedsSubjectPrincipal" or
               identifier == "NeedsCallerType" or
               identifier == "ReturnValueNeedsContainsHack" or
               identifier == "BinaryName" or
               identifier == "NonEnumerable"):
             # Known attributes that we don't need to do anything with here
@@ -5075,17 +5073,16 @@ class IDLMethod(IDLInterfaceMember, IDLS
             if self.isSpecial() and not self.isSetter() and not self.isDeleter():
                 raise WebIDLError("[CEReactions] is only allowed on operation, "
                                   "attribute, setter, and deleter",
                                   [attr.location, self.location])
         elif (identifier == "Throws" or
               identifier == "CanOOM" or
               identifier == "NewObject" or
               identifier == "ChromeOnly" or
-              identifier == "UnsafeInPrerendering" or
               identifier == "Pref" or
               identifier == "Deprecated" or
               identifier == "Func" or
               identifier == "SecureContext" or
               identifier == "BinaryName" or
               identifier == "NeedsSubjectPrincipal" or
               identifier == "NeedsCallerType" or
               identifier == "StaticClassOverride" or
--- a/dom/bindings/test/TestCodeGen.webidl
+++ b/dom/bindings/test/TestCodeGen.webidl
@@ -177,22 +177,16 @@ interface TestInterface {
   byte returnByteSideEffectFree();
   [Affects=Nothing, DependsOn=DOMState]
   byte returnDOMDependentByte();
   [Affects=Nothing, DependsOn=Nothing]
   byte returnConstantByte();
   [DependsOn=DeviceState, Affects=Nothing]
   byte returnDeviceStateDependentByte();
 
-  [UnsafeInPrerendering]
-  void unsafePrerenderMethod();
-  [UnsafeInPrerendering]
-  attribute long unsafePrerenderWritable;
-  [UnsafeInPrerendering]
-  readonly attribute long unsafePrerenderReadonly;
   readonly attribute short readonlyShort;
   attribute short writableShort;
   void passShort(short arg);
   short receiveShort();
   void passOptionalShort(optional short arg);
   void passOptionalShortWithDefault(optional short arg = 5);
 
   readonly attribute long readonlyLong;
--- a/dom/html/nsGenericHTMLFrameElement.cpp
+++ b/dom/html/nsGenericHTMLFrameElement.cpp
@@ -140,19 +140,16 @@ nsGenericHTMLFrameElement::EnsureFrameLo
     return;
   }
 
   // Strangely enough, this method doesn't actually ensure that the
   // frameloader exists.  It's more of a best-effort kind of thing.
   mFrameLoader = nsFrameLoader::Create(this,
                                        nsPIDOMWindowOuter::From(mOpenerWindow),
                                        mNetworkCreated);
-  if (mIsPrerendered) {
-    mFrameLoader->SetIsPrerendered();
-  }
 }
 
 nsresult
 nsGenericHTMLFrameElement::CreateRemoteFrameLoader(nsITabParent* aTabParent)
 {
   MOZ_ASSERT(!mFrameLoader);
   EnsureFrameLoader();
   NS_ENSURE_STATE(mFrameLoader);
@@ -223,24 +220,16 @@ nsGenericHTMLFrameElement::SwapFrameLoad
   if (!loader || !otherLoader) {
     rv.Throw(NS_ERROR_NOT_IMPLEMENTED);
     return;
   }
 
   rv = loader->SwapWithOtherLoader(otherLoader, this, aOtherLoaderOwner);
 }
 
-NS_IMETHODIMP
-nsGenericHTMLFrameElement::SetIsPrerendered()
-{
-  MOZ_ASSERT(!mFrameLoader, "Please call SetIsPrerendered before frameLoader is created");
-  mIsPrerendered = true;
-  return NS_OK;
-}
-
 nsresult
 nsGenericHTMLFrameElement::LoadSrc()
 {
   EnsureFrameLoader();
 
   if (!mFrameLoader) {
     return NS_OK;
   }
--- a/dom/html/nsGenericHTMLFrameElement.h
+++ b/dom/html/nsGenericHTMLFrameElement.h
@@ -33,17 +33,16 @@ class nsGenericHTMLFrameElement : public
 {
 public:
   nsGenericHTMLFrameElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
                             mozilla::dom::FromParser aFromParser)
     : nsGenericHTMLElement(aNodeInfo)
     , nsBrowserElement()
     , mSrcLoadHappened(false)
     , mNetworkCreated(aFromParser == mozilla::dom::FROM_PARSER_NETWORK)
-    , mIsPrerendered(false)
     , mBrowserFrameListenersRegistered(false)
     , mFrameLoaderCreationDisallowed(false)
     , mReallyIsBrowser(false)
   {
   }
 
   NS_DECL_ISUPPORTS_INHERITED
 
@@ -133,17 +132,16 @@ protected:
 
   /**
    * True when the element is created by the parser using the
    * NS_FROM_PARSER_NETWORK flag.
    * If the element is modified, it may lose the flag.
    */
   bool mNetworkCreated;
 
-  bool mIsPrerendered;
   bool mBrowserFrameListenersRegistered;
   bool mFrameLoaderCreationDisallowed;
   bool mReallyIsBrowser;
 
   // This flag is only used by <iframe>. See HTMLIFrameElement::
   // FullscreenFlag() for details. It is placed here so that we
   // do not bloat any struct.
   bool mFullscreenFlag = false;
--- a/dom/interfaces/base/nsITabParent.idl
+++ b/dom/interfaces/base/nsITabParent.idl
@@ -33,21 +33,16 @@ interface nsITabParent : nsISupports
 
   /**
    * True if layers are being rendered and the compositor has reported
    * receiving them.
    */
   readonly attribute boolean hasLayers;
 
   /**
-   * Whether this tabParent is in prerender mode.
-   */
-  [infallible] readonly attribute boolean isPrerendered;
-
-  /**
    * As an optimisation, setting the docshell's active state to
    * inactive also triggers a layer invalidation to free up some
    * potentially unhelpful memory usage. Calling preserveLayers
    * will cause the layers to be preserved even for inactive
    * docshells.
    */
   void preserveLayers(in boolean aPreserveLayers);
 
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -571,35 +571,16 @@ parent:
     // After a compositor reset, it is necessary to reconnect each layers ID to
     // the compositor of the widget that will render those layers. Note that
     // this is sync so we can ensure that messages to the window compositor
     // arrive before the TabChild attempts to use its cross-process compositor
     // bridge.
     sync EnsureLayersConnected() returns (CompositorOptions compositorOptions);
 
     /**
-     * Notify the parent that the session history state has been updated.
-     *
-     * @param aCount
-     *        The updated number of entries in child session history
-     * @param aLocalIndex
-     *        The local session history index which is loaded.
-     */
-    async SHistoryUpdate(uint32_t aCount, uint32_t aLocalIndex, bool aTruncate);
-
-    /**
-     * When the session history is across multiple root docshells, this function
-     * is used to notify parent that it needs to navigate to an entry out of
-     * local index of the child.
-     *
-     * @param aGlobalIndex The global index of history entry to navigate to.
-     */
-    async RequestCrossBrowserNavigation(uint32_t aGlobalIndex);
-
-    /**
      * This function is used to notify the parent that it should display a
      * canvas permission prompt.
      *
      * @param aFirstPartyURI first party of the tab that is requesting access.
      */
     async ShowCanvasPermissionPrompt(nsCString aFirstPartyURI);
 
 child:
@@ -896,42 +877,16 @@ child:
      * Update the child with the tab's current top-level native window handle.
      * This is used by a11y objects who must expose their native window.
      *
      * @param aNewHandle The native window handle of the tab's top-level window.
      */
     async UpdateNativeWindowHandle(uintptr_t aNewHandle);
 
     /**
-     * Called when the session history of this particular PBrowser has been
-     * attached to a grouped session history.
-     *
-     * @param aOffset           The number of entries in the grouped session
-     *                          history before this session history object.
-     */
-    async NotifyAttachGroupedSHistory(uint32_t aOffset);
-
-    /**
-     * Notify that the session history associated to this PBrowser has become
-     * the active history in the grouped session history.
-     *
-     * @param aGlobalLength      The up-to-date number of entries in the grouped
-     *                           session history.
-     * @param aTargetLocalIndex  The target local index to navigate to.
-     */
-    async NotifyPartialSHistoryActive(uint32_t aGlobalLength,
-                                      uint32_t aTargetLocalIndex);
-
-    /**
-     * Notify that the session history asssociates to this PBrowser has become
-     * an inactive history in the grouped session history.
-     */
-    async NotifyPartialSHistoryDeactive();
-
-    /**
      * Tell the TabChild that it should expect a Large-Allocation load to occur.
      * Loads which occur until this flag is cleared will not leave the process.
      */
     async AwaitLargeAlloc();
 
     /**
      * Tell the TabChild to set the name of its toplevel docshell to the given name.
      */
--- a/dom/ipc/PTabContext.ipdlh
+++ b/dom/ipc/PTabContext.ipdlh
@@ -38,19 +38,16 @@ struct FrameIPCTabContext
 {
   // The originAttributes dictionary.
   OriginAttributes originAttributes;
 
   // Whether this is a mozbrowser frame.  <iframe mozbrowser mozapp> and
   // <xul:browser> are not considered to be mozbrowser frames.
   bool isMozBrowserElement;
 
-  // Whether this TabContext should work in prerender mode.
-  bool isPrerendered;
-
   // The requested presentation URL.
   // This value would be empty if the TabContext isn't created for
   // presented content.
   nsString presentationURL;
 
   // Keyboard indicator state inherited from the parent.
   UIStateChangeType showAccelerators;
   UIStateChangeType showFocusRings;
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -115,17 +115,16 @@
 #include "mozilla/EventForwards.h"
 #include "nsDeviceContext.h"
 #include "nsSandboxFlags.h"
 #include "FrameLayerBuilder.h"
 #include "VRManagerChild.h"
 #include "nsICommandParams.h"
 #include "nsISHistory.h"
 #include "nsQueryObject.h"
-#include "GroupedSHistory.h"
 #include "nsIHttpChannel.h"
 #include "mozilla/dom/DocGroup.h"
 #include "nsString.h"
 #include "nsISupportsPrimitives.h"
 #include "mozilla/Telemetry.h"
 #include "nsIDocShellLoadInfo.h"
 
 #ifdef XP_WIN
@@ -153,20 +152,16 @@ using namespace mozilla::ipc;
 using namespace mozilla::layers;
 using namespace mozilla::layout;
 using namespace mozilla::docshell;
 using namespace mozilla::widget;
 using namespace mozilla::jsipc;
 using mozilla::layers::GeckoContentController;
 
 NS_IMPL_ISUPPORTS(ContentListener, nsIDOMEventListener)
-NS_IMPL_ISUPPORTS(TabChildSHistoryListener,
-                  nsISHistoryListener,
-                  nsIPartialSHistoryListener,
-                  nsISupportsWeakReference)
 
 static const char BEFORE_FIRST_PAINT[] = "before-first-paint";
 
 nsTHashtable<nsPtrHashKey<TabChild>>* TabChild::sVisibleTabs;
 
 typedef nsDataHashtable<nsUint64HashKey, TabChild*> TabChildMap;
 static TabChildMap* sTabChildren;
 StaticMutex sTabChildrenMutex;
@@ -635,51 +630,32 @@ TabChild::Init()
 
   if (window->GetCurrentInnerWindow()) {
     window->SetKeyboardIndicators(ShowAccelerators(), ShowFocusRings());
   } else {
     // Skip ShouldShowFocusRing check if no inner window is available
     window->SetInitialKeyboardIndicators(ShowAccelerators(), ShowFocusRings());
   }
 
-  // Set prerender flag if necessary.
-  if (mIsPrerendered) {
-    docShell->SetIsPrerendered();
-  }
-
   nsContentUtils::SetScrollbarsVisibility(window->GetDocShell(),
     !!(mChromeFlags & nsIWebBrowserChrome::CHROME_SCROLLBARS));
 
   nsWeakPtr weakPtrThis = do_GetWeakReference(static_cast<nsITabChild*>(this));  // for capture by the lambda
   ContentReceivedInputBlockCallback callback(
       [weakPtrThis](const ScrollableLayerGuid& aGuid,
                     uint64_t aInputBlockId,
                     bool aPreventDefault)
       {
         if (nsCOMPtr<nsITabChild> tabChild = do_QueryReferent(weakPtrThis)) {
           static_cast<TabChild*>(tabChild.get())->ContentReceivedInputBlock(aGuid, aInputBlockId, aPreventDefault);
         }
       });
   mAPZEventState = new APZEventState(mPuppetWidget, Move(callback));
 
   mIPCOpen = true;
-
-  if (GroupedSHistory::GroupedHistoryEnabled()) {
-    // Set session history listener.
-    nsCOMPtr<nsISHistory> shistory = GetRelatedSHistory();
-    if (!shistory) {
-      return NS_ERROR_FAILURE;
-    }
-    mHistoryListener = new TabChildSHistoryListener(this);
-    nsCOMPtr<nsISHistoryListener> listener(do_QueryObject(mHistoryListener));
-    shistory->AddSHistoryListener(listener);
-    nsCOMPtr<nsIPartialSHistoryListener> partialListener(do_QueryObject(mHistoryListener));
-    shistory->SetPartialSHistoryListener(partialListener);
-  }
-
   return NS_OK;
 }
 
 void
 TabChild::NotifyTabContextUpdated(bool aIsPreallocated)
 {
   nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
   MOZ_ASSERT(docShell);
@@ -1163,20 +1139,16 @@ TabChild::~TabChild()
 
   DestroyWindow();
 
   nsCOMPtr<nsIWebBrowser> webBrowser = do_QueryInterface(WebNavigation());
   if (webBrowser) {
     webBrowser->SetContainerWindow(nullptr);
   }
 
-  if (mHistoryListener) {
-    mHistoryListener->ClearTabChild();
-  }
-
   mozilla::DropJSObjects(this);
 }
 
 mozilla::ipc::IPCResult
 TabChild::RecvLoadURL(const nsCString& aURI,
                       const ShowInfo& aInfo)
 {
   if (!mDidLoadURLInit) {
@@ -1554,64 +1526,16 @@ TabChild::RecvSetKeyboardIndicators(cons
 mozilla::ipc::IPCResult
 TabChild::RecvStopIMEStateManagement()
 {
   IMEStateManager::StopIMEStateManagement();
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
-TabChild::RecvNotifyAttachGroupedSHistory(const uint32_t& aOffset)
-{
-  // nsISHistory uses int32_t
-  if (NS_WARN_IF(aOffset > INT32_MAX)) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  nsCOMPtr<nsISHistory> shistory = GetRelatedSHistory();
-  NS_ENSURE_TRUE(shistory, IPC_FAIL_NO_REASON(this));
-
-  if (NS_FAILED(shistory->OnAttachGroupedSHistory(aOffset))) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-TabChild::RecvNotifyPartialSHistoryActive(const uint32_t& aGlobalLength,
-                                          const uint32_t& aTargetLocalIndex)
-{
-  // nsISHistory uses int32_t
-  if (NS_WARN_IF(aGlobalLength > INT32_MAX || aTargetLocalIndex > INT32_MAX)) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  nsCOMPtr<nsISHistory> shistory = GetRelatedSHistory();
-  NS_ENSURE_TRUE(shistory, IPC_FAIL_NO_REASON(this));
-
-  if (NS_FAILED(shistory->OnPartialSHistoryActive(aGlobalLength,
-                                                  aTargetLocalIndex))) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-TabChild::RecvNotifyPartialSHistoryDeactive()
-{
-  nsCOMPtr<nsISHistory> shistory = GetRelatedSHistory();
-  NS_ENSURE_TRUE(shistory, IPC_FAIL_NO_REASON(this));
-
-  if (NS_FAILED(shistory->OnPartialSHistoryDeactive())) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
 TabChild::RecvMouseEvent(const nsString& aType,
                          const float&    aX,
                          const float&    aY,
                          const int32_t&  aButton,
                          const int32_t&  aClickCount,
                          const int32_t&  aModifiers,
                          const bool&     aIgnoreRootScrollFrame)
 {
@@ -2670,18 +2594,16 @@ TabChild::RemovePendingDocShellBlocker()
     mPendingRenderLayersReceivedMessage = false;
     RecvRenderLayers(mPendingRenderLayers, mPendingLayerObserverEpoch);
   }
 }
 
 void
 TabChild::InternalSetDocShellIsActive(bool aIsActive)
 {
-  // docshell is consider prerendered only if not active yet
-  mIsPrerendered &= !aIsActive;
   nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
 
   if (docShell) {
     docShell->SetIsActive(aIsActive);
   }
 }
 
 mozilla::ipc::IPCResult
@@ -3614,124 +3536,22 @@ TabChild::BeforeUnloadRemoved()
   MOZ_ASSERT(mBeforeUnloadListeners >= 0);
 
   // Don't bother notifying the parent if we don't have an IPC link open.
   if (mBeforeUnloadListeners == 0 && IPCOpen()) {
     SendSetHasBeforeUnload(false);
   }
 }
 
-already_AddRefed<nsISHistory>
-TabChild::GetRelatedSHistory()
-{
-  nsCOMPtr<nsISHistory> shistory;
-  mWebNav->GetSessionHistory(getter_AddRefs(shistory));
-  return shistory.forget();
-}
-
-nsresult
-TabChildSHistoryListener::SHistoryDidUpdate(bool aTruncate /* = false */)
-{
-  RefPtr<TabChild> tabChild(mTabChild);
-  if (NS_WARN_IF(!tabChild)) {
-    return NS_ERROR_FAILURE;
-  }
-
-  nsCOMPtr<nsISHistory> shistory = tabChild->GetRelatedSHistory();
-  NS_ENSURE_TRUE(shistory, NS_ERROR_FAILURE);
-
-  int32_t index, count;
-  nsresult rv = shistory->GetIndex(&index);
-  NS_ENSURE_SUCCESS(rv, rv);
-  rv = shistory->GetCount(&count);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // XXX: It would be nice if we could batch these updates like SessionStore
-  // does, and provide a form of `Flush` command which would allow us to trigger
-  // an update, and wait for the state to become consistent.
-  NS_ENSURE_TRUE(tabChild->SendSHistoryUpdate(count, index, aTruncate), NS_ERROR_FAILURE);
-  return NS_OK;
-}
-
 mozilla::dom::TabGroup*
 TabChild::TabGroup()
 {
   return mTabGroup;
 }
 
-/*******************************************************************************
- * nsISHistoryListener
- ******************************************************************************/
-
-NS_IMETHODIMP
-TabChildSHistoryListener::OnHistoryNewEntry(nsIURI *aNewURI, int32_t aOldIndex)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChildSHistoryListener::OnHistoryGoBack(nsIURI *aBackURI, bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChildSHistoryListener::OnHistoryGoForward(nsIURI *aForwardURI, bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChildSHistoryListener::OnHistoryReload(nsIURI *aReloadURI, uint32_t aReloadFlags, bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChildSHistoryListener::OnHistoryGotoIndex(int32_t aIndex, nsIURI *aGotoURI, bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChildSHistoryListener::OnHistoryPurge(int32_t aNumEntries, bool *_retval)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChildSHistoryListener::OnHistoryReplaceEntry(int32_t aIndex)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TabChildSHistoryListener::OnLengthChanged(int32_t aCount)
-{
-  return SHistoryDidUpdate(/* aTruncate = */ true);
-}
-
-NS_IMETHODIMP
-TabChildSHistoryListener::OnIndexChanged(int32_t aIndex)
-{
-  return SHistoryDidUpdate(/* aTruncate = */ false);
-}
-
-NS_IMETHODIMP
-TabChildSHistoryListener::OnRequestCrossBrowserNavigation(uint32_t aIndex)
-{
-  RefPtr<TabChild> tabChild(mTabChild);
-  if (!tabChild) {
-    return NS_ERROR_FAILURE;
-  }
-
-  return tabChild->SendRequestCrossBrowserNavigation(aIndex) ?
-           NS_OK : NS_ERROR_FAILURE;
-}
-
 TabChildGlobal::TabChildGlobal(TabChild* aTabChild)
 : mTabChild(aTabChild)
 {
   SetIsNotDOMBinding();
 }
 
 TabChildGlobal::~TabChildGlobal()
 {
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -38,17 +38,16 @@
 #include "mozilla/layers/CompositorOptions.h"
 #include "nsIWebBrowserChrome3.h"
 #include "mozilla/dom/ipc/IdType.h"
 #include "AudioChannelService.h"
 #include "PuppetWidget.h"
 #include "mozilla/layers/GeckoContentController.h"
 #include "nsDeque.h"
 #include "nsISHistoryListener.h"
-#include "nsIPartialSHistoryListener.h"
 
 class nsIDOMWindowUtils;
 class nsIHttpChannel;
 class nsISerialEventTarget;
 
 template<typename T> class nsTHashtable;
 template<typename T> class nsPtrHashKey;
 
@@ -181,39 +180,16 @@ public:
   explicit ContentListener(TabChild* aTabChild) : mTabChild(aTabChild) {}
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMEVENTLISTENER
 protected:
   ~ContentListener() {}
   TabChild* mTabChild;
 };
 
-/**
- * Listens on session history change, and sends NotifySessionHistoryChange to
- * parent process.
- */
-class TabChildSHistoryListener final : public nsISHistoryListener,
-                                       public nsIPartialSHistoryListener,
-                                       public nsSupportsWeakReference
-{
-public:
-  explicit TabChildSHistoryListener(TabChild* aTabChild) : mTabChild(aTabChild) {}
-  void ClearTabChild() { mTabChild = nullptr; }
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSISHISTORYLISTENER
-  NS_DECL_NSIPARTIALSHISTORYLISTENER
-
-private:
-  nsresult SHistoryDidUpdate(bool aTruncate = false);
-
-  ~TabChildSHistoryListener() {}
-  TabChild* mTabChild;
-};
-
 // This is base clase which helps to share Viewport and touch related
 // functionality between b2g/android FF/embedlite clients implementation.
 // It make sense to place in this class all helper functions, and functionality
 // which could be shared between Cross-process/Cross-thread implmentations.
 class TabChildBase : public nsISupports,
                      public nsMessageManagerScriptExecutor,
                      public ipc::MessageManagerCallback
 {
@@ -734,18 +710,16 @@ public:
   uintptr_t GetNativeWindowHandle() const { return mNativeWindowHandle; }
 #endif
 
   // These methods return `true` if this TabChild is currently awaiting a
   // Large-Allocation header.
   bool StopAwaitingLargeAlloc();
   bool IsAwaitingLargeAlloc();
 
-  already_AddRefed<nsISHistory> GetRelatedSHistory();
-
   mozilla::dom::TabGroup* TabGroup();
 
 #if defined(ACCESSIBILITY)
   void SetTopLevelDocAccessibleChild(PDocAccessibleChild* aTopLevelChild)
   {
     mTopLevelDocAccessibleChild = aTopLevelChild;
   }
 
@@ -814,23 +788,16 @@ protected:
 
   virtual mozilla::ipc::IPCResult RecvParentActivated(const bool& aActivated) override;
 
   virtual mozilla::ipc::IPCResult RecvSetKeyboardIndicators(const UIStateChangeType& aShowAccelerators,
                                                             const UIStateChangeType& aShowFocusRings) override;
 
   virtual mozilla::ipc::IPCResult RecvStopIMEStateManagement() override;
 
-  virtual mozilla::ipc::IPCResult RecvNotifyAttachGroupedSHistory(const uint32_t& aOffset) override;
-
-  virtual mozilla::ipc::IPCResult RecvNotifyPartialSHistoryActive(const uint32_t& aGlobalLength,
-                                                                  const uint32_t& aTargetLocalIndex) override;
-
-  virtual mozilla::ipc::IPCResult RecvNotifyPartialSHistoryDeactive() override;
-
   virtual mozilla::ipc::IPCResult RecvAwaitLargeAlloc() override;
 
   virtual mozilla::ipc::IPCResult RecvSetWindowName(const nsString& aName) override;
 
   virtual mozilla::ipc::IPCResult RecvSetOriginAttributes(const OriginAttributes& aOriginAttributes) override;
 
   virtual mozilla::ipc::IPCResult RecvSetWidgetNativeData(const WindowsHandle& aWidgetNativeData) override;
 
@@ -902,17 +869,16 @@ private:
 
   TextureFactoryIdentifier mTextureFactoryIdentifier;
   nsCOMPtr<nsIWebNavigation> mWebNav;
   RefPtr<mozilla::dom::TabGroup> mTabGroup;
   RefPtr<PuppetWidget> mPuppetWidget;
   nsCOMPtr<nsIURI> mLastURI;
   RenderFrameChild* mRemoteFrame;
   RefPtr<nsIContentChild> mManager;
-  RefPtr<TabChildSHistoryListener> mHistoryListener;
   uint32_t mChromeFlags;
   uint32_t mMaxTouchPoints;
   int32_t mActiveSuppressDisplayport;
   uint64_t mLayersId;
   int64_t mBeforeUnloadListeners;
   CSSRect mUnscaledOuterRect;
   nscolor mLastBackgroundColor;
   Maybe<bool> mLayersConnected;
--- a/dom/ipc/TabContext.cpp
+++ b/dom/ipc/TabContext.cpp
@@ -16,18 +16,17 @@
 
 using namespace mozilla::dom::ipc;
 using namespace mozilla::layout;
 
 namespace mozilla {
 namespace dom {
 
 TabContext::TabContext()
-  : mIsPrerendered(false)
-  , mInitialized(false)
+  : mInitialized(false)
   , mIsMozBrowserElement(false)
   , mJSPluginID(-1)
   , mShowAccelerators(UIStateChangeType_NoChange)
   , mShowFocusRings(UIStateChangeType_NoChange)
 {
 }
 
 bool
@@ -114,30 +113,28 @@ TabContext::ShowAccelerators() const
 UIStateChangeType
 TabContext::ShowFocusRings() const
 {
   return mShowFocusRings;
 }
 
 bool
 TabContext::SetTabContext(bool aIsMozBrowserElement,
-                          bool aIsPrerendered,
                           UIStateChangeType aShowAccelerators,
                           UIStateChangeType aShowFocusRings,
                           const OriginAttributes& aOriginAttributes,
                           const nsAString& aPresentationURL)
 {
   NS_ENSURE_FALSE(mInitialized, false);
 
   // Veryify that app id matches mAppId passed in originAttributes
   MOZ_RELEASE_ASSERT(aOriginAttributes.mAppId == NO_APP_ID);
 
   mInitialized = true;
   mIsMozBrowserElement = aIsMozBrowserElement;
-  mIsPrerendered = aIsPrerendered;
   mOriginAttributes = aOriginAttributes;
   mPresentationURL = aPresentationURL;
   mShowAccelerators = aShowAccelerators;
   mShowFocusRings = aShowFocusRings;
   return true;
 }
 
 bool
@@ -154,27 +151,25 @@ IPCTabContext
 TabContext::AsIPCTabContext() const
 {
   if (IsJSPlugin()) {
     return IPCTabContext(JSPluginFrameIPCTabContext(mJSPluginID));
   }
 
   return IPCTabContext(FrameIPCTabContext(mOriginAttributes,
                                           mIsMozBrowserElement,
-                                          mIsPrerendered,
                                           mPresentationURL,
                                           mShowAccelerators,
                                           mShowFocusRings));
 }
 
 MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
   : mInvalidReason(nullptr)
 {
   bool isMozBrowserElement = false;
-  bool isPrerendered = false;
   int32_t jsPluginId = -1;
   OriginAttributes originAttributes;
   nsAutoString presentationURL;
   UIStateChangeType showAccelerators = UIStateChangeType_NoChange;
   UIStateChangeType showFocusRings = UIStateChangeType_NoChange;
 
   switch(aParams.type()) {
     case IPCTabContext::TPopupIPCTabContext: {
@@ -230,17 +225,16 @@ MaybeInvalidTabContext::MaybeInvalidTabC
       jsPluginId = ipcContext.jsPluginId();
       break;
     }
     case IPCTabContext::TFrameIPCTabContext: {
       const FrameIPCTabContext &ipcContext =
         aParams.get_FrameIPCTabContext();
 
       isMozBrowserElement = ipcContext.isMozBrowserElement();
-      isPrerendered = ipcContext.isPrerendered();
       presentationURL = ipcContext.presentationURL();
       showAccelerators = ipcContext.showAccelerators();
       showFocusRings = ipcContext.showFocusRings();
       originAttributes = ipcContext.originAttributes();
       break;
     }
     case IPCTabContext::TUnsafeIPCTabContext: {
       // XXXcatalinb: This used *only* by ServiceWorkerClients::OpenWindow.
@@ -259,17 +253,16 @@ MaybeInvalidTabContext::MaybeInvalidTabC
     }
   }
 
   bool rv;
   if (jsPluginId >= 0) {
     rv = mTabContext.SetTabContextForJSPluginFrame(jsPluginId);
   } else {
     rv = mTabContext.SetTabContext(isMozBrowserElement,
-                                   isPrerendered,
                                    showAccelerators,
                                    showFocusRings,
                                    originAttributes,
                                    presentationURL);
   }
   if (!rv) {
     mInvalidReason = "Couldn't initialize TabContext.";
   }
--- a/dom/ipc/TabContext.h
+++ b/dom/ipc/TabContext.h
@@ -100,17 +100,16 @@ protected:
   bool SetTabContext(const TabContext& aContext);
 
   /**
    * Set the tab context's origin attributes to a private browsing value.
    */
   void SetPrivateBrowsingAttributes(bool aIsPrivateBrowsing);
 
   bool SetTabContext(bool aIsMozBrowserElement,
-                     bool aIsPrerendered,
                      UIStateChangeType aShowAccelerators,
                      UIStateChangeType aShowFocusRings,
                      const OriginAttributes& aOriginAttributes,
                      const nsAString& aPresentationURL);
 
   /**
    * Modify this TabContext to match the given TabContext.  This is a special
    * case triggered by nsFrameLoader::SwapWithOtherRemoteLoader which may have
@@ -118,21 +117,16 @@ protected:
    *
    * This special case only allows the field `mIsMozBrowserElement` to be
    * changed.  If any other fields have changed, the update is ignored and
    * returns false.
    */
   bool UpdateTabContextAfterSwap(const TabContext& aContext);
 
   /**
-   * Whether this TabContext is in prerender mode.
-   */
-  bool mIsPrerendered;
-
-  /**
    * Set this TabContext to be for a JS plugin. aPluginID is the id of the JS plugin
    * (@see nsFakePlugin::mId).
    * As with the other protected mutator methods, this lets you modify a TabContext once.
    * (@see TabContext::SetTabContext above for more details).
    */
   bool SetTabContextForJSPluginFrame(int32_t aJSPluginID);
 
 private:
@@ -178,24 +172,22 @@ class MutableTabContext : public TabCont
 public:
   bool SetTabContext(const TabContext& aContext)
   {
     return TabContext::SetTabContext(aContext);
   }
 
   bool
   SetTabContext(bool aIsMozBrowserElement,
-                bool aIsPrerendered,
                 UIStateChangeType aShowAccelerators,
                 UIStateChangeType aShowFocusRings,
                 const OriginAttributes& aOriginAttributes,
                 const nsAString& aPresentationURL = EmptyString())
   {
     return TabContext::SetTabContext(aIsMozBrowserElement,
-                                     aIsPrerendered,
                                      aShowAccelerators,
                                      aShowFocusRings,
                                      aOriginAttributes,
                                      aPresentationURL);
   }
 
   bool SetTabContextForJSPluginFrame(uint32_t aJSPluginID)
   {
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -93,18 +93,16 @@
 #include "nsILoginManagerPrompter.h"
 #include "nsPIWindowRoot.h"
 #include "nsIAuthPrompt2.h"
 #include "gfxDrawable.h"
 #include "ImageOps.h"
 #include "UnitTransforms.h"
 #include <algorithm>
 #include "mozilla/WebBrowserPersistDocumentParent.h"
-#include "nsIGroupedSHistory.h"
-#include "PartialSHistory.h"
 #include "ProcessPriorityManager.h"
 #include "nsString.h"
 #include "NullPrincipal.h"
 
 #ifdef XP_WIN
 #include "mozilla/plugins/PluginWidgetParent.h"
 #endif
 
@@ -2899,18 +2897,16 @@ TabParent::GetUseAsyncPanZoom(bool* useA
   *useAsyncPanZoom = AsyncPanZoomEnabled();
   return NS_OK;
 }
 
 // defined in nsITabParent
 NS_IMETHODIMP
 TabParent::SetDocShellIsActive(bool isActive)
 {
-  // docshell is consider prerendered only if not active yet
-  mIsPrerendered &= !isActive;
   mDocShellIsActive = isActive;
   SetRenderLayers(isActive);
   Unused << SendSetDocShellIsActive(isActive);
 
   // update active accessible documents on windows
 #if defined(XP_WIN) && defined(ACCESSIBILITY)
   if (a11y::Compatibility::IsDolphin()) {
     if (a11y::DocAccessibleParent* tabDoc = GetTopLevelDocAccessible()) {
@@ -2937,23 +2933,16 @@ TabParent::SetDocShellIsActive(bool isAc
 NS_IMETHODIMP
 TabParent::GetDocShellIsActive(bool* aIsActive)
 {
   *aIsActive = mDocShellIsActive;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TabParent::GetIsPrerendered(bool* aIsPrerendered)
-{
-  *aIsPrerendered = mIsPrerendered;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 TabParent::SetRenderLayers(bool aEnabled)
 {
   if (aEnabled == mRenderLayers) {
     if (aEnabled && mHasLayers && mPreserveLayers) {
       // RenderLayers might be called when we've been preserving layers,
       // and already had layers uploaded. In that case, the MozLayerTreeReady
       // event will not naturally arrive, which can confuse the front-end
       // layer. So we fire the event here.
@@ -3595,55 +3584,16 @@ TabParent::RecvLookUpDictionary(const ns
   }
 
   widget->LookUpDictionary(aText, aFontRangeArray, aIsVertical,
                            aPoint - GetChildProcessOffset());
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
-TabParent::RecvSHistoryUpdate(const uint32_t& aCount, const uint32_t& aLocalIndex, const bool& aTruncate)
-{
-  RefPtr<nsFrameLoader> frameLoader(GetFrameLoader());
-  if (!frameLoader) {
-    // FrameLoader can be nullptr if the it is destroying.
-    // In this case session history change can simply be ignored.
-    return IPC_OK();
-  }
-
-  nsCOMPtr<nsIPartialSHistory> partialHistory;
-  frameLoader->GetPartialSHistory(getter_AddRefs(partialHistory));
-  if (!partialHistory) {
-    // PartialSHistory is not enabled
-    return IPC_OK();
-  }
-
-  partialHistory->HandleSHistoryUpdate(aCount, aLocalIndex, aTruncate);
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
-TabParent::RecvRequestCrossBrowserNavigation(const uint32_t& aGlobalIndex)
-{
-  RefPtr<nsFrameLoader> frameLoader(GetFrameLoader());
-  if (!frameLoader) {
-    // FrameLoader can be nullptr if the it is destroying.
-    // In this case we can ignore the request.
-    return IPC_OK();
-  }
-
-  nsCOMPtr<nsISupports> promise;
-  if (NS_FAILED(frameLoader->RequestGroupedHistoryNavigation(aGlobalIndex,
-                                                             getter_AddRefs(promise)))) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
 TabParent::RecvShowCanvasPermissionPrompt(const nsCString& aFirstPartyURI)
 {
   nsCOMPtr<nsIBrowser> browser = do_QueryInterface(mFrameElement);
   if (!browser) {
     // If the tab is being closed, the browser may not be available.
     // In this case we can ignore the request.
     return IPC_OK();
   }
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -28,17 +28,16 @@
 #include "nsISecureBrowserUI.h"
 #include "nsITabParent.h"
 #include "nsIWebBrowserPersistable.h"
 #include "nsIXULBrowserWindow.h"
 #include "nsRefreshDriver.h"
 #include "nsWeakReference.h"
 #include "Units.h"
 #include "nsIWidget.h"
-#include "nsIPartialSHistory.h"
 
 class nsFrameLoader;
 class nsIFrameLoader;
 class nsIContent;
 class nsIPrincipal;
 class nsIURI;
 class nsILoadContext;
 class nsIDocShell;
@@ -638,21 +637,16 @@ protected:
   virtual mozilla::ipc::IPCResult RecvForcePaintNoOp(const uint64_t& aLayerObserverEpoch) override;
 
   virtual mozilla::ipc::IPCResult RecvSetDimensions(const uint32_t& aFlags,
                                                     const int32_t& aX, const int32_t& aY,
                                                     const int32_t& aCx, const int32_t& aCy) override;
 
   virtual mozilla::ipc::IPCResult RecvGetTabCount(uint32_t* aValue) override;
 
-  virtual mozilla::ipc::IPCResult RecvSHistoryUpdate(const uint32_t& aCount,
-                                                     const uint32_t& aLocalIndex,
-                                                     const bool& aTruncate) override;
-
-  virtual mozilla::ipc::IPCResult RecvRequestCrossBrowserNavigation(const uint32_t& aGlobalIndex) override;
   virtual mozilla::ipc::IPCResult RecvShowCanvasPermissionPrompt(const nsCString& aFirstPartyURI) override;
 
   ContentCacheInParent mContentCache;
 
   nsIntRect mRect;
   ScreenIntSize mDimensions;
   ScreenOrientationInternal mOrientation;
   float mDPI;
--- a/dom/webidl/AudioBufferSourceNode.webidl
+++ b/dom/webidl/AudioBufferSourceNode.webidl
@@ -27,15 +27,15 @@ interface AudioBufferSourceNode : AudioS
 
     readonly attribute AudioParam playbackRate;
     readonly attribute AudioParam detune;
 
     attribute boolean loop;
     attribute double loopStart;
     attribute double loopEnd;
 
-    [Throws, UnsafeInPrerendering]
+    [Throws]
     void start(optional double when = 0, optional double grainOffset = 0,
                optional double grainDuration);
 };
 
 // Mozilla extensions
 AudioBufferSourceNode implements AudioNodePassThrough;
--- a/dom/webidl/AudioContext.webidl
+++ b/dom/webidl/AudioContext.webidl
@@ -17,19 +17,19 @@ interface AudioContext : BaseAudioContex
     // Bug 1324545: readonly        attribute double outputLatency;
     // Bug 1324545: AudioTimestamp                  getOutputTimestamp ();
 
     [Throws]
     Promise<void> suspend();
     [Throws]
     Promise<void> close();
 
-    [NewObject, Throws, UnsafeInPrerendering]
+    [NewObject, Throws]
     MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement);
 
-    [NewObject, Throws, UnsafeInPrerendering]
+    [NewObject, Throws]
     MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream);
 
     // Bug 1324548: MediaStreamTrackAudioSourceNode createMediaStreamTrackSource (AudioMediaStreamTrack mediaStreamTrack);
 
     [NewObject, Throws]
     MediaStreamAudioDestinationNode createMediaStreamDestination();
 };
--- a/dom/webidl/AudioScheduledSourceNode.webidl
+++ b/dom/webidl/AudioScheduledSourceNode.webidl
@@ -7,14 +7,14 @@
  * https://webaudio.github.io/web-audio-api/#idl-def-AudioScheduledSourceNode
  *
  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
 interface AudioScheduledSourceNode : AudioNode {
                     attribute EventHandler onended;
-    [Throws, UnsafeInPrerendering]
+    [Throws]
     void start (optional double when = 0);
 
-    [Throws, UnsafeInPrerendering]
+    [Throws]
     void stop (optional double when = 0);
 };
--- a/dom/webidl/Element.webidl
+++ b/dom/webidl/Element.webidl
@@ -98,17 +98,17 @@ interface Element : Node {
    * string.
    *
    * See <http://dev.w3.org/2006/webapi/selectors-api2/#matchesselector>
    */
   [Throws, Pure, BinaryName="matches"]
   boolean mozMatchesSelector(DOMString selector);
 
   // Pointer events methods.
-  [Throws, Pref="dom.w3c_pointer_events.enabled", UnsafeInPrerendering]
+  [Throws, Pref="dom.w3c_pointer_events.enabled"]
   void setPointerCapture(long pointerId);
 
   [Throws, Pref="dom.w3c_pointer_events.enabled"]
   void releasePointerCapture(long pointerId);
 
   [Pref="dom.w3c_pointer_events.enabled"]
   boolean hasPointerCapture(long pointerId);
 
@@ -271,19 +271,19 @@ partial interface Element {
 Element implements ChildNode;
 Element implements NonDocumentTypeChildNode;
 Element implements ParentNode;
 Element implements Animatable;
 Element implements GeometryUtils;
 
 // https://fullscreen.spec.whatwg.org/#api
 partial interface Element {
-  [Throws, UnsafeInPrerendering, Func="nsDocument::IsUnprefixedFullscreenEnabled", NeedsCallerType]
+  [Throws, Func="nsDocument::IsUnprefixedFullscreenEnabled", NeedsCallerType]
   void requestFullscreen();
-  [Throws, UnsafeInPrerendering, BinaryName="requestFullscreen", NeedsCallerType]
+  [Throws, BinaryName="requestFullscreen", NeedsCallerType]
   void mozRequestFullScreen();
 };
 
 // https://w3c.github.io/pointerlock/#extensions-to-the-element-interface
 partial interface Element {
-  [UnsafeInPrerendering, NeedsCallerType]
+  [NeedsCallerType]
   void requestPointerLock();
 };
--- a/dom/webidl/External.webidl
+++ b/dom/webidl/External.webidl
@@ -2,11 +2,11 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 [NoInterfaceObject, JSImplementation="@mozilla.org/sidebar;1"]
 interface External
 {
-  [UnsafeInPrerendering] void AddSearchProvider(DOMString aDescriptionURL);
+  void AddSearchProvider(DOMString aDescriptionURL);
   unsigned long IsSearchProviderInstalled(DOMString aSearchURL);
 };
--- a/dom/webidl/FrameLoader.webidl
+++ b/dom/webidl/FrameLoader.webidl
@@ -3,19 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 interface LoadContext;
 interface TabParent;
 interface URI;
 interface nsIDocShell;
-interface nsIGroupedSHistory;
 interface nsIMessageSender;
-interface nsIPartialSHistory;
 interface nsIPrintSettings;
 interface nsIWebBrowserPersistDocumentReceiver;
 interface nsIWebProgressListener;
 
 [ChromeOnly]
 interface FrameLoader {
   /**
    * Get the docshell from the frame loader.
@@ -46,45 +44,16 @@ interface FrameLoader {
   /**
    * Loads the specified URI in this frame. Behaves identically to loadFrame,
    * except that this method allows specifying the URI to load.
    */
   [Throws]
   void loadURI(URI aURI, optional boolean originalSrc = false);
 
   /**
-   * Puts the frameloader in prerendering mode.
-   */
-  [Throws]
-  void setIsPrerendered();
-
-  /**
-   * Make the prerendered frameloader being active (and clear isPrerendered flag).
-   */
-  [Throws]
-  void makePrerenderedLoaderActive();
-
-  /**
-   * Append partial session history from another frame loader.
-   *
-   * @return A promise which will be resolved when the navigation is complete.
-   */
-  [Throws]
-  Promise<void> appendPartialSHistoryAndSwap(FrameLoader aOther);
-
-  /**
-   * If grouped session history is applied, use this function to navigate to
-   * an entry of session history object of another frameloader.
-   *
-   * @return A promise which will be resolved when the navigation is complete.
-   */
-  [Throws]
-  Promise<void> requestGroupedHistoryNavigation(unsigned long aGlobalIndex);
-
-  /**
    * Adds a blocking promise for the current cross process navigation.
    * This method can only be called while the "BrowserWillChangeProcess" event
    * is being fired.
    */
   [Throws]
   void addProcessChangeBlockingPromise(Promise<any> aPromise);
 
   /**
@@ -176,22 +145,16 @@ interface FrameLoader {
    * @param aProgressListener optional print progress listener.
    */
   [Throws]
   void print(unsigned long long aOuterWindowID,
              nsIPrintSettings aPrintSettings,
              optional nsIWebProgressListener? aProgressListener = null);
 
   /**
-   * Ensure that the current nsIFrameLoader has a GroupedSHistory.
-   */
-  [Throws]
-  nsIGroupedSHistory ensureGroupedSHistory();
-
-  /**
    * The default event mode automatically forwards the events
    * handled in EventStateManager::HandleCrossProcessEvent to
    * the child content process when these events are targeted to
    * the remote browser element.
    *
    * Used primarly for input events (mouse, keyboard)
    */
   const unsigned long EVENT_MODE_NORMAL_DISPATCH = 0x00000000;
@@ -257,27 +220,16 @@ interface FrameLoader {
    * a reflow, and therefore may not reflect the current state of things. It
    * should only be used in asynchronous APIs where values are not guaranteed
    * to be up-to-date when received.
    */
   [Pure]
   readonly attribute unsigned long lazyHeight;
 
   /**
-   * The partial session history.
-   */
-  readonly attribute nsIPartialSHistory? partialSHistory;
-
-  /**
-   * The grouped session history composed of multiple session history objects
-   * across root docshells.
-   */
-  readonly attribute nsIGroupedSHistory? groupedSHistory;
-
-  /**
    * Is `true` if the frameloader is dead (destroy has been called on it)
    */
   [Pure]
   readonly attribute boolean isDead;
 };
 
 [NoInterfaceObject]
 interface WebBrowserPersistable
--- a/dom/webidl/HTMLCanvasElement.webidl
+++ b/dom/webidl/HTMLCanvasElement.webidl
@@ -40,17 +40,17 @@ partial interface HTMLCanvasElement {
   File mozGetAsFile(DOMString name, optional DOMString? type = null);
   // A Mozilla-only extension to get a canvas context backed by double-buffered
   // shared memory. Only privileged callers can call this.
   [ChromeOnly, Throws]
   nsISupports? MozGetIPCContext(DOMString contextId);
 
            attribute PrintCallback? mozPrintCallback;
 
-  [Throws, UnsafeInPrerendering, Pref="canvas.capturestream.enabled"]
+  [Throws, Pref="canvas.capturestream.enabled"]
   CanvasCaptureMediaStream captureStream(optional double frameRate);
 };
 
 // For OffscreenCanvas
 // Reference: https://wiki.whatwg.org/wiki/OffscreenCanvas
 partial interface HTMLCanvasElement {
   [Pref="gfx.offscreencanvas.enabled", Throws]
   OffscreenCanvas transferControlToOffscreen();
--- a/dom/webidl/HTMLMediaElement.webidl
+++ b/dom/webidl/HTMLMediaElement.webidl
@@ -119,19 +119,19 @@ partial interface HTMLMediaElement {
 
   attribute boolean mozPreservesPitch;
 
   // NB: for internal use with the video controls:
   [Func="IsChromeOrXBL"] attribute boolean mozAllowCasting;
   [Func="IsChromeOrXBL"] attribute boolean mozIsCasting;
 
   // Mozilla extension: stream capture
-  [Throws, UnsafeInPrerendering]
+  [Throws]
   MediaStream mozCaptureStream();
-  [Throws, UnsafeInPrerendering]
+  [Throws]
   MediaStream mozCaptureStreamUntilEnded();
   readonly attribute boolean mozAudioCaptured;
 
   // Mozilla extension: return embedded metadata from the stream as a
   // JSObject with key:value pairs for each tag. This can be used by
   // player interfaces to display the song title, artist, etc.
   [Throws]
   object? mozGetMetadata();
--- a/dom/webidl/HTMLObjectElement.webidl
+++ b/dom/webidl/HTMLObjectElement.webidl
@@ -8,17 +8,17 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#HTMLObjectElement-partial
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-object-element
-[HTMLConstructor, NeedResolve, UnsafeInPrerendering]
+[HTMLConstructor, NeedResolve]
 interface HTMLObjectElement : HTMLElement {
   [CEReactions, Pure, SetterThrows]
            attribute DOMString data;
   [CEReactions, Pure, SetterThrows]
            attribute DOMString type;
   [CEReactions, Pure, SetterThrows]
            attribute boolean typeMustMatch;
   [CEReactions, Pure, SetterThrows]
--- a/dom/webidl/History.webidl
+++ b/dom/webidl/History.webidl
@@ -15,19 +15,19 @@ enum ScrollRestoration { "auto", "manual
 
 interface History {
   [Throws]
   readonly attribute unsigned long length;
   [Throws]
   attribute ScrollRestoration scrollRestoration;
   [Throws]
   readonly attribute any state;
-  [Throws, UnsafeInPrerendering]
+  [Throws]
   void go(optional long delta = 0);
-  [Throws, UnsafeInPrerendering]
+  [Throws]
   void back();
-  [Throws, UnsafeInPrerendering]
+  [Throws]
   void forward();
   [Throws]
   void pushState(any data, DOMString title, optional DOMString? url = null);
   [Throws]
   void replaceState(any data, DOMString title, optional DOMString? url = null);
 };
--- a/dom/webidl/Location.webidl
+++ b/dom/webidl/Location.webidl
@@ -34,20 +34,20 @@ interface Location {
            attribute USVString port;
   [Throws, NeedsSubjectPrincipal]
            attribute USVString pathname;
   [Throws, NeedsSubjectPrincipal]
            attribute USVString search;
   [Throws, NeedsSubjectPrincipal]
            attribute USVString hash;
 
-  [Throws, UnsafeInPrerendering, NeedsSubjectPrincipal]
+  [Throws, NeedsSubjectPrincipal]
   void assign(USVString url);
 
-  [Throws, CrossOriginCallable, UnsafeInPrerendering, NeedsSubjectPrincipal]
+  [Throws, CrossOriginCallable, NeedsSubjectPrincipal]
   void replace(USVString url);
 
   // XXXbz there is no forceget argument in the spec!  See bug 1037721.
-  [Throws, UnsafeInPrerendering, NeedsSubjectPrincipal]
+  [Throws, NeedsSubjectPrincipal]
   void reload(optional boolean forceget = false);
 
   // Bug 1085214 [SameObject] readonly attribute USVString[] ancestorOrigins;
 };
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -232,31 +232,31 @@ partial interface Navigator {
 partial interface Navigator {
   [Pref="dom.vr.test.enabled"]
   VRServiceTest requestVRServiceTest();
 };
 
 #ifdef MOZ_TIME_MANAGER
 // nsIDOMMozNavigatorTime
 partial interface Navigator {
-  [Throws, ChromeOnly, UnsafeInPrerendering]
+  [Throws, ChromeOnly]
   readonly attribute MozTimeManager mozTime;
 };
 #endif // MOZ_TIME_MANAGER
 
 callback NavigatorUserMediaSuccessCallback = void (MediaStream stream);
 callback NavigatorUserMediaErrorCallback = void (MediaStreamError error);
 
 partial interface Navigator {
   [Throws, Func="Navigator::HasUserMediaSupport"]
   readonly attribute MediaDevices mediaDevices;
 
   // Deprecated. Use mediaDevices.getUserMedia instead.
   [Deprecated="NavigatorGetUserMedia", Throws,
-   Func="Navigator::HasUserMediaSupport", UnsafeInPrerendering,
+   Func="Navigator::HasUserMediaSupport",
    NeedsCallerType]
   void mozGetUserMedia(MediaStreamConstraints constraints,
                        NavigatorUserMediaSuccessCallback successCallback,
                        NavigatorUserMediaErrorCallback errorCallback);
 };
 
 // nsINavigatorUserMedia
 callback MozGetUserMediaDevicesSuccessCallback = void (nsIVariant? devices);
--- a/dom/webidl/Notification.webidl
+++ b/dom/webidl/Notification.webidl
@@ -8,18 +8,17 @@
  *
  * Copyright:
  * To the extent possible under law, the editors have waived all copyright and
  * related or neighboring rights to this work.
  */
 
 [Constructor(DOMString title, optional NotificationOptions options),
  Exposed=(Window,Worker),
- Func="mozilla::dom::Notification::PrefEnabled",
- UnsafeInPrerendering]
+ Func="mozilla::dom::Notification::PrefEnabled"]
 interface Notification : EventTarget {
   [GetterThrows]
   static readonly attribute NotificationPermission permission;
 
   [Throws, Func="mozilla::dom::Notification::RequestPermissionEnabledForScope"]
   static Promise<NotificationPermission> requestPermission(optional NotificationPermissionCallback permissionCallback);
 
   [Throws, Func="mozilla::dom::Notification::IsGetEnabled"]
--- a/dom/webidl/RTCPeerConnection.webidl
+++ b/dom/webidl/RTCPeerConnection.webidl
@@ -108,19 +108,19 @@ interface RTCPeerConnection : EventTarge
   readonly attribute Promise<RTCIdentityAssertion> peerIdentity;
   [Pref="media.peerconnection.identity.enabled"]
   readonly attribute DOMString? idpLoginUrl;
 
   [ChromeOnly]
   attribute DOMString id;
 
   RTCConfiguration      getConfiguration ();
-  [UnsafeInPrerendering, Deprecated="RTCPeerConnectionGetStreams"]
+  [Deprecated="RTCPeerConnectionGetStreams"]
   sequence<MediaStream> getLocalStreams ();
-  [UnsafeInPrerendering, Deprecated="RTCPeerConnectionGetStreams"]
+  [Deprecated="RTCPeerConnectionGetStreams"]
   sequence<MediaStream> getRemoteStreams ();
   void addStream (MediaStream stream);
 
   // replaces addStream; fails if already added
   // because a track can be part of multiple streams, stream parameters
   // indicate which particular streams should be referenced in signaling
 
   RTCRtpSender addTrack(MediaStreamTrack track,
--- a/dom/webidl/Screen.webidl
+++ b/dom/webidl/Screen.webidl
@@ -38,25 +38,24 @@ interface Screen : EventTarget {
   readonly attribute DOMString mozOrientation;
 
   attribute EventHandler onmozorientationchange;
 
   /**
    * DEPRECATED, use ScreenOrientation API instead.
    * Lock screen orientation to the specified type.
    */
-  [Throws, UnsafeInPrerendering]
+  [Throws]
   boolean mozLockOrientation(DOMString orientation);
-  [Throws, UnsafeInPrerendering]
+  [Throws]
   boolean mozLockOrientation(sequence<DOMString> orientation);
 
   /**
    * DEPRECATED, use ScreenOrientation API instead.
    * Unlock the screen orientation.
    */
-  [UnsafeInPrerendering]
   void mozUnlockOrientation();
 };
 
 // https://w3c.github.io/screen-orientation
 partial interface Screen {
   readonly attribute ScreenOrientation orientation;
 };
--- a/dom/webidl/ScreenOrientation.webidl
+++ b/dom/webidl/ScreenOrientation.webidl
@@ -23,17 +23,16 @@ enum OrientationLockType {
   "landscape",
   "portrait",
   "portrait-primary",
   "portrait-secondary",
   "landscape-primary",
   "landscape-secondary"
 };
 
-[UnsafeInPrerendering]
 interface ScreenOrientation : EventTarget {
   [Throws]
   Promise<void> lock(OrientationLockType orientation);
   [Throws]
   void unlock();
   [Throws, NeedsCallerType]
   readonly attribute OrientationType type;
   [Throws, NeedsCallerType]
--- a/dom/webidl/SpeechRecognition.webidl
+++ b/dom/webidl/SpeechRecognition.webidl
@@ -20,17 +20,17 @@ interface SpeechRecognition : EventTarge
     [Throws]
     attribute boolean continuous;
     attribute boolean interimResults;
     attribute unsigned long maxAlternatives;
     [Throws]
     attribute DOMString serviceURI;
 
     // methods to drive the speech interaction
-    [Throws, UnsafeInPrerendering, NeedsCallerType]
+    [Throws, NeedsCallerType]
     void start(optional MediaStream stream);
     void stop();
     void abort();
 
     // event methods
     attribute EventHandler onaudiostart;
     attribute EventHandler onsoundstart;
     attribute EventHandler onspeechstart;
--- a/dom/webidl/SpeechSynthesis.webidl
+++ b/dom/webidl/SpeechSynthesis.webidl
@@ -11,21 +11,19 @@
  */
 
 [Pref="media.webspeech.synth.enabled"]
 interface SpeechSynthesis : EventTarget{
   readonly attribute boolean pending;
   readonly attribute boolean speaking;
   readonly attribute boolean paused;
 
-  [UnsafeInPrerendering]
   void speak(SpeechSynthesisUtterance utterance);
   void cancel();
   void pause();
-  [UnsafeInPrerendering]
   void resume();
   sequence<SpeechSynthesisVoice> getVoices();
 
   attribute EventHandler onvoiceschanged;
 
   [ChromeOnly]
   // Force an utterance to end. Circumvents bad speech service implementations.
   void forceEnd();
--- a/dom/webidl/Window.webidl
+++ b/dom/webidl/Window.webidl
@@ -43,48 +43,48 @@ interface XULControllers;
   readonly attribute CustomElementRegistry customElements;
   [Replaceable, Throws] readonly attribute BarProp locationbar;
   [Replaceable, Throws] readonly attribute BarProp menubar;
   [Replaceable, Throws] readonly attribute BarProp personalbar;
   [Replaceable, Throws] readonly attribute BarProp scrollbars;
   [Replaceable, Throws] readonly attribute BarProp statusbar;
   [Replaceable, Throws] readonly attribute BarProp toolbar;
   [Throws] attribute DOMString status;
-  [Throws, CrossOriginCallable, UnsafeInPrerendering] void close();
+  [Throws, CrossOriginCallable] void close();
   [Throws, CrossOriginReadable] readonly attribute boolean closed;
   [Throws] void stop();
-  [Throws, CrossOriginCallable, UnsafeInPrerendering] void focus();
+  [Throws, CrossOriginCallable] void focus();
   [Throws, CrossOriginCallable] void blur();
 
   // other browsing contexts
   [Replaceable, Throws, CrossOriginReadable] readonly attribute WindowProxy frames;
   [Replaceable, CrossOriginReadable] readonly attribute unsigned long length;
   //[Unforgeable, Throws, CrossOriginReadable] readonly attribute WindowProxy top;
   [Unforgeable, Throws, CrossOriginReadable] readonly attribute WindowProxy? top;
   [Throws, CrossOriginReadable] attribute any opener;
   //[Throws] readonly attribute WindowProxy parent;
   [Replaceable, Throws, CrossOriginReadable] readonly attribute WindowProxy? parent;
   [Throws, NeedsSubjectPrincipal] readonly attribute Element? frameElement;
   //[Throws] WindowProxy? open(optional USVString url = "about:blank", optional DOMString target = "_blank", [TreatNullAs=EmptyString] optional DOMString features = "");
-  [Throws, UnsafeInPrerendering] WindowProxy? open(optional DOMString url = "", optional DOMString target = "", [TreatNullAs=EmptyString] optional DOMString features = "");
+  [Throws] WindowProxy? open(optional DOMString url = "", optional DOMString target = "", [TreatNullAs=EmptyString] optional DOMString features = "");
   getter object (DOMString name);
 
   // the user agent
   readonly attribute Navigator navigator;
 #ifdef HAVE_SIDEBAR
   [Replaceable, Throws] readonly attribute External external;
 #endif
   [Throws, Pref="browser.cache.offline.enable"] readonly attribute ApplicationCache applicationCache;
 
   // user prompts
-  [Throws, UnsafeInPrerendering, NeedsSubjectPrincipal] void alert();
-  [Throws, UnsafeInPrerendering, NeedsSubjectPrincipal] void alert(DOMString message);
-  [Throws, UnsafeInPrerendering, NeedsSubjectPrincipal] boolean confirm(optional DOMString message = "");
-  [Throws, UnsafeInPrerendering, NeedsSubjectPrincipal] DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
-  [Throws, UnsafeInPrerendering, Func="nsGlobalWindowInner::IsWindowPrintEnabled"]
+  [Throws, NeedsSubjectPrincipal] void alert();
+  [Throws, NeedsSubjectPrincipal] void alert(DOMString message);
+  [Throws, NeedsSubjectPrincipal] boolean confirm(optional DOMString message = "");
+  [Throws, NeedsSubjectPrincipal] DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
+  [Throws, Func="nsGlobalWindowInner::IsWindowPrintEnabled"]
   void print();
 
   [Throws, CrossOriginCallable, NeedsSubjectPrincipal]
   void postMessage(any message, DOMString targetOrigin, optional sequence<object> transfer = []);
 
   // also has obsolete members
 };
 Window implements GlobalEventHandlers;
@@ -149,20 +149,20 @@ partial interface Window {
   //[SameObject, Replaceable, Throws] readonly attribute Screen screen;
   [Replaceable, Throws] readonly attribute Screen screen;
 
   // browsing context
   //[Throws] void moveTo(double x, double y);
   //[Throws] void moveBy(double x, double y);
   //[Throws] void resizeTo(double x, double y);
   //[Throws] void resizeBy(double x, double y);
-  [Throws, UnsafeInPrerendering, NeedsCallerType] void moveTo(long x, long y);
-  [Throws, UnsafeInPrerendering, NeedsCallerType] void moveBy(long x, long y);
-  [Throws, UnsafeInPrerendering, NeedsCallerType] void resizeTo(long x, long y);
-  [Throws, UnsafeInPrerendering, NeedsCallerType] void resizeBy(long x, long y);
+  [Throws, NeedsCallerType] void moveTo(long x, long y);
+  [Throws, NeedsCallerType] void moveBy(long x, long y);
+  [Throws, NeedsCallerType] void resizeTo(long x, long y);
+  [Throws, NeedsCallerType] void resizeBy(long x, long y);
 
   // viewport
   // These are writable because we allow chrome to write them.  And they need
   // to use 'any' as the type, because non-chrome writing them needs to act
   // like a [Replaceable] attribute would, which needs the original JS value.
   //[Replaceable, Throws] readonly attribute double innerWidth;
   //[Replaceable, Throws] readonly attribute double innerHeight;
   [Throws, NeedsCallerType] attribute any innerWidth;
@@ -243,17 +243,17 @@ partial interface Window {
   /**
    * Method for scrolling this window by a number of pages.
    */
   void                      scrollByPages(long numPages, optional ScrollOptions options);
 
   /**
    * Method for sizing this window to the content in the window.
    */
-  [Throws, UnsafeInPrerendering, NeedsCallerType] void sizeToContent();
+  [Throws, NeedsCallerType] void sizeToContent();
 
   // XXX Shouldn't this be in nsIDOMChromeWindow?
   [ChromeOnly, Replaceable, Throws] readonly attribute XULControllers controllers;
 
   [ChromeOnly, Throws] readonly attribute Element? realFrameElement;
 
   [Throws, NeedsCallerType]
   readonly attribute float mozInnerScreenX;
@@ -264,43 +264,43 @@ partial interface Window {
 
   /* The maximum offset that the window can be scrolled to
      (i.e., the document width/height minus the scrollport width/height) */
   [ChromeOnly, Throws]  readonly attribute long   scrollMinX;
   [ChromeOnly, Throws]  readonly attribute long   scrollMinY;
   [Replaceable, Throws] readonly attribute long   scrollMaxX;
   [Replaceable, Throws] readonly attribute long   scrollMaxY;
 
-  [Throws, UnsafeInPrerendering] attribute boolean fullScreen;
+  [Throws] attribute boolean fullScreen;
 
-  [Throws, ChromeOnly, UnsafeInPrerendering] void back();
-  [Throws, ChromeOnly, UnsafeInPrerendering] void forward();
-  [Throws, ChromeOnly, UnsafeInPrerendering, NeedsSubjectPrincipal] void home();
+  [Throws, ChromeOnly] void back();
+  [Throws, ChromeOnly] void forward();
+  [Throws, ChromeOnly, NeedsSubjectPrincipal] void home();
 
   // XXX Should this be in nsIDOMChromeWindow?
   void                      updateCommands(DOMString action,
                                            optional Selection? sel = null,
                                            optional short reason = 0);
 
   /* Find in page.
    * @param str: the search pattern
    * @param caseSensitive: is the search caseSensitive
    * @param backwards: should we search backwards
    * @param wrapAround: should we wrap the search
    * @param wholeWord: should we search only for whole words
    * @param searchInFrames: should we search through all frames
    * @param showDialog: should we show the Find dialog
    */
-  [Throws, UnsafeInPrerendering] boolean    find(optional DOMString str = "",
-                                                 optional boolean caseSensitive = false,
-                                                 optional boolean backwards = false,
-                                                 optional boolean wrapAround = false,
-                                                 optional boolean wholeWord = false,
-                                                 optional boolean searchInFrames = false,
-                                                 optional boolean showDialog = false);
+  [Throws] boolean    find(optional DOMString str = "",
+                           optional boolean caseSensitive = false,
+                           optional boolean backwards = false,
+                           optional boolean wrapAround = false,
+                           optional boolean wholeWord = false,
+                           optional boolean searchInFrames = false,
+                           optional boolean showDialog = false);
 
   /**
    * Returns the number of times this document for this window has
    * been painted to the screen.
    */
   [Throws] readonly attribute unsigned long long mozPaintCount;
 
            attribute EventHandler ondevicemotion;
@@ -319,20 +319,20 @@ partial interface Window {
   void                      setResizable(boolean resizable);
 
   /**
    * This is the scriptable version of
    * nsIDOMWindow::openDialog() that takes 3 optional
    * arguments, plus any additional arguments are passed on as
    * arguments on the dialog's window object (window.arguments).
    */
-  [Throws, ChromeOnly, UnsafeInPrerendering] WindowProxy? openDialog(optional DOMString url = "",
-                                                                   optional DOMString name = "",
-                                                                   optional DOMString options = "",
-                                                                   any... extraArguments);
+  [Throws, ChromeOnly] WindowProxy? openDialog(optional DOMString url = "",
+                                               optional DOMString name = "",
+                                               optional DOMString options = "",
+                                               any... extraArguments);
 
   [
 #ifdef NIGHTLY_BUILD
    ChromeOnly,
 #endif
    NonEnumerable, Replaceable, Throws, NeedsCallerType]
   readonly attribute object? content;
 
@@ -403,21 +403,21 @@ partial interface Window {
   void                      getAttention();
 
   [Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
   void                      getAttentionWithCycleCount(long aCycleCount);
 
   [Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
   void                      setCursor(DOMString cursor);
 
-  [Func="nsGlobalWindowInner::IsPrivilegedChromeWindow", UnsafeInPrerendering]
+  [Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
   void                      maximize();
-  [Func="nsGlobalWindowInner::IsPrivilegedChromeWindow", UnsafeInPrerendering]
+  [Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
   void                      minimize();
-  [Func="nsGlobalWindowInner::IsPrivilegedChromeWindow", UnsafeInPrerendering]
+  [Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
   void                      restore();
 
   /**
    * Notify a default button is loaded on a dialog or a wizard.
    * defaultButton is the default button.
    */
   [Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
   void notifyDefaultButtonLoaded(Element defaultButton);
--- a/dom/webidl/XULElement.webidl
+++ b/dom/webidl/XULElement.webidl
@@ -104,19 +104,16 @@ interface XULElement : Element {
 };
 
 // And the things from nsIFrameLoaderOwner
 [NoInterfaceObject]
 interface MozFrameLoaderOwner {
   [ChromeOnly]
   readonly attribute FrameLoader? frameLoader;
 
-  [ChromeOnly]
-  void setIsPrerendered();
-
   [ChromeOnly, Throws]
   void presetOpenerWindow(WindowProxy? window);
 
   [ChromeOnly, Throws]
   void swapFrameLoaders(XULElement aOtherLoaderOwner);
 
   [ChromeOnly, Throws]
   void swapFrameLoaders(HTMLIFrameElement aOtherLoaderOwner);
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -1426,22 +1426,16 @@ nsXULElement::LoadSrc()
         // session history at all.
         frameLoader = nsFrameLoader::Create(this, opener, false);
         slots->mFrameLoaderOrOpener = static_cast<nsIFrameLoader*>(frameLoader);
         NS_ENSURE_TRUE(frameLoader, NS_OK);
 
         (new AsyncEventDispatcher(this,
                                   NS_LITERAL_STRING("XULFrameLoaderCreated"),
                                   /* aBubbles */ true))->RunDOMEventWhenSafe();
-
-        if (AttrValueIs(kNameSpaceID_None, nsGkAtoms::prerendered,
-                        NS_LITERAL_STRING("true"), eIgnoreCase)) {
-            nsresult rv = frameLoader->SetIsPrerendered();
-            NS_ENSURE_SUCCESS(rv,rv);
-        }
     }
 
     return frameLoader->LoadFrame(false);
 }
 
 nsresult
 nsXULElement::GetFrameLoaderXPCOM(nsIFrameLoader **aFrameLoader)
 {
@@ -1464,23 +1458,16 @@ void
 nsXULElement::PresetOpenerWindow(mozIDOMWindowProxy* aWindow, ErrorResult& aRv)
 {
     nsExtendedDOMSlots* slots = ExtendedDOMSlots();
     MOZ_ASSERT(!slots->mFrameLoaderOrOpener, "A frameLoader or opener is present when calling PresetOpenerWindow");
 
     slots->mFrameLoaderOrOpener = aWindow;
 }
 
-nsresult
-nsXULElement::SetIsPrerendered()
-{
-  return SetAttr(kNameSpaceID_None, nsGkAtoms::prerendered, nullptr,
-                 NS_LITERAL_STRING("true"), true);
-}
-
 void
 nsXULElement::InternalSetFrameLoader(nsIFrameLoader* aNewFrameLoader)
 {
     nsExtendedDOMSlots* slots = GetExistingExtendedDOMSlots();
     MOZ_ASSERT(slots);
 
     slots->mFrameLoaderOrOpener = aNewFrameLoader;
 }
--- a/dom/xul/nsXULElement.h
+++ b/dom/xul/nsXULElement.h
@@ -406,17 +406,16 @@ public:
     NS_DECL_NSIDOMXULELEMENT
 
     virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
                            bool aPreallocateChildren) const override;
     virtual mozilla::EventStates IntrinsicState() const override;
 
     nsresult GetFrameLoaderXPCOM(nsIFrameLoader** aFrameLoader);
     void PresetOpenerWindow(mozIDOMWindowProxy* aWindow, ErrorResult& aRv);
-    nsresult SetIsPrerendered();
 
     virtual void RecompileScriptEventListeners() override;
 
     // This function should ONLY be used by BindToTree implementations.
     // The function exists solely because XUL elements store the binding
     // parent as a member instead of in the slots, as Element does.
     void SetXULBindingParent(nsIContent* aBindingParent)
     {
--- a/js/xpconnect/src/XPCJSContext.cpp
+++ b/js/xpconnect/src/XPCJSContext.cpp
@@ -691,23 +691,16 @@ XPCJSContext::InterruptCallback(JSContex
     if (win->IsDying()) {
         // The window is being torn down. When that happens we try to prevent
         // the dispatch of new runnables, so it also makes sense to kill any
         // long-running script. The user is primarily interested in this page
         // going away.
         return false;
     }
 
-    if (win->GetIsPrerendered()) {
-        // We cannot display a dialog if the page is being prerendered, so
-        // just kill the page.
-        mozilla::dom::HandlePrerenderingViolation(win->AsInner());
-        return false;
-    }
-
     // Accumulate slow script invokation delay.
     if (!chrome && !self->mTimeoutAccumulated) {
       uint32_t delay = uint32_t(self->mSlowScriptActualWait.ToMilliseconds() - (limit * 1000.0));
       Telemetry::Accumulate(Telemetry::SLOW_SCRIPT_NOTIFY_DELAY, delay);
       self->mTimeoutAccumulated = true;
     }
 
     // Show the prompt to the user, and kill if requested.
--- a/layout/style/nsDOMCSSAttrDeclaration.h
+++ b/layout/style/nsDOMCSSAttrDeclaration.h
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* DOM object for element.style */
 
 #ifndef nsDOMCSSAttributeDeclaration_h
 #define nsDOMCSSAttributeDeclaration_h
 
 #include "mozilla/Attributes.h"
+#include "mozilla/dom/DocGroup.h"
 #include "nsDOMCSSDeclaration.h"
 
 
 namespace mozilla {
 namespace dom {
 class DomGroup;
 class Element;
 } // namespace dom