diff --git a/mozilla/htmlparser/src/CNavDTD.cpp b/mozilla/htmlparser/src/CNavDTD.cpp
index cea970cb7b3..79483478457 100644
--- a/mozilla/htmlparser/src/CNavDTD.cpp
+++ b/mozilla/htmlparser/src/CNavDTD.cpp
@@ -1691,13 +1691,11 @@ nsresult CNavDTD::CollectAttributes(nsCParserNode& aNode,eHTMLTags aTag,PRInt32
theToken=(CToken*)mSkippedContent.PopFront();
else theToken=mTokenizer->PopToken();
if(theToken) {
- CAttributeToken* theAttrToken = ((CAttributeToken*)theToken);
- nsString& key=theAttrToken->GetKey();
// Sanitize the key for it might contain some non-alpha-non-digit characters
// at its end. Ex. - This will be tokenized as "<" "OPTION",
// "SELECTED/", and ">". In this case the "SELECTED/" key will be sanitized to
// a legitimate "SELECTED" key.
- theAttrToken->Sanitize(key);
+ ((CAttributeToken*)theToken)->SanitizeKey();
#ifdef RICKG_DEBUG
WriteTokenToLog(theToken);
diff --git a/mozilla/htmlparser/src/nsHTMLTokens.cpp b/mozilla/htmlparser/src/nsHTMLTokens.cpp
index fa67f63fc02..e4e1dbb2b35 100644
--- a/mozilla/htmlparser/src/nsHTMLTokens.cpp
+++ b/mozilla/htmlparser/src/nsHTMLTokens.cpp
@@ -1047,21 +1047,21 @@ PRInt32 CAttributeToken::GetTokenType(void) {
}
/*
- * Removes non-alpha-non-digit characters from the end of the string
+ * Removes non-alpha-non-digit characters from the end of a KEY
*
* @update harishd 07/15/99
- * @param aString - The string might contain garbage at the end!!
+ * @param
* @return
*/
-void CAttributeToken::Sanitize(nsString& aString) {
- PRInt32 length=aString.Length();
+void CAttributeToken::SanitizeKey() {
+ PRInt32 length=mTextKey.Length();
if(length > 0) {
- PRUnichar theChar=aString.Last();
+ PRUnichar theChar=mTextKey.Last();
while(!nsString::IsAlpha(theChar) && !nsString::IsDigit(theChar)) {
- aString.Truncate(length-1);
- length = aString.Length();
+ mTextKey.Truncate(length-1);
+ length = mTextKey.Length();
if(length <= 0) break;
- theChar = aString.Last();
+ theChar = mTextKey.Last();
}
}
return;
diff --git a/mozilla/htmlparser/src/nsHTMLTokens.h b/mozilla/htmlparser/src/nsHTMLTokens.h
index 77767bfd767..573fdfbd587 100644
--- a/mozilla/htmlparser/src/nsHTMLTokens.h
+++ b/mozilla/htmlparser/src/nsHTMLTokens.h
@@ -262,7 +262,7 @@ class CAttributeToken: public CHTMLToken {
virtual const char* GetClassName(void);
virtual PRInt32 GetTokenType(void);
virtual nsString& GetKey(void) {return mTextKey;}
- virtual void Sanitize(nsString& aString);
+ virtual void SanitizeKey();
virtual void DebugDumpToken(ostream& out);
virtual void GetSource(nsString& anOutputString);
virtual void DebugDumpSource(ostream& out);
diff --git a/mozilla/parser/htmlparser/src/CNavDTD.cpp b/mozilla/parser/htmlparser/src/CNavDTD.cpp
index cea970cb7b3..79483478457 100644
--- a/mozilla/parser/htmlparser/src/CNavDTD.cpp
+++ b/mozilla/parser/htmlparser/src/CNavDTD.cpp
@@ -1691,13 +1691,11 @@ nsresult CNavDTD::CollectAttributes(nsCParserNode& aNode,eHTMLTags aTag,PRInt32
theToken=(CToken*)mSkippedContent.PopFront();
else theToken=mTokenizer->PopToken();
if(theToken) {
- CAttributeToken* theAttrToken = ((CAttributeToken*)theToken);
- nsString& key=theAttrToken->GetKey();
// Sanitize the key for it might contain some non-alpha-non-digit characters
// at its end. Ex. - This will be tokenized as "<" "OPTION",
// "SELECTED/", and ">". In this case the "SELECTED/" key will be sanitized to
// a legitimate "SELECTED" key.
- theAttrToken->Sanitize(key);
+ ((CAttributeToken*)theToken)->SanitizeKey();
#ifdef RICKG_DEBUG
WriteTokenToLog(theToken);
diff --git a/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp b/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp
index fa67f63fc02..e4e1dbb2b35 100644
--- a/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp
+++ b/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp
@@ -1047,21 +1047,21 @@ PRInt32 CAttributeToken::GetTokenType(void) {
}
/*
- * Removes non-alpha-non-digit characters from the end of the string
+ * Removes non-alpha-non-digit characters from the end of a KEY
*
* @update harishd 07/15/99
- * @param aString - The string might contain garbage at the end!!
+ * @param
* @return
*/
-void CAttributeToken::Sanitize(nsString& aString) {
- PRInt32 length=aString.Length();
+void CAttributeToken::SanitizeKey() {
+ PRInt32 length=mTextKey.Length();
if(length > 0) {
- PRUnichar theChar=aString.Last();
+ PRUnichar theChar=mTextKey.Last();
while(!nsString::IsAlpha(theChar) && !nsString::IsDigit(theChar)) {
- aString.Truncate(length-1);
- length = aString.Length();
+ mTextKey.Truncate(length-1);
+ length = mTextKey.Length();
if(length <= 0) break;
- theChar = aString.Last();
+ theChar = mTextKey.Last();
}
}
return;
diff --git a/mozilla/parser/htmlparser/src/nsHTMLTokens.h b/mozilla/parser/htmlparser/src/nsHTMLTokens.h
index 77767bfd767..573fdfbd587 100644
--- a/mozilla/parser/htmlparser/src/nsHTMLTokens.h
+++ b/mozilla/parser/htmlparser/src/nsHTMLTokens.h
@@ -262,7 +262,7 @@ class CAttributeToken: public CHTMLToken {
virtual const char* GetClassName(void);
virtual PRInt32 GetTokenType(void);
virtual nsString& GetKey(void) {return mTextKey;}
- virtual void Sanitize(nsString& aString);
+ virtual void SanitizeKey();
virtual void DebugDumpToken(ostream& out);
virtual void GetSource(nsString& anOutputString);
virtual void DebugDumpSource(ostream& out);