diff --git a/accessible/src/base/nsAccessibilityService.cpp b/accessible/src/base/nsAccessibilityService.cpp
index fd4549adcb40..cc834276048d 100644
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -1483,7 +1483,7 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
return InitAccessible(newAcc, aAccessible, nsnull);
}
- PRBool isHTML = content->IsNodeOfType(nsINode::eHTML);
+ PRBool isHTML = content->IsHTML();
if (isHTML && content->Tag() == nsAccessibilityAtoms::map) {
// Create hyper text accessible for HTML map if it is used to group links
// (see http://www.w3.org/TR/WCAG10-HTML-TECHS/#group-bypass). If the HTML
diff --git a/accessible/src/base/nsAccessible.cpp b/accessible/src/base/nsAccessible.cpp
index 191813197e96..4f943e07d4bc 100644
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -298,9 +298,9 @@ nsAccessible::GetName(nsAString& aName)
nsIAtom *tooltipAttr = nsnull;
- if (content->IsNodeOfType(nsINode::eHTML))
+ if (content->IsHTML())
tooltipAttr = nsAccessibilityAtoms::title;
- else if (content->IsNodeOfType(nsINode::eXUL))
+ else if (content->IsXUL())
tooltipAttr = nsAccessibilityAtoms::tooltiptext;
else
return NS_OK;
@@ -342,7 +342,7 @@ NS_IMETHODIMP nsAccessible::GetDescription(nsAString& aDescription)
NS_ENSURE_SUCCESS(rv, rv);
if (description.IsEmpty()) {
- PRBool isXUL = content->IsNodeOfType(nsINode::eXUL);
+ PRBool isXUL = content->IsXUL();
if (isXUL) {
// Try XUL description text
nsIContent *descriptionContent =
@@ -1009,7 +1009,7 @@ nsAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
// if someone sets it on another attribute,
// it seems reasonable to consider it unavailable
PRBool isDisabled;
- if (content->IsNodeOfType(nsINode::eHTML)) {
+ if (content->IsHTML()) {
// In HTML, just the presence of the disabled attribute means it is disabled,
// therefore disabled="false" indicates disabled!
isDisabled = content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::disabled);
@@ -2410,7 +2410,7 @@ nsAccessible::GetRelationByType(PRUint32 aRelationType,
case nsIAccessibleRelation::RELATION_LABEL_FOR:
{
if (content->Tag() == nsAccessibilityAtoms::label) {
- nsIAtom *IDAttr = content->IsNodeOfType(nsINode::eHTML) ?
+ nsIAtom *IDAttr = content->IsHTML() ?
nsAccessibilityAtoms::_for : nsAccessibilityAtoms::control;
rv = nsRelUtils::
AddTargetFromIDRefAttr(aRelationType, aRelation, content, IDAttr);
@@ -2467,7 +2467,7 @@ nsAccessible::GetRelationByType(PRUint32 aRelationType,
return NS_OK; // XXX bug 381599, avoid performance problems
if (content->Tag() == nsAccessibilityAtoms::description &&
- content->IsNodeOfType(nsINode::eXUL)) {
+ content->IsXUL()) {
// This affectively adds an optional control attribute to xul:description,
// which only affects accessibility, by allowing the description to be
// tied to a control.
@@ -2551,7 +2551,7 @@ nsAccessible::GetRelationByType(PRUint32 aRelationType,
case nsIAccessibleRelation::RELATION_DEFAULT_BUTTON:
{
- if (content->IsNodeOfType(nsINode::eHTML)) {
+ if (content->IsHTML()) {
// HTML form controls implements nsIFormControl interface.
nsCOMPtr control(do_QueryInterface(content));
if (control) {
@@ -3098,10 +3098,10 @@ nsAccessible::GetNameInternal(nsAString& aName)
if (!content)
return NS_OK;
- if (content->IsNodeOfType(nsINode::eHTML))
+ if (content->IsHTML())
return GetHTMLName(aName);
- if (content->IsNodeOfType(nsINode::eXUL))
+ if (content->IsXUL())
return GetXULName(aName);
return NS_OK;
diff --git a/accessible/src/base/nsAccessibleTreeWalker.cpp b/accessible/src/base/nsAccessibleTreeWalker.cpp
index c32613b75abf..e3672edeb78f 100644
--- a/accessible/src/base/nsAccessibleTreeWalker.cpp
+++ b/accessible/src/base/nsAccessibleTreeWalker.cpp
@@ -75,7 +75,7 @@ nsAccessibleTreeWalker::~nsAccessibleTreeWalker()
void nsAccessibleTreeWalker::GetKids(nsIDOMNode *aParentNode)
{
nsCOMPtr parentContent(do_QueryInterface(aParentNode));
- if (!parentContent || !parentContent->IsNodeOfType(nsINode::eHTML)) {
+ if (!parentContent || !parentContent->IsHTML()) {
mState.frame = nsnull; // Don't walk frames in non-HTML content, just walk the DOM.
}
diff --git a/accessible/src/base/nsCoreUtils.cpp b/accessible/src/base/nsCoreUtils.cpp
index e2c299ab1e60..fb57a0ab964c 100644
--- a/accessible/src/base/nsCoreUtils.cpp
+++ b/accessible/src/base/nsCoreUtils.cpp
@@ -760,7 +760,7 @@ nsCoreUtils::FindDescendantPointingToIDImpl(nsCString& aIdWithSpaces,
nsIContent*
nsCoreUtils::GetLabelContent(nsIContent *aForNode)
{
- if (aForNode->IsNodeOfType(nsINode::eXUL))
+ if (aForNode->IsXUL())
return FindNeighbourPointingToNode(aForNode, nsAccessibilityAtoms::control,
nsAccessibilityAtoms::label);
diff --git a/accessible/src/base/nsTextEquivUtils.cpp b/accessible/src/base/nsTextEquivUtils.cpp
index a1ca0c23a4db..d2f297832be4 100644
--- a/accessible/src/base/nsTextEquivUtils.cpp
+++ b/accessible/src/base/nsTextEquivUtils.cpp
@@ -219,7 +219,7 @@ nsTextEquivUtils::AppendTextEquivFromTextContent(nsIContent *aContent,
return NS_OK;
}
- if (aContent->IsNodeOfType(nsINode::eHTML) &&
+ if (aContent->IsHTML() &&
aContent->NodeInfo()->Equals(nsAccessibilityAtoms::br)) {
aString->AppendLiteral("\r\n");
return NS_OK;
@@ -393,7 +393,7 @@ nsTextEquivUtils::AppendFromDOMNode(nsIContent *aContent, nsAString *aString)
if (rv != NS_OK_NO_NAME_CLAUSE_HANDLED)
return NS_OK;
- if (aContent->IsNodeOfType(nsINode::eXUL)) {
+ if (aContent->IsXUL()) {
nsAutoString textEquivalent;
nsCOMPtr labeledEl =
do_QueryInterface(aContent);
diff --git a/accessible/src/html/nsHTMLSelectAccessible.cpp b/accessible/src/html/nsHTMLSelectAccessible.cpp
index 650efedaf9b6..a6873f55dbdb 100644
--- a/accessible/src/html/nsHTMLSelectAccessible.cpp
+++ b/accessible/src/html/nsHTMLSelectAccessible.cpp
@@ -408,7 +408,7 @@ nsHTMLSelectListAccessible::CacheOptSiblings(nsIAccessibilityService *aAccServic
for (PRUint32 count = 0; count < numChildren; count ++) {
nsIContent *childContent = aParentContent->GetChildAt(count);
- if (!childContent->IsNodeOfType(nsINode::eHTML)) {
+ if (!childContent->IsHTML()) {
continue;
}
nsCOMPtr tag = childContent->Tag();
@@ -835,7 +835,7 @@ nsresult nsHTMLSelectOptionAccessible::GetFocusedOptionNode(nsIDOMNode *aListNod
void nsHTMLSelectOptionAccessible::SelectionChangedIfOption(nsIContent *aPossibleOption)
{
if (!aPossibleOption || aPossibleOption->Tag() != nsAccessibilityAtoms::option ||
- !aPossibleOption->IsNodeOfType(nsINode::eHTML)) {
+ !aPossibleOption->IsHTML()) {
return;
}
diff --git a/accessible/src/html/nsHyperTextAccessible.cpp b/accessible/src/html/nsHyperTextAccessible.cpp
index 738f55b0d145..3eb42ef47280 100644
--- a/accessible/src/html/nsHyperTextAccessible.cpp
+++ b/accessible/src/html/nsHyperTextAccessible.cpp
@@ -633,7 +633,7 @@ nsresult nsHyperTextAccessible::DOMPointToHypertextOffset(nsIDOMNode* aNode, PRI
nsCOMPtr descendantAccessible;
if (findNode) {
nsCOMPtr findContent = do_QueryInterface(findNode);
- if (findContent->IsNodeOfType(nsINode::eHTML) &&
+ if (findContent->IsHTML() &&
findContent->NodeInfo()->Equals(nsAccessibilityAtoms::br)) {
nsIContent *parent = findContent->GetParent();
if (parent &&
diff --git a/content/base/public/nsIContent.h b/content/base/public/nsIContent.h
index 74dc0d359ed6..8ef8c86790ac 100644
--- a/content/base/public/nsIContent.h
+++ b/content/base/public/nsIContent.h
@@ -247,6 +247,26 @@ public:
return mNodeInfo;
}
+ inline PRBool IsInNamespace(PRInt32 aNamespace) const {
+ return mNodeInfo->NamespaceID() == aNamespace;
+ }
+
+ inline PRBool IsHTML() const {
+ return IsInNamespace(kNameSpaceID_XHTML);
+ }
+
+ inline PRBool IsSVG() const {
+ return IsInNamespace(kNameSpaceID_SVG);
+ }
+
+ inline PRBool IsXUL() const {
+ return IsInNamespace(kNameSpaceID_XUL);
+ }
+
+ inline PRBool IsMathML() const {
+ return IsInNamespace(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
diff --git a/content/base/public/nsINode.h b/content/base/public/nsINode.h
index f67c14223f16..d57f593a6103 100644
--- a/content/base/public/nsINode.h
+++ b/content/base/public/nsINode.h
@@ -293,28 +293,21 @@ public:
ePROCESSING_INSTRUCTION = 1 << 5,
/** comment nodes */
eCOMMENT = 1 << 6,
- /** html elements */
- eHTML = 1 << 7,
/** form control elements */
- eHTML_FORM_CONTROL = 1 << 8,
+ eHTML_FORM_CONTROL = 1 << 7,
/** XUL elements */
- eXUL = 1 << 9,
- /** svg elements */
- eSVG = 1 << 10,
/** document fragments */
- eDOCUMENT_FRAGMENT = 1 << 11,
+ eDOCUMENT_FRAGMENT = 1 << 8,
/** data nodes (comments, PIs, text). Nodes of this type always
returns a non-null value for nsIContent::GetText() */
- eDATA_NODE = 1 << 12,
- /** nsMathMLElement */
- eMATHML = 1 << 13,
+ eDATA_NODE = 1 << 9,
/** nsHTMLMediaElement */
- eMEDIA = 1 << 14
+ eMEDIA = 1 << 10
};
/**
* API for doing a quick check if a content is of a given
- * type, such as HTML, XUL, Text, ... Use this when you can instead of
+ * type, such as Text, Document, Comment ... Use this when you can instead of
* checking the tag.
*
* @param aFlags what types you want to test for (see above)
diff --git a/content/base/src/mozSanitizingSerializer.cpp b/content/base/src/mozSanitizingSerializer.cpp
index 335b0eba0e60..07a5f319077e 100644
--- a/content/base/src/mozSanitizingSerializer.cpp
+++ b/content/base/src/mozSanitizingSerializer.cpp
@@ -214,7 +214,7 @@ mozSanitizingHTMLSerializer::IsContainer(PRInt32 aId)
PRInt32
mozSanitizingHTMLSerializer::GetIdForContent(nsIContent* aContent)
{
- if (!aContent->IsNodeOfType(nsINode::eHTML)) {
+ if (!aContent->IsHTML()) {
return eHTMLTag_unknown;
}
diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp
index 8b3526271d33..bbd4ad5a247f 100644
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -2092,7 +2092,7 @@ nsContentUtils::BelongsInForm(nsIDOMHTMLFormElement *aForm,
}
if (content->Tag() == nsGkAtoms::form &&
- content->IsNodeOfType(nsINode::eHTML)) {
+ content->IsHTML()) {
// The child is contained within a form, but not the right form
// so we ignore it.
diff --git a/content/base/src/nsCopySupport.cpp b/content/base/src/nsCopySupport.cpp
index 8cbf63016bef..f93b064463c2 100644
--- a/content/base/src/nsCopySupport.cpp
+++ b/content/base/src/nsCopySupport.cpp
@@ -349,7 +349,7 @@ nsresult nsCopySupport::IsPlainTextContext(nsISelection *aSel, nsIDocument *aDoc
{
// checking for selection inside a plaintext form widget
- if (!selContent->IsNodeOfType(nsINode::eHTML)) {
+ if (!selContent->IsHTML()) {
continue;
}
diff --git a/content/base/src/nsDOMAttributeMap.cpp b/content/base/src/nsDOMAttributeMap.cpp
index 55ea0e61805f..f38e3b50a5fa 100644
--- a/content/base/src/nsDOMAttributeMap.cpp
+++ b/content/base/src/nsDOMAttributeMap.cpp
@@ -354,7 +354,7 @@ nsDOMAttributeMap::SetNamedItemInternal(nsIDOMNode *aNode,
iAttribute->SetMap(this);
if (!aWithNS && ni->NamespaceID() == kNameSpaceID_None &&
- mContent->IsNodeOfType(nsINode::eHTML)) {
+ mContent->IsHTML()) {
// Set via setAttribute(), which may do normalization on the
// attribute name for HTML
nsCOMPtr ourElement(do_QueryInterface(mContent));
diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp
index 769c2465a561..0cc2d9572272 100644
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -4825,7 +4825,7 @@ nsDocument::GetHtmlContent()
{
nsIContent* rootContent = GetRootContent();
if (rootContent && rootContent->Tag() == nsGkAtoms::html &&
- rootContent->IsNodeOfType(nsINode::eHTML))
+ rootContent->IsHTML())
return rootContent;
return nsnull;
}
@@ -4841,14 +4841,14 @@ nsDocument::GetHtmlChildContent(nsIAtom* aTag)
// forwards to find the first such element.
for (PRUint32 i = 0; i < html->GetChildCount(); ++i) {
nsIContent* result = html->GetChildAt(i);
- if (result->Tag() == aTag && result->IsNodeOfType(nsINode::eHTML))
+ if (result->Tag() == aTag && result->IsHTML())
return result;
}
return nsnull;
}
nsIContent*
-nsDocument::GetTitleContent(PRUint32 aNodeType)
+nsDocument::GetTitleContent(PRUint32 aNamespace)
{
// mMayHaveTitleElement will have been set to true if any HTML or SVG
// element has been bound to this document. So if it's false,
@@ -4870,15 +4870,15 @@ nsDocument::GetTitleContent(PRUint32 aNodeType)
nsIContent* elem = list->Item(i, PR_FALSE);
if (!elem)
return nsnull;
- if (elem->IsNodeOfType(aNodeType))
+ if (elem->IsInNamespace(aNamespace))
return elem;
}
}
void
-nsDocument::GetTitleFromElement(PRUint32 aNodeType, nsAString& aTitle)
+nsDocument::GetTitleFromElement(PRUint32 aNamespace, nsAString& aTitle)
{
- nsIContent* title = GetTitleContent(aNodeType);
+ nsIContent* title = GetTitleContent(aNamespace);
if (!title)
return;
nsContentUtils::GetNodeTextContent(title, PR_FALSE, aTitle);
@@ -4904,12 +4904,12 @@ nsDocument::GetTitle(nsAString& aTitle)
#ifdef MOZ_SVG
case kNameSpaceID_SVG:
if (rootContent->Tag() == nsGkAtoms::svg) {
- GetTitleFromElement(nsINode::eSVG, tmp);
+ GetTitleFromElement(kNameSpaceID_SVG, tmp);
break;
} // else fall through
#endif
default:
- GetTitleFromElement(nsINode::eHTML, tmp);
+ GetTitleFromElement(kNameSpaceID_XHTML, tmp);
break;
}
@@ -4941,7 +4941,7 @@ nsDocument::SetTitle(const nsAString& aTitle)
// element" under us
mozAutoDocUpdate updateBatch(this, UPDATE_CONTENT_MODEL, PR_TRUE);
- nsIContent* title = GetTitleContent(nsINode::eHTML);
+ nsIContent* title = GetTitleContent(kNameSpaceID_XHTML);
if (!title) {
nsIContent *head = GetHeadContent();
if (!head)
@@ -5020,7 +5020,7 @@ nsDocument::GetBoxObjectFor(nsIDOMElement* aElement, nsIBoxObject** aResult)
nsIDocument* doc = content->GetOwnerDoc();
NS_ENSURE_TRUE(doc == this, NS_ERROR_DOM_WRONG_DOCUMENT_ERR);
- if (!mHasWarnedAboutBoxObjects && !content->IsNodeOfType(eXUL)) {
+ if (!mHasWarnedAboutBoxObjects && !content->IsXUL()) {
mHasWarnedAboutBoxObjects = PR_TRUE;
nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
"UseOfGetBoxObjectForWarning",
diff --git a/content/base/src/nsFrameLoader.cpp b/content/base/src/nsFrameLoader.cpp
index 0320736f5fb0..e5ff5c061acd 100644
--- a/content/base/src/nsFrameLoader.cpp
+++ b/content/base/src/nsFrameLoader.cpp
@@ -400,7 +400,7 @@ AddTreeItemToTreeOwner(nsIDocShellTreeItem* aItem, nsIContent* aOwningContent,
nsAutoString value;
PRBool isContent = PR_FALSE;
- if (aOwningContent->IsNodeOfType(nsINode::eXUL)) {
+ if (aOwningContent->IsXUL()) {
aOwningContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, value);
}
diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp
index 1dc51e88677d..265ddd3bee22 100644
--- a/content/base/src/nsGenericElement.cpp
+++ b/content/base/src/nsGenericElement.cpp
@@ -338,7 +338,8 @@ nsINode::GetTextEditorRootContent(nsIEditor** aEditor)
if (aEditor)
*aEditor = nsnull;
for (nsINode* node = this; node; node = node->GetNodeParent()) {
- if (!node->IsNodeOfType(eHTML))
+ if (!node->IsNodeOfType(eELEMENT) ||
+ !static_cast(node)->IsHTML())
continue;
nsCOMPtr editor;
@@ -1144,7 +1145,7 @@ nsNSElementTearoff::GetScrollInfo(nsIScrollableView **aScrollableView,
*aScrollableView = nsnull;
// it isn't clear what to return for SVG nodes, so just return nothing
- if (mContent->IsNodeOfType(nsINode::eSVG)) {
+ if (mContent->IsSVG()) {
if (aFrame)
*aFrame = nsnull;
return;
@@ -1296,7 +1297,7 @@ nsNSElementTearoff::GetScrollHeight(PRInt32* aScrollHeight)
NS_ENSURE_ARG_POINTER(aScrollHeight);
*aScrollHeight = 0;
- if (mContent->IsNodeOfType(nsINode::eSVG))
+ if (mContent->IsSVG())
return NS_OK;
nsIScrollableView *scrollView;
@@ -1327,7 +1328,7 @@ nsNSElementTearoff::GetScrollWidth(PRInt32* aScrollWidth)
NS_ENSURE_ARG_POINTER(aScrollWidth);
*aScrollWidth = 0;
- if (mContent->IsNodeOfType(nsINode::eSVG))
+ if (mContent->IsSVG())
return NS_OK;
nsIScrollableView *scrollView;
@@ -1358,7 +1359,7 @@ nsNSElementTearoff::GetClientAreaRect()
nsIFrame *frame;
// it isn't clear what to return for SVG nodes, so just return 0
- if (mContent->IsNodeOfType(nsINode::eSVG))
+ if (mContent->IsSVG())
return nsRect(0, 0, 0, 0);
GetScrollInfo(&scrollView, &frame);
@@ -3949,7 +3950,7 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace,
}
}
- if (!newContent->IsNodeOfType(eXUL)) {
+ if (!newContent->IsXUL()) {
nsContentUtils::ReparentContentWrapper(newContent, aParent,
container->GetOwnerDoc(),
container->GetOwnerDoc());
@@ -4008,7 +4009,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGenericElement)
NS_IMPL_CYCLE_COLLECTION_UNLINK_LISTENERMANAGER
NS_IMPL_CYCLE_COLLECTION_UNLINK_USERDATA
- if (tmp->HasProperties() && tmp->IsNodeOfType(nsINode::eXUL)) {
+ if (tmp->HasProperties() && tmp->IsXUL()) {
tmp->DeleteProperty(nsGkAtoms::contextmenulistener);
tmp->DeleteProperty(nsGkAtoms::popuplistener);
}
@@ -4038,7 +4039,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGenericElement)
slots->mAttributeMap->DropReference();
slots->mAttributeMap = nsnull;
}
- if (tmp->IsNodeOfType(nsINode::eXUL))
+ if (tmp->IsXUL())
NS_IF_RELEASE(slots->mControllers);
slots->mChildrenList = nsnull;
}
@@ -4076,7 +4077,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGenericElement)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_LISTENERMANAGER
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_USERDATA
- if (tmp->HasProperties() && tmp->IsNodeOfType(nsINode::eXUL)) {
+ if (tmp->HasProperties() && tmp->IsXUL()) {
nsISupports* property =
static_cast
(tmp->GetProperty(nsGkAtoms::contextmenulistener));
@@ -4118,7 +4119,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGenericElement)
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "slots mAttributeMap");
cb.NoteXPCOMChild(slots->mAttributeMap.get());
- if (tmp->IsNodeOfType(nsINode::eXUL))
+ if (tmp->IsXUL())
cb.NoteXPCOMChild(slots->mControllers);
cb.NoteXPCOMChild(
static_cast(slots->mChildrenList.get()));
diff --git a/content/base/src/nsNodeUtils.cpp b/content/base/src/nsNodeUtils.cpp
index f781d5cdf41b..6bcb4c6e2338 100644
--- a/content/base/src/nsNodeUtils.cpp
+++ b/content/base/src/nsNodeUtils.cpp
@@ -690,7 +690,7 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, PRBool aClone, PRBool aDeep,
// cloning, so kids of the new node aren't confused about whether they're
// in a document.
#ifdef MOZ_XUL
- if (aClone && !aParent && aNode->IsNodeOfType(nsINode::eXUL)) {
+ if (aClone && !aParent && aNode->IsNodeOfType(nsINode::eELEMENT) && static_cast(aNode)->IsXUL()) {
nsXULElement *xulElem = static_cast(elem);
if (!xulElem->mPrototype || xulElem->IsInDoc()) {
clone->SetFlags(NODE_FORCE_XBL_BINDINGS);
diff --git a/content/base/src/nsObjectLoadingContent.cpp b/content/base/src/nsObjectLoadingContent.cpp
index 6a82d09dc7b6..1afd79aba982 100644
--- a/content/base/src/nsObjectLoadingContent.cpp
+++ b/content/base/src/nsObjectLoadingContent.cpp
@@ -1788,7 +1788,7 @@ nsObjectLoadingContent::ShouldShowDefaultPlugin(nsIContent* aContent,
nsObjectLoadingContent::GetPluginSupportState(nsIContent* aContent,
const nsCString& aContentType)
{
- if (!aContent->IsNodeOfType(nsINode::eHTML)) {
+ if (!aContent->IsHTML()) {
return ePluginOtherState;
}
@@ -1805,7 +1805,7 @@ nsObjectLoadingContent::GetPluginSupportState(nsIContent* aContent,
nsIContent* child = aContent->GetChildAt(i);
NS_ASSERTION(child, "GetChildCount lied!");
- if (child->IsNodeOfType(nsINode::eHTML) &&
+ if (child->IsHTML() &&
child->Tag() == nsGkAtoms::param) {
if (child->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name,
NS_LITERAL_STRING("pluginurl"), eIgnoreCase)) {
diff --git a/content/base/src/nsPlainTextSerializer.cpp b/content/base/src/nsPlainTextSerializer.cpp
index 88bdf4f36f46..4fc29c71ff71 100644
--- a/content/base/src/nsPlainTextSerializer.cpp
+++ b/content/base/src/nsPlainTextSerializer.cpp
@@ -1853,7 +1853,7 @@ nsPlainTextSerializer::IsCurrentNodeConverted(const nsIParserNode* aNode)
PRInt32
nsPlainTextSerializer::GetIdForContent(nsIContent* aContent)
{
- if (!aContent->IsNodeOfType(nsINode::eHTML)) {
+ if (!aContent->IsHTML()) {
return eHTMLTag_unknown;
}
diff --git a/content/base/src/nsScriptElement.cpp b/content/base/src/nsScriptElement.cpp
index dd489e43cfb3..3e70ee7f850b 100644
--- a/content/base/src/nsScriptElement.cpp
+++ b/content/base/src/nsScriptElement.cpp
@@ -145,23 +145,23 @@ nsScriptElement::ContentInserted(nsIDocument *aDocument,
}
static PRBool
-InNonScriptingContainer(nsINode* aNode)
+InNonScriptingContainer(nsIContent* aNode)
{
- aNode = aNode->GetNodeParent();
+ aNode = aNode->GetParent();
while (aNode) {
// XXX noframes and noembed are currently unconditionally not
// displayed and processed. This might change if we support either
// prefs or per-document container settings for not allowing
// frames or plugins.
- if (aNode->IsNodeOfType(nsINode::eHTML)) {
- nsIAtom *localName = static_cast(aNode)->Tag();
+ if (aNode->IsHTML()) {
+ nsIAtom *localName = aNode->Tag();
if (localName == nsGkAtoms::iframe ||
localName == nsGkAtoms::noframes ||
localName == nsGkAtoms::noembed) {
return PR_TRUE;
}
}
- aNode = aNode->GetNodeParent();
+ aNode = aNode->GetParent();
}
return PR_FALSE;
diff --git a/content/base/src/nsXHTMLContentSerializer.cpp b/content/base/src/nsXHTMLContentSerializer.cpp
index 99c6b45d5b88..b4c6c3ede70b 100644
--- a/content/base/src/nsXHTMLContentSerializer.cpp
+++ b/content/base/src/nsXHTMLContentSerializer.cpp
@@ -503,7 +503,7 @@ nsXHTMLContentSerializer::AfterElementStart(nsIContent * aContent,
PRUint32 i, childCount = aContent->GetChildCount();
for (i = 0; i < childCount; ++i) {
nsIContent* child = aContent->GetChildAt(i);
- if (child->IsNodeOfType(nsINode::eHTML) &&
+ if (child->IsHTML() &&
child->Tag() == nsGkAtoms::meta &&
child->HasAttr(kNameSpaceID_None, nsGkAtoms::content)) {
nsAutoString header;
diff --git a/content/base/src/nsXMLContentSerializer.cpp b/content/base/src/nsXMLContentSerializer.cpp
index 8f247e670998..77cbdffcbc8e 100644
--- a/content/base/src/nsXMLContentSerializer.cpp
+++ b/content/base/src/nsXMLContentSerializer.cpp
@@ -772,7 +772,7 @@ nsXMLContentSerializer::IsJavaScript(nsIContent * aContent, nsIAtom* aAttrNameAt
PRInt32 aAttrNamespaceID, const nsAString& aValueString)
{
PRInt32 namespaceID = aContent->GetNameSpaceID();
- PRBool isHtml = aContent->IsNodeOfType(nsINode::eHTML);
+ PRBool isHtml = aContent->IsHTML();
if (aAttrNamespaceID == kNameSpaceID_None &&
(isHtml ||
diff --git a/content/events/src/nsContentEventHandler.cpp b/content/events/src/nsContentEventHandler.cpp
index a299ca8aad0c..1f0ed00a7067 100644
--- a/content/events/src/nsContentEventHandler.cpp
+++ b/content/events/src/nsContentEventHandler.cpp
@@ -141,7 +141,7 @@ nsContentEventHandler::Init(nsQueryContentEvent* aEvent)
// we don't want to include the bogus BRs at the end.
static PRBool IsContentBR(nsIContent* aContent)
{
- return aContent->IsNodeOfType(nsINode::eHTML) &&
+ return aContent->IsHTML() &&
aContent->Tag() == nsGkAtoms::br &&
!aContent->AttrValueIs(kNameSpaceID_None,
nsGkAtoms::type,
@@ -857,12 +857,12 @@ static void AdjustRangeForSelection(nsIContent* aRoot,
node = node->GetParent();
offset = node->IndexOf(*aNode) + (offset ? 1 : 0);
}
- nsINode* brNode = node->GetChildAt(offset - 1);
- while (brNode && brNode->IsNodeOfType(nsINode::eHTML)) {
- nsIContent* brContent = static_cast(brNode);
+
+ nsIContent* brContent = node->GetChildAt(offset - 1);
+ while (brContent && brContent->IsHTML()) {
if (brContent->Tag() != nsGkAtoms::br || IsContentBR(brContent))
break;
- brNode = node->GetChildAt(--offset - 1);
+ brContent = node->GetChildAt(--offset - 1);
}
*aNode = node;
*aOffset = PR_MAX(offset, 0);
diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp
index e2cd7ecdf206..b7d65969a1c7 100644
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -1243,7 +1243,7 @@ IsAccessKeyTarget(nsIContent* aContent, nsIFrame* aFrame, nsAString& aKey)
nsCOMPtr xulDoc =
do_QueryInterface(aContent->GetOwnerDoc());
- if (!xulDoc && !aContent->IsNodeOfType(nsINode::eXUL))
+ if (!xulDoc && !aContent->IsXUL())
return PR_TRUE;
// For XUL we do visibility checks.
@@ -1264,7 +1264,7 @@ IsAccessKeyTarget(nsIContent* aContent, nsIFrame* aFrame, nsAString& aKey)
if (control)
return PR_TRUE;
- if (aContent->IsNodeOfType(nsINode::eHTML)) {
+ if (aContent->IsHTML()) {
nsIAtom* tag = aContent->Tag();
// HTML area, label and legend elements are never focusable, so
@@ -1274,7 +1274,7 @@ IsAccessKeyTarget(nsIContent* aContent, nsIFrame* aFrame, nsAString& aKey)
tag == nsGkAtoms::legend)
return PR_TRUE;
- } else if (aContent->IsNodeOfType(nsINode::eXUL)) {
+ } else if (aContent->IsXUL()) {
// XUL label elements are never focusable, so we need to check for them
// explicitly before giving up.
if (aContent->Tag() == nsGkAtoms::label)
@@ -1557,7 +1557,7 @@ nsEventStateManager::FireContextClick()
nsIAtom *tag = mGestureDownContent->Tag();
PRBool allowedToDispatch = PR_TRUE;
- if (mGestureDownContent->IsNodeOfType(nsINode::eXUL)) {
+ if (mGestureDownContent->IsXUL()) {
if (tag == nsGkAtoms::scrollbar ||
tag == nsGkAtoms::scrollbarbutton ||
tag == nsGkAtoms::button)
@@ -1578,7 +1578,7 @@ nsEventStateManager::FireContextClick()
}
}
}
- else if (mGestureDownContent->IsNodeOfType(nsINode::eHTML)) {
+ else if (mGestureDownContent->IsHTML()) {
nsCOMPtr formCtrl(do_QueryInterface(mGestureDownContent));
if (formCtrl) {
@@ -2207,7 +2207,7 @@ nsEventStateManager::DoScrollZoom(nsIFrame *aTargetFrame,
nsIContent *content = aTargetFrame->GetContent();
if (content &&
!content->IsNodeOfType(nsINode::eHTML_FORM_CONTROL) &&
- !content->IsNodeOfType(nsINode::eXUL))
+ !content->IsXUL())
{
// positive adjustment to decrease zoom, negative to increase
PRInt32 change = (adjustment > 0) ? -1 : 1;
diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp
index 5b2f1aa42f36..8c03673cca61 100644
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -436,8 +436,8 @@ nsGenericHTMLElement::SetClassName(const nsAString& aClassName)
static PRBool
IsBody(nsIContent *aContent)
{
- return (aContent->NodeInfo()->Equals(nsGkAtoms::body) &&
- aContent->IsNodeOfType(nsINode::eHTML));
+ return aContent->NodeInfo()->Equals(nsGkAtoms::body) &&
+ aContent->IsHTML();
}
static PRBool IS_TABLE_CELL(nsIAtom* frameType) {
@@ -752,14 +752,13 @@ nsGenericHTMLElement::GetSpellcheck(PRBool* aSpellcheck)
*aSpellcheck = PR_FALSE; // Default answer is to not spellcheck
// Has the state has been explicitly set?
- nsINode* node;
- for (node = this; node; node = node->GetNodeParent()) {
- if (node->IsNodeOfType(nsINode::eHTML)) {
+ nsIContent* node;
+ for (node = this; node; node = node->GetParent()) {
+ if (node->IsHTML()) {
static nsIContent::AttrValuesArray strings[] =
{&nsGkAtoms::_true, &nsGkAtoms::_false, nsnull};
- switch (static_cast(node)->
- FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::spellcheck,
- strings, eCaseMatters)) {
+ switch (node->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::spellcheck,
+ strings, eCaseMatters)) {
case 0: // spellcheck = "true"
*aSpellcheck = PR_TRUE;
// Fall through
@@ -906,7 +905,7 @@ nsGenericHTMLElement::FindForm(nsIForm* aCurrentForm)
while (content != bindingParent && content) {
// If the current ancestor is a form, return it as our form
if (content->Tag() == nsGkAtoms::form &&
- content->IsNodeOfType(nsINode::eHTML)) {
+ content->IsHTML()) {
#ifdef DEBUG
if (!nsContentUtils::IsInSameAnonymousTree(this, content)) {
// It's possible that we started unbinding at |content| or
@@ -959,7 +958,7 @@ static PRBool
IsArea(nsIContent *aContent)
{
return (aContent->Tag() == nsGkAtoms::area &&
- aContent->IsNodeOfType(nsINode::eHTML));
+ aContent->IsHTML());
}
PRBool
@@ -1211,7 +1210,7 @@ nsGenericHTMLElement::GetBaseTarget(nsAString& aBaseTarget) const
PRBool
nsGenericHTMLElement::IsNodeOfType(PRUint32 aFlags) const
{
- return !(aFlags & ~(eCONTENT | eELEMENT | eHTML));
+ return !(aFlags & ~(eCONTENT | eELEMENT));
}
//----------------------------------------------------------------------
@@ -2293,7 +2292,7 @@ NS_IMPL_QUERY_INTERFACE_INHERITED1(nsGenericHTMLFormElement,
PRBool
nsGenericHTMLFormElement::IsNodeOfType(PRUint32 aFlags) const
{
- return !(aFlags & ~(eCONTENT | eELEMENT | eHTML | eHTML_FORM_CONTROL));
+ return !(aFlags & ~(eCONTENT | eELEMENT | eHTML_FORM_CONTROL));
}
void
diff --git a/content/html/content/src/nsGenericHTMLElement.h b/content/html/content/src/nsGenericHTMLElement.h
index ec0772995b62..9e5217e981e6 100644
--- a/content/html/content/src/nsGenericHTMLElement.h
+++ b/content/html/content/src/nsGenericHTMLElement.h
@@ -79,7 +79,7 @@ public:
/** Typesafe, non-refcounting cast from nsIContent. Cheaper than QI. **/
static nsGenericHTMLElement* FromContent(nsIContent *aContent)
{
- if (aContent->IsNodeOfType(eHTML))
+ if (aContent->IsHTML())
return static_cast(aContent);
return nsnull;
}
diff --git a/content/html/content/src/nsHTMLMediaElement.cpp b/content/html/content/src/nsHTMLMediaElement.cpp
index 8896e34eb3ce..45622bf6fbdb 100644
--- a/content/html/content/src/nsHTMLMediaElement.cpp
+++ b/content/html/content/src/nsHTMLMediaElement.cpp
@@ -436,7 +436,7 @@ static PRBool HasSourceChildren(nsIContent *aElement)
NS_ASSERTION(child, "GetChildCount lied!");
if (child &&
child->Tag() == nsGkAtoms::source &&
- child->IsNodeOfType(nsINode::eHTML))
+ child->IsHTML())
{
return PR_TRUE;
}
@@ -1626,7 +1626,7 @@ void nsHTMLMediaElement::Thaw()
PRBool
nsHTMLMediaElement::IsNodeOfType(PRUint32 aFlags) const
{
- return !(aFlags & ~(eCONTENT | eELEMENT | eHTML | eMEDIA));
+ return !(aFlags & ~(eCONTENT | eELEMENT | eMEDIA));
}
void nsHTMLMediaElement::NotifyAddedSource()
@@ -1679,7 +1679,7 @@ already_AddRefed nsHTMLMediaElement::GetNextSource()
// If child is a element, it may be the next candidate.
if (child &&
child->Tag() == nsGkAtoms::source &&
- child->IsNodeOfType(nsINode::eHTML))
+ child->IsHTML())
{
nsCOMPtr uri;
nsAutoString src,type;
diff --git a/content/html/content/src/nsHTMLOptGroupElement.cpp b/content/html/content/src/nsHTMLOptGroupElement.cpp
index e51bf01b9c76..eaa1122e6381 100644
--- a/content/html/content/src/nsHTMLOptGroupElement.cpp
+++ b/content/html/content/src/nsHTMLOptGroupElement.cpp
@@ -158,8 +158,7 @@ nsIContent*
nsHTMLOptGroupElement::GetSelect()
{
nsIContent* parent = this;
- while ((parent = parent->GetParent()) &&
- parent->IsNodeOfType(eHTML)) {
+ while ((parent = parent->GetParent()) && parent->IsHTML()) {
if (parent->Tag() == nsGkAtoms::select) {
return parent;
}
diff --git a/content/html/content/src/nsHTMLOptionElement.cpp b/content/html/content/src/nsHTMLOptionElement.cpp
index 020d6fb05d0a..af4fcf952282 100644
--- a/content/html/content/src/nsHTMLOptionElement.cpp
+++ b/content/html/content/src/nsHTMLOptionElement.cpp
@@ -442,7 +442,7 @@ nsHTMLOptionElement::GetSelect()
{
nsIContent* parent = this;
while ((parent = parent->GetParent()) &&
- parent->IsNodeOfType(eHTML)) {
+ parent->IsHTML()) {
if (parent->Tag() == nsGkAtoms::select) {
return parent;
}
diff --git a/content/html/content/src/nsHTMLSelectElement.cpp b/content/html/content/src/nsHTMLSelectElement.cpp
index f21d164e6791..719d38b10a19 100644
--- a/content/html/content/src/nsHTMLSelectElement.cpp
+++ b/content/html/content/src/nsHTMLSelectElement.cpp
@@ -331,7 +331,7 @@ nsHTMLSelectElement::RemoveOptionsFromList(nsIContent* aOptions,
static PRBool IsOptGroup(nsIContent *aContent)
{
return (aContent->NodeInfo()->Equals(nsGkAtoms::optgroup) &&
- aContent->IsNodeOfType(nsINode::eHTML));
+ aContent->IsHTML());
}
// If the document is such that recursing over these options gets us
diff --git a/content/html/content/src/nsHTMLTableCellElement.cpp b/content/html/content/src/nsHTMLTableCellElement.cpp
index 777f0ddce273..9007d35b56c5 100644
--- a/content/html/content/src/nsHTMLTableCellElement.cpp
+++ b/content/html/content/src/nsHTMLTableCellElement.cpp
@@ -140,7 +140,7 @@ nsHTMLTableCellElement::GetTable()
if (parent) { // GetParent() should be a row
nsIContent* section = parent->GetParent();
if (section) {
- if (section->IsNodeOfType(eHTML) &&
+ if (section->IsHTML() &&
section->NodeInfo()->Equals(nsGkAtoms::table)) {
// XHTML, without a row group
result = section;
diff --git a/content/html/content/src/nsHTMLTableRowElement.cpp b/content/html/content/src/nsHTMLTableRowElement.cpp
index 62910dba1baf..e7843148c669 100644
--- a/content/html/content/src/nsHTMLTableRowElement.cpp
+++ b/content/html/content/src/nsHTMLTableRowElement.cpp
@@ -237,7 +237,7 @@ IsCell(nsIContent *aContent, PRInt32 aNamespaceID,
nsIAtom* tag = aContent->Tag();
return ((tag == nsGkAtoms::td || tag == nsGkAtoms::th) &&
- aContent->IsNodeOfType(nsINode::eHTML));
+ aContent->IsHTML());
}
NS_IMETHODIMP
diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp
index fa857b4158b5..721ffd1874e8 100644
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -1592,7 +1592,7 @@ nsHTMLDocument::SetBody(nsIDOMHTMLElement* aBody)
// body.
if (!newBody || !(newBody->Tag() == nsGkAtoms::body ||
newBody->Tag() == nsGkAtoms::frameset) ||
- !root || !root->IsNodeOfType(nsINode::eHTML) ||
+ !root || !root->IsHTML() ||
root->Tag() != nsGkAtoms::html) {
return NS_ERROR_DOM_HIERARCHY_REQUEST_ERR;
}
@@ -2824,7 +2824,7 @@ nsHTMLDocument::ResolveName(const nsAString& aName,
nsIContent *e = entry->GetIdContent();
- if (e && e->IsNodeOfType(nsINode::eHTML)) {
+ if (e && e->IsHTML()) {
nsIAtom *tag = e->Tag();
if ((tag == nsGkAtoms::embed ||
diff --git a/content/mathml/content/src/nsMathMLElement.cpp b/content/mathml/content/src/nsMathMLElement.cpp
index 150f66ffab5a..37d98f8d2c40 100644
--- a/content/mathml/content/src/nsMathMLElement.cpp
+++ b/content/mathml/content/src/nsMathMLElement.cpp
@@ -410,7 +410,7 @@ nsMathMLElement::IntrinsicState() const
PRBool
nsMathMLElement::IsNodeOfType(PRUint32 aFlags) const
{
- return !(aFlags & ~(eCONTENT | eELEMENT | eMATHML));
+ return !(aFlags & ~(eCONTENT | eELEMENT));
}
void
diff --git a/content/svg/content/src/nsSVGElement.cpp b/content/svg/content/src/nsSVGElement.cpp
index d308c4576ee9..af64061d58ae 100644
--- a/content/svg/content/src/nsSVGElement.cpp
+++ b/content/svg/content/src/nsSVGElement.cpp
@@ -699,7 +699,7 @@ nsSVGElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
PRBool
nsSVGElement::IsNodeOfType(PRUint32 aFlags) const
{
- return !(aFlags & ~(eCONTENT | eELEMENT | eSVG));
+ return !(aFlags & ~(eCONTENT | eELEMENT));
}
already_AddRefed
diff --git a/content/svg/content/src/nsSVGLength2.cpp b/content/svg/content/src/nsSVGLength2.cpp
index 5e7590000a02..d8f5fc931a48 100644
--- a/content/svg/content/src/nsSVGLength2.cpp
+++ b/content/svg/content/src/nsSVGLength2.cpp
@@ -289,7 +289,7 @@ float
nsSVGLength2::GetUnitScaleFactor(nsIFrame *aFrame, PRUint8 aUnitType) const
{
nsIContent* content = aFrame->GetContent();
- if (content->IsNodeOfType(nsINode::eSVG))
+ if (content->IsSVG())
return GetUnitScaleFactor(static_cast(content), aUnitType);
switch (aUnitType) {
diff --git a/content/xbl/src/nsXBLContentSink.cpp b/content/xbl/src/nsXBLContentSink.cpp
index 7209b3102b36..24a6e970a5a1 100644
--- a/content/xbl/src/nsXBLContentSink.cpp
+++ b/content/xbl/src/nsXBLContentSink.cpp
@@ -899,7 +899,7 @@ nsresult
nsXBLContentSink::AddAttributes(const PRUnichar** aAtts,
nsIContent* aContent)
{
- if (aContent->IsNodeOfType(nsINode::eXUL))
+ if (aContent->IsXUL())
return NS_OK; // Nothing to do, since the proto already has the attrs.
return nsXMLContentSink::AddAttributes(aAtts, aContent);
diff --git a/content/xbl/src/nsXBLPrototypeHandler.cpp b/content/xbl/src/nsXBLPrototypeHandler.cpp
index 0eeab2da8956..fbc33312b170 100644
--- a/content/xbl/src/nsXBLPrototypeHandler.cpp
+++ b/content/xbl/src/nsXBLPrototypeHandler.cpp
@@ -481,8 +481,7 @@ nsXBLPrototypeHandler::DispatchXBLCommand(nsPIDOMEventTarget* aTarget, nsIDOMEve
// element is focused and has a parent.
if (focusedContent && focusedContent->GetParent()) {
while (content) {
- if (content->Tag() == nsGkAtoms::a &&
- content->IsNodeOfType(nsINode::eHTML)) {
+ if (content->Tag() == nsGkAtoms::a && content->IsHTML()) {
isLink = PR_TRUE;
break;
}
diff --git a/content/xbl/src/nsXBLService.cpp b/content/xbl/src/nsXBLService.cpp
index 94882c5ced8e..e172b7c36886 100644
--- a/content/xbl/src/nsXBLService.cpp
+++ b/content/xbl/src/nsXBLService.cpp
@@ -1172,8 +1172,7 @@ nsXBLService::LoadBindingDocumentInfo(nsIContent* aBoundElement,
ni->Equals(nsGkAtoms::thumb, kNameSpaceID_XUL) ||
((ni->Equals(nsGkAtoms::input) ||
ni->Equals(nsGkAtoms::select)) &&
- aBoundElement->IsNodeOfType(nsINode::eHTML)))) &&
- !aForceSyncLoad) {
+ aBoundElement->IsHTML()))) && !aForceSyncLoad) {
// The third line of defense is to investigate whether or not the
// document is currently being loaded asynchronously. If so, there's no
// document yet, but we need to glom on our request so that it will be
diff --git a/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp b/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp
index c2730126fdc6..ad2320abbaa7 100644
--- a/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp
+++ b/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp
@@ -437,13 +437,6 @@ txXPathNodeUtils::getLocalName(const txXPathNode& aNode, nsAString& aLocalName)
if (aNode.mNode->IsNodeOfType(nsINode::eELEMENT)) {
nsINodeInfo* nodeInfo = aNode.Content()->NodeInfo();
nodeInfo->GetLocalName(aLocalName);
-
- // Check for html
- if (nodeInfo->NamespaceEquals(kNameSpaceID_None) &&
- aNode.mNode->IsNodeOfType(nsINode::eHTML)) {
- ToUpperCase(aLocalName);
- }
-
return;
}
@@ -465,7 +458,7 @@ txXPathNodeUtils::getLocalName(const txXPathNode& aNode, nsAString& aLocalName)
// Check for html
if (aNode.Content()->NodeInfo()->NamespaceEquals(kNameSpaceID_None) &&
- aNode.Content()->IsNodeOfType(nsINode::eHTML)) {
+ aNode.Content()->IsHTML()) {
ToUpperCase(aLocalName);
}
}
@@ -486,11 +479,9 @@ txXPathNodeUtils::getNodeName(const txXPathNode& aNode, nsAString& aName)
nodeInfo->GetQualifiedName(aName);
// Check for html
- if (nodeInfo->NamespaceEquals(kNameSpaceID_None) &&
- aNode.Content()->IsNodeOfType(nsINode::eHTML)) {
+ if (aNode.Content()->IsHTML()) {
ToUpperCase(aName);
}
-
return;
}
@@ -510,8 +501,7 @@ txXPathNodeUtils::getNodeName(const txXPathNode& aNode, nsAString& aName)
aNode.Content()->GetAttrNameAt(aNode.mIndex)->GetQualifiedName(aName);
// Check for html
- if (aNode.Content()->NodeInfo()->NamespaceEquals(kNameSpaceID_None) &&
- aNode.Content()->IsNodeOfType(nsINode::eHTML)) {
+ if (aNode.Content()->IsHTML()) {
ToUpperCase(aName);
}
}
diff --git a/content/xslt/src/xpath/txXPathTreeWalker.h b/content/xslt/src/xpath/txXPathTreeWalker.h
index 378f302fba93..88ff61ffdf01 100644
--- a/content/xslt/src/xpath/txXPathTreeWalker.h
+++ b/content/xslt/src/xpath/txXPathTreeWalker.h
@@ -150,7 +150,7 @@ public:
return PR_FALSE;
}
nsIContent* content = aNode.Content();
- return content->IsNodeOfType(nsINode::eHTML) && content->IsInHTMLDocument();
+ return content->IsHTML() && content->IsInHTMLDocument();
}
#else
private:
diff --git a/content/xslt/src/xslt/txMozillaXMLOutput.cpp b/content/xslt/src/xslt/txMozillaXMLOutput.cpp
index 54dee1b2a3e1..76c70f2272e1 100644
--- a/content/xslt/src/xslt/txMozillaXMLOutput.cpp
+++ b/content/xslt/src/xslt/txMozillaXMLOutput.cpp
@@ -308,14 +308,14 @@ txMozillaXMLOutput::endElement()
// Handle html-elements
if (!mNoFixup) {
- if (element->IsNodeOfType(nsINode::eHTML)) {
+ if (element->IsHTML()) {
rv = endHTMLElement(element);
NS_ENSURE_SUCCESS(rv, rv);
}
// Handle script elements
if (element->Tag() == nsGkAtoms::script &&
- (element->IsNodeOfType(nsINode::eHTML) ||
+ (element->IsHTML() ||
element->GetNameSpaceID() == kNameSpaceID_SVG)) {
rv = element->DoneAddingChildren(PR_TRUE);
diff --git a/content/xul/content/src/nsXULElement.cpp b/content/xul/content/src/nsXULElement.cpp
index 1615d59b2995..ddb9c2bc5717 100644
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -2152,7 +2152,7 @@ nsXULElement::GetBindingParent() const
PRBool
nsXULElement::IsNodeOfType(PRUint32 aFlags) const
{
- return !(aFlags & ~(eCONTENT | eELEMENT | eXUL));
+ return !(aFlags & ~(eCONTENT | eELEMENT));
}
static void
diff --git a/content/xul/content/src/nsXULElement.h b/content/xul/content/src/nsXULElement.h
index e80998889601..ca65294c4f4b 100644
--- a/content/xul/content/src/nsXULElement.h
+++ b/content/xul/content/src/nsXULElement.h
@@ -476,7 +476,7 @@ public:
/** Typesafe, non-refcounting cast from nsIContent. Cheaper than QI. **/
static nsXULElement* FromContent(nsIContent *aContent)
{
- if (aContent->IsNodeOfType(eXUL))
+ if (aContent->IsXUL())
return static_cast(aContent);
return nsnull;
}
diff --git a/content/xul/templates/src/nsXULContentBuilder.cpp b/content/xul/templates/src/nsXULContentBuilder.cpp
index 707c96ff83a2..846a661cdba4 100644
--- a/content/xul/templates/src/nsXULContentBuilder.cpp
+++ b/content/xul/templates/src/nsXULContentBuilder.cpp
@@ -1302,7 +1302,7 @@ PRBool
nsXULContentBuilder::IsOpen(nsIContent* aElement)
{
// Determine if this is a or