bug 299036: Fix crash in CNavDTD by moving newline stripping into the tokenizer. This reduces our reliance on the invariants that the tokenizer tries to provide. r+sr=jst a=chofmann

git-svn-id: svn://10.0.0.236/trunk@175279 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mrbkap%gmail.com
2005-06-29 02:46:45 +00:00
parent 18aa1786a6
commit 052698242f
4 changed files with 46 additions and 60 deletions

View File

@@ -872,8 +872,7 @@ nsresult nsHTMLTokenizer::ConsumeStartTag(PRUnichar aChar,
if (isCDATA) {
// The only tags that consume conservatively are <script> and
// <style>, the rest all consume until the end of the document.
result = textToken->ConsumeCharacterData(0,
theTag==eHTMLTag_script ||
result = textToken->ConsumeCharacterData(theTag==eHTMLTag_script ||
theTag==eHTMLTag_style,
theTag!=eHTMLTag_script,
aScanner,
@@ -888,12 +887,13 @@ nsresult nsHTMLTokenizer::ConsumeStartTag(PRUnichar aChar,
else if (isPCDATA) {
// Title is consumed conservatively in order to not regress
// bug 42945
result = textToken->ConsumeParsedCharacterData(0,
theTag==eHTMLTag_title,
aScanner,
endTagName,
mFlags,
done);
result = textToken->ConsumeParsedCharacterData(
theTag==eHTMLTag_textarea,
theTag==eHTMLTag_title,
aScanner,
endTagName,
mFlags,
done);
// Note: we *don't* set aFlushTokens here.
}