Added test for postdata before invoking the anchor scrolling code to prevent obscure form problem where the submit url is the same as the current url with an anchor appended. b=52290

This commit is contained in:
locka%iol.ie 2000-09-14 09:45:14 +00:00
Родитель e8714aaa82
Коммит 264ad311ba
1 изменённых файлов: 4 добавлений и 4 удалений

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

@ -2768,10 +2768,10 @@ NS_IMETHODIMP nsDocShell::InternalLoad(nsIURI* aURI, nsIURI* aReferrer,
{
mURIResultedInDocument = PR_FALSE; // reset the clock...
// Check to see if the new URI is an anchor in the existing document.
if (aLoadType == nsIDocShellLoadInfo::loadNormal ||
aLoadType == nsIDocShellLoadInfo::loadNormalReplace ||
aLoadType == nsIDocShellLoadInfo::loadHistory ||
aLoadType == nsIDocShellLoadInfo::loadLink)
if ((aLoadType == nsIDocShellLoadInfo::loadNormal ||
aLoadType == nsIDocShellLoadInfo::loadNormalReplace ||
aLoadType == nsIDocShellLoadInfo::loadHistory ||
aLoadType == nsIDocShellLoadInfo::loadLink) && (aPostData == nsnull))
{
PRBool wasAnchor = PR_FALSE;
NS_ENSURE_SUCCESS(ScrollIfAnchor(aURI, &wasAnchor), NS_ERROR_FAILURE);