Bug 207904, doctype with name only got destroyed by our doctype handling, r=harishd, sr=jst.

This commit is contained in:
heikki%netscape.com 2003-06-03 17:47:10 +00:00
Родитель ce5744af12
Коммит 826f91eada
2 изменённых файлов: 14 добавлений и 4 удалений

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

@ -504,6 +504,8 @@ nsExpatDriver::HandleEndCdataSection()
* detected errors. The only slightly problematic case is whitespace
* between the tokens. There MUST be whitespace between the tokens
* EXCEPT right before > and [.
*
* We assume the string will not contain the ending '>'.
*/
static void
GetDocTypeToken(nsString& aStr,
@ -516,9 +518,12 @@ GetDocTypeToken(nsString& aStr,
PRInt32 endQuote = aStr.FindChar(aStr[0],1);
aStr.Mid(aToken,1,endQuote-1);
aStr.Cut(0,endQuote+1);
} else {
static const char* kDelimiter = " >[\r\n\t"; // Optimized for typical cases
} else {
static const char* kDelimiter = " [\r\n\t"; // Optimized for typical cases
PRInt32 tokenEnd = aStr.FindCharInSet(kDelimiter);
if (tokenEnd < 0) {
tokenEnd = aStr.Length();
}
if (tokenEnd > 0) {
aStr.Left(aToken, tokenEnd);
aStr.Cut(0, tokenEnd);

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

@ -504,6 +504,8 @@ nsExpatDriver::HandleEndCdataSection()
* detected errors. The only slightly problematic case is whitespace
* between the tokens. There MUST be whitespace between the tokens
* EXCEPT right before > and [.
*
* We assume the string will not contain the ending '>'.
*/
static void
GetDocTypeToken(nsString& aStr,
@ -516,9 +518,12 @@ GetDocTypeToken(nsString& aStr,
PRInt32 endQuote = aStr.FindChar(aStr[0],1);
aStr.Mid(aToken,1,endQuote-1);
aStr.Cut(0,endQuote+1);
} else {
static const char* kDelimiter = " >[\r\n\t"; // Optimized for typical cases
} else {
static const char* kDelimiter = " [\r\n\t"; // Optimized for typical cases
PRInt32 tokenEnd = aStr.FindCharInSet(kDelimiter);
if (tokenEnd < 0) {
tokenEnd = aStr.Length();
}
if (tokenEnd > 0) {
aStr.Left(aToken, tokenEnd);
aStr.Cut(0, tokenEnd);