NS_ASSERTION(mParser, "no parser");
HTMLContentSink::WillBuildModel(void){  if (mFlags & NS_SINK_FLAG_CAN_INTERRUPT_PARSER) {    nsresult rv = AddDummyParserRequest();    if (NS_FAILED(rv)) {      NS_ERROR("Adding dummy parser request failed");      // Don't return the error result, just reset flag which      // indicates that it can interrupt parsing. If      // AddDummyParserRequests fails it should not affect      // WillBuildModel.      mFlags &= ~NS_SINK_FLAG_CAN_INTERRUPT_PARSER;    }    mBeginLoadTime = PR_IntervalToMicroseconds(PR_IntervalNow());  }  mScrolledToRefAlready = PR_FALSE;  if (mHTMLDocument) {    nsCompatibility mode = eCompatibility_NavQuirks;    if (mParser) {      nsDTDMode dtdMode = mParser->GetParseMode();      switch (dtdMode) {        case eDTDMode_full_standards:          mode = eCompatibility_FullStandards;          break;        case eDTDMode_almost_standards:          mode = eCompatibility_AlmostStandards;          break;        default:          mode = eCompatibility_NavQuirks;          break;      }    }    mHTMLDocument->SetCompatibilityMode(mode);  }  // Notify document that the load is beginning  mDocument->BeginLoad();  return NS_OK;}