Loading content/html/document/src/nsHTMLContentSink.cpp +3 −1 Original line number Original line Diff line number Diff line Loading @@ -538,10 +538,12 @@ MakeContentObject(nsHTMLTag aNodeType, break; break; case eHTMLTag_form: case eHTMLTag_form: // the form was already created // the form was already created *aResult = nsnull; if (aForm) { if (aForm) { rv = aForm->QueryInterface(kIHTMLContentIID, (void**)aResult); rv = aForm->QueryInterface(kIHTMLContentIID, (void**)aResult); } } else { rv = NS_NewHTMLFormElement(aResult, aAtom); } break; break; case eHTMLTag_frame: case eHTMLTag_frame: rv = NS_NewHTMLFrameElement(aResult, aAtom); rv = NS_NewHTMLFrameElement(aResult, aAtom); Loading content/xml/document/src/nsXMLContentSink.cpp +40 −24 Original line number Original line Diff line number Diff line Loading @@ -455,7 +455,8 @@ nsXMLContentSink::OpenContainer(const nsIParserNode& aNode) nsAutoString tag, nameSpace; nsAutoString tag, nameSpace; PRInt32 nsoffset; PRInt32 nsoffset; PRInt32 id = gNameSpaceId_Unknown; PRInt32 id = gNameSpaceId_Unknown; PRBool isHTML = nsnull; PRBool isHTML = PR_FALSE; PRBool pushContent = PR_TRUE; nsIContent *content; nsIContent *content; // XXX Hopefully the parser will flag this before we get // XXX Hopefully the parser will flag this before we get Loading Loading @@ -494,7 +495,13 @@ nsXMLContentSink::OpenContainer(const nsIParserNode& aNode) if (nsHTMLAtoms::script == tagAtom) { if (nsHTMLAtoms::script == tagAtom) { result = ProcessStartSCRIPTTag(aNode); result = ProcessStartSCRIPTTag(aNode); } } // XXX Treat the form elements as a leaf element (even if it is a // container). Need to do further processing with forms else if (nsHTMLAtoms::form == tagAtom) { pushContent = PR_FALSE; } NS_RELEASE(tagAtom); NS_RELEASE(tagAtom); nsIHTMLContent *htmlContent = nsnull; nsIHTMLContent *htmlContent = nsnull; result = NS_CreateHTMLElement(&htmlContent, tag); result = NS_CreateHTMLElement(&htmlContent, tag); content = (nsIContent *)htmlContent; content = (nsIContent *)htmlContent; Loading Loading @@ -533,9 +540,11 @@ nsXMLContentSink::OpenContainer(const nsIParserNode& aNode) parent->AppendChildTo(content, PR_FALSE); parent->AppendChildTo(content, PR_FALSE); } } if (pushContent) { PushContent(content); PushContent(content); } } } } } return result; return result; } } Loading @@ -547,7 +556,8 @@ nsXMLContentSink::CloseContainer(const nsIParserNode& aNode) nsAutoString tag, nameSpace; nsAutoString tag, nameSpace; PRInt32 nsoffset; PRInt32 nsoffset; PRInt32 id = gNameSpaceId_Unknown; PRInt32 id = gNameSpaceId_Unknown; PRBool isHTML = nsnull; PRBool isHTML = PR_FALSE; PRBool popContent = PR_TRUE; // XXX Hopefully the parser will flag this before we get // XXX Hopefully the parser will flag this before we get // here. If we're in the prolog or epilog, there should be // here. If we're in the prolog or epilog, there should be Loading @@ -571,19 +581,24 @@ nsXMLContentSink::CloseContainer(const nsIParserNode& aNode) FlushText(); FlushText(); } } nsIContent* content = PopContent(); if (nsnull != content) { PRInt32 nestLevel = GetCurrentNestLevel(); if (isHTML) { if (isHTML) { tag.ToUpperCase(); tag.ToUpperCase(); nsIAtom* tagAtom = NS_NewAtom(tag); nsIAtom* tagAtom = NS_NewAtom(tag); if (nsHTMLAtoms::script == tagAtom) { if (nsHTMLAtoms::script == tagAtom) { result = ProcessEndSCRIPTTag(aNode); result = ProcessEndSCRIPTTag(aNode); } } // XXX Form content was never pushed on the stack else if (nsHTMLAtoms::form == tagAtom) { popContent = PR_FALSE; } NS_RELEASE(tagAtom); NS_RELEASE(tagAtom); } } if (popContent) { nsIContent* content = PopContent(); if (nsnull != content) { PRInt32 nestLevel = GetCurrentNestLevel(); CloseNameSpacesAtNestLevel(nestLevel); CloseNameSpacesAtNestLevel(nestLevel); if (mDocElement == content) { if (mDocElement == content) { Loading @@ -596,6 +611,7 @@ nsXMLContentSink::CloseContainer(const nsIParserNode& aNode) // we should never get here. // we should never get here. PR_ASSERT(0); PR_ASSERT(0); } } } return result; return result; } } Loading content/xml/document/src/nsXMLDocument.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -265,6 +265,9 @@ NS_IMETHODIMP nsXMLDocument::CreateElement(const nsString& aTagName, nsXMLDocument::CreateElement(const nsString& aTagName, nsIDOMElement** aReturn) nsIDOMElement** aReturn) { { // XXX Should actually check parse namespace, determine // current namespace scope and, potentially, create new // HTML content form tags with a HTML prefix. nsIXMLContent* content; nsIXMLContent* content; nsIAtom* tag = NS_NewAtom(aTagName); nsIAtom* tag = NS_NewAtom(aTagName); nsresult rv = NS_NewXMLElement(&content, tag); nsresult rv = NS_NewXMLElement(&content, tag); Loading layout/html/document/src/nsHTMLContentSink.cpp +3 −1 Original line number Original line Diff line number Diff line Loading @@ -538,10 +538,12 @@ MakeContentObject(nsHTMLTag aNodeType, break; break; case eHTMLTag_form: case eHTMLTag_form: // the form was already created // the form was already created *aResult = nsnull; if (aForm) { if (aForm) { rv = aForm->QueryInterface(kIHTMLContentIID, (void**)aResult); rv = aForm->QueryInterface(kIHTMLContentIID, (void**)aResult); } } else { rv = NS_NewHTMLFormElement(aResult, aAtom); } break; break; case eHTMLTag_frame: case eHTMLTag_frame: rv = NS_NewHTMLFrameElement(aResult, aAtom); rv = NS_NewHTMLFrameElement(aResult, aAtom); Loading layout/xml/document/src/nsXMLContentSink.cpp +40 −24 Original line number Original line Diff line number Diff line Loading @@ -455,7 +455,8 @@ nsXMLContentSink::OpenContainer(const nsIParserNode& aNode) nsAutoString tag, nameSpace; nsAutoString tag, nameSpace; PRInt32 nsoffset; PRInt32 nsoffset; PRInt32 id = gNameSpaceId_Unknown; PRInt32 id = gNameSpaceId_Unknown; PRBool isHTML = nsnull; PRBool isHTML = PR_FALSE; PRBool pushContent = PR_TRUE; nsIContent *content; nsIContent *content; // XXX Hopefully the parser will flag this before we get // XXX Hopefully the parser will flag this before we get Loading Loading @@ -494,7 +495,13 @@ nsXMLContentSink::OpenContainer(const nsIParserNode& aNode) if (nsHTMLAtoms::script == tagAtom) { if (nsHTMLAtoms::script == tagAtom) { result = ProcessStartSCRIPTTag(aNode); result = ProcessStartSCRIPTTag(aNode); } } // XXX Treat the form elements as a leaf element (even if it is a // container). Need to do further processing with forms else if (nsHTMLAtoms::form == tagAtom) { pushContent = PR_FALSE; } NS_RELEASE(tagAtom); NS_RELEASE(tagAtom); nsIHTMLContent *htmlContent = nsnull; nsIHTMLContent *htmlContent = nsnull; result = NS_CreateHTMLElement(&htmlContent, tag); result = NS_CreateHTMLElement(&htmlContent, tag); content = (nsIContent *)htmlContent; content = (nsIContent *)htmlContent; Loading Loading @@ -533,9 +540,11 @@ nsXMLContentSink::OpenContainer(const nsIParserNode& aNode) parent->AppendChildTo(content, PR_FALSE); parent->AppendChildTo(content, PR_FALSE); } } if (pushContent) { PushContent(content); PushContent(content); } } } } } return result; return result; } } Loading @@ -547,7 +556,8 @@ nsXMLContentSink::CloseContainer(const nsIParserNode& aNode) nsAutoString tag, nameSpace; nsAutoString tag, nameSpace; PRInt32 nsoffset; PRInt32 nsoffset; PRInt32 id = gNameSpaceId_Unknown; PRInt32 id = gNameSpaceId_Unknown; PRBool isHTML = nsnull; PRBool isHTML = PR_FALSE; PRBool popContent = PR_TRUE; // XXX Hopefully the parser will flag this before we get // XXX Hopefully the parser will flag this before we get // here. If we're in the prolog or epilog, there should be // here. If we're in the prolog or epilog, there should be Loading @@ -571,19 +581,24 @@ nsXMLContentSink::CloseContainer(const nsIParserNode& aNode) FlushText(); FlushText(); } } nsIContent* content = PopContent(); if (nsnull != content) { PRInt32 nestLevel = GetCurrentNestLevel(); if (isHTML) { if (isHTML) { tag.ToUpperCase(); tag.ToUpperCase(); nsIAtom* tagAtom = NS_NewAtom(tag); nsIAtom* tagAtom = NS_NewAtom(tag); if (nsHTMLAtoms::script == tagAtom) { if (nsHTMLAtoms::script == tagAtom) { result = ProcessEndSCRIPTTag(aNode); result = ProcessEndSCRIPTTag(aNode); } } // XXX Form content was never pushed on the stack else if (nsHTMLAtoms::form == tagAtom) { popContent = PR_FALSE; } NS_RELEASE(tagAtom); NS_RELEASE(tagAtom); } } if (popContent) { nsIContent* content = PopContent(); if (nsnull != content) { PRInt32 nestLevel = GetCurrentNestLevel(); CloseNameSpacesAtNestLevel(nestLevel); CloseNameSpacesAtNestLevel(nestLevel); if (mDocElement == content) { if (mDocElement == content) { Loading @@ -596,6 +611,7 @@ nsXMLContentSink::CloseContainer(const nsIParserNode& aNode) // we should never get here. // we should never get here. PR_ASSERT(0); PR_ASSERT(0); } } } return result; return result; } } Loading Loading
content/html/document/src/nsHTMLContentSink.cpp +3 −1 Original line number Original line Diff line number Diff line Loading @@ -538,10 +538,12 @@ MakeContentObject(nsHTMLTag aNodeType, break; break; case eHTMLTag_form: case eHTMLTag_form: // the form was already created // the form was already created *aResult = nsnull; if (aForm) { if (aForm) { rv = aForm->QueryInterface(kIHTMLContentIID, (void**)aResult); rv = aForm->QueryInterface(kIHTMLContentIID, (void**)aResult); } } else { rv = NS_NewHTMLFormElement(aResult, aAtom); } break; break; case eHTMLTag_frame: case eHTMLTag_frame: rv = NS_NewHTMLFrameElement(aResult, aAtom); rv = NS_NewHTMLFrameElement(aResult, aAtom); Loading
content/xml/document/src/nsXMLContentSink.cpp +40 −24 Original line number Original line Diff line number Diff line Loading @@ -455,7 +455,8 @@ nsXMLContentSink::OpenContainer(const nsIParserNode& aNode) nsAutoString tag, nameSpace; nsAutoString tag, nameSpace; PRInt32 nsoffset; PRInt32 nsoffset; PRInt32 id = gNameSpaceId_Unknown; PRInt32 id = gNameSpaceId_Unknown; PRBool isHTML = nsnull; PRBool isHTML = PR_FALSE; PRBool pushContent = PR_TRUE; nsIContent *content; nsIContent *content; // XXX Hopefully the parser will flag this before we get // XXX Hopefully the parser will flag this before we get Loading Loading @@ -494,7 +495,13 @@ nsXMLContentSink::OpenContainer(const nsIParserNode& aNode) if (nsHTMLAtoms::script == tagAtom) { if (nsHTMLAtoms::script == tagAtom) { result = ProcessStartSCRIPTTag(aNode); result = ProcessStartSCRIPTTag(aNode); } } // XXX Treat the form elements as a leaf element (even if it is a // container). Need to do further processing with forms else if (nsHTMLAtoms::form == tagAtom) { pushContent = PR_FALSE; } NS_RELEASE(tagAtom); NS_RELEASE(tagAtom); nsIHTMLContent *htmlContent = nsnull; nsIHTMLContent *htmlContent = nsnull; result = NS_CreateHTMLElement(&htmlContent, tag); result = NS_CreateHTMLElement(&htmlContent, tag); content = (nsIContent *)htmlContent; content = (nsIContent *)htmlContent; Loading Loading @@ -533,9 +540,11 @@ nsXMLContentSink::OpenContainer(const nsIParserNode& aNode) parent->AppendChildTo(content, PR_FALSE); parent->AppendChildTo(content, PR_FALSE); } } if (pushContent) { PushContent(content); PushContent(content); } } } } } return result; return result; } } Loading @@ -547,7 +556,8 @@ nsXMLContentSink::CloseContainer(const nsIParserNode& aNode) nsAutoString tag, nameSpace; nsAutoString tag, nameSpace; PRInt32 nsoffset; PRInt32 nsoffset; PRInt32 id = gNameSpaceId_Unknown; PRInt32 id = gNameSpaceId_Unknown; PRBool isHTML = nsnull; PRBool isHTML = PR_FALSE; PRBool popContent = PR_TRUE; // XXX Hopefully the parser will flag this before we get // XXX Hopefully the parser will flag this before we get // here. If we're in the prolog or epilog, there should be // here. If we're in the prolog or epilog, there should be Loading @@ -571,19 +581,24 @@ nsXMLContentSink::CloseContainer(const nsIParserNode& aNode) FlushText(); FlushText(); } } nsIContent* content = PopContent(); if (nsnull != content) { PRInt32 nestLevel = GetCurrentNestLevel(); if (isHTML) { if (isHTML) { tag.ToUpperCase(); tag.ToUpperCase(); nsIAtom* tagAtom = NS_NewAtom(tag); nsIAtom* tagAtom = NS_NewAtom(tag); if (nsHTMLAtoms::script == tagAtom) { if (nsHTMLAtoms::script == tagAtom) { result = ProcessEndSCRIPTTag(aNode); result = ProcessEndSCRIPTTag(aNode); } } // XXX Form content was never pushed on the stack else if (nsHTMLAtoms::form == tagAtom) { popContent = PR_FALSE; } NS_RELEASE(tagAtom); NS_RELEASE(tagAtom); } } if (popContent) { nsIContent* content = PopContent(); if (nsnull != content) { PRInt32 nestLevel = GetCurrentNestLevel(); CloseNameSpacesAtNestLevel(nestLevel); CloseNameSpacesAtNestLevel(nestLevel); if (mDocElement == content) { if (mDocElement == content) { Loading @@ -596,6 +611,7 @@ nsXMLContentSink::CloseContainer(const nsIParserNode& aNode) // we should never get here. // we should never get here. PR_ASSERT(0); PR_ASSERT(0); } } } return result; return result; } } Loading
content/xml/document/src/nsXMLDocument.cpp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -265,6 +265,9 @@ NS_IMETHODIMP nsXMLDocument::CreateElement(const nsString& aTagName, nsXMLDocument::CreateElement(const nsString& aTagName, nsIDOMElement** aReturn) nsIDOMElement** aReturn) { { // XXX Should actually check parse namespace, determine // current namespace scope and, potentially, create new // HTML content form tags with a HTML prefix. nsIXMLContent* content; nsIXMLContent* content; nsIAtom* tag = NS_NewAtom(aTagName); nsIAtom* tag = NS_NewAtom(aTagName); nsresult rv = NS_NewXMLElement(&content, tag); nsresult rv = NS_NewXMLElement(&content, tag); Loading
layout/html/document/src/nsHTMLContentSink.cpp +3 −1 Original line number Original line Diff line number Diff line Loading @@ -538,10 +538,12 @@ MakeContentObject(nsHTMLTag aNodeType, break; break; case eHTMLTag_form: case eHTMLTag_form: // the form was already created // the form was already created *aResult = nsnull; if (aForm) { if (aForm) { rv = aForm->QueryInterface(kIHTMLContentIID, (void**)aResult); rv = aForm->QueryInterface(kIHTMLContentIID, (void**)aResult); } } else { rv = NS_NewHTMLFormElement(aResult, aAtom); } break; break; case eHTMLTag_frame: case eHTMLTag_frame: rv = NS_NewHTMLFrameElement(aResult, aAtom); rv = NS_NewHTMLFrameElement(aResult, aAtom); Loading
layout/xml/document/src/nsXMLContentSink.cpp +40 −24 Original line number Original line Diff line number Diff line Loading @@ -455,7 +455,8 @@ nsXMLContentSink::OpenContainer(const nsIParserNode& aNode) nsAutoString tag, nameSpace; nsAutoString tag, nameSpace; PRInt32 nsoffset; PRInt32 nsoffset; PRInt32 id = gNameSpaceId_Unknown; PRInt32 id = gNameSpaceId_Unknown; PRBool isHTML = nsnull; PRBool isHTML = PR_FALSE; PRBool pushContent = PR_TRUE; nsIContent *content; nsIContent *content; // XXX Hopefully the parser will flag this before we get // XXX Hopefully the parser will flag this before we get Loading Loading @@ -494,7 +495,13 @@ nsXMLContentSink::OpenContainer(const nsIParserNode& aNode) if (nsHTMLAtoms::script == tagAtom) { if (nsHTMLAtoms::script == tagAtom) { result = ProcessStartSCRIPTTag(aNode); result = ProcessStartSCRIPTTag(aNode); } } // XXX Treat the form elements as a leaf element (even if it is a // container). Need to do further processing with forms else if (nsHTMLAtoms::form == tagAtom) { pushContent = PR_FALSE; } NS_RELEASE(tagAtom); NS_RELEASE(tagAtom); nsIHTMLContent *htmlContent = nsnull; nsIHTMLContent *htmlContent = nsnull; result = NS_CreateHTMLElement(&htmlContent, tag); result = NS_CreateHTMLElement(&htmlContent, tag); content = (nsIContent *)htmlContent; content = (nsIContent *)htmlContent; Loading Loading @@ -533,9 +540,11 @@ nsXMLContentSink::OpenContainer(const nsIParserNode& aNode) parent->AppendChildTo(content, PR_FALSE); parent->AppendChildTo(content, PR_FALSE); } } if (pushContent) { PushContent(content); PushContent(content); } } } } } return result; return result; } } Loading @@ -547,7 +556,8 @@ nsXMLContentSink::CloseContainer(const nsIParserNode& aNode) nsAutoString tag, nameSpace; nsAutoString tag, nameSpace; PRInt32 nsoffset; PRInt32 nsoffset; PRInt32 id = gNameSpaceId_Unknown; PRInt32 id = gNameSpaceId_Unknown; PRBool isHTML = nsnull; PRBool isHTML = PR_FALSE; PRBool popContent = PR_TRUE; // XXX Hopefully the parser will flag this before we get // XXX Hopefully the parser will flag this before we get // here. If we're in the prolog or epilog, there should be // here. If we're in the prolog or epilog, there should be Loading @@ -571,19 +581,24 @@ nsXMLContentSink::CloseContainer(const nsIParserNode& aNode) FlushText(); FlushText(); } } nsIContent* content = PopContent(); if (nsnull != content) { PRInt32 nestLevel = GetCurrentNestLevel(); if (isHTML) { if (isHTML) { tag.ToUpperCase(); tag.ToUpperCase(); nsIAtom* tagAtom = NS_NewAtom(tag); nsIAtom* tagAtom = NS_NewAtom(tag); if (nsHTMLAtoms::script == tagAtom) { if (nsHTMLAtoms::script == tagAtom) { result = ProcessEndSCRIPTTag(aNode); result = ProcessEndSCRIPTTag(aNode); } } // XXX Form content was never pushed on the stack else if (nsHTMLAtoms::form == tagAtom) { popContent = PR_FALSE; } NS_RELEASE(tagAtom); NS_RELEASE(tagAtom); } } if (popContent) { nsIContent* content = PopContent(); if (nsnull != content) { PRInt32 nestLevel = GetCurrentNestLevel(); CloseNameSpacesAtNestLevel(nestLevel); CloseNameSpacesAtNestLevel(nestLevel); if (mDocElement == content) { if (mDocElement == content) { Loading @@ -596,6 +611,7 @@ nsXMLContentSink::CloseContainer(const nsIParserNode& aNode) // we should never get here. // we should never get here. PR_ASSERT(0); PR_ASSERT(0); } } } return result; return result; } } Loading