landing updates for harish, and residual style WIP; r=rickg

This commit is contained in:
rickg@netscape.com
1999-11-22 06:18:24 +00:00
parent 7beb8e6aee
commit 50db323a88
10 changed files with 232 additions and 112 deletions

View File

@@ -542,7 +542,7 @@ nsresult CTextToken::ConsumeUntil(PRUnichar aChar,PRBool aIgnoreComments,nsScann
result=aScanner.ReadUntil(mTextValue,kGreaterThan,PR_TRUE);
}
}
else if(('\b'==theChar) || ('\t'==theChar) || (' '==theChar)) {
else if(('\b'==aChar) || ('\t'==aChar) || (' '==aChar)) {
static CWhitespaceToken theWS;
result=theWS.Consume(aChar,aScanner,aMode);
if(NS_OK==result) {
@@ -986,9 +986,22 @@ nsString& CNewlineToken::GetStringValueXXX(void) {
* @return error result
*/
nsresult CNewlineToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aMode) {
#if 0
mTextValue=kNewLine; //This is what I THINK we should be doing.
#endif
mTextValue=aChar;
//we already read the \r or \n, let's see what's next!
/*******************************************************************
Here's what the HTML spec says about newlines:
"A line break is defined to be a carriage return (
),
a line feed (
), or a carriage return/line feed pair.
All line breaks constitute white space."
*******************************************************************/
PRUnichar theChar;
nsresult result=aScanner.Peek(theChar);
@@ -1000,10 +1013,10 @@ nsresult CNewlineToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aMo
mTextValue+=theChar;
}
break;
case kCR:
case kCR:
//convert CRLF into just CR
if(kNewLine==theChar) {
result=aScanner.GetChar(theChar);
mTextValue+=theChar;
}
break;
default: