diff --git a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/pageshow-event.window.js b/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/pageshow-event.window.js
deleted file mode 100644
index 45570b35abf2..000000000000
--- a/testing/web-platform/tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/pageshow-event.window.js
+++ /dev/null
@@ -1,13 +0,0 @@
-async_test(t => {
- const frame = document.body.appendChild(document.createElement("iframe"));
- assert_equals(frame.contentDocument.open(), frame.contentDocument);
- assert_equals(frame.contentDocument.documentElement, null);
- frame.contentDocument.write("
heya
");
- frame.contentDocument.close();
- frame.contentWindow.addEventListener("pageshow", function() {
- t.step(function() {
- assert_true(true, "Got pageshow event");
- });
- t.done();
- });
-}, "document.open(), and the pageshow events");
diff --git a/uriloader/base/nsDocLoader.cpp b/uriloader/base/nsDocLoader.cpp
index 14e25e5bc693..068fdf850be4 100644
--- a/uriloader/base/nsDocLoader.cpp
+++ b/uriloader/base/nsDocLoader.cpp
@@ -769,17 +769,17 @@ void nsDocLoader::DocLoaderIsEmpty(bool aFlushLayout,
if (!parent || parent->ChildEnteringOnload(this)) {
nsresult loadGroupStatus = NS_OK;
mLoadGroup->GetStatus(&loadGroupStatus);
+ // Make sure we're not canceling the loadgroup. If we are, then just
+ // like the normal navigation case we should not fire a load event.
+ if (NS_SUCCEEDED(loadGroupStatus) ||
+ loadGroupStatus == NS_ERROR_PARSED_DATA_CACHED) {
+ // Can "doc" or "window" ever come back null here? Our state machine
+ // is complicated enough I wouldn't bet against it...
+ nsCOMPtr doc = do_GetInterface(GetAsSupports(this));
+ if (doc) {
+ doc->SetReadyStateInternal(Document::READYSTATE_COMPLETE,
+ /* updateTimingInformation = */ false);
- // Can "doc" or "window" ever come back null here? Our state machine
- // is complicated enough I wouldn't bet against it...
- nsCOMPtr doc = do_GetInterface(GetAsSupports(this));
- if (doc) {
- doc->SetReadyStateInternal(Document::READYSTATE_COMPLETE,
- /* updateTimingInformation = */ false);
- // Make sure we're not canceling the loadgroup. If we are, then just
- // like the normal navigation case we should not fire a load event.
- if (NS_SUCCEEDED(loadGroupStatus) ||
- loadGroupStatus == NS_ERROR_PARSED_DATA_CACHED) {
nsCOMPtr window = doc->GetWindow();
if (window && !doc->SkipLoadEventAfterClose()) {
if (!mozilla::dom::DocGroup::TryToLoadIframesInBackground() ||
@@ -817,19 +817,6 @@ void nsDocLoader::DocLoaderIsEmpty(bool aFlushLayout,
}
}
}
- } else if (loadGroupStatus == NS_BINDING_ABORTED) {
- doc->NotifyAbortedLoad();
- }
-
- if (doc->IsCurrentActiveDocument() && !doc->IsShowing() &&
- loadGroupStatus != NS_BINDING_ABORTED) {
- nsCOMPtr docShell = do_QueryInterface(this);
- bool isInUnload;
- if (docShell &&
- NS_SUCCEEDED(docShell->GetIsInUnload(&isInUnload)) &&
- !isInUnload) {
- doc->OnPageShow(false, nullptr);
- }
}
}
NotifyDoneWithOnload(parent);