Bug 840263, make sure to notify the right navigation timing about page load, r=hsivonen

--HG--
extra : rebase_source : fedfbc41e787117e941fd4d5c12807002dfbe64a
This commit is contained in:
Olli Pettay 2013-02-20 20:15:21 +02:00
parent 67f3f94f14
commit bf4137cb5f

View File

@ -989,7 +989,7 @@ nsDocumentViewer::LoadComplete(nsresult aStatus)
NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);
// First, get the window from the document...
nsPIDOMWindow *window = mDocument->GetWindow();
nsCOMPtr<nsPIDOMWindow> window = mDocument->GetWindow();
mLoaded = true;
@ -1025,9 +1025,10 @@ nsDocumentViewer::LoadComplete(nsresult aStatus)
nsIDocument::READYSTATE_UNINITIALIZED &&
NS_IsAboutBlank(mDocument->GetDocumentURI())),
"Bad readystate");
nsCOMPtr<nsIDocument> d = mDocument;
mDocument->SetReadyStateInternal(nsIDocument::READYSTATE_COMPLETE);
nsRefPtr<nsDOMNavigationTiming> timing(mDocument->GetNavigationTiming());
nsRefPtr<nsDOMNavigationTiming> timing(d->GetNavigationTiming());
if (timing) {
timing->NotifyLoadEventStart();
}