Bug 1643204 - Back out changes to not fire pageshow event for aborted document loads. a=RyanVM
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 26 Jun 2020 00:01:49 +0000
changeset 601895 54b80be511d33c81c2601db1b0ad779433b93511
parent 601894 a24cfb80b10eafb3c5d534f5a85be792c19d8afe
child 601896 0d5c0a5e7bb6060e6ff4fd2626c1ff96eee0fd9c
push id13342
push userryanvm@gmail.com
push dateThu, 02 Jul 2020 16:51:46 +0000
treeherdermozilla-beta@54b80be511d3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRyanVM
bugs1643204
milestone79.0
Bug 1643204 - Back out changes to not fire pageshow event for aborted document loads. a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D81248
layout/base/nsDocumentViewer.cpp
testing/web-platform/meta/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load.html.ini
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -1175,20 +1175,17 @@ nsDocumentViewer::LoadComplete(nsresult 
   // it was just loaded). Note: mDocument may be null now if the above
   // firing of onload caused the document to unload. Or, mDocument may not be
   // the "current active" document, if the above firing of onload caused our
   // docshell to navigate away. NOTE: In this latter scenario, it's likely that
   // we fired pagehide (when navigating away) without ever having fired
   // pageshow, and that's pretty broken... Fortunately, this should be rare.
   // (It requires us to spin the event loop in onload handler, e.g. via sync
   // XHR, in order for the navigation-away to happen before onload completes.)
-  // We skip firing pageshow if we're currently handling unload, or if loading
-  // was explicitly aborted.
-  if (mDocument && mDocument->IsCurrentActiveDocument() &&
-      aStatus != NS_BINDING_ABORTED) {
+  if (mDocument && mDocument->IsCurrentActiveDocument()) {
     // Re-get window, since it might have changed during above firing of onload
     window = mDocument->GetWindow();
     if (window) {
       nsIDocShell* docShell = window->GetDocShell();
       bool isInUnload;
       if (docShell && NS_SUCCEEDED(docShell->GetIsInUnload(&isInUnload)) &&
           !isInUnload) {
         mDocument->OnPageShow(restoring, nullptr);
--- a/testing/web-platform/meta/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load.html.ini
+++ b/testing/web-platform/meta/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load.html.ini
@@ -1,5 +1,4 @@
 [abort-document-load.html]
   [Aborting a Document load]
-    expected:
-      if (os == "linux") and not webrender and not debug: ["PASS", "FAIL"]
+    expected: FAIL