bug 272702: Remove skipped content. This simplifies the code handling <script>, <style> and related tags and makes the nsIHTMLContentSink interface just that much easier to implement. This also allows <object> tags to appear in the head with children. r=sicking sr=jst

This commit is contained in:
mrbkap%gmail.com 2005-09-09 18:11:51 +00:00
Родитель 973abde5a4
Коммит 9612499f1c
1 изменённых файлов: 13 добавлений и 15 удалений

Просмотреть файл

@ -1,4 +1,5 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=2 et tw=78: */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -39,13 +40,6 @@
*
* ***** END LICENSE BLOCK ***** */
/**
* MODULE NOTES:
* @update gess 4/8/98
*
*
*/
/*
* Set NS_VIEWSOURCE_TOKENS_PER_BLOCK to 0 to disable multi-block
* output. Multi-block output helps reduce the amount of bidi
@ -538,16 +532,26 @@ NS_IMETHODIMP CViewSourceHTML::BuildModel(nsIParser* aParser,nsITokenizer* aToke
nsCParserNode headNode(&headToken, 0/*stack token*/);
mSink->OpenHead(headNode);
CStartToken titleToken(NS_LITERAL_STRING("TITLE"), eHTMLTag_title);
nsCParserNode titleNode(&titleToken, 0/*stack token*/);
mSink->OpenContainer(titleNode);
// Note that XUL will automatically add the prefix "Source of: "
if (StringBeginsWith(mFilename, NS_LITERAL_STRING("data:")) &&
mFilename.Length() > 50) {
nsAutoString dataFilename(Substring(mFilename, 0, 50));
dataFilename.AppendLiteral("...");
mSink->SetTitle(dataFilename);
CTextToken titleText(dataFilename);
nsCParserNode titleTextNode(&titleText, 0/*stack token*/);
mSink->AddLeaf(titleTextNode);
} else {
mSink->SetTitle(mFilename);
CTextToken titleText(mFilename);
nsCParserNode titleTextNode(&titleText, 0/*stack token*/);
mSink->AddLeaf(titleTextNode);
}
mSink->CloseContainer(eHTMLTag_title);
if (theAllocator) {
CStartToken* theToken=
NS_STATIC_CAST(CStartToken*,
@ -812,12 +816,6 @@ CViewSourceHTML::GetType() {
return NS_IPARSER_FLAG_HTML;
}
NS_IMETHODIMP
CViewSourceHTML::CollectSkippedContent(PRInt32 aTag, nsAString& aContent, PRInt32 &aLineNo)
{
return NS_OK;
}
/**
*
* @update gess5/18/98