r=heikki. sr=jst. Fix for bug 29171. Create HTML unknown element for non-lowercased elements that are in the XHTML namespace.
This commit is contained in:
Родитель
0092a87ee3
Коммит
545241bba3
|
@ -830,7 +830,7 @@ HTMLContentSink::CreateContentObject(const nsIParserNode& aNode,
|
|||
static NS_DEFINE_CID(kParserServiceCID, NS_PARSERSERVICE_CID);
|
||||
|
||||
nsresult
|
||||
NS_CreateHTMLElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo)
|
||||
NS_CreateHTMLElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo, PRBool aCaseSensitive)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
@ -855,11 +855,18 @@ NS_CreateHTMLElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo)
|
|||
// Create atom for tag and then create content object
|
||||
rv = parserService->HTMLIdToStringTag(id, tag);
|
||||
}
|
||||
nsCOMPtr<nsIAtom> atom(dont_AddRef(NS_NewAtom(tag.GetUnicode())));
|
||||
nsCOMPtr<nsINodeInfo> newName;
|
||||
aNodeInfo->NameChanged(atom, *getter_AddRefs(newName));
|
||||
|
||||
rv = MakeContentObject(nsHTMLTag(id), newName, nsnull, nsnull, aResult);
|
||||
if (aCaseSensitive && tag != tmpName)
|
||||
{
|
||||
rv = MakeContentObject(eHTMLTag_unknown, aNodeInfo, nsnull, nsnull, aResult);
|
||||
}
|
||||
else {
|
||||
nsCOMPtr<nsIAtom> atom(dont_AddRef(NS_NewAtom(tag.GetUnicode())));
|
||||
nsCOMPtr<nsINodeInfo> newName;
|
||||
aNodeInfo->NameChanged(atom, *getter_AddRefs(newName));
|
||||
|
||||
rv = MakeContentObject(nsHTMLTag(id), newName, nsnull, nsnull, aResult);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -605,7 +605,7 @@ nsXMLContentSink::OpenContainer(const nsIParserNode& aNode)
|
|||
}
|
||||
|
||||
nsCOMPtr<nsIHTMLContent> htmlContent;
|
||||
result = NS_CreateHTMLElement(getter_AddRefs(htmlContent), nodeInfo);
|
||||
result = NS_CreateHTMLElement(getter_AddRefs(htmlContent), nodeInfo, PR_TRUE);
|
||||
content = do_QueryInterface(htmlContent);
|
||||
|
||||
if (tagAtom.get() == nsHTMLAtoms::textarea) {
|
||||
|
|
|
@ -261,7 +261,8 @@ NS_NewHTMLUnknownElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|||
*/
|
||||
PR_EXTERN(nsresult)
|
||||
NS_CreateHTMLElement(nsIHTMLContent** aResult,
|
||||
nsINodeInfo *aNodeInfo);
|
||||
nsINodeInfo *aNodeInfo,
|
||||
PRBool aCaseSensitive = PR_FALSE);
|
||||
|
||||
// Factory methods for creating html layout objects
|
||||
|
||||
|
|
|
@ -261,7 +261,8 @@ NS_NewHTMLUnknownElement(nsIHTMLContent** aResult, nsINodeInfo *aNodeInfo);
|
|||
*/
|
||||
PR_EXTERN(nsresult)
|
||||
NS_CreateHTMLElement(nsIHTMLContent** aResult,
|
||||
nsINodeInfo *aNodeInfo);
|
||||
nsINodeInfo *aNodeInfo,
|
||||
PRBool aCaseSensitive = PR_FALSE);
|
||||
|
||||
// Factory methods for creating html layout objects
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче