зеркало из https://github.com/mozilla/gecko-dev.git
Fix for 15204 [ PDT+]
Including tag name when recording trailing contents ( only used on TEXTAREA) r=pollmann a=rickg
This commit is contained in:
Родитель
cd8ce490e8
Коммит
5cca95cdae
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче