зеркало из https://github.com/mozilla/pjs.git
Bug 160095 NOEMBED tag causes leaks as the skipped content is not consumed.
patch by mrbkap@gmail.com r=rbs sr=brendan
This commit is contained in:
Родитель
dcf385909f
Коммит
70371ad98c
|
@ -3229,6 +3229,12 @@ CNavDTD::OpenContainer(const nsCParserNode *aNode,
|
|||
result = HandleScriptToken(aNode);
|
||||
break;
|
||||
|
||||
case eHTMLTag_noembed:
|
||||
// <noembed> is unconditionally alternate content.
|
||||
done = PR_FALSE;
|
||||
mFlags |= NS_DTD_FLAG_ALTERNATE_CONTENT;
|
||||
break;
|
||||
|
||||
case eHTMLTag_noscript:
|
||||
// we want to make sure that OpenContainer gets called below since we're
|
||||
// not doing it here
|
||||
|
@ -3315,6 +3321,7 @@ CNavDTD::CloseContainer(const eHTMLTags aTag, eHTMLTags aTarget,PRBool aClosedBy
|
|||
break;
|
||||
|
||||
case eHTMLTag_iframe:
|
||||
case eHTMLTag_noembed:
|
||||
case eHTMLTag_noscript:
|
||||
case eHTMLTag_noframes:
|
||||
// switch from alternate content state to regular state
|
||||
|
|
|
@ -859,9 +859,9 @@ void InitializeElementTable(void) {
|
|||
/*req-parent excl-parent*/ eHTMLTag_unknown,eHTMLTag_unknown,
|
||||
/*rootnodes,endrootnodes*/ &gRootTags,&gRootTags,
|
||||
/*autoclose starttags and endtags*/ 0,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kNone, kNone, kNone,
|
||||
/*special props, prop-range*/ kDiscardTag, kDefaultPropRange,
|
||||
/*special parents,kids,skip*/ 0,0,eHTMLTag_noembed);
|
||||
/*parent,incl,exclgroups*/ kFlowEntity, kFlowEntity, kNone,
|
||||
/*special props, prop-range*/ 0, kNoPropRange,
|
||||
/*special parents,kids,skip*/ 0,0,eHTMLTag_unknown);
|
||||
|
||||
Initialize(
|
||||
/*tag*/ eHTMLTag_noframes,
|
||||
|
|
|
@ -817,9 +817,12 @@ nsresult nsHTMLTokenizer::ConsumeStartTag(PRUnichar aChar,
|
|||
PRBool isPCDATA = eHTMLTag_textarea == theTag ||
|
||||
eHTMLTag_title == theTag;
|
||||
|
||||
// XXX This is an evil hack, we should be able to handle these properly
|
||||
// in the DTD.
|
||||
if ((eHTMLTag_iframe == theTag && (mFlags & NS_IPARSER_FLAG_FRAMES_ENABLED)) ||
|
||||
(eHTMLTag_noframes == theTag && (mFlags & NS_IPARSER_FLAG_FRAMES_ENABLED)) ||
|
||||
(eHTMLTag_noscript == theTag && (mFlags & NS_IPARSER_FLAG_SCRIPT_ENABLED))) {
|
||||
(eHTMLTag_noscript == theTag && (mFlags & NS_IPARSER_FLAG_SCRIPT_ENABLED)) ||
|
||||
(eHTMLTag_noembed == theTag)) {
|
||||
isCDATA = PR_TRUE;
|
||||
}
|
||||
|
||||
|
@ -844,7 +847,7 @@ nsresult nsHTMLTokenizer::ConsumeStartTag(PRUnichar aChar,
|
|||
mFlags,
|
||||
done);
|
||||
|
||||
// Only flush tokens for <script>, to give oursevles more of a
|
||||
// Only flush tokens for <script>, to give ourselves more of a
|
||||
// chance of allowing inlines to contain blocks.
|
||||
aFlushTokens = done && theTag == eHTMLTag_script;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче