42429 - Pass whitespace, inside table, to the sink.
44178 - Enabled SERVER tag 43005 - Made HR a block element per spec. 43499 - Made XML document with .txt extension to be rendered as plain text 45437 - Enabled META charset notification in strict DTD. r=pollmann
This commit is contained in:
Родитель
23d1950d4a
Коммит
c97698ad33
|
@ -713,10 +713,8 @@ nsresult COtherDTD::WillHandleStartTag(CToken* aToken,eHTMLTags aTag,nsCParserNo
|
|||
|
||||
CObserverService* theService=mParser->GetObserverService();
|
||||
if(theService) {
|
||||
CParserContext* pc=mParser->PeekContext();
|
||||
void* theDocID=(pc)? pc->mKey:0;
|
||||
|
||||
result=theService->Notify(aTag,aNode,theDocID, NS_ConvertToString(kHTMLTextContentType), mParser);
|
||||
const nsISupportsParserBundle* bundle=mParser->GetParserBundle();
|
||||
result=theService->Notify(aTag,aNode,(void*)bundle, NS_ConvertToString(kHTMLTextContentType), mParser);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -633,7 +633,7 @@ void InitializeElementTable(void) {
|
|||
/*req-parent excl-parent*/ eHTMLTag_unknown,eHTMLTag_unknown,
|
||||
/*rootnodes,endrootnodes*/ &gRootTags,&gRootTags,
|
||||
/*autoclose starttags and endtags*/ &gHRAutoClose,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kSpecial, kNone, kNone,
|
||||
/*parent,incl,exclgroups*/ kBlock, kNone, kNone,
|
||||
/*special props, prop-range*/ kNonContainer,kDefaultPropRange,
|
||||
/*special parents,kids,skip*/ 0,0,eHTMLTag_unknown);
|
||||
|
||||
|
@ -984,7 +984,7 @@ void InitializeElementTable(void) {
|
|||
/*req-parent excl-parent*/ eHTMLTag_unknown,eHTMLTag_unknown,
|
||||
/*rootnodes,endrootnodes*/ &gRootTags,&gRootTags,
|
||||
/*autoclose starttags and endtags*/ 0,0,0,0,
|
||||
/*parent,incl,exclgroups*/ (kSpecial|kHeadMisc), kPCDATA, kNone,
|
||||
/*parent,incl,exclgroups*/ (kSpecial|kHeadMisc), kCDATA, kNone,
|
||||
/*special props, prop-range*/ kNoStyleLeaksIn|kLegalOpen, kNoPropRange,
|
||||
/*special parents,kids,skip*/ 0,&gContainsText,eHTMLTag_script);
|
||||
|
||||
|
@ -1002,9 +1002,9 @@ void InitializeElementTable(void) {
|
|||
/*req-parent excl-parent*/ eHTMLTag_unknown,eHTMLTag_unknown,
|
||||
/*rootnodes,endrootnodes*/ &gRootTags,&gRootTags,
|
||||
/*autoclose starttags and endtags*/ 0,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kNone, kNone, kNone,
|
||||
/*special props, prop-range*/ kNoStyleLeaksIn, kNoPropRange,
|
||||
/*special parents,kids,skip*/ 0,0,eHTMLTag_unknown);
|
||||
/*parent,incl,exclgroups*/ (kSpecial|kHeadMisc), kCDATA, kNone,
|
||||
/*special props, prop-range*/ (kNoStyleLeaksIn|kLegalOpen), kNoPropRange,
|
||||
/*special parents,kids,skip*/ 0,&gContainsText,eHTMLTag_server);
|
||||
|
||||
Initialize(
|
||||
/*tag*/ eHTMLTag_small,
|
||||
|
@ -1083,7 +1083,7 @@ void InitializeElementTable(void) {
|
|||
/*req-parent excl-parent*/ eHTMLTag_unknown,eHTMLTag_unknown,
|
||||
/*rootnodes,endrootnodes*/ &gInHead, &gInHead,
|
||||
/*autoclose starttags and endtags*/ 0,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kHeadMisc, kPCDATA, kNone,
|
||||
/*parent,incl,exclgroups*/ kHeadMisc, kCDATA, kNone,
|
||||
/*special props, prop-range*/ kNoStyleLeaksIn|kNonContainer, kNoPropRange,
|
||||
/*special parents,kids,skip*/ &gInHead,0,eHTMLTag_style);
|
||||
|
||||
|
@ -1112,7 +1112,7 @@ void InitializeElementTable(void) {
|
|||
/*rootnodes,endrootnodes*/ &gTableRootTags,&gTableRootTags,
|
||||
/*autoclose starttags and endtags*/ 0,&gTableCloseTags,0,0,
|
||||
/*parent,incl,exclgroups*/ kBlock, kNone, (kSelf|kInlineEntity),
|
||||
/*special props, prop-range*/ (kOmitWS|kBadContentWatch|kNoStyleLeaksIn), 2,
|
||||
/*special props, prop-range*/ (kBadContentWatch|kNoStyleLeaksIn), 2,
|
||||
/*special parents,kids,skip*/ 0,&gTableKids,eHTMLTag_unknown);
|
||||
|
||||
Initialize(
|
||||
|
@ -1121,7 +1121,7 @@ void InitializeElementTable(void) {
|
|||
/*rootnodes,endrootnodes*/ &gInTable, &gInTable,
|
||||
/*autoclose starttags and endtags*/ &gTBodyAutoClose,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kNone, kNone, (kSelf|kInlineEntity),
|
||||
/*special props, prop-range*/ (kNoPropagate|kOmitWS|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kDefaultPropRange,
|
||||
/*special props, prop-range*/ (kNoPropagate|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kDefaultPropRange,
|
||||
/*special parents,kids,skip*/ &gInTable,&gTBodyKids,eHTMLTag_unknown);
|
||||
|
||||
Initialize(
|
||||
|
@ -1148,7 +1148,7 @@ void InitializeElementTable(void) {
|
|||
/*rootnodes,endrootnodes*/ &gInTable, &gInTable,
|
||||
/*autoclose starttags and endtags*/ &gTBodyAutoClose,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kNone, kNone, kSelf,
|
||||
/*special props, prop-range*/ (kNoPropagate|kOmitWS|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kNoPropRange,
|
||||
/*special props, prop-range*/ (kNoPropagate|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kNoPropRange,
|
||||
/*special parents,kids,skip*/ &gInTable,&gTableElemKids,eHTMLTag_unknown);
|
||||
|
||||
Initialize(
|
||||
|
@ -1166,7 +1166,7 @@ void InitializeElementTable(void) {
|
|||
/*rootnodes,endrootnodes*/ &gInTable,&gInTable,
|
||||
/*autoclose starttags and endtags*/ &gTBodyAutoClose,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kNone, kNone, kSelf,
|
||||
/*special props, prop-range*/ (kNoPropagate|kOmitWS|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kNoPropRange,
|
||||
/*special props, prop-range*/ (kNoPropagate|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kNoPropRange,
|
||||
/*special parents,kids,skip*/ &gInTable,&gTableElemKids,eHTMLTag_unknown);
|
||||
|
||||
Initialize(
|
||||
|
@ -1184,7 +1184,7 @@ void InitializeElementTable(void) {
|
|||
/*rootnodes,endrootnodes*/ &gTRParents,&gTREndParents,
|
||||
/*autoclose starttags and endtags*/ &gTRCloseTags,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kNone, kNone, kInlineEntity,
|
||||
/*special props, prop-range*/ (kOmitWS|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kNoPropRange,
|
||||
/*special props, prop-range*/ (kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kNoPropRange,
|
||||
/*special parents,kids,skip*/ &gTRParents,&gTRKids,eHTMLTag_unknown);
|
||||
|
||||
Initialize(
|
||||
|
|
|
@ -59,11 +59,12 @@ static const int kBlockMisc = 0x0400; // OBJECT, SCRIPT
|
|||
static const int kBlock = 0x0800; // ADDRESS, BLOCKQUOTE, CENTER, DIV, DL, FIELDSET, FORM,
|
||||
// ISINDEX, HR, NOSCRIPT, NOFRAMES, P, TABLE
|
||||
static const int kList = 0x1000; // UL, OL, DIR, MENU
|
||||
static const int kPCDATA = 0x2000; // just plain text...
|
||||
static const int kPCDATA = 0x2000; // plain text and entities...
|
||||
static const int kSelf = 0x4000; // whatever THIS tag is...
|
||||
static const int kExtensions = 0x8000; // BGSOUND, WBR, NOBR
|
||||
static const int kTable = 0x10000;// TR,TD,THEAD,TBODY,TFOOT,CAPTION,TH
|
||||
static const int kDLChild = 0x20000;// DL, DT
|
||||
static const int kCDATA = 0x40000;// just plain text...
|
||||
|
||||
static const int kInlineEntity = (kPCDATA|kFontStyle|kPhrase|kSpecial|kFormControl|kExtensions); // #PCDATA, %fontstyle, %phrase, %special, %formctrl
|
||||
static const int kBlockEntity = (kHeading|kList|kPreformatted|kBlock); // %heading, %list, %preformatted, %block
|
||||
|
|
|
@ -547,7 +547,8 @@ nsresult nsHTMLTokenizer::ConsumeStartTag(PRUnichar aChar,CToken*& aToken,nsScan
|
|||
if(mRecordTrailingContent)
|
||||
RecordTrailingContent((CStartToken*)aToken,aScanner);
|
||||
|
||||
if((eHTMLTag_style==theTag) || (eHTMLTag_script==theTag)) {
|
||||
//if((eHTMLTag_style==theTag) || (eHTMLTag_script==theTag)) {
|
||||
if(gHTMLElements[theTag].CanContainType(kCDATA)) {
|
||||
nsAutoString endTag; endTag.AssignWithConversion(nsHTMLTags::GetStringValue(theTag));
|
||||
endTag.InsertWithConversion("</",0,2);
|
||||
CToken* textToken=theRecycler->CreateTokenOfType(eToken_text,eHTMLTag_text);
|
||||
|
|
|
@ -651,9 +651,13 @@ void DetermineParseMode(nsString& aBuffer,nsDTDMode& aParseMode,eParserDocType&
|
|||
aDocType=eHTML4Text;
|
||||
aParseMode=eDTDMode_strict;
|
||||
}
|
||||
else aDocType=eXMLText;
|
||||
return;
|
||||
|
||||
else {
|
||||
if(!aMimeType.EqualsWithConversion(kPlainTextContentType)) {
|
||||
aDocType=eXMLText;
|
||||
}
|
||||
else aDocType=ePlainText;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if(aMimeType.EqualsWithConversion(kPlainTextContentType)) {
|
||||
aDocType=ePlainText;
|
||||
|
|
|
@ -713,10 +713,8 @@ nsresult COtherDTD::WillHandleStartTag(CToken* aToken,eHTMLTags aTag,nsCParserNo
|
|||
|
||||
CObserverService* theService=mParser->GetObserverService();
|
||||
if(theService) {
|
||||
CParserContext* pc=mParser->PeekContext();
|
||||
void* theDocID=(pc)? pc->mKey:0;
|
||||
|
||||
result=theService->Notify(aTag,aNode,theDocID, NS_ConvertToString(kHTMLTextContentType), mParser);
|
||||
const nsISupportsParserBundle* bundle=mParser->GetParserBundle();
|
||||
result=theService->Notify(aTag,aNode,(void*)bundle, NS_ConvertToString(kHTMLTextContentType), mParser);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -633,7 +633,7 @@ void InitializeElementTable(void) {
|
|||
/*req-parent excl-parent*/ eHTMLTag_unknown,eHTMLTag_unknown,
|
||||
/*rootnodes,endrootnodes*/ &gRootTags,&gRootTags,
|
||||
/*autoclose starttags and endtags*/ &gHRAutoClose,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kSpecial, kNone, kNone,
|
||||
/*parent,incl,exclgroups*/ kBlock, kNone, kNone,
|
||||
/*special props, prop-range*/ kNonContainer,kDefaultPropRange,
|
||||
/*special parents,kids,skip*/ 0,0,eHTMLTag_unknown);
|
||||
|
||||
|
@ -984,7 +984,7 @@ void InitializeElementTable(void) {
|
|||
/*req-parent excl-parent*/ eHTMLTag_unknown,eHTMLTag_unknown,
|
||||
/*rootnodes,endrootnodes*/ &gRootTags,&gRootTags,
|
||||
/*autoclose starttags and endtags*/ 0,0,0,0,
|
||||
/*parent,incl,exclgroups*/ (kSpecial|kHeadMisc), kPCDATA, kNone,
|
||||
/*parent,incl,exclgroups*/ (kSpecial|kHeadMisc), kCDATA, kNone,
|
||||
/*special props, prop-range*/ kNoStyleLeaksIn|kLegalOpen, kNoPropRange,
|
||||
/*special parents,kids,skip*/ 0,&gContainsText,eHTMLTag_script);
|
||||
|
||||
|
@ -1002,9 +1002,9 @@ void InitializeElementTable(void) {
|
|||
/*req-parent excl-parent*/ eHTMLTag_unknown,eHTMLTag_unknown,
|
||||
/*rootnodes,endrootnodes*/ &gRootTags,&gRootTags,
|
||||
/*autoclose starttags and endtags*/ 0,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kNone, kNone, kNone,
|
||||
/*special props, prop-range*/ kNoStyleLeaksIn, kNoPropRange,
|
||||
/*special parents,kids,skip*/ 0,0,eHTMLTag_unknown);
|
||||
/*parent,incl,exclgroups*/ (kSpecial|kHeadMisc), kCDATA, kNone,
|
||||
/*special props, prop-range*/ (kNoStyleLeaksIn|kLegalOpen), kNoPropRange,
|
||||
/*special parents,kids,skip*/ 0,&gContainsText,eHTMLTag_server);
|
||||
|
||||
Initialize(
|
||||
/*tag*/ eHTMLTag_small,
|
||||
|
@ -1083,7 +1083,7 @@ void InitializeElementTable(void) {
|
|||
/*req-parent excl-parent*/ eHTMLTag_unknown,eHTMLTag_unknown,
|
||||
/*rootnodes,endrootnodes*/ &gInHead, &gInHead,
|
||||
/*autoclose starttags and endtags*/ 0,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kHeadMisc, kPCDATA, kNone,
|
||||
/*parent,incl,exclgroups*/ kHeadMisc, kCDATA, kNone,
|
||||
/*special props, prop-range*/ kNoStyleLeaksIn|kNonContainer, kNoPropRange,
|
||||
/*special parents,kids,skip*/ &gInHead,0,eHTMLTag_style);
|
||||
|
||||
|
@ -1112,7 +1112,7 @@ void InitializeElementTable(void) {
|
|||
/*rootnodes,endrootnodes*/ &gTableRootTags,&gTableRootTags,
|
||||
/*autoclose starttags and endtags*/ 0,&gTableCloseTags,0,0,
|
||||
/*parent,incl,exclgroups*/ kBlock, kNone, (kSelf|kInlineEntity),
|
||||
/*special props, prop-range*/ (kOmitWS|kBadContentWatch|kNoStyleLeaksIn), 2,
|
||||
/*special props, prop-range*/ (kBadContentWatch|kNoStyleLeaksIn), 2,
|
||||
/*special parents,kids,skip*/ 0,&gTableKids,eHTMLTag_unknown);
|
||||
|
||||
Initialize(
|
||||
|
@ -1121,7 +1121,7 @@ void InitializeElementTable(void) {
|
|||
/*rootnodes,endrootnodes*/ &gInTable, &gInTable,
|
||||
/*autoclose starttags and endtags*/ &gTBodyAutoClose,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kNone, kNone, (kSelf|kInlineEntity),
|
||||
/*special props, prop-range*/ (kNoPropagate|kOmitWS|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kDefaultPropRange,
|
||||
/*special props, prop-range*/ (kNoPropagate|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kDefaultPropRange,
|
||||
/*special parents,kids,skip*/ &gInTable,&gTBodyKids,eHTMLTag_unknown);
|
||||
|
||||
Initialize(
|
||||
|
@ -1148,7 +1148,7 @@ void InitializeElementTable(void) {
|
|||
/*rootnodes,endrootnodes*/ &gInTable, &gInTable,
|
||||
/*autoclose starttags and endtags*/ &gTBodyAutoClose,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kNone, kNone, kSelf,
|
||||
/*special props, prop-range*/ (kNoPropagate|kOmitWS|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kNoPropRange,
|
||||
/*special props, prop-range*/ (kNoPropagate|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kNoPropRange,
|
||||
/*special parents,kids,skip*/ &gInTable,&gTableElemKids,eHTMLTag_unknown);
|
||||
|
||||
Initialize(
|
||||
|
@ -1166,7 +1166,7 @@ void InitializeElementTable(void) {
|
|||
/*rootnodes,endrootnodes*/ &gInTable,&gInTable,
|
||||
/*autoclose starttags and endtags*/ &gTBodyAutoClose,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kNone, kNone, kSelf,
|
||||
/*special props, prop-range*/ (kNoPropagate|kOmitWS|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kNoPropRange,
|
||||
/*special props, prop-range*/ (kNoPropagate|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kNoPropRange,
|
||||
/*special parents,kids,skip*/ &gInTable,&gTableElemKids,eHTMLTag_unknown);
|
||||
|
||||
Initialize(
|
||||
|
@ -1184,7 +1184,7 @@ void InitializeElementTable(void) {
|
|||
/*rootnodes,endrootnodes*/ &gTRParents,&gTREndParents,
|
||||
/*autoclose starttags and endtags*/ &gTRCloseTags,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kNone, kNone, kInlineEntity,
|
||||
/*special props, prop-range*/ (kOmitWS|kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kNoPropRange,
|
||||
/*special props, prop-range*/ (kBadContentWatch|kNoStyleLeaksIn|kNoStyleLeaksOut), kNoPropRange,
|
||||
/*special parents,kids,skip*/ &gTRParents,&gTRKids,eHTMLTag_unknown);
|
||||
|
||||
Initialize(
|
||||
|
|
|
@ -59,11 +59,12 @@ static const int kBlockMisc = 0x0400; // OBJECT, SCRIPT
|
|||
static const int kBlock = 0x0800; // ADDRESS, BLOCKQUOTE, CENTER, DIV, DL, FIELDSET, FORM,
|
||||
// ISINDEX, HR, NOSCRIPT, NOFRAMES, P, TABLE
|
||||
static const int kList = 0x1000; // UL, OL, DIR, MENU
|
||||
static const int kPCDATA = 0x2000; // just plain text...
|
||||
static const int kPCDATA = 0x2000; // plain text and entities...
|
||||
static const int kSelf = 0x4000; // whatever THIS tag is...
|
||||
static const int kExtensions = 0x8000; // BGSOUND, WBR, NOBR
|
||||
static const int kTable = 0x10000;// TR,TD,THEAD,TBODY,TFOOT,CAPTION,TH
|
||||
static const int kDLChild = 0x20000;// DL, DT
|
||||
static const int kCDATA = 0x40000;// just plain text...
|
||||
|
||||
static const int kInlineEntity = (kPCDATA|kFontStyle|kPhrase|kSpecial|kFormControl|kExtensions); // #PCDATA, %fontstyle, %phrase, %special, %formctrl
|
||||
static const int kBlockEntity = (kHeading|kList|kPreformatted|kBlock); // %heading, %list, %preformatted, %block
|
||||
|
|
|
@ -547,7 +547,8 @@ nsresult nsHTMLTokenizer::ConsumeStartTag(PRUnichar aChar,CToken*& aToken,nsScan
|
|||
if(mRecordTrailingContent)
|
||||
RecordTrailingContent((CStartToken*)aToken,aScanner);
|
||||
|
||||
if((eHTMLTag_style==theTag) || (eHTMLTag_script==theTag)) {
|
||||
//if((eHTMLTag_style==theTag) || (eHTMLTag_script==theTag)) {
|
||||
if(gHTMLElements[theTag].CanContainType(kCDATA)) {
|
||||
nsAutoString endTag; endTag.AssignWithConversion(nsHTMLTags::GetStringValue(theTag));
|
||||
endTag.InsertWithConversion("</",0,2);
|
||||
CToken* textToken=theRecycler->CreateTokenOfType(eToken_text,eHTMLTag_text);
|
||||
|
|
|
@ -651,9 +651,13 @@ void DetermineParseMode(nsString& aBuffer,nsDTDMode& aParseMode,eParserDocType&
|
|||
aDocType=eHTML4Text;
|
||||
aParseMode=eDTDMode_strict;
|
||||
}
|
||||
else aDocType=eXMLText;
|
||||
return;
|
||||
|
||||
else {
|
||||
if(!aMimeType.EqualsWithConversion(kPlainTextContentType)) {
|
||||
aDocType=eXMLText;
|
||||
}
|
||||
else aDocType=ePlainText;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if(aMimeType.EqualsWithConversion(kPlainTextContentType)) {
|
||||
aDocType=ePlainText;
|
||||
|
|
Загрузка…
Ссылка в новой задаче