Supported XML namespace decls as attributes of HTML content embedded in XML

git-svn-id: svn://10.0.0.236/trunk@21056 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
vidur%netscape.com
1999-02-18 00:18:50 +00:00
parent e999bd483b
commit 1defb4fd38
4 changed files with 22 additions and 2 deletions

View File

@@ -42,6 +42,7 @@
#include "nsICSSParser.h"
#include "nsICSSStyleSheet.h"
#include "nsHTMLAtoms.h"
#include "nsLayoutAtoms.h"
#include "nsIScriptContext.h"
#include "nsIScriptContextOwner.h"
#include "nsINameSpace.h"
@@ -430,7 +431,13 @@ nsXMLContentSink::AddAttributes(const nsIParserNode& aNode,
nsIAtom* nameSpacePrefix = CutNameSpacePrefix(name);
nsIAtom* nameAtom = NS_NewAtom(name);
PRInt32 nameSpaceID = GetNameSpaceId(nameSpacePrefix);
if ((kNameSpaceID_None == nameSpaceID) && aIsHTML) {
if ((kNameSpaceID_XMLNS == nameSpaceID) && aIsHTML) {
NS_RELEASE(nameAtom);
name.Insert("xmlns:", 0);
nameAtom = NS_NewAtom(name);
nameSpaceID = kNameSpaceID_HTML;
}
else if ((kNameSpaceID_None == nameSpaceID) && aIsHTML) {
nameSpaceID = kNameSpaceID_HTML;
}

View File

@@ -6,6 +6,9 @@ Inc.</Title>
<p xmlns="http://www.w3.org/TR/REC-html40" xmlns:h="http://www.w3.org/TR/REC-html40">
<h:img src="flamer.gif"/>
<img src="flamer.gif"/>
<button>
<h1>Some text</h1>
</button>
</p>
<BookInfo> <BookBiblio> <Title>Demo Product Documentation</Title>
<AuthorGroup><CorpAuthor>SoftQuad Inc.</CorpAuthor></AuthorGroup>

View File

@@ -42,6 +42,7 @@
#include "nsICSSParser.h"
#include "nsICSSStyleSheet.h"
#include "nsHTMLAtoms.h"
#include "nsLayoutAtoms.h"
#include "nsIScriptContext.h"
#include "nsIScriptContextOwner.h"
#include "nsINameSpace.h"
@@ -430,7 +431,13 @@ nsXMLContentSink::AddAttributes(const nsIParserNode& aNode,
nsIAtom* nameSpacePrefix = CutNameSpacePrefix(name);
nsIAtom* nameAtom = NS_NewAtom(name);
PRInt32 nameSpaceID = GetNameSpaceId(nameSpacePrefix);
if ((kNameSpaceID_None == nameSpaceID) && aIsHTML) {
if ((kNameSpaceID_XMLNS == nameSpaceID) && aIsHTML) {
NS_RELEASE(nameAtom);
name.Insert("xmlns:", 0);
nameAtom = NS_NewAtom(name);
nameSpaceID = kNameSpaceID_HTML;
}
else if ((kNameSpaceID_None == nameSpaceID) && aIsHTML) {
nameSpaceID = kNameSpaceID_HTML;
}

View File

@@ -6,6 +6,9 @@ Inc.</Title>
<p xmlns="http://www.w3.org/TR/REC-html40" xmlns:h="http://www.w3.org/TR/REC-html40">
<h:img src="flamer.gif"/>
<img src="flamer.gif"/>
<button>
<h1>Some text</h1>
</button>
</p>
<BookInfo> <BookBiblio> <Title>Demo Product Documentation</Title>
<AuthorGroup><CorpAuthor>SoftQuad Inc.</CorpAuthor></AuthorGroup>