mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Added code to avoid head tag getting closed
on encountering newlines and whitespaces. This would prevent script tag, inside head, from opening body tag - made up body tag.
This commit is contained in:
parent
b39c6dde91
commit
0c6e6332fa
@ -987,11 +987,13 @@ nsresult CNavDTD::WillHandleStartTag(CToken* aToken,eHTMLTags aTag,nsCParserNode
|
||||
//with any tags that don't belong in the head.
|
||||
if(NS_OK==result) {
|
||||
if(mHasOpenHead){
|
||||
if(!gHTMLElements[eHTMLTag_head].IsChildOfHead(aTag)){
|
||||
|
||||
CEndToken theToken(eHTMLTag_head);
|
||||
nsCParserNode theNode(&theToken,mLineNumber);
|
||||
result=CloseContainer(theNode,eHTMLTag_head,PR_FALSE);
|
||||
static eHTMLTags skip2[]={eHTMLTag_newline,eHTMLTag_whitespace};
|
||||
if(!FindTagInSet(aTag,skip2,sizeof(skip2)/sizeof(eHTMLTag_unknown))){
|
||||
if(!gHTMLElements[eHTMLTag_head].IsChildOfHead(aTag)){
|
||||
CEndToken theToken(eHTMLTag_head);
|
||||
nsCParserNode theNode(&theToken,mLineNumber);
|
||||
result=CloseContainer(theNode,eHTMLTag_head,PR_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -987,11 +987,13 @@ nsresult CNavDTD::WillHandleStartTag(CToken* aToken,eHTMLTags aTag,nsCParserNode
|
||||
//with any tags that don't belong in the head.
|
||||
if(NS_OK==result) {
|
||||
if(mHasOpenHead){
|
||||
if(!gHTMLElements[eHTMLTag_head].IsChildOfHead(aTag)){
|
||||
|
||||
CEndToken theToken(eHTMLTag_head);
|
||||
nsCParserNode theNode(&theToken,mLineNumber);
|
||||
result=CloseContainer(theNode,eHTMLTag_head,PR_FALSE);
|
||||
static eHTMLTags skip2[]={eHTMLTag_newline,eHTMLTag_whitespace};
|
||||
if(!FindTagInSet(aTag,skip2,sizeof(skip2)/sizeof(eHTMLTag_unknown))){
|
||||
if(!gHTMLElements[eHTMLTag_head].IsChildOfHead(aTag)){
|
||||
CEndToken theToken(eHTMLTag_head);
|
||||
nsCParserNode theNode(&theToken,mLineNumber);
|
||||
result=CloseContainer(theNode,eHTMLTag_head,PR_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user