Backed out changeset ef7d2e82eb5a (bug 1825745) for causing assertion failure on nsDocShell.cpp CLOSED TREE

This commit is contained in:
Norisz Fay
2023-03-31 15:08:34 +03:00
parent 399e9f7aa7
commit ce652adb9a
5 changed files with 12 additions and 22 deletions

View File

@@ -975,7 +975,6 @@ bool nsDocShell::MaybeHandleSubframeHistory(
// executing an onLoad Handler,this load will not go
// into session history.
// XXX Why is this code in a method which deals with iframes!
MOZ_ASSERT(!aLoadState->IsFormSubmission());
bool inOnLoadHandler = false;
GetIsExecutingOnLoadHandler(&inOnLoadHandler);
if (inOnLoadHandler) {
@@ -13086,20 +13085,11 @@ nsresult nsDocShell::OnLinkClickSync(nsIContent* aContent,
CopyUTF8toUTF16(type, typeHint);
}
uint32_t loadType;
if (aLoadState->IsFormSubmission()) {
// https://html.spec.whatwg.org/#form-submission-algorithm
// 22. Let historyHandling be "push".
// 23. If form document has not yet completely loaded, then set
// historyHandling to "replace".
loadType = mEODForCurrentDocument ? LOAD_LINK : LOAD_NORMAL_REPLACE;
} else {
// Link click can be triggered inside an onload handler, and we don't want
// to add history entry in this case.
bool inOnLoadHandler = false;
GetIsExecutingOnLoadHandler(&inOnLoadHandler);
loadType = inOnLoadHandler ? LOAD_NORMAL_REPLACE : LOAD_LINK;
}
// Link click (or form submission) can be triggered inside an onload
// handler, and we don't want to add history entry in this case.
bool inOnLoadHandler = false;
GetIsExecutingOnLoadHandler(&inOnLoadHandler);
uint32_t loadType = inOnLoadHandler ? LOAD_NORMAL_REPLACE : LOAD_LINK;
nsCOMPtr<nsIReferrerInfo> referrerInfo =
elementCanHaveNoopener ? new ReferrerInfo(*aContent->AsElement())