Bug 110544, improving comment parsing by avioding string copies and other trickery. r=harishd, sr=jst, a=asa.

git-svn-id: svn://10.0.0.236/trunk@116687 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
heikki%netscape.com
2002-03-16 03:03:45 +00:00
parent de840dd3e9
commit 82bf6a58a6
7 changed files with 404 additions and 370 deletions

View File

@@ -1169,8 +1169,11 @@ NS_IMETHODIMP CViewSourceHTML::HandleToken(CToken* aToken,nsIParser* aParser) {
case eToken_comment:
{
const nsAReadableString& commentValue = aToken->GetStringValue();
result=WriteTag(mCommentTag,commentValue,0,PR_TRUE);
nsAutoString theStr;
theStr.Assign(NS_LITERAL_STRING("<!--") +
aToken->GetStringValue() +
NS_LITERAL_STRING("-->") );
result=WriteTag(mCommentTag,theStr,0,PR_TRUE);
}
break;