ScrollToRef(LoadType & nsIDocShell::LOAD_CMD_HISTORY == 0);
ScrollToRef(!(LoadType & nsIDocShell::LOAD_CMD_HISTORY));
HTMLContentSink::DidBuildModel(PRInt32 aQualityLevel){  // NRA Dump stopwatch stop info here#ifdef MOZ_PERF_METRICS  MOZ_TIMER_DEBUGLOG(("Stop: nsHTMLContentSink::DidBuildModel(), this=%p\n",                      this));  MOZ_TIMER_STOP(mWatch);  MOZ_TIMER_LOG(("Content creation time (this=%p): ", this));  MOZ_TIMER_PRINT(mWatch);#endif  // Cancel a timer if we had one out there  if (mNotificationTimer) {    SINK_TRACE(SINK_TRACE_REFLOW,               ("HTMLContentSink::DidBuildModel: canceling notification "                "timeout"));    mNotificationTimer->Cancel();    mNotificationTimer = 0;  }  if (mTitle.IsEmpty()) {    nsCOMPtr<nsIDOMHTMLDocument> domDoc(do_QueryInterface(mHTMLDocument));    if (domDoc)      domDoc->SetTitle(mTitle);  }  // XXX this is silly; who cares? RickG cares. It's part of the  // regression test. So don't bug me.  PRInt32 i, ns = mDocument->GetNumberOfShells();  for (i = 0; i < ns; i++) {    nsCOMPtr<nsIPresShell> shell;    mDocument->GetShellAt(i, getter_AddRefs(shell));    if (shell) {      nsCOMPtr<nsIViewManager> vm;      nsresult rv = shell->GetViewManager(getter_AddRefs(vm));      if (NS_SUCCEEDED(rv) && vm) {        vm->SetQuality(nsContentQuality(aQualityLevel));      }    }  }  // Reflow the last batch of content  if (mBody) {    SINK_TRACE(SINK_TRACE_REFLOW,               ("HTMLContentSink::DidBuildModel: layout final content"));    mCurrentContext->FlushTags(PR_TRUE);  } else if (!mLayoutStarted) {    // We never saw the body, and layout never got started. Force    // layout *now*, to get an initial reflow.    SINK_TRACE(SINK_TRACE_REFLOW,               ("HTMLContentSink::DidBuildModel: forcing reflow on empty "                "document"));    // NOTE: only force the layout if we are NOT destroying the    // webshell. If we are destroying it, then starting layout will    // likely cause us to crash, or at best waste a lot of time as we    // are just going to tear it down anyway.    PRBool bDestroying = PR_TRUE;    if (mWebShell) {      nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(mWebShell));      if (docShell) {        docShell->IsBeingDestroyed(&bDestroying);      }    }    if (!bDestroying) {      StartLayout();    }  }  if (mWebShell) {    nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(mWebShell));    if (docShell) {      PRUint32 LoadType;      docShell->GetLoadType(&LoadType);      ScrollToRef(LoadType & nsIDocShell::LOAD_CMD_HISTORY == 0);    }  }  nsCOMPtr<nsIScriptLoader> loader;  mDocument->GetScriptLoader(getter_AddRefs(loader));  if (loader) {    loader->RemoveObserver(this);  }  mDocument->EndLoad();  // Ref. Bug 49115  // Do this hack to make sure that the parser  // doesn't get destroyed, accidently, before  // the circularity, between sink & parser, is  // actually borken.  nsCOMPtr<nsIParser> kungFuDeathGrip(mParser);  // Drop our reference to the parser to get rid of a circular  // reference.  NS_IF_RELEASE(mParser);  if (mFlags & NS_SINK_FLAG_DYNAMIC_LOWER_VALUE) {    // Reset the performance hint which was set to FALSE    // when NS_SINK_FLAG_DYNAMIC_LOWER_VALUE was set.     PL_FavorPerformanceHint(PR_TRUE , 0);  }  if (mFlags & NS_SINK_FLAG_CAN_INTERRUPT_PARSER) {    // Note: Don't return value from RemoveDummyParserRequest,    // If RemoveDummyParserRequests fails it should not affect    // DidBuildModel. The remove can fail if the parser request    // was already removed by a DummyParserRequest::Cancel    RemoveDummyParserRequest();  }  return NS_OK;}