Bug 133853 why always add <HTML> token into Tokenizer even there is an <HTML> token already?
r=harishd, sr=jst Check in for Jerry Tan(jerry.tan@sun.com)'s fix.
This commit is contained in:
Родитель
46a243fb50
Коммит
5361ff6879
|
@ -492,9 +492,21 @@ nsresult CNavDTD::BuildModel(nsIParser* aParser,nsITokenizer* aTokenizer,nsIToke
|
|||
mTokenizer->PushTokenFront(theToken);
|
||||
}
|
||||
//if the content model is empty, then begin by opening <html>...
|
||||
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.
|
||||
theToken = (CStartToken*)mTokenizer->GetTokenAt(0);
|
||||
if (theToken) {
|
||||
eHTMLTags theTag = (eHTMLTags)theToken->GetTypeID();
|
||||
if (theTag != eHTMLTag_html) {
|
||||
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.
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
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.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -492,9 +492,21 @@ nsresult CNavDTD::BuildModel(nsIParser* aParser,nsITokenizer* aTokenizer,nsIToke
|
|||
mTokenizer->PushTokenFront(theToken);
|
||||
}
|
||||
//if the content model is empty, then begin by opening <html>...
|
||||
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.
|
||||
theToken = (CStartToken*)mTokenizer->GetTokenAt(0);
|
||||
if (theToken) {
|
||||
eHTMLTags theTag = (eHTMLTags)theToken->GetTypeID();
|
||||
if (theTag != eHTMLTag_html) {
|
||||
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.
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
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.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче