bug 287990: Bring back <plaintext> support. This supports it "properly" (i.e., no end tag). r=jst sr=dbaron a=shaver

git-svn-id: svn://10.0.0.236/trunk@173992 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mrbkap%gmail.com
2005-06-01 22:11:30 +00:00
parent c9f28169f5
commit 6f39bbf718
10 changed files with 60 additions and 3 deletions

View File

@@ -342,6 +342,23 @@ void nsHTMLTokenizer::PrependTokens(nsDeque& aDeque)
}
/**
* Copies the state flags from aTokenizer into this tokenizer. This is used
* to pass information around between the main tokenizer and tokenizers
* created for document.write() calls.
*
* @param aTokenizer The tokenizer with more information in it.
* @return NS_OK
*/
nsresult nsHTMLTokenizer::CopyState(nsITokenizer* aTokenizer)
{
if (aTokenizer) {
mFlags = ((nsHTMLTokenizer*)aTokenizer)->mFlags;
}
return NS_OK;
}
/**
* This is a utilty method for ScanDocStructure, which finds a given
* tag in the stack. The return value is meant to be used with
@@ -834,6 +851,16 @@ nsresult nsHTMLTokenizer::ConsumeStartTag(PRUnichar aChar,
isCDATA = PR_TRUE;
}
// Plaintext contains CDATA, but it's special, so we handle it
// differently than the other CDATA elements
if (eHTMLTag_plaintext == theTag) {
isCDATA = PR_FALSE;
// Note: We check in ConsumeToken() for this flag, and if we see it
// we only construct text tokens (which is what we want).
mFlags |= NS_IPARSER_FLAG_PLAIN_TEXT;
}
if (isCDATA || isPCDATA) {
PRBool done = PR_FALSE;