Backed out changeset da1424ee1d11 (bug 1643204) for wpt failure on reload.window.html CLOSED TREE

This commit is contained in:
Narcis Beleuzu 2020-08-27 04:56:35 +03:00
Родитель ad0733dd86
Коммит a502871f99
2 изменённых файлов: 10 добавлений и 36 удалений

Просмотреть файл

@ -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("<div>heya</div>");
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");

Просмотреть файл

@ -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<Document> 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<Document> 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<nsPIDOMWindowOuter> 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<nsIDocShell> docShell = do_QueryInterface(this);
bool isInUnload;
if (docShell &&
NS_SUCCEEDED(docShell->GetIsInUnload(&isInUnload)) &&
!isInUnload) {
doc->OnPageShow(false, nullptr);
}
}
}
NotifyDoneWithOnload(parent);