Minor adjustments in consuming attributes ( Tracking down '<').

This commit is contained in:
harishd%netscape.com 1999-08-25 21:27:43 +00:00
Родитель 8a89a43d63
Коммит 71fca2d466
4 изменённых файлов: 30 добавлений и 10 удалений

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

@ -331,7 +331,7 @@ nsresult nsHTMLTokenizer::ConsumeTag(PRUnichar aChar,CToken*& aToken,nsScanner&
PRUnichar ch;
result=aScanner.Peek(ch);
if(NS_OK==result) {
if(nsString::IsAlpha(ch)) {
if(nsString::IsAlpha(ch)||(kGreaterThan==ch)) {
result=ConsumeEndTag(aChar,aToken,aScanner);
}
else result=ConsumeComment(aChar,aToken,aScanner);
@ -413,9 +413,19 @@ nsresult nsHTMLTokenizer::ConsumeAttributes(PRUnichar aChar,CStartToken* aToken,
result=aScanner.SkipWhitespace();
if(NS_SUCCEEDED(result)) {
result=aScanner.Peek(aChar);
if(NS_SUCCEEDED(result) && (aChar==kGreaterThan)) { //you just ate the '>'
if(NS_SUCCEEDED(result)) {
if(aChar==kGreaterThan) { //you just ate the '>'
aScanner.GetChar(aChar); //skip the '>'
done=PR_TRUE;
}
else if(aChar==kLessThan) {
eHTMLTags theEndTag = (eHTMLTags)aToken->GetTypeID();
if(result==NS_OK&&(gHTMLElements[theEndTag].mSkipTarget)){
CToken* theEndToken=theRecycler->CreateTokenOfType(eToken_end,theEndTag);
AddToken(theEndToken,NS_OK,mTokenDeque,theRecycler);
}
done=PR_TRUE;
}
}//if
}
}//if

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

@ -1228,7 +1228,7 @@ nsresult CAttributeToken::Consume(PRUnichar aChar, nsScanner& aScanner) {
else {
//If you're here, handle an unquoted key.
//Don't forget to reduce entities inline!
static nsAutoString terminals("\b\t\n\r \"=>");
static nsAutoString terminals("\b\t\n\r \"<=>");
result=aScanner.ReadUntil(mTextKey,terminals,PR_TRUE,PR_FALSE);
}

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

@ -331,7 +331,7 @@ nsresult nsHTMLTokenizer::ConsumeTag(PRUnichar aChar,CToken*& aToken,nsScanner&
PRUnichar ch;
result=aScanner.Peek(ch);
if(NS_OK==result) {
if(nsString::IsAlpha(ch)) {
if(nsString::IsAlpha(ch)||(kGreaterThan==ch)) {
result=ConsumeEndTag(aChar,aToken,aScanner);
}
else result=ConsumeComment(aChar,aToken,aScanner);
@ -413,9 +413,19 @@ nsresult nsHTMLTokenizer::ConsumeAttributes(PRUnichar aChar,CStartToken* aToken,
result=aScanner.SkipWhitespace();
if(NS_SUCCEEDED(result)) {
result=aScanner.Peek(aChar);
if(NS_SUCCEEDED(result) && (aChar==kGreaterThan)) { //you just ate the '>'
if(NS_SUCCEEDED(result)) {
if(aChar==kGreaterThan) { //you just ate the '>'
aScanner.GetChar(aChar); //skip the '>'
done=PR_TRUE;
}
else if(aChar==kLessThan) {
eHTMLTags theEndTag = (eHTMLTags)aToken->GetTypeID();
if(result==NS_OK&&(gHTMLElements[theEndTag].mSkipTarget)){
CToken* theEndToken=theRecycler->CreateTokenOfType(eToken_end,theEndTag);
AddToken(theEndToken,NS_OK,mTokenDeque,theRecycler);
}
done=PR_TRUE;
}
}//if
}
}//if

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

@ -1228,7 +1228,7 @@ nsresult CAttributeToken::Consume(PRUnichar aChar, nsScanner& aScanner) {
else {
//If you're here, handle an unquoted key.
//Don't forget to reduce entities inline!
static nsAutoString terminals("\b\t\n\r \"=>");
static nsAutoString terminals("\b\t\n\r \"<=>");
result=aScanner.ReadUntil(mTextKey,terminals,PR_TRUE,PR_FALSE);
}