Bug 665964: If the nsISHistoryListener vetoes navigation, reset mRequestedIndex to make it clear that the navigation has been cancelled. r=bz
--- a/docshell/shistory/src/nsSHistory.cpp
+++ b/docshell/shistory/src/nsSHistory.cpp
@@ -1491,16 +1491,17 @@ nsSHistory::LoadEntry(PRInt32 aIndex, lo
listener->OnHistoryGotoIndex(aIndex, nextURI, &canNavigate);
}
}
}
if (!canNavigate) {
// If the listener asked us not to proceed with
// the operation, simply return.
+ mRequestedIndex = -1;
return NS_OK; // XXX Maybe I can return some other error code?
}
nsCOMPtr<nsIURI> nexturi;
PRInt32 pCount=0, nCount=0;
nsCOMPtr<nsISHContainer> prevAsContainer(do_QueryInterface(prevEntry));
nsCOMPtr<nsISHContainer> nextAsContainer(do_QueryInterface(nextEntry));
if (prevAsContainer && nextAsContainer) {