From 81953be03a3b2d3adb95e479ef8250c2a60650b4 Mon Sep 17 00:00:00 2001 From: "ftang%netscape.com" Date: Fri, 11 May 2001 14:39:17 +0000 Subject: [PATCH] fix 76689. r=harishd sr=blizzard fix non-ASCII xml element name display in the end tag at xml view source --- htmlparser/src/nsHTMLTokenizer.cpp | 5 ++++- parser/htmlparser/src/nsHTMLTokenizer.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htmlparser/src/nsHTMLTokenizer.cpp b/htmlparser/src/nsHTMLTokenizer.cpp index 5203dab1d4e4..d6dd2eaba701 100644 --- a/htmlparser/src/nsHTMLTokenizer.cpp +++ b/htmlparser/src/nsHTMLTokenizer.cpp @@ -504,7 +504,10 @@ nsresult nsHTMLTokenizer::ConsumeTag(PRUnichar aChar,CToken*& aToken,nsScanner& result=aScanner.Peek(theNextChar, 1); if(NS_OK==result) { - if(nsCRT::IsAsciiAlpha(theNextChar)||(kGreaterThan==theNextChar)) { + // xml allow non ASCII tag name, consume as end tag. need to make xml view source work + PRBool isXML=((eXMLText==mDocType) || (eXHTMLText==mDocType)); + if(nsCRT::IsAsciiAlpha(theNextChar)||(kGreaterThan==theNextChar)|| + (isXML && (! nsCRT::IsAscii(theNextChar)))) { result=ConsumeEndTag(aChar,aToken,aScanner); } else result=ConsumeComment(aChar,aToken,aScanner); diff --git a/parser/htmlparser/src/nsHTMLTokenizer.cpp b/parser/htmlparser/src/nsHTMLTokenizer.cpp index 5203dab1d4e4..d6dd2eaba701 100644 --- a/parser/htmlparser/src/nsHTMLTokenizer.cpp +++ b/parser/htmlparser/src/nsHTMLTokenizer.cpp @@ -504,7 +504,10 @@ nsresult nsHTMLTokenizer::ConsumeTag(PRUnichar aChar,CToken*& aToken,nsScanner& result=aScanner.Peek(theNextChar, 1); if(NS_OK==result) { - if(nsCRT::IsAsciiAlpha(theNextChar)||(kGreaterThan==theNextChar)) { + // xml allow non ASCII tag name, consume as end tag. need to make xml view source work + PRBool isXML=((eXMLText==mDocType) || (eXHTMLText==mDocType)); + if(nsCRT::IsAsciiAlpha(theNextChar)||(kGreaterThan==theNextChar)|| + (isXML && (! nsCRT::IsAscii(theNextChar)))) { result=ConsumeEndTag(aChar,aToken,aScanner); } else result=ConsumeComment(aChar,aToken,aScanner);