mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
Bug 764400 - Move various nsIContent methods to nsINode; r=mounir
This commit is contained in:
parent
871b9e2a3a
commit
51aeb99f90
@ -250,65 +250,6 @@ public:
|
||||
return OwnerDoc()->IsHTML();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the namespace that this element's tag is defined in
|
||||
* @return the namespace
|
||||
*/
|
||||
PRInt32 GetNameSpaceID() const
|
||||
{
|
||||
return mNodeInfo->NamespaceID();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tag for this element. This will always return a non-null
|
||||
* atom pointer (as implied by the naming of the method).
|
||||
*/
|
||||
nsIAtom *Tag() const
|
||||
{
|
||||
return mNodeInfo->NameAtom();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the NodeInfo for this element
|
||||
* @return the nodes node info
|
||||
*/
|
||||
nsINodeInfo *NodeInfo() const
|
||||
{
|
||||
return mNodeInfo;
|
||||
}
|
||||
|
||||
inline bool IsInNamespace(PRInt32 aNamespace) const {
|
||||
return mNodeInfo->NamespaceID() == aNamespace;
|
||||
}
|
||||
|
||||
inline bool IsHTML() const {
|
||||
return IsInNamespace(kNameSpaceID_XHTML);
|
||||
}
|
||||
|
||||
inline bool IsHTML(nsIAtom* aTag) const {
|
||||
return mNodeInfo->Equals(aTag, kNameSpaceID_XHTML);
|
||||
}
|
||||
|
||||
inline bool IsSVG() const {
|
||||
return IsInNamespace(kNameSpaceID_SVG);
|
||||
}
|
||||
|
||||
inline bool IsSVG(nsIAtom* aTag) const {
|
||||
return mNodeInfo->Equals(aTag, kNameSpaceID_SVG);
|
||||
}
|
||||
|
||||
inline bool IsXUL() const {
|
||||
return IsInNamespace(kNameSpaceID_XUL);
|
||||
}
|
||||
|
||||
inline bool IsMathML() const {
|
||||
return IsInNamespace(kNameSpaceID_MathML);
|
||||
}
|
||||
|
||||
inline bool IsMathML(nsIAtom* aTag) const {
|
||||
return mNodeInfo->Equals(aTag, kNameSpaceID_MathML);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an atom holding the name of the attribute of type ID on
|
||||
* this content node (if applicable). Returns null for non-element
|
||||
|
@ -476,6 +476,75 @@ public:
|
||||
return mNodeInfo->LocalName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the namespace that this element's tag is defined in
|
||||
* @return the namespace
|
||||
*/
|
||||
PRInt32 GetNameSpaceID() const
|
||||
{
|
||||
return mNodeInfo->NamespaceID();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tag for this element. This will always return a non-null atom
|
||||
* pointer (as implied by the naming of the method). For elements this is
|
||||
* the non-namespaced tag, and for other nodes it's something like "#text",
|
||||
* "#comment", "#document", etc.
|
||||
*/
|
||||
nsIAtom* Tag() const
|
||||
{
|
||||
return mNodeInfo->NameAtom();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the NodeInfo for this element
|
||||
* @return the nodes node info
|
||||
*/
|
||||
nsINodeInfo* NodeInfo() const
|
||||
{
|
||||
return mNodeInfo;
|
||||
}
|
||||
|
||||
bool IsInNamespace(PRInt32 aNamespace) const
|
||||
{
|
||||
return mNodeInfo->NamespaceID() == aNamespace;
|
||||
}
|
||||
|
||||
bool IsHTML() const
|
||||
{
|
||||
return IsInNamespace(kNameSpaceID_XHTML);
|
||||
}
|
||||
|
||||
bool IsHTML(nsIAtom* aTag) const
|
||||
{
|
||||
return mNodeInfo->Equals(aTag, kNameSpaceID_XHTML);
|
||||
}
|
||||
|
||||
bool IsSVG() const
|
||||
{
|
||||
return IsInNamespace(kNameSpaceID_SVG);
|
||||
}
|
||||
|
||||
bool IsSVG(nsIAtom* aTag) const
|
||||
{
|
||||
return mNodeInfo->Equals(aTag, kNameSpaceID_SVG);
|
||||
}
|
||||
|
||||
bool IsXUL() const
|
||||
{
|
||||
return IsInNamespace(kNameSpaceID_XUL);
|
||||
}
|
||||
|
||||
bool IsMathML() const
|
||||
{
|
||||
return IsInNamespace(kNameSpaceID_MathML);
|
||||
}
|
||||
|
||||
bool IsMathML(nsIAtom* aTag) const
|
||||
{
|
||||
return mNodeInfo->Equals(aTag, kNameSpaceID_MathML);
|
||||
}
|
||||
|
||||
nsINode*
|
||||
InsertBefore(nsINode *aNewChild, nsINode *aRefChild, nsresult *aReturn)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user