Including tag name when recording trailing contents ( only used on TEXTAREA)
r=pollmann
a=rickg
This commit is contained in:
harishd%netscape.com 2000-03-09 22:16:10 +00:00
Родитель cd8ce490e8
Коммит 5cca95cdae
4 изменённых файлов: 22 добавлений и 6 удалений

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

@ -491,7 +491,8 @@ nsresult nsHTMLTokenizer::ConsumeStartTag(PRUnichar aChar,CToken*& aToken,nsScan
aToken=theRecycler->CreateTokenOfType(eToken_start,eHTMLTag_unknown);
if(aToken) {
result= aToken->Consume(aChar,aScanner,mPlainText); //tell new token to finish consuming text...
((CStartToken*)aToken)->mOrigin=aScanner.GetOffset()-1; // Save the position after '<' for use in recording traling contents. Ref: Bug. 15204.
result= aToken->Consume(aChar,aScanner,mPlainText); //tell new token to finish consuming text...
if(NS_SUCCEEDED(result)) {
AddToken(aToken,result,&mTokenDeque,theRecycler);

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

@ -257,7 +257,6 @@ nsresult CStartToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aMode
//and see if the next char is ">". If so, we have a complete
//tag without attributes.
if(NS_OK==result) {
mOrigin=aScanner.GetOffset(); // We need this position to record the trailing contents of the start token
result=aScanner.SkipWhitespace();
mNewlineCount += aScanner.GetNewlinesSkipped();
if(NS_OK==result) {
@ -299,7 +298,15 @@ void CStartToken::DebugDumpSource(nsOutputStream& out) {
*/
void CStartToken::GetSource(nsString& anOutputString){
anOutputString="<";
anOutputString+=mTextValue;
/*
* mTextValue used to contain the name of the tag.
* But for the sake of performance we now rely on the tagID
* rather than tag name. This however, caused bug 15204
* to reincarnate. Since, mTextvalue is not being used here..
* I'm just going to comment it out.
*
*/
// anOutputString+=mTextValue;
if(mTrailingContent.Length()>0)
anOutputString+=mTrailingContent;
}

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

@ -491,7 +491,8 @@ nsresult nsHTMLTokenizer::ConsumeStartTag(PRUnichar aChar,CToken*& aToken,nsScan
aToken=theRecycler->CreateTokenOfType(eToken_start,eHTMLTag_unknown);
if(aToken) {
result= aToken->Consume(aChar,aScanner,mPlainText); //tell new token to finish consuming text...
((CStartToken*)aToken)->mOrigin=aScanner.GetOffset()-1; // Save the position after '<' for use in recording traling contents. Ref: Bug. 15204.
result= aToken->Consume(aChar,aScanner,mPlainText); //tell new token to finish consuming text...
if(NS_SUCCEEDED(result)) {
AddToken(aToken,result,&mTokenDeque,theRecycler);

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

@ -257,7 +257,6 @@ nsresult CStartToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aMode
//and see if the next char is ">". If so, we have a complete
//tag without attributes.
if(NS_OK==result) {
mOrigin=aScanner.GetOffset(); // We need this position to record the trailing contents of the start token
result=aScanner.SkipWhitespace();
mNewlineCount += aScanner.GetNewlinesSkipped();
if(NS_OK==result) {
@ -299,7 +298,15 @@ void CStartToken::DebugDumpSource(nsOutputStream& out) {
*/
void CStartToken::GetSource(nsString& anOutputString){
anOutputString="<";
anOutputString+=mTextValue;
/*
* mTextValue used to contain the name of the tag.
* But for the sake of performance we now rely on the tagID
* rather than tag name. This however, caused bug 15204
* to reincarnate. Since, mTextvalue is not being used here..
* I'm just going to comment it out.
*
*/
// anOutputString+=mTextValue;
if(mTrailingContent.Length()>0)
anOutputString+=mTrailingContent;
}