From 185d879123d81925902ebe6a0ba198bd4211db99 Mon Sep 17 00:00:00 2001 From: "kyle.yuan%sun.com" Date: Tue, 23 Jul 2002 02:00:48 +0000 Subject: [PATCH] Bug 157865 at the beginning of the page followed by or causes Mozilla to freeze r=choess, sr=bzbarsky, a=asa Check in for Jerry's fix. git-svn-id: svn://10.0.0.236/trunk@125594 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/htmlparser/src/CNavDTD.cpp | 3 ++- mozilla/parser/htmlparser/src/CNavDTD.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mozilla/htmlparser/src/CNavDTD.cpp b/mozilla/htmlparser/src/CNavDTD.cpp index 56cfd8bb2a8..430fdbbe933 100644 --- a/mozilla/htmlparser/src/CNavDTD.cpp +++ b/mozilla/htmlparser/src/CNavDTD.cpp @@ -495,7 +495,8 @@ nsresult CNavDTD::BuildModel(nsIParser* aParser,nsITokenizer* aTokenizer,nsIToke theToken = (CStartToken*)mTokenizer->GetTokenAt(0); if (theToken) { eHTMLTags theTag = (eHTMLTags)theToken->GetTypeID(); - if (theTag != eHTMLTag_html) { + eHTMLTokenTypes theType = eHTMLTokenTypes(theToken->GetTokenType()); + if (theTag != eHTMLTag_html || theType != eToken_start) { theToken = NS_STATIC_CAST(CStartToken*,mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_html,NS_LITERAL_STRING("html"))); if (theToken) { mTokenizer->PushTokenFront(theToken); //this token should get pushed on the context stack. diff --git a/mozilla/parser/htmlparser/src/CNavDTD.cpp b/mozilla/parser/htmlparser/src/CNavDTD.cpp index 56cfd8bb2a8..430fdbbe933 100644 --- a/mozilla/parser/htmlparser/src/CNavDTD.cpp +++ b/mozilla/parser/htmlparser/src/CNavDTD.cpp @@ -495,7 +495,8 @@ nsresult CNavDTD::BuildModel(nsIParser* aParser,nsITokenizer* aTokenizer,nsIToke theToken = (CStartToken*)mTokenizer->GetTokenAt(0); if (theToken) { eHTMLTags theTag = (eHTMLTags)theToken->GetTypeID(); - if (theTag != eHTMLTag_html) { + eHTMLTokenTypes theType = eHTMLTokenTypes(theToken->GetTokenType()); + if (theTag != eHTMLTag_html || theType != eToken_start) { theToken = NS_STATIC_CAST(CStartToken*,mTokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_html,NS_LITERAL_STRING("html"))); if (theToken) { mTokenizer->PushTokenFront(theToken); //this token should get pushed on the context stack.