--mChangeNestCount;
PresShell::EndLoad(nsIDocument *aDocument){  // Restore frame state for the root scroll frame  nsIFrame* rootFrame = FrameManager()->GetRootFrame();  nsCOMPtr<nsISupports> container = mPresContext->GetContainer();  if (!container)    return;  nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(container));  if (!docShell)    return;  nsCOMPtr<nsILayoutHistoryState> historyState;  docShell->GetLayoutHistoryState(getter_AddRefs(historyState));  if (rootFrame && historyState) {    nsIFrame* scrollFrame = GetRootScrollFrame(rootFrame);    if (scrollFrame) {      nsIScrollableFrame* scrollableFrame;      CallQueryInterface(scrollFrame, &scrollableFrame);      if (scrollableFrame) {        FrameManager()->RestoreFrameStateFor(scrollFrame, historyState,                                             nsIStatefulFrame::eDocumentScrollState);        scrollableFrame->ScrollToRestoredPosition();      }    }  }#ifdef MOZ_PERF_METRICS  // Dump reflow, style resolution and frame construction times here.  MOZ_TIMER_DEBUGLOG(("Stop: Reflow: PresShell::EndLoad(), this=%p\n", this));  MOZ_TIMER_STOP(mReflowWatch);  MOZ_TIMER_LOG(("Reflow time (this=%p): ", this));  MOZ_TIMER_PRINT(mReflowWatch);    MOZ_TIMER_DEBUGLOG(("Stop: Frame Creation: PresShell::EndLoad(), this=%p\n", this));  MOZ_TIMER_STOP(mFrameCreationWatch);  MOZ_TIMER_LOG(("Frame construction plus style resolution time (this=%p): ", this));  MOZ_TIMER_PRINT(mFrameCreationWatch);  // Print style resolution stopwatch maintained by style set  MOZ_TIMER_DEBUGLOG(("Stop: Style Resolution: PresShell::EndLoad(), this=%p\n", this));#endif    mDocumentLoading = PR_FALSE;}