зеркало из https://github.com/mozilla/gecko-dev.git
Minor adjustments in consuming attributes ( Tracking down '<').
This commit is contained in:
Родитель
8a89a43d63
Коммит
71fca2d466
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче