assorted work to expose nav html dtd to the editor
git-svn-id: svn://10.0.0.236/trunk@40179 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1778,6 +1778,16 @@ PRBool CNavDTD::CanContain(PRInt32 aParent,PRInt32 aChild) const {
|
||||
return gHTMLElements[aParent].CanContain((eHTMLTags)aChild);
|
||||
}
|
||||
|
||||
/**
|
||||
* Give rest of world access to our tag enums, so that CanContain(), etc,
|
||||
* become useful.
|
||||
*/
|
||||
NS_IMETHODIMP CNavDTD::StringTagToIntTag(nsString &aTag, PRInt32* aIntTag) const
|
||||
{
|
||||
*aIntTag = nsHTMLTags::LookupTag(aTag);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called to determine whether or not
|
||||
* the necessary intermediate tags should be propagated
|
||||
|
||||
@@ -369,6 +369,12 @@ CLASS_EXPORT_HTMLPARS CNavDTD : public nsIDTD {
|
||||
*/
|
||||
virtual PRInt32 GetTopmostIndexOf(eHTMLTags aTagSet[],PRInt32 aCount) const;
|
||||
|
||||
/**
|
||||
* Give rest of world access to our tag enums, so that CanContain(), etc,
|
||||
* become useful.
|
||||
*/
|
||||
NS_IMETHOD StringTagToIntTag(nsString &aTag, PRInt32* aIntTag) const;
|
||||
|
||||
|
||||
/**
|
||||
* The following methods are use to create and manage
|
||||
|
||||
@@ -306,6 +306,15 @@ PRBool COtherDTD::CanContain(PRInt32 aParent,PRInt32 aChild) const {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Give rest of world access to our tag enums, so that CanContain(), etc,
|
||||
* become useful.
|
||||
*/
|
||||
NS_IMETHODIMP COtherDTD::StringTagToIntTag(nsString &aTag, PRInt32* aIntTag) const
|
||||
{
|
||||
return CNavDTD::StringTagToIntTag(aTag, aIntTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method gets called to determine whether a given
|
||||
* tag can contain newlines. Most do not.
|
||||
|
||||
@@ -121,6 +121,12 @@ class COtherDTD : public CNavDTD {
|
||||
*/
|
||||
virtual PRBool CanOmit(eHTMLTags aParent,eHTMLTags aChild)const;
|
||||
|
||||
/**
|
||||
* Give rest of world access to our tag enums, so that CanContain(), etc,
|
||||
* become useful.
|
||||
*/
|
||||
NS_IMETHOD StringTagToIntTag(nsString &aTag, PRInt32* aIntTag)const;
|
||||
|
||||
/**
|
||||
* This method gets called when a start token has been consumed and needs
|
||||
* to be handled (possibly added to content model via sink).
|
||||
|
||||
@@ -370,6 +370,15 @@ PRBool CRtfDTD::CanContain(PRInt32 aParent,PRInt32 aChild) const{
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Give rest of world access to our tag enums, so that CanContain(), etc,
|
||||
* become useful.
|
||||
*/
|
||||
NS_IMETHODIMP CRtfDTD::StringTagToIntTag(nsString &aTag, PRInt32* aIntTag) const
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @update gess 3/25/98
|
||||
|
||||
@@ -337,6 +337,13 @@ class CRtfDTD : public nsIDTD {
|
||||
* @return ptr to recycler (or null)
|
||||
*/
|
||||
virtual nsITokenRecycler* GetTokenRecycler(void);
|
||||
|
||||
/**
|
||||
* Give rest of world access to our tag enums, so that CanContain(), etc,
|
||||
* become useful.
|
||||
*/
|
||||
NS_IMETHOD StringTagToIntTag(nsString &aTag, PRInt32* aIntTag) const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -199,6 +199,14 @@ class nsIDTD : public nsISupports {
|
||||
* @return
|
||||
*/
|
||||
virtual PRBool Verify(nsString& aURLRef,nsIParser* aParser)=0;
|
||||
|
||||
/* XXX Temporary measure, pending further work by RickG */
|
||||
|
||||
/**
|
||||
* Give rest of world access to our tag enums, so that CanContain(), etc,
|
||||
* become useful.
|
||||
*/
|
||||
NS_IMETHOD StringTagToIntTag(nsString &aTag, PRInt32* aIntTag) const =0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -37,5 +37,8 @@
|
||||
#define NS_WELLFORMEDDTD_CID \
|
||||
{ 0xe6fd9941, 0x899d, 0x11d2, { 0x8e, 0xae, 0x0, 0x80, 0x5f, 0x29, 0xf3, 0x70 } }
|
||||
|
||||
// {a6cf9107-15b3-11d2-932e-00805f8add32}
|
||||
#define NS_CNAVDTD_CID \
|
||||
{ 0xa6cf9107, 0x15b3, 0x11d2, { 0x93, 0x2e, 0x0, 0x80, 0x5f, 0x8a, 0xdd, 0x32 } }
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "nsParser.h"
|
||||
#include "nsParserNode.h"
|
||||
#include "nsWellFormedDTD.h"
|
||||
#include "CNavDTD.h"
|
||||
|
||||
#include "nsHTMLTags.h"
|
||||
#include "nsHTMLEntities.h"
|
||||
@@ -36,6 +37,7 @@ static NS_DEFINE_IID(kCParser, NS_PARSER_IID);
|
||||
static NS_DEFINE_IID(kCParserNode, NS_PARSER_NODE_IID);
|
||||
static NS_DEFINE_IID(kLoggingSinkCID, NS_LOGGING_SINK_IID);
|
||||
static NS_DEFINE_CID(kWellFormedDTDCID, NS_WELLFORMEDDTD_CID);
|
||||
static NS_DEFINE_CID(kCNavDTDCID, NS_CNAVDTD_CID);
|
||||
|
||||
class nsParserFactory : public nsIFactory
|
||||
{
|
||||
@@ -151,6 +153,12 @@ nsresult nsParserFactory::CreateInstance(nsISupports *aOuter,
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
else if (mClassID.Equals(kCNavDTDCID)) {
|
||||
nsresult rv = NS_NewNavHTMLDTD((nsIDTD**) &inst);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
if (inst == NULL) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
@@ -296,6 +296,16 @@ PRBool CValidDTD::CanContain(PRInt32 aParent,PRInt32 aChild) const{
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Give rest of world access to our tag enums, so that CanContain(), etc,
|
||||
* become useful.
|
||||
*/
|
||||
NS_IMETHODIMP CValidDTD::StringTagToIntTag(nsString &aTag, PRInt32* aIntTag) const
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method gets called to determine whether a given
|
||||
* tag is itself a container
|
||||
|
||||
@@ -230,6 +230,13 @@ class CValidDTD : public nsIDTD {
|
||||
* @return ptr to recycler (or null)
|
||||
*/
|
||||
virtual nsITokenRecycler* GetTokenRecycler(void);
|
||||
|
||||
/**
|
||||
* Give rest of world access to our tag enums, so that CanContain(), etc,
|
||||
* become useful.
|
||||
*/
|
||||
NS_IMETHOD StringTagToIntTag(nsString &aTag, PRInt32* aIntTag) const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -544,6 +544,15 @@ PRBool CViewSourceHTML::CanContain(PRInt32 aParent,PRInt32 aChild) const{
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Give rest of world access to our tag enums, so that CanContain(), etc,
|
||||
* become useful.
|
||||
*/
|
||||
NS_IMETHODIMP CViewSourceHTML::StringTagToIntTag(nsString &aTag, PRInt32* aIntTag) const
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method gets called to determine whether a given
|
||||
* tag is itself a container
|
||||
|
||||
@@ -214,6 +214,12 @@ class CViewSourceHTML: public nsIDTD {
|
||||
*/
|
||||
virtual PRBool CanContain(PRInt32 aParent,PRInt32 aChild) const;
|
||||
|
||||
/**
|
||||
* Give rest of world access to our tag enums, so that CanContain(), etc,
|
||||
* become useful.
|
||||
*/
|
||||
NS_IMETHOD StringTagToIntTag(nsString &aTag, PRInt32* aIntTag) const;
|
||||
|
||||
/**
|
||||
* This method gets called to determine whether a given
|
||||
* tag is itself a container
|
||||
|
||||
@@ -397,6 +397,15 @@ PRBool CWellFormedDTD::CanContain(PRInt32 aParent,PRInt32 aChild) const{
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Give rest of world access to our tag enums, so that CanContain(), etc,
|
||||
* become useful.
|
||||
*/
|
||||
NS_IMETHODIMP CWellFormedDTD::StringTagToIntTag(nsString &aTag, PRInt32* aIntTag) const
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method gets called to determine whether a given
|
||||
* tag is itself a container
|
||||
|
||||
Reference in New Issue
Block a user