From b09978b72c5a596fdb44228f621e8bd84a636306 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 13 Nov 2003 21:55:26 +0000 Subject: [PATCH] Save the original tagname when viewing source to prevent case-folding. Bug 63137, r=choess, sr=heikki --- htmlparser/src/nsHTMLTokens.cpp | 8 ++++++-- parser/htmlparser/src/nsHTMLTokens.cpp | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/htmlparser/src/nsHTMLTokens.cpp b/htmlparser/src/nsHTMLTokens.cpp index c89d4531720..61406296402 100644 --- a/htmlparser/src/nsHTMLTokens.cpp +++ b/htmlparser/src/nsHTMLTokens.cpp @@ -215,7 +215,9 @@ nsresult CStartToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aFlag nsAutoString theSubstr; result=aScanner.GetIdentifier(theSubstr,PR_TRUE); mTypeID = (PRInt32)nsHTMLTags::LookupTag(theSubstr); - if(eHTMLTag_userdefined==mTypeID) { + // Save the original tag string if this is user-defined or if we + // are viewing source + if(eHTMLTag_userdefined==mTypeID || (aFlag & NS_IPARSER_FLAG_VIEW_SOURCE)) { mTextValue=theSubstr; } } @@ -328,7 +330,9 @@ nsresult CEndToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aFlag) NS_ENSURE_SUCCESS(result, result); mTypeID = (PRInt32)nsHTMLTags::LookupTag(theSubstr); - if(eHTMLTag_userdefined==mTypeID) { + // Save the original tag string if this is user-defined or if we + // are viewing source + if(eHTMLTag_userdefined==mTypeID || (aFlag & NS_IPARSER_FLAG_VIEW_SOURCE)) { mTextValue=theSubstr; } } diff --git a/parser/htmlparser/src/nsHTMLTokens.cpp b/parser/htmlparser/src/nsHTMLTokens.cpp index c89d4531720..61406296402 100644 --- a/parser/htmlparser/src/nsHTMLTokens.cpp +++ b/parser/htmlparser/src/nsHTMLTokens.cpp @@ -215,7 +215,9 @@ nsresult CStartToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aFlag nsAutoString theSubstr; result=aScanner.GetIdentifier(theSubstr,PR_TRUE); mTypeID = (PRInt32)nsHTMLTags::LookupTag(theSubstr); - if(eHTMLTag_userdefined==mTypeID) { + // Save the original tag string if this is user-defined or if we + // are viewing source + if(eHTMLTag_userdefined==mTypeID || (aFlag & NS_IPARSER_FLAG_VIEW_SOURCE)) { mTextValue=theSubstr; } } @@ -328,7 +330,9 @@ nsresult CEndToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aFlag) NS_ENSURE_SUCCESS(result, result); mTypeID = (PRInt32)nsHTMLTags::LookupTag(theSubstr); - if(eHTMLTag_userdefined==mTypeID) { + // Save the original tag string if this is user-defined or if we + // are viewing source + if(eHTMLTag_userdefined==mTypeID || (aFlag & NS_IPARSER_FLAG_VIEW_SOURCE)) { mTextValue=theSubstr; } }