Bug 1721217 - Part 5: Change the error code when we cancel loads due to another one starting, r=nika
This allows us to move away from using IsNavigating field in parent-controlled paths. Use a new distinct error code in cases when we cancel loads in Canonical BC due to another load starting. This way, we know to not reset the urlbar if we are doing another load. See https://bugzilla.mozilla.org/show_bug.cgi?id=1721217#c10 for longer explanation of what is going on here. Differential Revision: https://phabricator.services.mozilla.com/D126845
This commit is contained in:
@@ -1293,7 +1293,7 @@ void CanonicalBrowsingContext::GoBack(
|
||||
|
||||
// Stop any known network loads if necessary.
|
||||
if (mCurrentLoad) {
|
||||
mCurrentLoad->Cancel(NS_BINDING_ABORTED);
|
||||
mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD);
|
||||
}
|
||||
|
||||
if (nsDocShell* docShell = nsDocShell::Cast(GetDocShell())) {
|
||||
@@ -1319,7 +1319,7 @@ void CanonicalBrowsingContext::GoForward(
|
||||
|
||||
// Stop any known network loads if necessary.
|
||||
if (mCurrentLoad) {
|
||||
mCurrentLoad->Cancel(NS_BINDING_ABORTED);
|
||||
mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD);
|
||||
}
|
||||
|
||||
if (auto* docShell = nsDocShell::Cast(GetDocShell())) {
|
||||
@@ -1345,7 +1345,7 @@ void CanonicalBrowsingContext::GoToIndex(
|
||||
|
||||
// Stop any known network loads if necessary.
|
||||
if (mCurrentLoad) {
|
||||
mCurrentLoad->Cancel(NS_BINDING_ABORTED);
|
||||
mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD);
|
||||
}
|
||||
|
||||
if (auto* docShell = nsDocShell::Cast(GetDocShell())) {
|
||||
@@ -1369,7 +1369,7 @@ void CanonicalBrowsingContext::Reload(uint32_t aReloadFlags) {
|
||||
|
||||
// Stop any known network loads if necessary.
|
||||
if (mCurrentLoad) {
|
||||
mCurrentLoad->Cancel(NS_BINDING_ABORTED);
|
||||
mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD);
|
||||
}
|
||||
|
||||
if (auto* docShell = nsDocShell::Cast(GetDocShell())) {
|
||||
@@ -2084,7 +2084,7 @@ bool CanonicalBrowsingContext::StartDocumentLoad(
|
||||
// that we need to cancel any existing ones.
|
||||
if (StaticPrefs::browser_tabs_documentchannel_parent_controlled() &&
|
||||
mozilla::SessionHistoryInParent() && mCurrentLoad) {
|
||||
mCurrentLoad->Cancel(NS_BINDING_ABORTED);
|
||||
mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD);
|
||||
}
|
||||
mCurrentLoad = aLoad;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user