Bug 478927 - Add a new flag LOCATION_CHANGE_ERROR_PAGE for onLocationChangeBug. r=smaug, sr=bzbarsky

This commit is contained in:
Oonishi Atsushi 2012-05-03 06:22:32 -04:00
parent c75394595e
commit 4e66b438ee
2 changed files with 21 additions and 6 deletions

View File

@ -7535,14 +7535,14 @@ nsDocShell::CreateContentViewer(const char *aContentType,
// Create an shistory entry for the old load.
if (failedURI) {
#ifdef DEBUG
bool errorOnLocationChangeNeeded =
#endif
OnNewURI(failedURI, failedChannel, nsnull, mLoadType, true, false,
false);
OnNewURI(failedURI, failedChannel, nsnull, mLoadType, false,
false, false);
MOZ_ASSERT(!errorOnLocationChangeNeeded,
"We have to fire onLocationChange again.");
if (errorOnLocationChangeNeeded) {
FireOnLocationChange(this, failedChannel, failedURI,
LOCATION_CHANGE_ERROR_PAGE);
}
}
// Be sure to have a correct mLSHE, it may have been cleared by

View File

@ -309,8 +309,23 @@ interface nsIWebProgressListener : nsISupports
* This flag is on when |aWebProgress| did not load a new document.
* For example, the location change is due to an anchor scroll or a
* pushState/popState/replaceState.
*
* LOCATION_CHANGE_ERROR_PAGE
* This flag is on when |aWebProgress| redirected from the requested
* contents to an internal page to show error status, such as
* <about:neterror>, <about:certerror> and so on.
*
* Generally speaking, |aURI| and |aRequest| are the original data. DOM
* |window.location.href| is also the original location, while
* |document.documentURI| is the redirected location. Sometimes |aURI| is
* <about:blank> and |aRequest| is null when the original data does not
+ remain.
*
* |aWebProgress| does NOT set this flag when it did not try to load a new
* document. In this case, it should set LOCATION_CHANGE_SAME_DOCUMENT.
*/
const unsigned long LOCATION_CHANGE_SAME_DOCUMENT = 0x00000001;
const unsigned long LOCATION_CHANGE_ERROR_PAGE = 0x00000002;
/**
* Called when the location of the window being watched changes. This is not