Back out b00bf7f3869c (bug 737976) for apparently causing mochitest-1 leaks on a CLOSED TREE
authorPhil Ringnalda <philringnalda@gmail.com>
Wed, 28 Mar 2012 22:43:09 -0700
changeset 93911 04aa64acdc6597872b8ff1f2df6c39026e2bddbc
parent 93910 bb679e5939b973b93932b867da24b2eaa10da98e
child 93912 7ed31daf07bd276798d7510d92fdfb405fbbee61
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs737976
milestone14.0a1
backs outb00bf7f3869c471073f6ade173b50617904066e0
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Back out b00bf7f3869c (bug 737976) for apparently causing mochitest-1 leaks on a CLOSED TREE
accessible/src/msaa/nsAccessibleWrap.cpp
accessible/src/xforms/nsXFormsAccessible.cpp
content/base/public/Element.h
content/base/public/Makefile.in
content/base/public/nsContentCreatorFunctions.h
content/base/public/nsContentUtils.h
content/base/public/nsIAttribute.h
content/base/public/nsIContent.h
content/base/public/nsINode.h
content/base/public/nsINodeInfo.h
content/base/src/Makefile.in
content/base/src/nsAttrAndChildArray.cpp
content/base/src/nsAttrAndChildArray.h
content/base/src/nsAttrName.h
content/base/src/nsCommentNode.cpp
content/base/src/nsContentList.cpp
content/base/src/nsContentSink.cpp
content/base/src/nsContentUtils.cpp
content/base/src/nsDOMAttribute.cpp
content/base/src/nsDOMAttribute.h
content/base/src/nsDOMAttributeMap.cpp
content/base/src/nsDOMAttributeMap.h
content/base/src/nsDOMDocumentType.cpp
content/base/src/nsDOMDocumentType.h
content/base/src/nsDocument.cpp
content/base/src/nsDocument.h
content/base/src/nsDocumentFragment.cpp
content/base/src/nsGenConImageContent.cpp
content/base/src/nsGenericDOMDataNode.cpp
content/base/src/nsGenericDOMDataNode.h
content/base/src/nsGenericElement.cpp
content/base/src/nsGenericElement.h
content/base/src/nsMappedAttributeElement.h
content/base/src/nsNameSpaceManager.cpp
content/base/src/nsNodeInfo.cpp
content/base/src/nsNodeInfo.h
content/base/src/nsNodeInfoManager.cpp
content/base/src/nsNodeInfoManager.h
content/base/src/nsNodeUtils.cpp
content/base/src/nsStyledElement.h
content/base/src/nsTextNode.cpp
content/base/src/nsTextNode.h
content/base/src/nsTreeSanitizer.cpp
content/events/src/nsEventStateManager.cpp
content/events/src/nsXMLEventsElement.cpp
content/events/src/nsXMLEventsManager.cpp
content/html/content/public/nsHTMLAudioElement.h
content/html/content/public/nsHTMLCanvasElement.h
content/html/content/public/nsHTMLMediaElement.h
content/html/content/public/nsHTMLVideoElement.h
content/html/content/src/nsGenericHTMLElement.cpp
content/html/content/src/nsGenericHTMLElement.h
content/html/content/src/nsGenericHTMLFrameElement.h
content/html/content/src/nsHTMLAnchorElement.cpp
content/html/content/src/nsHTMLAreaElement.cpp
content/html/content/src/nsHTMLAudioElement.cpp
content/html/content/src/nsHTMLBRElement.cpp
content/html/content/src/nsHTMLBodyElement.cpp
content/html/content/src/nsHTMLButtonElement.cpp
content/html/content/src/nsHTMLCanvasElement.cpp
content/html/content/src/nsHTMLDataListElement.cpp
content/html/content/src/nsHTMLDivElement.cpp
content/html/content/src/nsHTMLElement.cpp
content/html/content/src/nsHTMLFieldSetElement.cpp
content/html/content/src/nsHTMLFieldSetElement.h
content/html/content/src/nsHTMLFontElement.cpp
content/html/content/src/nsHTMLFormElement.cpp
content/html/content/src/nsHTMLFormElement.h
content/html/content/src/nsHTMLFrameElement.cpp
content/html/content/src/nsHTMLFrameSetElement.cpp
content/html/content/src/nsHTMLFrameSetElement.h
content/html/content/src/nsHTMLHRElement.cpp
content/html/content/src/nsHTMLHeadingElement.cpp
content/html/content/src/nsHTMLIFrameElement.cpp
content/html/content/src/nsHTMLImageElement.cpp
content/html/content/src/nsHTMLInputElement.cpp
content/html/content/src/nsHTMLInputElement.h
content/html/content/src/nsHTMLLIElement.cpp
content/html/content/src/nsHTMLLabelElement.cpp
content/html/content/src/nsHTMLLabelElement.h
content/html/content/src/nsHTMLLegendElement.cpp
content/html/content/src/nsHTMLLegendElement.h
content/html/content/src/nsHTMLLinkElement.cpp
content/html/content/src/nsHTMLMapElement.cpp
content/html/content/src/nsHTMLMediaElement.cpp
content/html/content/src/nsHTMLMenuElement.cpp
content/html/content/src/nsHTMLMenuElement.h
content/html/content/src/nsHTMLMenuItemElement.cpp
content/html/content/src/nsHTMLMenuItemElement.h
content/html/content/src/nsHTMLMetaElement.cpp
content/html/content/src/nsHTMLModElement.cpp
content/html/content/src/nsHTMLOListElement.cpp
content/html/content/src/nsHTMLObjectElement.cpp
content/html/content/src/nsHTMLOptGroupElement.cpp
content/html/content/src/nsHTMLOptionElement.cpp
content/html/content/src/nsHTMLOptionElement.h
content/html/content/src/nsHTMLOutputElement.cpp
content/html/content/src/nsHTMLParagraphElement.cpp
content/html/content/src/nsHTMLPreElement.cpp
content/html/content/src/nsHTMLProgressElement.cpp
content/html/content/src/nsHTMLScriptElement.cpp
content/html/content/src/nsHTMLSelectElement.cpp
content/html/content/src/nsHTMLSelectElement.h
content/html/content/src/nsHTMLSharedElement.cpp
content/html/content/src/nsHTMLSharedObjectElement.cpp
content/html/content/src/nsHTMLSourceElement.cpp
content/html/content/src/nsHTMLSpanElement.cpp
content/html/content/src/nsHTMLStyleElement.cpp
content/html/content/src/nsHTMLTableCaptionElement.cpp
content/html/content/src/nsHTMLTableCellElement.cpp
content/html/content/src/nsHTMLTableColElement.cpp
content/html/content/src/nsHTMLTableElement.cpp
content/html/content/src/nsHTMLTableElement.h
content/html/content/src/nsHTMLTableRowElement.cpp
content/html/content/src/nsHTMLTableSectionElement.cpp
content/html/content/src/nsHTMLTextAreaElement.cpp
content/html/content/src/nsHTMLTitleElement.cpp
content/html/content/src/nsHTMLUnknownElement.cpp
content/html/content/src/nsHTMLVideoElement.cpp
content/html/content/src/nsTextEditorState.cpp
content/html/document/src/ImageDocument.cpp
content/html/document/src/MediaDocument.cpp
content/html/document/src/PluginDocument.cpp
content/html/document/src/VideoDocument.cpp
content/html/document/src/nsHTMLContentSink.cpp
content/html/document/src/nsHTMLDocument.cpp
content/html/document/src/nsHTMLDocument.h
content/mathml/content/src/nsMathMLElement.h
content/mathml/content/src/nsMathMLElementFactory.cpp
content/svg/content/src/nsSVGAElement.cpp
content/svg/content/src/nsSVGAElement.h
content/svg/content/src/nsSVGAltGlyphElement.cpp
content/svg/content/src/nsSVGAnimateElement.cpp
content/svg/content/src/nsSVGAnimateMotionElement.cpp
content/svg/content/src/nsSVGAnimateMotionElement.h
content/svg/content/src/nsSVGAnimateTransformElement.cpp
content/svg/content/src/nsSVGAnimationElement.cpp
content/svg/content/src/nsSVGAnimationElement.h
content/svg/content/src/nsSVGCircleElement.cpp
content/svg/content/src/nsSVGClipPathElement.cpp
content/svg/content/src/nsSVGClipPathElement.h
content/svg/content/src/nsSVGDefsElement.cpp
content/svg/content/src/nsSVGDescElement.cpp
content/svg/content/src/nsSVGElement.cpp
content/svg/content/src/nsSVGElement.h
content/svg/content/src/nsSVGElementFactory.cpp
content/svg/content/src/nsSVGEllipseElement.cpp
content/svg/content/src/nsSVGFilterElement.cpp
content/svg/content/src/nsSVGFilterElement.h
content/svg/content/src/nsSVGFilters.cpp
content/svg/content/src/nsSVGFilters.h
content/svg/content/src/nsSVGForeignObjectElement.cpp
content/svg/content/src/nsSVGForeignObjectElement.h
content/svg/content/src/nsSVGGElement.cpp
content/svg/content/src/nsSVGGradientElement.cpp
content/svg/content/src/nsSVGGradientElement.h
content/svg/content/src/nsSVGGraphicElement.cpp
content/svg/content/src/nsSVGGraphicElement.h
content/svg/content/src/nsSVGImageElement.cpp
content/svg/content/src/nsSVGImageElement.h
content/svg/content/src/nsSVGLineElement.cpp
content/svg/content/src/nsSVGMarkerElement.cpp
content/svg/content/src/nsSVGMarkerElement.h
content/svg/content/src/nsSVGMaskElement.cpp
content/svg/content/src/nsSVGMaskElement.h
content/svg/content/src/nsSVGMetadataElement.cpp
content/svg/content/src/nsSVGMpathElement.cpp
content/svg/content/src/nsSVGMpathElement.h
content/svg/content/src/nsSVGPathElement.cpp
content/svg/content/src/nsSVGPathElement.h
content/svg/content/src/nsSVGPathGeometryElement.cpp
content/svg/content/src/nsSVGPathGeometryElement.h
content/svg/content/src/nsSVGPatternElement.cpp
content/svg/content/src/nsSVGPatternElement.h
content/svg/content/src/nsSVGPolyElement.cpp
content/svg/content/src/nsSVGPolyElement.h
content/svg/content/src/nsSVGPolygonElement.cpp
content/svg/content/src/nsSVGPolylineElement.cpp
content/svg/content/src/nsSVGRectElement.cpp
content/svg/content/src/nsSVGSVGElement.cpp
content/svg/content/src/nsSVGSVGElement.h
content/svg/content/src/nsSVGScriptElement.cpp
content/svg/content/src/nsSVGSetElement.cpp
content/svg/content/src/nsSVGStopElement.cpp
content/svg/content/src/nsSVGStylableElement.cpp
content/svg/content/src/nsSVGStylableElement.h
content/svg/content/src/nsSVGStyleElement.cpp
content/svg/content/src/nsSVGSwitchElement.cpp
content/svg/content/src/nsSVGSwitchElement.h
content/svg/content/src/nsSVGSymbolElement.cpp
content/svg/content/src/nsSVGTSpanElement.cpp
content/svg/content/src/nsSVGTextContentElement.h
content/svg/content/src/nsSVGTextElement.cpp
content/svg/content/src/nsSVGTextPathElement.cpp
content/svg/content/src/nsSVGTextPathElement.h
content/svg/content/src/nsSVGTextPositioningElement.h
content/svg/content/src/nsSVGTitleElement.cpp
content/svg/content/src/nsSVGUnknownElement.cpp
content/svg/content/src/nsSVGUseElement.cpp
content/svg/content/src/nsSVGUseElement.h
content/svg/document/src/nsSVGDocument.cpp
content/svg/document/src/nsSVGDocument.h
content/xbl/src/nsXBLBinding.cpp
content/xbl/src/nsXBLContentSink.cpp
content/xbl/src/nsXBLContentSink.h
content/xbl/src/nsXBLPrototypeBinding.cpp
content/xbl/src/nsXBLService.cpp
content/xml/content/src/nsXMLCDATASection.cpp
content/xml/content/src/nsXMLElement.cpp
content/xml/content/src/nsXMLElement.h
content/xml/content/src/nsXMLProcessingInstruction.cpp
content/xml/content/src/nsXMLProcessingInstruction.h
content/xml/content/src/nsXMLStylesheetPI.cpp
content/xml/document/src/nsXMLContentSink.cpp
content/xml/document/src/nsXMLContentSink.h
content/xml/document/src/nsXMLDocument.cpp
content/xml/document/src/nsXMLDocument.h
content/xml/document/src/nsXMLFragmentContentSink.cpp
content/xslt/src/base/txURIUtils.cpp
content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp
content/xslt/src/xpath/txXPathTreeWalker.h
content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp
content/xslt/src/xslt/txMozillaTextOutput.cpp
content/xslt/src/xslt/txMozillaXMLOutput.cpp
content/xtf/src/nsIXTFService.h
content/xtf/src/nsXMLContentBuilder.cpp
content/xtf/src/nsXTFElementWrapper.cpp
content/xtf/src/nsXTFElementWrapper.h
content/xtf/src/nsXTFService.cpp
content/xul/content/src/nsXULContextMenuBuilder.cpp
content/xul/content/src/nsXULElement.cpp
content/xul/content/src/nsXULElement.h
content/xul/document/src/nsXULContentSink.cpp
content/xul/document/src/nsXULContentSink.h
content/xul/document/src/nsXULDocument.cpp
content/xul/document/src/nsXULPrototypeDocument.cpp
content/xul/templates/src/nsXULContentBuilder.cpp
content/xul/templates/src/nsXULContentUtils.cpp
content/xul/templates/src/nsXULSortService.cpp
content/xul/templates/src/nsXULTemplateBuilder.cpp
content/xul/templates/src/nsXULTreeBuilder.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/build/nsContentDLF.cpp
layout/build/nsLayoutModule.cpp
layout/forms/nsComboboxControlFrame.cpp
layout/forms/nsFileControlFrame.cpp
layout/forms/nsListControlFrame.cpp
layout/forms/nsProgressFrame.cpp
layout/forms/nsTextControlFrame.cpp
layout/generic/nsFrameSetFrame.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsImageFrame.cpp
layout/generic/nsObjectFrame.cpp
layout/generic/nsVideoFrame.cpp
layout/xul/base/src/nsDocElementBoxFrame.cpp
layout/xul/base/src/nsListBoxBodyFrame.cpp
layout/xul/base/src/nsMenuPopupFrame.cpp
layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
layout/xul/base/src/tree/src/nsTreeBoxObject.cpp
layout/xul/base/src/tree/src/nsTreeColumns.cpp
layout/xul/base/src/tree/src/nsTreeContentView.cpp
layout/xul/base/src/tree/src/nsTreeUtils.cpp
parser/html/nsHtml5TreeOperation.cpp
xpcom/glue/nsCycleCollectionParticipant.h
xpcom/glue/nsISupportsImpl.h
--- a/accessible/src/msaa/nsAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsAccessibleWrap.cpp
@@ -54,17 +54,17 @@
 #include "Accessible2_i.c"
 #include "AccessibleStates.h"
 
 #include "nsIMutableArray.h"
 #include "nsIDOMDocument.h"
 #include "nsIFrame.h"
 #include "nsIScrollableFrame.h"
 #include "nsINameSpaceManager.h"
-#include "nsNodeInfo.h"
+#include "nsINodeInfo.h"
 #include "nsRootAccessible.h"
 #include "nsIServiceManager.h"
 #include "nsTextFormatter.h"
 #include "nsIView.h"
 #include "nsIViewManager.h"
 #include "nsRoleMap.h"
 #include "nsEventMap.h"
 #include "nsArrayUtils.h"
@@ -375,17 +375,17 @@ STDMETHODIMP nsAccessibleWrap::get_accRo
   if (content->IsElement()) {
     nsAutoString roleString;
     if (msaaRole != ROLE_SYSTEM_CLIENT &&
         !content->GetAttr(kNameSpaceID_None, nsGkAtoms::role, roleString)) {
       nsIDocument * document = content->GetCurrentDoc();
       if (!document)
         return E_FAIL;
 
-      nsNodeInfo *nodeInfo = content->NodeInfo();
+      nsINodeInfo *nodeInfo = content->NodeInfo();
       nodeInfo->GetName(roleString);
 
       // Only append name space if different from that of current document.
       if (!nodeInfo->NamespaceEquals(document->GetDefaultNamespaceID())) {
         nsAutoString nameSpaceURI;
         nodeInfo->GetNamespaceURI(nameSpaceURI);
         roleString += NS_LITERAL_STRING(", ") + nameSpaceURI;
       }
--- a/accessible/src/xforms/nsXFormsAccessible.cpp
+++ b/accessible/src/xforms/nsXFormsAccessible.cpp
@@ -510,17 +510,17 @@ nsIContent*
 nsXFormsSelectableAccessible::GetItemByIndex(PRUint32* aIndex,
                                              nsAccessible* aAccessible)
 {
   nsAccessible* accessible = aAccessible ? aAccessible : this;
   PRInt32 childCount = accessible->GetChildCount();
   for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
     nsAccessible *child = accessible->GetChildAt(childIdx);
     nsIContent* childContent = child->GetContent();
-    nsNodeInfo *nodeInfo = childContent->NodeInfo();
+    nsINodeInfo *nodeInfo = childContent->NodeInfo();
     if (nodeInfo->NamespaceEquals(NS_LITERAL_STRING(NS_NAMESPACE_XFORMS))) {
       if (nodeInfo->Equals(nsGkAtoms::item)) {
         if (!*aIndex)
           return childContent;
 
         --*aIndex;
       } else if (nodeInfo->Equals(nsGkAtoms::choices)) {
         nsIContent* itemContent = GetItemByIndex(aIndex, child);
@@ -574,17 +574,17 @@ nsXFormsSelectableItemAccessible::IsSele
   nsresult rv;
 
   nsINode* parent = mContent;
   while ((parent = parent->GetNodeParent())) {
     nsCOMPtr<nsIContent> content(do_QueryInterface(parent));
     if (!content)
       return false;
 
-    nsRefPtr<nsNodeInfo> nodeinfo = content->NodeInfo();
+    nsCOMPtr<nsINodeInfo> nodeinfo = content->NodeInfo();
     if (!nodeinfo->NamespaceEquals(NS_LITERAL_STRING(NS_NAMESPACE_XFORMS)))
       continue;
 
     nsCOMPtr<nsIDOMNode> select(do_QueryInterface(parent));
     if (!select)
       continue;
 
     nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
--- a/content/base/public/Element.h
+++ b/content/base/public/Element.h
@@ -91,17 +91,17 @@ class Link;
 #define NS_ELEMENT_IID      \
 { 0xa1588efb, 0x5a84, 0x49cd, \
   { 0x99, 0x1a, 0xac, 0x84, 0x9d, 0x92, 0x05, 0x0f } }
 
 class Element : public nsIContent
 {
 public:
 #ifdef MOZILLA_INTERNAL_API
-  Element(already_AddRefed<nsNodeInfo> aNodeInfo) :
+  Element(already_AddRefed<nsINodeInfo> aNodeInfo) :
     nsIContent(aNodeInfo),
     mState(NS_EVENT_STATE_MOZ_READONLY)
   {}
 #endif // MOZILLA_INTERNAL_API
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ELEMENT_IID)
 
   /**
--- a/content/base/public/Makefile.in
+++ b/content/base/public/Makefile.in
@@ -55,16 +55,17 @@ nsContentPolicyUtils.h \
 nsContentUtils.h \
 nsIDocument.h \
 nsDeprecatedOperationList.h \
 nsIDocumentObserver.h \
 nsIMutationObserver.h \
 nsIMutationObserver2.h \
 nsINameSpaceManager.h \
 nsINode.h \
+nsINodeInfo.h \
 nsINodeList.h \
 nsIScriptElement.h \
 nsIStyleSheetLinkingElement.h \
 nsIContentSerializer.h \
 nsIXPathEvaluatorInternal.h \
 nsCaseTreatment.h \
 nsContentCID.h \
 nsCopySupport.h \
--- a/content/base/public/nsContentCreatorFunctions.h
+++ b/content/base/public/nsContentCreatorFunctions.h
@@ -47,28 +47,28 @@
 /**
  * Functions to create content, to be used only inside Gecko
  * (mozilla/content and mozilla/layout).
  */
 
 class nsAString;
 class nsIContent;
 class nsIDocument;
-class nsNodeInfo;
+class nsINodeInfo;
 class imgIRequest;
 class nsNodeInfoManager;
 class nsGenericHTMLElement;
 
 nsresult
 NS_NewElement(nsIContent** aResult,
-              already_AddRefed<nsNodeInfo> aNodeInfo,
+              already_AddRefed<nsINodeInfo> aNodeInfo,
               mozilla::dom::FromParser aFromParser);
 
 nsresult
-NS_NewXMLElement(nsIContent** aResult, already_AddRefed<nsNodeInfo> aNodeInfo);
+NS_NewXMLElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo);
 
 /**
  * aNodeInfoManager must not be null.
  */
 nsresult
 NS_NewTextNode(nsIContent **aResult, nsNodeInfoManager *aNodeInfoManager);
 
 /**
@@ -97,43 +97,43 @@ NS_NewXMLStylesheetProcessingInstruction
 /**
  * aNodeInfoManager must not be null.
  */
 nsresult
 NS_NewXMLCDATASection(nsIContent** aInstancePtrResult,
                       nsNodeInfoManager *aNodeInfoManager);
 
 nsresult
-NS_NewHTMLElement(nsIContent** aResult, already_AddRefed<nsNodeInfo> aNodeInfo,
+NS_NewHTMLElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo,
                   mozilla::dom::FromParser aFromParser);
 
 // First argument should be nsHTMLTag, but that adds dependency to parser
 // for a bunch of files.
 already_AddRefed<nsGenericHTMLElement>
-CreateHTMLElement(PRUint32 aNodeType, already_AddRefed<nsNodeInfo> aNodeInfo,
+CreateHTMLElement(PRUint32 aNodeType, already_AddRefed<nsINodeInfo> aNodeInfo,
                   mozilla::dom::FromParser aFromParser);
 
 nsresult
 NS_NewMathMLElement(nsIContent** aResult,
-                     already_AddRefed<nsNodeInfo> aNodeInfo);
+                     already_AddRefed<nsINodeInfo> aNodeInfo);
 
 #ifdef MOZ_XUL
 nsresult
-NS_NewXULElement(nsIContent** aResult, already_AddRefed<nsNodeInfo> aNodeInfo);
+NS_NewXULElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo);
 
 void
-NS_TrustedNewXULElement(nsIContent** aResult, already_AddRefed<nsNodeInfo> aNodeInfo);
+NS_TrustedNewXULElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo);
 #endif
 
 nsresult
-NS_NewSVGElement(nsIContent** aResult, already_AddRefed<nsNodeInfo> aNodeInfo,
+NS_NewSVGElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo,
                  mozilla::dom::FromParser aFromParser);
 
 nsresult
 NS_NewGenConImageContent(nsIContent** aResult,
-                         already_AddRefed<nsNodeInfo> aNodeInfo,
+                         already_AddRefed<nsINodeInfo> aNodeInfo,
                          imgIRequest* aImageRequest);
 
 nsresult
 NS_NewXMLEventsElement(nsIContent** aResult,
-                       already_AddRefed<nsNodeInfo> aNodeInfo);
+                       already_AddRefed<nsINodeInfo> aNodeInfo);
 
 #endif // nsContentCreatorFunctions_h__
--- a/content/base/public/nsContentUtils.h
+++ b/content/base/public/nsContentUtils.h
@@ -59,17 +59,17 @@ static fp_except_t allmask = FP_X_INV|FP
 #else
 static fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP|FP_X_DNML;
 #endif
 static fp_except_t oldmask = fpsetmask(~allmask);
 #endif
 
 #include "nsAString.h"
 #include "nsIStatefulFrame.h"
-#include "nsNodeInfo.h"
+#include "nsINodeInfo.h"
 #include "nsNodeInfoManager.h"
 #include "nsContentList.h"
 #include "nsDOMClassInfoID.h"
 #include "nsIXPCScriptable.h"
 #include "nsDataHashtable.h"
 #include "nsIScriptRuntime.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIDOMEvent.h"
@@ -609,17 +609,17 @@ public:
   static nsresult SplitQName(const nsIContent* aNamespaceResolver,
                              const nsAFlatString& aQName,
                              PRInt32 *aNamespace, nsIAtom **aLocalName);
 
   static nsresult GetNodeInfoFromQName(const nsAString& aNamespaceURI,
                                        const nsAString& aQualifiedName,
                                        nsNodeInfoManager* aNodeInfoManager,
                                        PRUint16 aNodeType,
-                                       nsNodeInfo** aNodeInfo);
+                                       nsINodeInfo** aNodeInfo);
 
   static void SplitExpatName(const PRUnichar *aExpatName, nsIAtom **aPrefix,
                              nsIAtom **aTagName, PRInt32 *aNameSpaceID);
 
   // Get a permission-manager setting for the given uri and type.
   // If the pref doesn't exist or if it isn't ALLOW_ACTION, false is
   // returned, otherwise true is returned.
   static bool IsSitePermAllow(nsIURI* aURI, const char* aType);
@@ -741,18 +741,18 @@ public:
    * @return whether it's a draggable link
    */
   static bool IsDraggableLink(const nsIContent* aContent);
 
   /**
    * Convenience method to create a new nodeinfo that differs only by name
    * from aNodeInfo.
    */
-  static nsresult NameChanged(nsNodeInfo *aNodeInfo, nsIAtom *aName,
-                              nsNodeInfo** aResult)
+  static nsresult NameChanged(nsINodeInfo *aNodeInfo, nsIAtom *aName,
+                              nsINodeInfo** aResult)
   {
     nsNodeInfoManager *niMgr = aNodeInfo->NodeInfoManager();
 
     *aResult = niMgr->GetNodeInfo(aName, aNodeInfo->GetPrefixAtom(),
                                   aNodeInfo->NamespaceID(),
                                   aNodeInfo->NodeType(),
                                   aNodeInfo->GetExtraName()).get();
     return *aResult ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
--- a/content/base/public/nsIAttribute.h
+++ b/content/base/public/nsIAttribute.h
@@ -56,32 +56,32 @@ public:
 
   virtual void SetMap(nsDOMAttributeMap *aMap) = 0;
   
   nsDOMAttributeMap *GetMap()
   {
     return mAttrMap;
   }
 
-  nsNodeInfo *NodeInfo()
+  nsINodeInfo *NodeInfo()
   {
     return mNodeInfo;
   }
 
   virtual nsIContent* GetContent() const = 0;
 
   /**
    * Called when our ownerElement is moved into a new document.
    * Updates the nodeinfo of this node.
    */
   virtual nsresult SetOwnerDocument(nsIDocument* aDocument) = 0;
 
 protected:
 #ifdef MOZILLA_INTERNAL_API
-  nsIAttribute(nsDOMAttributeMap *aAttrMap, already_AddRefed<nsNodeInfo> aNodeInfo,
+  nsIAttribute(nsDOMAttributeMap *aAttrMap, already_AddRefed<nsINodeInfo> aNodeInfo,
                bool aNsAware)
     : nsINode(aNodeInfo), mAttrMap(aAttrMap), mNsAware(aNsAware)
   {
   }
 #endif //MOZILLA_INTERNAL_API
 
   nsDOMAttributeMap *mAttrMap; // WEAK
   bool mNsAware;
--- a/content/base/public/nsIContent.h
+++ b/content/base/public/nsIContent.h
@@ -87,21 +87,21 @@ enum nsLinkState {
 class nsIContent : public nsINode {
 public:
   typedef mozilla::widget::IMEState IMEState;
 
 #ifdef MOZILLA_INTERNAL_API
   // If you're using the external API, the only thing you can know about
   // nsIContent is that it exists with an IID
 
-  nsIContent(already_AddRefed<nsNodeInfo> aNodeInfo)
+  nsIContent(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsINode(aNodeInfo)
   {
     NS_ASSERTION(mNodeInfo,
-                 "No nsNodeInfo passed to nsIContent, PREPARE TO CRASH!!!");
+                 "No nsINodeInfo passed to nsIContent, PREPARE TO CRASH!!!");
   }
 #endif // MOZILLA_INTERNAL_API
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENT_IID)
 
   /**
    * Bind this content node to a tree.  If this method throws, the caller must
    * call UnbindFromTree() on the node.  In the typical case of a node being
@@ -298,17 +298,17 @@ public:
   {
     return mNodeInfo->NameAtom();
   }
 
   /**
    * Get the NodeInfo for this element
    * @return the nodes node info
    */
-  nsNodeInfo *NodeInfo() const
+  nsINodeInfo *NodeInfo() const
   {
     return mNodeInfo;
   }
 
   inline bool IsInNamespace(PRInt32 aNamespace) const {
     return mNodeInfo->NamespaceID() == aNamespace;
   }
 
@@ -352,17 +352,17 @@ public:
    * with that name exists. This method is intended for character case
    * conversion if the content object is case insensitive (e.g. HTML). Returns
    * the nodeinfo of the attribute with the specified name if one exists or
    * null otherwise.
    *
    * @param aStr the unparsed attribute string
    * @return the node info. May be nsnull.
    */
-  virtual already_AddRefed<nsNodeInfo> GetExistingAttrNameFromQName(const nsAString& aStr) const = 0;
+  virtual already_AddRefed<nsINodeInfo> GetExistingAttrNameFromQName(const nsAString& aStr) const = 0;
 
   /**
    * Set attribute values. All attribute values are assumed to have a
    * canonical string representation that can be used for these
    * methods. The SetAttr method is assumed to perform a translation
    * of the canonical form into the underlying content specific
    * form.
    *
--- a/content/base/public/nsINode.h
+++ b/content/base/public/nsINode.h
@@ -37,19 +37,18 @@
 
 #ifndef nsINode_h___
 #define nsINode_h___
 
 #include "nsIDOMEventTarget.h"
 #include "nsEvent.h"
 #include "nsPropertyTable.h"
 #include "nsTObserverArray.h"
-#include "nsNodeInfo.h"
+#include "nsINodeInfo.h"
 #include "nsCOMPtr.h"
-#include "nsAutoPtr.h"
 #include "nsWrapperCache.h"
 #include "nsIProgrammingLanguage.h" // for ::JAVASCRIPT
 #include "nsDOMError.h"
 #include "nsDOMString.h"
 #include "jspubtd.h"
 #include "nsWindowMemoryReporter.h"
 #include "nsIVariant.h"
 #include "nsGkAtoms.h"
@@ -346,17 +345,17 @@ public:
   friend class nsAttrAndChildArray;
 
 #ifdef MOZILLA_INTERNAL_API
 #ifdef _MSC_VER
 #pragma warning(push)
 // Disable annoying warning about 'this' in initializers.
 #pragma warning(disable:4355)
 #endif
-  nsINode(already_AddRefed<nsNodeInfo> aNodeInfo)
+  nsINode(already_AddRefed<nsINodeInfo> aNodeInfo)
   : mNodeInfo(aNodeInfo),
     mParent(nsnull),
     mFlags(0),
     mBoolFlags(0),
     mNextSibling(nsnull),
     mPreviousSibling(nsnull),
     mFirstChild(nsnull),
     mSubtreeRoot(this),
@@ -861,17 +860,17 @@ public:
    * Clones this node. This needs to be overriden by all node classes. aNodeInfo
    * should be identical to this node's nodeInfo, except for the document which
    * may be different. When cloning an element, all attributes of the element
    * will be cloned. The children of the node will not be cloned.
    *
    * @param aNodeInfo the nodeinfo to use for the clone
    * @param aResult the clone
    */
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const = 0;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const = 0;
 
   /**
    * Checks if a node has the same ownerDocument as this one. Note that this
    * actually compares nodeinfo managers because nodes always have one, even
    * when they don't have an ownerDocument. If this function returns true
    * it doesn't mean that the nodes actually have an ownerDocument.
    *
    * @param aOther Other node to check
@@ -1543,17 +1542,17 @@ public:
 #undef TOUCH_EVENT
 #undef EVENT  
 
 protected:
   static void Trace(nsINode *tmp, TraceCallback cb, void *closure);
   static bool Traverse(nsINode *tmp, nsCycleCollectionTraversalCallback &cb);
   static void Unlink(nsINode *tmp);
 
-  nsRefPtr<nsNodeInfo> mNodeInfo;
+  nsCOMPtr<nsINodeInfo> mNodeInfo;
 
   nsINode* mParent;
 
   PRUint32 mFlags;
 
 private:
   // Boolean flags.
   PRUint32 mBoolFlags;
new file mode 100644
--- /dev/null
+++ b/content/base/public/nsINodeInfo.h
@@ -0,0 +1,387 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * nsINodeInfo is an interface to node info, such as name, prefix, namespace
+ * ID and possibly other data that is shared between nodes (elements
+ * and attributes) that have the same name, prefix and namespace ID within
+ * the same document.
+ *
+ * nsNodeInfoManager's are internal objects that manage a list of
+ * nsINodeInfo's, every document object should hold a strong reference to
+ * a nsNodeInfoManager and every nsINodeInfo also holds a strong reference
+ * to their owning manager. When a nsINodeInfo is no longer used it will
+ * automatically remove itself from its owner manager, and when all
+ * nsINodeInfo's have been removed from a nsNodeInfoManager and all external
+ * references are released the nsNodeInfoManager deletes itself.
+ *
+ * -- jst@netscape.com
+ */
+
+#ifndef nsINodeInfo_h___
+#define nsINodeInfo_h___
+
+#include "nsISupports.h"
+#include "nsIAtom.h"
+#include "nsINameSpaceManager.h"
+#include "nsNodeInfoManager.h"
+#include "nsCOMPtr.h"
+
+#ifdef MOZILLA_INTERNAL_API
+#include "nsDOMString.h"
+#endif
+
+// Forward declarations
+class nsIDocument;
+class nsIURI;
+class nsIPrincipal;
+
+// IID for the nsINodeInfo interface
+#define NS_INODEINFO_IID      \
+{ 0xc5188ea1, 0x0a9c, 0x43e6, \
+ { 0x95, 0x90, 0xcc, 0x43, 0x6b, 0xe9, 0xcf, 0xa0 } }
+
+class nsINodeInfo : public nsISupports
+{
+public:
+  NS_DECLARE_STATIC_IID_ACCESSOR(NS_INODEINFO_IID)
+
+  nsINodeInfo()
+    : mInner(nsnull, nsnull, kNameSpaceID_None, 0, nsnull),
+      mOwnerManager(nsnull)
+  {
+  }
+
+  /*
+   * Get the name from this node as a string, this does not include the prefix.
+   *
+   * For the HTML element "<body>" this will return "body" and for the XML
+   * element "<html:body>" this will return "body".
+   */
+  void GetName(nsAString& aName) const
+  {
+    mInner.mName->ToString(aName);
+  }
+
+  /*
+   * Get the name from this node as an atom, this does not include the prefix.
+   * This function never returns a null atom.
+   *
+   * For the HTML element "<body>" this will return the "body" atom and for
+   * the XML element "<html:body>" this will return the "body" atom.
+   */
+  nsIAtom* NameAtom() const
+  {
+    return mInner.mName;
+  }
+
+  /*
+   * Get the qualified name from this node as a string, the qualified name
+   * includes the prefix, if one exists.
+   *
+   * For the HTML element "<body>" this will return "body" and for the XML
+   * element "<html:body>" this will return "html:body".
+   */
+  const nsString& QualifiedName() const {
+    return mQualifiedName;
+  }
+
+  /*
+   * Returns the node's nodeName as defined in DOM Core
+   */
+  const nsString& NodeName() const {
+    return mNodeName;
+  }
+
+  /*
+   * Returns the node's localName as defined in DOM Core
+   */
+  const nsString& LocalName() const {
+    return mLocalName;
+  }
+
+#ifdef MOZILLA_INTERNAL_API
+  /*
+   * Get the prefix from this node as a string.
+   *
+   * For the HTML element "<body>" this will return a null string and for
+   * the XML element "<html:body>" this will return the string "html".
+   */
+  void GetPrefix(nsAString& aPrefix) const
+  {
+    if (mInner.mPrefix) {
+      mInner.mPrefix->ToString(aPrefix);
+    } else {
+      SetDOMStringToNull(aPrefix);
+    }
+  }
+#endif
+
+  /*
+   * Get the prefix from this node as an atom.
+   *
+   * For the HTML element "<body>" this will return a null atom and for
+   * the XML element "<html:body>" this will return the "html" atom.
+   */
+  nsIAtom* GetPrefixAtom() const
+  {
+    return mInner.mPrefix;
+  }
+
+  /*
+   * Get the namespace URI for a node, if the node has a namespace URI.
+   */
+  virtual nsresult GetNamespaceURI(nsAString& aNameSpaceURI) const = 0;
+
+  /*
+   * Get the namespace ID for a node if the node has a namespace, if not this
+   * returns kNameSpaceID_None.
+   */
+  PRInt32 NamespaceID() const
+  {
+    return mInner.mNamespaceID;
+  }
+
+  /*
+   * Get the nodetype for the node. Returns the values specified in nsIDOMNode
+   * for nsIDOMNode.nodeType
+   */
+  PRUint16 NodeType() const
+  {
+    return mInner.mNodeType;
+  }
+
+  /*
+   * Get the extra name, used by PIs and DocTypes, for the node.
+   */
+  nsIAtom* GetExtraName() const
+  {
+    return mInner.mExtraName;
+  }
+
+  /*
+   * Get and set the ID attribute atom for this node.
+   * See http://www.w3.org/TR/1998/REC-xml-19980210#sec-attribute-types
+   * for the definition of an ID attribute.
+   *
+   */
+  nsIAtom* GetIDAttributeAtom() const
+  {
+    return mIDAttributeAtom;
+  }
+
+  void SetIDAttributeAtom(nsIAtom* aID)
+  {
+    mIDAttributeAtom = aID;
+  }
+
+  /**
+   * Get the owning node info manager. Only to be used inside Gecko, you can't
+   * really do anything with the pointer outside Gecko anyway.
+   */
+  nsNodeInfoManager *NodeInfoManager() const
+  {
+    return mOwnerManager;
+  }
+
+  /*
+   * Utility functions that can be used to check if a nodeinfo holds a specific
+   * name, name and prefix, name and prefix and namespace ID, or just
+   * namespace ID.
+   */
+  bool Equals(nsINodeInfo *aNodeInfo) const
+  {
+    return aNodeInfo == this || aNodeInfo->Equals(mInner.mName, mInner.mPrefix,
+                                                  mInner.mNamespaceID);
+  }
+
+  bool NameAndNamespaceEquals(nsINodeInfo *aNodeInfo) const
+  {
+    return aNodeInfo == this || aNodeInfo->Equals(mInner.mName,
+                                                  mInner.mNamespaceID);
+  }
+
+  bool Equals(nsIAtom *aNameAtom) const
+  {
+    return mInner.mName == aNameAtom;
+  }
+
+  bool Equals(nsIAtom *aNameAtom, nsIAtom *aPrefixAtom) const
+  {
+    return (mInner.mName == aNameAtom) && (mInner.mPrefix == aPrefixAtom);
+  }
+
+  bool Equals(nsIAtom *aNameAtom, PRInt32 aNamespaceID) const
+  {
+    return ((mInner.mName == aNameAtom) &&
+            (mInner.mNamespaceID == aNamespaceID));
+  }
+
+  bool Equals(nsIAtom *aNameAtom, nsIAtom *aPrefixAtom,
+                PRInt32 aNamespaceID) const
+  {
+    return ((mInner.mName == aNameAtom) &&
+            (mInner.mPrefix == aPrefixAtom) &&
+            (mInner.mNamespaceID == aNamespaceID));
+  }
+
+  bool NamespaceEquals(PRInt32 aNamespaceID) const
+  {
+    return mInner.mNamespaceID == aNamespaceID;
+  }
+
+  bool Equals(const nsAString& aName) const
+  {
+    return mInner.mName->Equals(aName);
+  }
+
+  bool Equals(const nsAString& aName, const nsAString& aPrefix) const
+  {
+    return mInner.mName->Equals(aName) &&
+      (mInner.mPrefix ? mInner.mPrefix->Equals(aPrefix) : aPrefix.IsEmpty());
+  }
+
+  bool Equals(const nsAString& aName, PRInt32 aNamespaceID) const
+  {
+    return mInner.mNamespaceID == aNamespaceID &&
+      mInner.mName->Equals(aName);
+  }
+
+  bool Equals(const nsAString& aName, const nsAString& aPrefix,
+                PRInt32 aNamespaceID) const
+  {
+    return mInner.mName->Equals(aName) && mInner.mNamespaceID == aNamespaceID &&
+      (mInner.mPrefix ? mInner.mPrefix->Equals(aPrefix) : aPrefix.IsEmpty());
+  }
+
+  virtual bool NamespaceEquals(const nsAString& aNamespaceURI) const = 0;
+
+  bool QualifiedNameEquals(nsIAtom* aNameAtom) const
+  {
+    NS_PRECONDITION(aNameAtom, "Must have name atom");
+    if (!GetPrefixAtom())
+      return Equals(aNameAtom);
+
+    return aNameAtom->Equals(mQualifiedName);
+  }
+
+  bool QualifiedNameEquals(const nsAString& aQualifiedName) const
+  {
+    return mQualifiedName == aQualifiedName;
+  }
+
+  /*
+   * Retrieve a pointer to the document that owns this node info.
+   */
+  nsIDocument* GetDocument() const
+  {
+    return mDocument;
+  }
+
+protected:
+  /*
+   * nsNodeInfoInner is used for two things:
+   *
+   *   1. as a member in nsNodeInfo for holding the name, prefix and
+   *      namespace ID
+   *   2. as the hash key in the hash table in nsNodeInfoManager
+   *
+   * nsNodeInfoInner does not do any kind of reference counting,
+   * that's up to the user of this class. Since nsNodeInfoInner is
+   * typically used as a member of nsNodeInfo, the hash table doesn't
+   * need to delete the keys. When the value (nsNodeInfo) is deleted
+   * the key is automatically deleted.
+   */
+
+  class nsNodeInfoInner
+  {
+  public:
+    nsNodeInfoInner()
+      : mName(nsnull), mPrefix(nsnull), mNamespaceID(kNameSpaceID_Unknown),
+        mNodeType(0), mNameString(nsnull), mExtraName(nsnull)
+    {
+    }
+    nsNodeInfoInner(nsIAtom *aName, nsIAtom *aPrefix, PRInt32 aNamespaceID,
+                    PRUint16 aNodeType, nsIAtom* aExtraName)
+      : mName(aName), mPrefix(aPrefix), mNamespaceID(aNamespaceID),
+        mNodeType(aNodeType), mNameString(nsnull), mExtraName(aExtraName)
+    {
+    }
+    nsNodeInfoInner(const nsAString& aTmpName, nsIAtom *aPrefix,
+                    PRInt32 aNamespaceID, PRUint16 aNodeType)
+      : mName(nsnull), mPrefix(aPrefix), mNamespaceID(aNamespaceID),
+        mNodeType(aNodeType), mNameString(&aTmpName), mExtraName(nsnull)
+    {
+    }
+
+    nsIAtom*            mName;
+    nsIAtom*            mPrefix;
+    PRInt32             mNamespaceID;
+    PRUint16            mNodeType; // As defined by nsIDOMNode.nodeType
+    const nsAString*    mNameString;
+    nsIAtom*            mExtraName; // Only used by PIs and DocTypes
+  };
+
+  // nsNodeInfoManager needs to pass mInner to the hash table.
+  friend class nsNodeInfoManager;
+
+  nsIDocument* mDocument; // Weak. Cache of mOwnerManager->mDocument
+
+  nsNodeInfoInner mInner;
+
+  nsCOMPtr<nsIAtom> mIDAttributeAtom;
+  nsNodeInfoManager* mOwnerManager; // Strong reference!
+
+  /*
+   * Members for various functions of mName+mPrefix that we can be
+   * asked to compute.
+   */
+
+  // Qualified name
+  nsString mQualifiedName;
+
+  // nodeName for the node.
+  nsString mNodeName;
+
+  // localName for the node. This is either equal to mInner.mName, or a
+  // void string, depending on mInner.mNodeType.
+  nsString mLocalName;
+};
+
+NS_DEFINE_STATIC_IID_ACCESSOR(nsINodeInfo, NS_INODEINFO_IID)
+
+#endif /* nsINodeInfo_h___ */
--- a/content/base/src/Makefile.in
+++ b/content/base/src/Makefile.in
@@ -51,17 +51,16 @@ LIBXUL_LIBRARY	= 1
 EXPORTS		= \
 		nsAtomListUtils.h \
 		nsAttrName.h \
 		nsContentList.h \
 		nsContentSink.h \
 		nsGkAtomList.h \
 		nsGkAtoms.h \
 		nsNodeInfoManager.h \
-    nsNodeInfo.h \
 		nsNodeUtils.h \
 		nsPropertyTable.h \
 		nsRange.h \
 		nsScriptLoader.h \
 		nsStubDocumentObserver.h \
 		nsStubImageDecoderObserver.h \
 		nsStubMutationObserver.h \
 		nsTextFragment.h \
--- a/content/base/src/nsAttrAndChildArray.cpp
+++ b/content/base/src/nsAttrAndChildArray.cpp
@@ -389,17 +389,17 @@ nsAttrAndChildArray::SetAndTakeAttr(nsIA
   new (&ATTRS(mImpl)[i].mName) nsAttrName(aLocalName);
   new (&ATTRS(mImpl)[i].mValue) nsAttrValue();
   ATTRS(mImpl)[i].mValue.SwapValueWith(aValue);
 
   return NS_OK;
 }
 
 nsresult
-nsAttrAndChildArray::SetAndTakeAttr(nsNodeInfo* aName, nsAttrValue& aValue)
+nsAttrAndChildArray::SetAndTakeAttr(nsINodeInfo* aName, nsAttrValue& aValue)
 {
   PRInt32 namespaceID = aName->NamespaceID();
   nsIAtom* localName = aName->NameAtom();
   if (namespaceID == kNameSpaceID_None) {
     return SetAndTakeAttr(localName, aValue);
   }
 
   PRUint32 i, slotCount = AttrSlotCount();
--- a/content/base/src/nsAttrAndChildArray.h
+++ b/content/base/src/nsAttrAndChildArray.h
@@ -101,17 +101,17 @@ public:
   // removed back to the caller instead of just releasing it.
   already_AddRefed<nsIContent> TakeChildAt(PRUint32 aPos);
   PRInt32 IndexOfChild(nsINode* aPossibleChild) const;
 
   PRUint32 AttrCount() const;
   const nsAttrValue* GetAttr(nsIAtom* aLocalName, PRInt32 aNamespaceID = kNameSpaceID_None) const;
   const nsAttrValue* AttrAt(PRUint32 aPos) const;
   nsresult SetAndTakeAttr(nsIAtom* aLocalName, nsAttrValue& aValue);
-  nsresult SetAndTakeAttr(nsNodeInfo* aName, nsAttrValue& aValue);
+  nsresult SetAndTakeAttr(nsINodeInfo* aName, nsAttrValue& aValue);
 
   // Remove the attr at position aPos.  The value of the attr is placed in
   // aValue; any value that was already in aValue is destroyed.
   nsresult RemoveAttrAt(PRUint32 aPos, nsAttrValue& aValue);
 
   // Returns attribute name at given position, *not* out-of-bounds safe
   const nsAttrName* AttrNameAt(PRUint32 aPos) const;
 
--- a/content/base/src/nsAttrName.h
+++ b/content/base/src/nsAttrName.h
@@ -40,17 +40,17 @@
  * Class that represents the name (nodeinfo or atom) of an attribute;
  * using nodeinfos all the time is too slow, so we use atoms when we
  * can.
  */
 
 #ifndef nsAttrName_h___
 #define nsAttrName_h___
 
-#include "nsNodeInfo.h"
+#include "nsINodeInfo.h"
 #include "nsIAtom.h"
 #include "nsDOMString.h"
 
 typedef PRUptrdiff PtrBits;
 
 #define NS_ATTRNAME_NODEINFO_BIT 1
 class nsAttrName
 {
@@ -63,17 +63,17 @@ public:
 
   explicit nsAttrName(nsIAtom* aAtom)
     : mBits(reinterpret_cast<PtrBits>(aAtom))
   {
     NS_ASSERTION(aAtom, "null atom-name in nsAttrName");
     NS_ADDREF(aAtom);
   }
 
-  explicit nsAttrName(nsNodeInfo* aNodeInfo)
+  explicit nsAttrName(nsINodeInfo* aNodeInfo)
   {
     NS_ASSERTION(aNodeInfo, "null nodeinfo-name in nsAttrName");
     if (aNodeInfo->NamespaceEquals(kNameSpaceID_None)) {
       mBits = reinterpret_cast<PtrBits>(aNodeInfo->NameAtom());
       NS_ADDREF(aNodeInfo->NameAtom());
     }
     else {
       mBits = reinterpret_cast<PtrBits>(aNodeInfo) |
@@ -82,17 +82,17 @@ public:
     }
   }
 
   ~nsAttrName()
   {
     ReleaseInternalName();
   }
 
-  void SetTo(nsNodeInfo* aNodeInfo)
+  void SetTo(nsINodeInfo* aNodeInfo)
   {
     NS_ASSERTION(aNodeInfo, "null nodeinfo-name in nsAttrName");
 
     ReleaseInternalName();
     if (aNodeInfo->NamespaceEquals(kNameSpaceID_None)) {
       mBits = reinterpret_cast<PtrBits>(aNodeInfo->NameAtom());
       NS_ADDREF(aNodeInfo->NameAtom());
     }
@@ -112,20 +112,20 @@ public:
     NS_ADDREF(aAtom);
   }
 
   bool IsAtom() const
   {
     return !(mBits & NS_ATTRNAME_NODEINFO_BIT);
   }
 
-  nsNodeInfo* NodeInfo() const
+  nsINodeInfo* NodeInfo() const
   {
     NS_ASSERTION(!IsAtom(), "getting nodeinfo-value of atom-name");
-    return reinterpret_cast<nsNodeInfo*>(mBits & ~NS_ATTRNAME_NODEINFO_BIT);
+    return reinterpret_cast<nsINodeInfo*>(mBits & ~NS_ATTRNAME_NODEINFO_BIT);
   }
 
   nsIAtom* Atom() const
   {
     NS_ASSERTION(IsAtom(), "getting atom-value of nodeinfo-name");
     return reinterpret_cast<nsIAtom*>(mBits);
   }
 
@@ -143,17 +143,17 @@ public:
   bool Equals(nsIAtom* aLocalName, PRInt32 aNamespaceID) const
   {
     if (aNamespaceID == kNameSpaceID_None) {
       return Equals(aLocalName);
     }
     return !IsAtom() && NodeInfo()->Equals(aLocalName, aNamespaceID);
   }
 
-  bool Equals(nsNodeInfo* aNodeInfo) const
+  bool Equals(nsINodeInfo* aNodeInfo) const
   {
     return Equals(aNodeInfo->NameAtom(), aNodeInfo->NamespaceID());
   }
 
   PRInt32 NamespaceID() const
   {
     return IsAtom() ? kNameSpaceID_None : NodeInfo()->NamespaceID();
   }
@@ -213,28 +213,30 @@ public:
   {
     return mBits < reinterpret_cast<PtrBits>(aOther);
   }
 
 private:
 
   void AddRefInternalName()
   {
-    if (IsAtom()) {
-      NS_ADDREF(Atom());
-    } else {
-      NS_ADDREF(NodeInfo());
-    }
+    // Since both nsINodeInfo and nsIAtom inherit nsISupports as its first
+    // interface we can safely assume that it's first in the vtable
+    nsISupports* name = reinterpret_cast<nsISupports *>
+                                        (mBits & ~NS_ATTRNAME_NODEINFO_BIT);
+
+    NS_ADDREF(name);
   }
 
   void ReleaseInternalName()
   {
-    if (IsAtom()) {
-      Atom()->Release();
-    } else {
-      NodeInfo()->Release();
-    }
+    // Since both nsINodeInfo and nsIAtom inherit nsISupports as its first
+    // interface we can safely assume that it's first in the vtable
+    nsISupports* name = reinterpret_cast<nsISupports *>
+                                        (mBits & ~NS_ATTRNAME_NODEINFO_BIT);
+
+    NS_RELEASE(name);
   }
 
   PtrBits mBits;
 };
 
 #endif
--- a/content/base/src/nsCommentNode.cpp
+++ b/content/base/src/nsCommentNode.cpp
@@ -45,17 +45,17 @@
 #include "nsCOMPtr.h"
 #include "nsIDocument.h"
 #include "nsGenericElement.h" // DOMCI_NODE_DATA
 
 class nsCommentNode : public nsGenericDOMDataNode,
                       public nsIDOMComment
 {
 public:
-  nsCommentNode(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsCommentNode(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsCommentNode();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericDOMDataNode::)
 
@@ -63,17 +63,17 @@ public:
   NS_FORWARD_NSIDOMCHARACTERDATA(nsGenericDOMDataNode::)
 
   // nsIDOMComment
   // Empty interface
 
   // nsINode
   virtual bool IsNodeOfType(PRUint32 aFlags) const;
 
-  virtual nsGenericDOMDataNode* CloneDataNode(nsNodeInfo *aNodeInfo,
+  virtual nsGenericDOMDataNode* CloneDataNode(nsINodeInfo *aNodeInfo,
                                               bool aCloneText) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 #ifdef DEBUG
   virtual void List(FILE* out, PRInt32 aIndent) const;
   virtual void DumpContent(FILE* out = stdout, PRInt32 aIndent = 0,
                            bool aDumpAll = true) const
   {
@@ -85,30 +85,30 @@ public:
 nsresult
 NS_NewCommentNode(nsIContent** aInstancePtrResult,
                   nsNodeInfoManager *aNodeInfoManager)
 {
   NS_PRECONDITION(aNodeInfoManager, "Missing nodeinfo manager");
 
   *aInstancePtrResult = nsnull;
 
-  nsRefPtr<nsNodeInfo> ni = aNodeInfoManager->GetCommentNodeInfo();
+  nsCOMPtr<nsINodeInfo> ni = aNodeInfoManager->GetCommentNodeInfo();
   NS_ENSURE_TRUE(ni, NS_ERROR_OUT_OF_MEMORY);
 
   nsCommentNode *instance = new nsCommentNode(ni.forget());
   if (!instance) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   NS_ADDREF(*aInstancePtrResult = instance);
 
   return NS_OK;
 }
 
-nsCommentNode::nsCommentNode(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsCommentNode::nsCommentNode(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericDOMDataNode(aNodeInfo)
 {
   NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::COMMENT_NODE,
                     "Bad NodeType in aNodeInfo");
 }
 
 nsCommentNode::~nsCommentNode()
 {
@@ -130,19 +130,19 @@ NS_IMPL_RELEASE_INHERITED(nsCommentNode,
 
 bool
 nsCommentNode::IsNodeOfType(PRUint32 aFlags) const
 {
   return !(aFlags & ~(eCONTENT | eCOMMENT | eDATA_NODE));
 }
 
 nsGenericDOMDataNode*
-nsCommentNode::CloneDataNode(nsNodeInfo *aNodeInfo, bool aCloneText) const
+nsCommentNode::CloneDataNode(nsINodeInfo *aNodeInfo, bool aCloneText) const
 {
-  nsRefPtr<nsNodeInfo> ni = aNodeInfo;
+  nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
   nsCommentNode *it = new nsCommentNode(ni.forget());
   if (it && aCloneText) {
     it->mText = mText;
   }
 
   return it;
 }
 
--- a/content/base/src/nsContentList.cpp
+++ b/content/base/src/nsContentList.cpp
@@ -837,17 +837,17 @@ nsContentList::Match(Element *aElement)
 {
   if (mFunc) {
     return (*mFunc)(aElement, mMatchNameSpaceId, mXMLMatchAtom, mData);
   }
 
   if (!mXMLMatchAtom)
     return false;
 
-  nsNodeInfo *ni = aElement->NodeInfo();
+  nsINodeInfo *ni = aElement->NodeInfo();
  
   bool unknown = mMatchNameSpaceId == kNameSpaceID_Unknown;
   bool wildcard = mMatchNameSpaceId == kNameSpaceID_Wildcard;
   bool toReturn = mMatchAll;
   if (!unknown && !wildcard)
     toReturn &= ni->NamespaceEquals(mMatchNameSpaceId);
 
   if (toReturn)
--- a/content/base/src/nsContentSink.cpp
+++ b/content/base/src/nsContentSink.cpp
@@ -44,16 +44,17 @@
 
 #include "nsContentSink.h"
 #include "nsScriptLoader.h"
 #include "nsIDocument.h"
 #include "nsIDOMDocument.h"
 #include "mozilla/css/Loader.h"
 #include "nsStyleConsts.h"
 #include "nsStyleLinkElement.h"
+#include "nsINodeInfo.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsCPrefetchService.h"
 #include "nsIURI.h"
 #include "nsNetUtil.h"
 #include "nsIHttpChannel.h"
 #include "nsIContent.h"
 #include "nsIScriptElement.h"
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -57,17 +57,17 @@
 #include "nsIScriptContext.h"
 #include "nsIDOMScriptObjectFactory.h"
 #include "nsDOMCID.h"
 #include "nsContentUtils.h"
 #include "nsIXPConnect.h"
 #include "nsIContent.h"
 #include "mozilla/dom/Element.h"
 #include "nsIDocument.h"
-#include "nsNodeInfo.h"
+#include "nsINodeInfo.h"
 #include "nsReadableUtils.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMNode.h"
 #include "nsIIOService.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsIScriptSecurityManager.h"
@@ -2433,17 +2433,17 @@ nsContentUtils::SplitQName(const nsICont
 }
 
 // static
 nsresult
 nsContentUtils::GetNodeInfoFromQName(const nsAString& aNamespaceURI,
                                      const nsAString& aQualifiedName,
                                      nsNodeInfoManager* aNodeInfoManager,
                                      PRUint16 aNodeType,
-                                     nsNodeInfo** aNodeInfo)
+                                     nsINodeInfo** aNodeInfo)
 {
   nsIParserService* parserService = GetParserService();
   NS_ENSURE_TRUE(parserService, NS_ERROR_FAILURE);
 
   const nsAFlatString& qName = PromiseFlatString(aQualifiedName);
   const PRUnichar* colon;
   nsresult rv = parserService->CheckQName(qName, true, &colon);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -3924,17 +3924,17 @@ nsContentUtils::CreateContextualFragment
           }
           tagName.Append(NS_LITERAL_STRING("=\"") + uriStr +
             NS_LITERAL_STRING("\""));
         }
       }
     }
 
     if (!setDefaultNamespace) {
-      nsNodeInfo* info = content->NodeInfo();
+      nsINodeInfo* info = content->NodeInfo();
       if (!info->GetPrefixAtom() &&
           info->NamespaceID() != kNameSpaceID_None) {
         // We have no namespace prefix, but have a namespace ID.  Push
         // default namespace attr in, so that our kids will be in our
         // namespace.
         info->GetNamespaceURI(uriStr);
         tagName.Append(NS_LITERAL_STRING(" xmlns=\"") + uriStr +
                        NS_LITERAL_STRING("\""));
--- a/content/base/src/nsDOMAttribute.cpp
+++ b/content/base/src/nsDOMAttribute.cpp
@@ -63,17 +63,17 @@
 #include "nsWrapperCacheInlines.h"
 
 using namespace mozilla::dom;
 
 //----------------------------------------------------------------------
 bool nsDOMAttribute::sInitialized;
 
 nsDOMAttribute::nsDOMAttribute(nsDOMAttributeMap *aAttrMap,
-                               already_AddRefed<nsNodeInfo> aNodeInfo,
+                               already_AddRefed<nsINodeInfo> aNodeInfo,
                                const nsAString   &aValue, bool aNsAware)
   : nsIAttribute(aAttrMap, aNodeInfo, aNsAware), mValue(aValue), mChild(nsnull)
 {
   NS_ABORT_IF_FALSE(mNodeInfo, "We must get a nodeinfo here!");
   NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::ATTRIBUTE_NODE,
                     "Wrong nodeType");
 
   // We don't add a reference to our content. It will tell us
@@ -178,17 +178,17 @@ nsresult
 nsDOMAttribute::SetOwnerDocument(nsIDocument* aDocument)
 {
   NS_ASSERTION(aDocument, "Missing document");
 
   nsIDocument *doc = OwnerDoc();
   NS_ASSERTION(doc != aDocument, "bad call to nsDOMAttribute::SetOwnerDocument");
   doc->DeleteAllPropertiesFor(this);
 
-  nsRefPtr<nsNodeInfo> newNodeInfo;
+  nsCOMPtr<nsINodeInfo> newNodeInfo;
   newNodeInfo = aDocument->NodeInfoManager()->
     GetNodeInfo(mNodeInfo->NameAtom(), mNodeInfo->GetPrefixAtom(),
                 mNodeInfo->NamespaceID(),
                 nsIDOMNode::ATTRIBUTE_NODE);
   NS_ENSURE_TRUE(newNodeInfo, NS_ERROR_OUT_OF_MEMORY);
   NS_ASSERTION(newNodeInfo, "GetNodeInfo lies");
   mNodeInfo.swap(newNodeInfo);
 
@@ -458,22 +458,22 @@ NS_IMETHODIMP
 nsDOMAttribute::AppendChild(nsIDOMNode* aNewChild, nsIDOMNode** aReturn)
 {
   OwnerDoc()->WarnOnceAbout(nsIDocument::eAppendChild);
 
   return InsertBefore(aNewChild, nsnull, aReturn);
 }
 
 nsresult
-nsDOMAttribute::Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const
+nsDOMAttribute::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
 {
   nsAutoString value;
   const_cast<nsDOMAttribute*>(this)->GetValue(value);
 
-  nsRefPtr<nsNodeInfo> ni = aNodeInfo;
+  nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
   *aResult = new nsDOMAttribute(nsnull, ni.forget(), value, mNsAware);
   if (!*aResult) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   NS_ADDREF(*aResult);
 
   return NS_OK;
--- a/content/base/src/nsDOMAttribute.h
+++ b/content/base/src/nsDOMAttribute.h
@@ -43,29 +43,30 @@
 #define nsDOMAttribute_h___
 
 #include "nsIAttribute.h"
 #include "nsIDOMAttr.h"
 #include "nsIDOMText.h"
 #include "nsIDOMNodeList.h"
 #include "nsString.h"
 #include "nsCOMPtr.h"
+#include "nsINodeInfo.h"
 #include "nsDOMAttributeMap.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsStubMutationObserver.h"
 
 // Attribute helper class used to wrap up an attribute with a dom
 // object that implements nsIDOMAttr and nsIDOMNode
 class nsDOMAttribute : public nsIAttribute,
                        public nsIDOMAttr,
                        public nsStubMutationObserver
 {
 public:
   nsDOMAttribute(nsDOMAttributeMap* aAttrMap,
-                 already_AddRefed<nsNodeInfo> aNodeInfo,
+                 already_AddRefed<nsINodeInfo> aNodeInfo,
                  const nsAString& aValue,
                  bool aNsAware);
   virtual ~nsDOMAttribute();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   // nsIDOMNode interface
   NS_DECL_NSIDOMNODE
@@ -85,17 +86,17 @@ public:
   virtual PRUint32 GetChildCount() const;
   virtual nsIContent *GetChildAt(PRUint32 aIndex) const;
   virtual nsIContent * const * GetChildArray(PRUint32* aChildCount) const;
   virtual PRInt32 IndexOf(nsINode* aPossibleChild) const;
   virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex,
                                  bool aNotify);
   virtual nsresult AppendChildTo(nsIContent* aKid, bool aNotify);
   virtual nsresult RemoveChildAt(PRUint32 aIndex, bool aNotify);
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual already_AddRefed<nsIURI> GetBaseURI() const;
 
   static void Initialize();
   static void Shutdown();
 
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDOMAttribute,
                                                          nsIAttribute)
 
--- a/content/base/src/nsDOMAttributeMap.cpp
+++ b/content/base/src/nsDOMAttributeMap.cpp
@@ -159,32 +159,32 @@ nsDOMAttributeMap::DropAttribute(PRInt32
     node->SetMap(nsnull);
 
     // Remove from cache
     mAttributeCache.Remove(attr);
   }
 }
 
 nsresult
-nsDOMAttributeMap::RemoveAttribute(nsNodeInfo* aNodeInfo, nsIDOMNode** aReturn)
+nsDOMAttributeMap::RemoveAttribute(nsINodeInfo* aNodeInfo, nsIDOMNode** aReturn)
 {
   NS_ASSERTION(aNodeInfo, "RemoveAttribute() called with aNodeInfo == nsnull!");
   NS_ASSERTION(aReturn, "RemoveAttribute() called with aReturn == nsnull");
 
   *aReturn = nsnull;
 
   nsAttrKey attr(aNodeInfo->NamespaceID(), aNodeInfo->NameAtom());
 
   nsRefPtr<nsDOMAttribute> node;
   if (!mAttributeCache.Get(attr, getter_AddRefs(node))) {
     nsAutoString value;
     // As we are removing the attribute we need to set the current value in
     // the attribute node.
     mContent->GetAttr(aNodeInfo->NamespaceID(), aNodeInfo->NameAtom(), value);
-    nsRefPtr<nsNodeInfo> ni = aNodeInfo;
+    nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
     nsCOMPtr<nsIDOMNode> newAttr =
       new nsDOMAttribute(nsnull, ni.forget(), value, true);
     if (!newAttr) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
     newAttr.swap(*aReturn);
   }
   else {
@@ -196,42 +196,42 @@ nsDOMAttributeMap::RemoveAttribute(nsNod
 
     node.forget(aReturn);
   }
 
   return NS_OK;
 }
 
 nsDOMAttribute*
-nsDOMAttributeMap::GetAttribute(nsNodeInfo* aNodeInfo, bool aNsAware)
+nsDOMAttributeMap::GetAttribute(nsINodeInfo* aNodeInfo, bool aNsAware)
 {
   NS_ASSERTION(aNodeInfo, "GetAttribute() called with aNodeInfo == nsnull!");
 
   nsAttrKey attr(aNodeInfo->NamespaceID(), aNodeInfo->NameAtom());
 
   nsDOMAttribute* node = mAttributeCache.GetWeak(attr);
   if (!node) {
-    nsRefPtr<nsNodeInfo> ni = aNodeInfo;
+    nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
     nsRefPtr<nsDOMAttribute> newAttr =
       new nsDOMAttribute(this, ni.forget(), EmptyString(), aNsAware);
     if (newAttr && mAttributeCache.Put(attr, newAttr)) {
       node = newAttr;
     }
   }
 
   return node;
 }
 
 nsDOMAttribute*
 nsDOMAttributeMap::GetNamedItem(const nsAString& aAttrName, nsresult *aResult)
 {
   *aResult = NS_OK;
 
   if (mContent) {
-    nsRefPtr<nsNodeInfo> ni =
+    nsCOMPtr<nsINodeInfo> ni =
       mContent->GetExistingAttrNameFromQName(aAttrName);
     if (ni) {
       return GetAttribute(ni, false);
     }
   }
 
   return nsnull;
 }
@@ -306,17 +306,17 @@ nsDOMAttributeMap::SetNamedItemInternal(
       rv = domDoc->AdoptNode(aNode, getter_AddRefs(adoptedNode));
       NS_ENSURE_SUCCESS(rv, rv);
 
       NS_ASSERTION(adoptedNode == aNode, "Uh, adopt node changed nodes?");
     }
 
     // Get nodeinfo and preexisting attribute (if it exists)
     nsAutoString name;
-    nsRefPtr<nsNodeInfo> ni;
+    nsCOMPtr<nsINodeInfo> ni;
 
     // SetNamedItemNS()
     if (aWithNS) {
       // Return existing attribute, if present
       ni = iAttribute->NodeInfo();
 
       if (mContent->HasAttr(ni->NamespaceID(), ni->NameAtom())) {
         rv = RemoveAttribute(ni, getter_AddRefs(tmpReturn));
@@ -373,17 +373,17 @@ nsDOMAttributeMap::RemoveNamedItem(const
                                    nsIDOMNode** aReturn)
 {
   NS_ENSURE_ARG_POINTER(aReturn);
   *aReturn = nsnull;
 
   nsresult rv = NS_OK;
 
   if (mContent) {
-    nsRefPtr<nsNodeInfo> ni = mContent->GetExistingAttrNameFromQName(aName);
+    nsCOMPtr<nsINodeInfo> ni = mContent->GetExistingAttrNameFromQName(aName);
     if (!ni) {
       return NS_ERROR_DOM_NOT_FOUND_ERR;
     }
 
     NS_ADDREF(*aReturn = GetAttribute(ni, true));
 
     // This removes the attribute node from the attribute map.
     rv = mContent->UnsetAttr(ni->NamespaceID(), ni->NameAtom(), true);
@@ -399,17 +399,17 @@ nsDOMAttributeMap::GetItemAt(PRUint32 aI
   *aResult = NS_OK;
 
   nsDOMAttribute* node = nsnull;
 
   const nsAttrName* name;
   if (mContent && (name = mContent->GetAttrNameAt(aIndex))) {
     // Don't use the nodeinfo even if one exists since it can
     // have the wrong owner document.
-    nsRefPtr<nsNodeInfo> ni;
+    nsCOMPtr<nsINodeInfo> ni;
     ni = mContent->NodeInfo()->NodeInfoManager()->
       GetNodeInfo(name->LocalName(), name->GetPrefix(), name->NamespaceID(),
                   nsIDOMNode::ATTRIBUTE_NODE);
     if (ni) {
       node = GetAttribute(ni, true);
     }
     else {
       *aResult = NS_ERROR_OUT_OF_MEMORY;
@@ -477,17 +477,17 @@ nsDOMAttributeMap::GetNamedItemNSInterna
   PRUint32 i, count = mContent->GetAttrCount();
   for (i = 0; i < count; ++i) {
     const nsAttrName* name = mContent->GetAttrNameAt(i);
     PRInt32 attrNS = name->NamespaceID();
     nsIAtom* nameAtom = name->LocalName();
 
     if (nameSpaceID == attrNS &&
         nameAtom->Equals(aLocalName)) {
-      nsRefPtr<nsNodeInfo> ni;
+      nsCOMPtr<nsINodeInfo> ni;
       ni = mContent->NodeInfo()->NodeInfoManager()->
         GetNodeInfo(nameAtom, name->GetPrefix(), nameSpaceID,
                     nsIDOMNode::ATTRIBUTE_NODE);
       NS_ENSURE_TRUE(ni, NS_ERROR_OUT_OF_MEMORY);
 
       if (aRemove) {
         return RemoveAttribute(ni, aReturn);
       }
@@ -519,17 +519,17 @@ nsDOMAttributeMap::RemoveNamedItemNS(con
     return NS_ERROR_DOM_NOT_FOUND_ERR;
   }
 
   nsCOMPtr<nsIAttribute> attr = do_QueryInterface(*aReturn);
   NS_ASSERTION(attr, "attribute returned from nsDOMAttributeMap::GetNameItemNS "
                "didn't implement nsIAttribute");
   NS_ENSURE_TRUE(attr, NS_ERROR_UNEXPECTED);
 
-  nsNodeInfo *ni = attr->NodeInfo();
+  nsINodeInfo *ni = attr->NodeInfo();
   mContent->UnsetAttr(ni->NamespaceID(), ni->NameAtom(), true);
 
   return NS_OK;
 }
 
 PRUint32
 nsDOMAttributeMap::Count() const
 {
--- a/content/base/src/nsDOMAttributeMap.h
+++ b/content/base/src/nsDOMAttributeMap.h
@@ -48,17 +48,17 @@
 #include "nsRefPtrHashtable.h"
 #include "nsCycleCollectionParticipant.h"
 #include "prbit.h"
 #include "nsIDOMNode.h"
 
 class nsIAtom;
 class nsIContent;
 class nsDOMAttribute;
-class nsNodeInfo;
+class nsINodeInfo;
 class nsIDocument;
 
 namespace mozilla {
 namespace dom {
 class Element;
 } // namespace dom
 } // namespace mozilla
 
@@ -219,19 +219,19 @@ private:
    * GetNamedItemNS() implementation taking |aRemove| for GetAttribute(),
    * which is used by RemoveNamedItemNS().
    */
   nsresult GetNamedItemNSInternal(const nsAString& aNamespaceURI,
                                   const nsAString& aLocalName,
                                   nsIDOMNode** aReturn,
                                   bool aRemove = false);
 
-  nsDOMAttribute* GetAttribute(nsNodeInfo* aNodeInfo, bool aNsAware);
+  nsDOMAttribute* GetAttribute(nsINodeInfo* aNodeInfo, bool aNsAware);
 
   /**
    * Remove an attribute, returns the removed node.
    */
-  nsresult RemoveAttribute(nsNodeInfo*      aNodeInfo,
+  nsresult RemoveAttribute(nsINodeInfo*     aNodeInfo,
                            nsIDOMNode**     aReturn);
 };
 
 
 #endif /* nsDOMAttributeMap_h___ */
--- a/content/base/src/nsDOMDocumentType.cpp
+++ b/content/base/src/nsDOMDocumentType.cpp
@@ -59,31 +59,31 @@ NS_NewDOMDocumentType(nsIDOMDocumentType
                       nsIAtom *aName,
                       const nsAString& aPublicId,
                       const nsAString& aSystemId,
                       const nsAString& aInternalSubset)
 {
   NS_ENSURE_ARG_POINTER(aDocType);
   NS_ENSURE_ARG_POINTER(aName);
 
-  nsRefPtr<nsNodeInfo> ni =
+  nsCOMPtr<nsINodeInfo> ni =
     aNodeInfoManager->GetNodeInfo(nsGkAtoms::documentTypeNodeName, nsnull,
                                   kNameSpaceID_None,
                                   nsIDOMNode::DOCUMENT_TYPE_NODE,
                                   aName);
   NS_ENSURE_TRUE(ni, NS_ERROR_OUT_OF_MEMORY);
 
   *aDocType = new nsDOMDocumentType(ni.forget(), aPublicId, aSystemId,
                                     aInternalSubset);
   NS_ADDREF(*aDocType);
 
   return NS_OK;
 }
 
-nsDOMDocumentType::nsDOMDocumentType(already_AddRefed<nsNodeInfo> aNodeInfo,
+nsDOMDocumentType::nsDOMDocumentType(already_AddRefed<nsINodeInfo> aNodeInfo,
                                      const nsAString& aPublicId,
                                      const nsAString& aSystemId,
                                      const nsAString& aInternalSubset) :
   nsDOMDocumentTypeForward(aNodeInfo),
   mPublicId(aPublicId),
   mSystemId(aSystemId),
   mInternalSubset(aInternalSubset)
 {
@@ -150,15 +150,15 @@ nsDOMDocumentType::GetSystemId(nsAString
 NS_IMETHODIMP
 nsDOMDocumentType::GetInternalSubset(nsAString& aInternalSubset)
 {
   aInternalSubset = mInternalSubset;
   return NS_OK;
 }
 
 nsGenericDOMDataNode*
-nsDOMDocumentType::CloneDataNode(nsNodeInfo *aNodeInfo, bool aCloneText) const
+nsDOMDocumentType::CloneDataNode(nsINodeInfo *aNodeInfo, bool aCloneText) const
 {
-  nsRefPtr<nsNodeInfo> ni = aNodeInfo;
+  nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
   return new nsDOMDocumentType(ni.forget(), mPublicId, mSystemId,
                                mInternalSubset);
 }
 
--- a/content/base/src/nsDOMDocumentType.h
+++ b/content/base/src/nsDOMDocumentType.h
@@ -52,29 +52,29 @@
 // CharacterData object, even though DocumentType is not character
 // data. This is done simply for convenience and should be changed if
 // this restricts what should be done for character data.
 
 class nsDOMDocumentTypeForward : public nsGenericDOMDataNode,
                                  public nsIDOMDocumentType
 {
 public:
-  nsDOMDocumentTypeForward(already_AddRefed<nsNodeInfo> aNodeInfo)
+  nsDOMDocumentTypeForward(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsGenericDOMDataNode(aNodeInfo)
   {
   }
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericDOMDataNode::)
 };
 
 class nsDOMDocumentType : public nsDOMDocumentTypeForward
 {
 public:
-  nsDOMDocumentType(already_AddRefed<nsNodeInfo> aNodeInfo,
+  nsDOMDocumentType(already_AddRefed<nsINodeInfo> aNodeInfo,
                     const nsAString& aPublicId,
                     const nsAString& aSystemId,
                     const nsAString& aInternalSubset);
 
   virtual ~nsDOMDocumentType();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
@@ -97,17 +97,17 @@ public:
   }
 
   // nsINode
   virtual bool IsNodeOfType(PRUint32 aFlags) const;
 
   // nsIContent overrides
   virtual const nsTextFragment* GetText();
 
-  virtual nsGenericDOMDataNode* CloneDataNode(nsNodeInfo *aNodeInfo,
+  virtual nsGenericDOMDataNode* CloneDataNode(nsINodeInfo *aNodeInfo,
                                               bool aCloneText) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 protected:
   nsString mPublicId;
   nsString mSystemId;
   nsString mInternalSubset;
 };
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -4453,17 +4453,17 @@ nsDocument::CreateElementNS(const nsAStr
   return CallQueryInterface(content, aReturn);
 }
 
 nsresult
 nsDocument::CreateElementNS(const nsAString& aNamespaceURI,
                             const nsAString& aQualifiedName,
                             nsIContent** aReturn)
 {
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   nsresult rv = nsContentUtils::GetNodeInfoFromQName(aNamespaceURI,
                                                      aQualifiedName,
                                                      mNodeInfoManager,
                                                      nsIDOMNode::ELEMENT_NODE,
                                                      getter_AddRefs(nodeInfo));
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_NewElement(aReturn, nodeInfo.forget(), NOT_FROM_PARSER);
@@ -4581,17 +4581,17 @@ nsDocument::CreateAttribute(const nsAStr
 
   WarnOnceAbout(eCreateAttribute);
 
   NS_ENSURE_TRUE(mNodeInfoManager, NS_ERROR_NOT_INITIALIZED);
 
   nsresult rv = nsContentUtils::CheckQName(aName, false);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   rv = mNodeInfoManager->GetNodeInfo(aName, nsnull, kNameSpaceID_None,
                                      nsIDOMNode::ATTRIBUTE_NODE,
                                      getter_AddRefs(nodeInfo));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoString value;
   nsCOMPtr<nsIDOMAttr> attribute =
     new nsDOMAttribute(nsnull, nodeInfo.forget(), value, false);
@@ -4604,17 +4604,17 @@ nsDocument::CreateAttributeNS(const nsAS
                               const nsAString & aQualifiedName,
                               nsIDOMAttr **aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
   *aResult = nsnull;
 
   WarnOnceAbout(eCreateAttributeNS);
 
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   nsresult rv = nsContentUtils::GetNodeInfoFromQName(aNamespaceURI,
                                                      aQualifiedName,
                                                      mNodeInfoManager,
                                                      nsIDOMNode::ATTRIBUTE_NODE,
                                                      getter_AddRefs(nodeInfo));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoString value;
@@ -5272,17 +5272,17 @@ nsDocument::SetTitle(const nsAString& aT
 
   nsIContent* title = GetTitleContent(kNameSpaceID_XHTML);
   if (!title) {
     Element *head = GetHeadElement();
     if (!head)
       return NS_OK;
 
     {
-      nsRefPtr<nsNodeInfo> titleInfo;
+      nsCOMPtr<nsINodeInfo> titleInfo;
       titleInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::title, nsnull,
                                                 kNameSpaceID_XHTML,
                                                 nsIDOMNode::ELEMENT_NODE);
       if (!titleInfo)
         return NS_OK;
       title = NS_NewHTMLTitleElement(titleInfo.forget());
       if (!title)
         return NS_OK;
@@ -6816,17 +6816,17 @@ nsDocument::CreateElem(const nsAString& 
   bool nsAware = aPrefix != nsnull || aNamespaceID != GetDefaultNamespaceID();
   NS_ASSERTION(NS_SUCCEEDED(nsContentUtils::CheckQName(qName, nsAware)),
                "Don't pass invalid prefixes to nsDocument::CreateElem, "
                "check caller.");
 #endif
 
   *aResult = nsnull;
   
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   mNodeInfoManager->GetNodeInfo(aName, aPrefix, aNamespaceID,
                                 nsIDOMNode::ELEMENT_NODE,
                                 getter_AddRefs(nodeInfo));
   NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
 
   return NS_NewElement(aResult, nodeInfo.forget(), NOT_FROM_PARSER);
 }
 
--- a/content/base/src/nsDocument.h
+++ b/content/base/src/nsDocument.h
@@ -57,16 +57,17 @@
 #include "nsIScriptGlobalObject.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIContent.h"
 #include "nsEventListenerManager.h"
 #include "nsIDOMNodeSelector.h"
 #include "nsIPrincipal.h"
 #include "nsIParser.h"
 #include "nsBindingManager.h"
+#include "nsINodeInfo.h"
 #include "nsHashtable.h"
 #include "nsInterfaceHashtable.h"
 #include "nsIBoxObject.h"
 #include "nsPIBoxObject.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsIURI.h"
 #include "nsScriptLoader.h"
 #include "nsIRadioGroupContainer.h"
@@ -719,17 +720,17 @@ public:
   virtual nsIContent *GetChildAt(PRUint32 aIndex) const;
   virtual nsIContent * const * GetChildArray(PRUint32* aChildCount) const;
   virtual PRInt32 IndexOf(nsINode* aPossibleChild) const;
   virtual PRUint32 GetChildCount() const;
   virtual nsresult InsertChildAt(nsIContent* aKid, PRUint32 aIndex,
                                  bool aNotify);
   virtual nsresult AppendChildTo(nsIContent* aKid, bool aNotify);
   virtual nsresult RemoveChildAt(PRUint32 aIndex, bool aNotify);
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
   {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   // nsIRadioGroupContainer
   NS_IMETHOD WalkRadioGroup(const nsAString& aName,
                             nsIRadioVisitor* aVisitor,
                             bool aFlushContent);
--- a/content/base/src/nsDocumentFragment.cpp
+++ b/content/base/src/nsDocumentFragment.cpp
@@ -39,17 +39,17 @@
  * Implementation of DOM Core's nsIDOMDocumentFragment.
  */
 
 #include "nsISupports.h"
 #include "nsIContent.h"
 #include "nsIDOMDocumentFragment.h"
 #include "nsGenericElement.h"
 #include "nsINameSpaceManager.h"
-#include "nsNodeInfo.h"
+#include "nsINodeInfo.h"
 #include "nsNodeInfoManager.h"
 #include "nsIDocument.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMAttr.h"
 #include "nsDOMError.h"
 #include "nsGkAtoms.h"
 #include "nsDOMString.h"
 #include "nsIDOMUserDataHandler.h"
@@ -62,17 +62,17 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   // interface nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericElement::)
 
   // interface nsIDOMDocumentFragment
   // NS_DECL_NSIDOCUMENTFRAGMENT  Empty
 
-  nsDocumentFragment(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsDocumentFragment(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsDocumentFragment()
   {
   }
 
   // nsIContent
   nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
                    const nsAString& aValue, bool aNotify)
   {
@@ -102,42 +102,42 @@ public:
   virtual bool IsNodeOfType(PRUint32 aFlags) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIAtom* DoGetID() const;
   virtual nsIAtom *GetIDAttributeName() const;
 
 protected:
-  nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 };
 
 nsresult
 NS_NewDocumentFragment(nsIDOMDocumentFragment** aInstancePtrResult,
                        nsNodeInfoManager *aNodeInfoManager)
 {
   NS_ENSURE_ARG(aNodeInfoManager);
 
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   nodeInfo = aNodeInfoManager->GetNodeInfo(nsGkAtoms::documentFragmentNodeName,
                                            nsnull, kNameSpaceID_None,
                                            nsIDOMNode::DOCUMENT_FRAGMENT_NODE);
   NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
 
   nsDocumentFragment *it = new nsDocumentFragment(nodeInfo.forget());
   if (!it) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   NS_ADDREF(*aInstancePtrResult = it);
 
   return NS_OK;
 }
 
-nsDocumentFragment::nsDocumentFragment(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsDocumentFragment::nsDocumentFragment(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericElement(aNodeInfo)
 {
   ClearIsElement();
 }
 
 bool
 nsDocumentFragment::IsNodeOfType(PRUint32 aFlags) const
 {
--- a/content/base/src/nsGenConImageContent.cpp
+++ b/content/base/src/nsGenConImageContent.cpp
@@ -47,17 +47,17 @@
 #include "nsImageLoadingContent.h"
 #include "imgIRequest.h"
 #include "nsEventStates.h"
 
 class nsGenConImageContent : public nsXMLElement,
                              public nsImageLoadingContent
 {
 public:
-  nsGenConImageContent(already_AddRefed<nsNodeInfo> aNodeInfo)
+  nsGenConImageContent(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsXMLElement(aNodeInfo)
   {
     // nsImageLoadingContent starts out broken, so we start out
     // suppressed to match it.
     AddStatesSilently(NS_EVENT_STATE_SUPPRESSED);
   }
 
   nsresult Init(imgIRequest* aImageRequest)
@@ -75,17 +75,17 @@ private:
 public:
   NS_DECL_ISUPPORTS_INHERITED
 };
 
 NS_IMPL_ISUPPORTS_INHERITED3(nsGenConImageContent, nsXMLElement,
                              nsIImageLoadingContent, imgIContainerObserver, imgIDecoderObserver)
 
 nsresult
-NS_NewGenConImageContent(nsIContent** aResult, already_AddRefed<nsNodeInfo> aNodeInfo,
+NS_NewGenConImageContent(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo,
                          imgIRequest* aImageRequest)
 {
   NS_PRECONDITION(aImageRequest, "Must have request!");
   nsGenConImageContent *it = new nsGenConImageContent(aNodeInfo);
   if (!it)
     return NS_ERROR_OUT_OF_MEMORY;
   NS_ADDREF(*aResult = it);
   nsresult rv = it->Init(aImageRequest);
--- a/content/base/src/nsGenericDOMDataNode.cpp
+++ b/content/base/src/nsGenericDOMDataNode.cpp
@@ -65,17 +65,17 @@
 #include "nsAsyncDOMEvent.h"
 
 #include "pldhash.h"
 #include "prprf.h"
 #include "nsWrapperCacheInlines.h"
 
 using namespace mozilla;
 
-nsGenericDOMDataNode::nsGenericDOMDataNode(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsGenericDOMDataNode::nsGenericDOMDataNode(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsIContent(aNodeInfo)
 {
   NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::TEXT_NODE ||
                     mNodeInfo->NodeType() == nsIDOMNode::CDATA_SECTION_NODE ||
                     mNodeInfo->NodeType() == nsIDOMNode::COMMENT_NODE ||
                     mNodeInfo->NodeType() ==
                       nsIDOMNode::PROCESSING_INSTRUCTION_NODE ||
                     mNodeInfo->NodeType() == nsIDOMNode::DOCUMENT_TYPE_NODE,
@@ -595,17 +595,17 @@ nsGenericDOMDataNode::GetChildren(PRUint
 }
 
 nsIAtom *
 nsGenericDOMDataNode::GetIDAttributeName() const
 {
   return nsnull;
 }
 
-already_AddRefed<nsNodeInfo>
+already_AddRefed<nsINodeInfo>
 nsGenericDOMDataNode::GetExistingAttrNameFromQName(const nsAString& aStr) const
 {
   return nsnull;
 }
 
 nsresult
 nsGenericDOMDataNode::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttr,
                               nsIAtom* aPrefix, const nsAString& aValue,
--- a/content/base/src/nsGenericDOMDataNode.h
+++ b/content/base/src/nsGenericDOMDataNode.h
@@ -65,27 +65,27 @@
 // Make sure we have enough space for those bits
 PR_STATIC_ASSERT(NODE_TYPE_SPECIFIC_BITS_OFFSET + 1 < 32);
 
 class nsIDOMAttr;
 class nsIDOMEventListener;
 class nsIDOMNodeList;
 class nsIFrame;
 class nsIDOMText;
-class nsNodeInfo;
+class nsINodeInfo;
 class nsURI;
 
 class nsGenericDOMDataNode : public nsIContent
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   NS_DECL_SIZEOF_EXCLUDING_THIS
 
-  nsGenericDOMDataNode(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsGenericDOMDataNode(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsGenericDOMDataNode();
 
   // Implementation for nsIDOMNode
   nsresult GetNodeName(nsAString& aNodeName)
   {
     aNodeName = NodeName();
     return NS_OK;
   }
@@ -189,17 +189,17 @@ public:
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers);
   virtual void UnbindFromTree(bool aDeep = true,
                               bool aNullParent = true);
 
   virtual already_AddRefed<nsINodeList> GetChildren(PRUint32 aFilter);
 
   virtual nsIAtom *GetIDAttributeName() const;
-  virtual already_AddRefed<nsNodeInfo> GetExistingAttrNameFromQName(const nsAString& aStr) const;
+  virtual already_AddRefed<nsINodeInfo> GetExistingAttrNameFromQName(const nsAString& aStr) const;
   nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
                    const nsAString& aValue, bool aNotify)
   {
     return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify);
   }
   virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
                            nsIAtom* aPrefix, const nsAString& aValue,
                            bool aNotify);
@@ -249,17 +249,17 @@ public:
   NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
   virtual mozilla::css::StyleRule* GetInlineStyleRule();
   NS_IMETHOD SetInlineStyleRule(mozilla::css::StyleRule* aStyleRule, bool aNotify);
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
   virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
                                               PRInt32 aModType) const;
   virtual nsIAtom *GetClassAttributeName() const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
   {
     *aResult = CloneDataNode(aNodeInfo, true);
     if (!*aResult) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
 
     NS_ADDREF(*aResult);
 
@@ -341,17 +341,17 @@ protected:
   /**
    * Method to clone this node. This needs to be overriden by all derived
    * classes. If aCloneText is true the text content will be cloned too.
    *
    * @param aOwnerDocument the ownerDocument of the clone
    * @param aCloneText if true the text content will be cloned too
    * @return the clone
    */
-  virtual nsGenericDOMDataNode *CloneDataNode(nsNodeInfo *aNodeInfo,
+  virtual nsGenericDOMDataNode *CloneDataNode(nsINodeInfo *aNodeInfo,
                                               bool aCloneText) const = 0;
 
   nsTextFragment mText;
 
 public:
   virtual bool IsPurple()
   {
     return mRefCnt.IsPurple();
--- a/content/base/src/nsGenericElement.cpp
+++ b/content/base/src/nsGenericElement.cpp
@@ -45,17 +45,17 @@
 
 #include "mozilla/Util.h"
 
 #include "nsGenericElement.h"
 
 #include "nsDOMAttribute.h"
 #include "nsDOMAttributeMap.h"
 #include "nsIAtom.h"
-#include "nsNodeInfo.h"
+#include "nsINodeInfo.h"
 #include "nsIDocument.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMDocument.h"
 #include "nsIContentIterator.h"
 #include "nsEventListenerManager.h"
 #include "nsFocusManager.h"
 #include "nsILinkHandler.h"
 #include "nsIScriptGlobalObject.h"
@@ -901,18 +901,18 @@ nsINode::IsEqualTo(nsINode* aOther)
   nsINode* node1 = this;
   nsINode* node2 = aOther;
   do {
     PRUint16 nodeType = node1->NodeType();
     if (nodeType != node2->NodeType()) {
       return false;
     }
 
-    nsNodeInfo* nodeInfo1 = node1->mNodeInfo;
-    nsNodeInfo* nodeInfo2 = node2->mNodeInfo;
+    nsINodeInfo* nodeInfo1 = node1->mNodeInfo;
+    nsINodeInfo* nodeInfo2 = node2->mNodeInfo;
     if (!nodeInfo1->Equals(nodeInfo2) ||
         nodeInfo1->GetExtraName() != nodeInfo2->GetExtraName()) {
       return false;
     }
 
     switch(nodeType) {
       case nsIDOMNode::ELEMENT_NODE:
       {
@@ -1245,17 +1245,17 @@ nsINode::Traverse(nsINode *tmp, nsCycleC
         if (parent && !UnoptimizableCCNode(parent) && parent->IsBlack()) {
           NS_ABORT_IF_FALSE(parent->IndexOf(tmp) >= 0, "Parent doesn't own us?");
           return false;
         }
       }
     }
   }
 
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_PTR(tmp->mNodeInfo, nsNodeInfo, "mNodeInfo")
+  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mNodeInfo)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(GetParent())
 
   nsSlots *slots = tmp->GetExistingSlots();
   if (slots) {
     slots->Traverse(cb);
   }
 
   if (tmp->HasProperties()) {
@@ -2476,17 +2476,17 @@ nsGenericElement::nsDOMSlots::Unlink(boo
     NS_IF_RELEASE(mControllers);
   mChildrenList = nsnull;
   if (mClassList) {
     mClassList->DropReference();
     mClassList = nsnull;
   }
 }
 
-nsGenericElement::nsGenericElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsGenericElement::nsGenericElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : Element(aNodeInfo)
 {
   NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::ELEMENT_NODE ||
                     (mNodeInfo->NodeType() ==
                        nsIDOMNode::DOCUMENT_FRAGMENT_NODE &&
                      mNodeInfo->Equals(nsGkAtoms::documentFragmentNodeName,
                                        kNameSpaceID_None)),
                     "Bad NodeType in aNodeInfo");
@@ -2857,17 +2857,17 @@ nsGenericElement::GetAttributeNS(const n
   return NS_OK;
 }
 
 nsresult
 nsGenericElement::SetAttributeNS(const nsAString& aNamespaceURI,
                                  const nsAString& aQualifiedName,
                                  const nsAString& aValue)
 {
-  nsRefPtr<nsNodeInfo> ni;
+  nsCOMPtr<nsINodeInfo> ni;
   nsresult rv =
     nsContentUtils::GetNodeInfoFromQName(aNamespaceURI, aQualifiedName,
                                          mNodeInfo->NodeInfoManager(),
                                          nsIDOMNode::ATTRIBUTE_NODE,
                                          getter_AddRefs(ni));
   NS_ENSURE_SUCCESS(rv, rv);
 
   return SetAttr(ni->NamespaceID(), ni->NameAtom(), ni->GetPrefixAtom(),
@@ -3640,25 +3640,25 @@ nsGenericElement::FindAttributeDependenc
         return true;
       }
     }
   }
 
   return false;
 }
 
-already_AddRefed<nsNodeInfo>
+already_AddRefed<nsINodeInfo>
 nsGenericElement::GetExistingAttrNameFromQName(const nsAString& aStr) const
 {
   const nsAttrName* name = InternalGetExistingAttrNameFromQName(aStr);
   if (!name) {
     return nsnull;
   }
 
-  nsNodeInfo* nodeInfo;
+  nsINodeInfo* nodeInfo;
   if (name->IsAtom()) {
     nodeInfo = mNodeInfo->NodeInfoManager()->
       GetNodeInfo(name->Atom(), nsnull, kNameSpaceID_None,
                   nsIDOMNode::ATTRIBUTE_NODE).get();
   }
   else {
     NS_ADDREF(nodeInfo = name->NodeInfo());
   }
@@ -5032,17 +5032,17 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
   {
     PRUint32 i;
     PRUint32 attrs = tmp->mAttrsAndChildren.AttrCount();
     for (i = 0; i < attrs; i++) {
       const nsAttrName* name = tmp->mAttrsAndChildren.AttrNameAt(i);
       if (!name->IsAtom()) {
         NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb,
                                            "mAttrsAndChildren[i]->NodeInfo()");
-        cb.NoteNativeChild(name->NodeInfo(), &NS_CYCLE_COLLECTION_NAME(nsNodeInfo));
+        cb.NoteXPCOMChild(name->NodeInfo());
       }
     }
 
     PRUint32 kids = tmp->mAttrsAndChildren.ChildCount();
     for (i = 0; i < kids; i++) {
       NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mAttrsAndChildren[i]");
       cb.NoteXPCOMChild(tmp->mAttrsAndChildren.GetSafeChildAt(i));
     }
@@ -5322,17 +5322,17 @@ nsGenericElement::SetAttrAndNotify(PRInt
     // XXXbz Perhaps we should push up the attribute mapping function
     // stuff to nsGenericElement?
     if (!IsAttributeMapped(aName) ||
         !SetMappedAttribute(document, aName, aParsedValue, &rv)) {
       rv = mAttrsAndChildren.SetAndTakeAttr(aName, aParsedValue);
     }
   }
   else {
-    nsRefPtr<nsNodeInfo> ni;
+    nsCOMPtr<nsINodeInfo> ni;
     ni = mNodeInfo->NodeInfoManager()->GetNodeInfo(aName, aPrefix,
                                                    aNamespaceID,
                                                    nsIDOMNode::ATTRIBUTE_NODE);
     NS_ENSURE_TRUE(ni, NS_ERROR_OUT_OF_MEMORY);
 
     rv = mAttrsAndChildren.SetAndTakeAttr(ni, aParsedValue);
   }
   NS_ENSURE_SUCCESS(rv, rv);
--- a/content/base/src/nsGenericElement.h
+++ b/content/base/src/nsGenericElement.h
@@ -71,17 +71,17 @@
 
 class nsIDOMAttr;
 class nsIDOMEventListener;
 class nsIFrame;
 class nsIDOMNamedNodeMap;
 class nsICSSDeclaration;
 class nsIDOMCSSStyleDeclaration;
 class nsIURI;
-class nsNodeInfo;
+class nsINodeInfo;
 class nsIControllers;
 class nsEventListenerManager;
 class nsIScrollableFrame;
 class nsAttrValueOrString;
 class nsContentList;
 class nsDOMTokenList;
 class ContentUnbinder;
 struct nsRect;
@@ -235,17 +235,17 @@ class nsInlineEventHandlersTearoff;
 
 /**
  * A generic base class for DOM elements, implementing many nsIContent,
  * nsIDOMNode and nsIDOMElement methods.
  */
 class nsGenericElement : public mozilla::dom::Element
 {
 public:
-  nsGenericElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsGenericElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsGenericElement();
 
   friend class nsTouchEventReceiverTearoff;
   friend class nsInlineEventHandlersTearoff;
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   NS_DECL_SIZEOF_EXCLUDING_THIS
@@ -272,17 +272,17 @@ public:
 
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers);
   virtual void UnbindFromTree(bool aDeep = true,
                               bool aNullParent = true);
   virtual already_AddRefed<nsINodeList> GetChildren(PRUint32 aFilter);
   virtual nsIAtom *GetClassAttributeName() const;
-  virtual already_AddRefed<nsNodeInfo> GetExistingAttrNameFromQName(const nsAString& aStr) const;
+  virtual already_AddRefed<nsINodeInfo> GetExistingAttrNameFromQName(const nsAString& aStr) const;
   nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
                    const nsAString& aValue, bool aNotify)
   {
     return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify);
   }
   /**
    * Helper for SetAttr/SetParsedAttr. This method will return true if aNotify
    * is true or there are mutation listeners that must be triggered, the
@@ -608,17 +608,17 @@ public:
    * live on this element (and is only virtual to handle XUL prototypes).  That
    * is, this should only be called from methods that only care about attrs
    * that effectively live in mAttrsAndChildren.
    */
   virtual nsAttrInfo GetAttrInfo(PRInt32 aNamespaceID, nsIAtom* aName) const;
 
   NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsGenericElement)
 
-  virtual void NodeInfoChanged(nsNodeInfo* aOldNodeInfo)
+  virtual void NodeInfoChanged(nsINodeInfo* aOldNodeInfo)
   {
   }
 
   /**
    * Fire a DOMNodeRemoved mutation event for all children of this node
    */
   void FireNodeRemovedForChildren();
 
@@ -996,40 +996,40 @@ private:
 };
 
 /**
  * Macros to implement Clone(). _elementName is the class for which to implement
  * Clone.
  */
 #define NS_IMPL_ELEMENT_CLONE(_elementName)                                 \
 nsresult                                                                    \
-_elementName::Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const         \
+_elementName::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const        \
 {                                                                           \
   *aResult = nsnull;                                                        \
-  nsRefPtr<nsNodeInfo> ni = aNodeInfo;                                      \
+  nsCOMPtr<nsINodeInfo> ni = aNodeInfo;                                     \
   _elementName *it = new _elementName(ni.forget());                         \
   if (!it) {                                                                \
     return NS_ERROR_OUT_OF_MEMORY;                                          \
   }                                                                         \
                                                                             \
   nsCOMPtr<nsINode> kungFuDeathGrip = it;                                   \
   nsresult rv = CopyInnerTo(it);                                            \
   if (NS_SUCCEEDED(rv)) {                                                   \
     kungFuDeathGrip.swap(*aResult);                                         \
   }                                                                         \
                                                                             \
   return rv;                                                                \
 }
 
 #define NS_IMPL_ELEMENT_CLONE_WITH_INIT(_elementName)                       \
 nsresult                                                                    \
-_elementName::Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const         \
+_elementName::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const        \
 {                                                                           \
   *aResult = nsnull;                                                        \
-  nsRefPtr<nsNodeInfo> ni = aNodeInfo;                                      \
+  nsCOMPtr<nsINodeInfo> ni = aNodeInfo;                                     \
   _elementName *it = new _elementName(ni.forget());                         \
   if (!it) {                                                                \
     return NS_ERROR_OUT_OF_MEMORY;                                          \
   }                                                                         \
                                                                             \
   nsCOMPtr<nsINode> kungFuDeathGrip = it;                                   \
   nsresult rv = it->Init();                                                 \
   rv |= CopyInnerTo(it);                                                    \
--- a/content/base/src/nsMappedAttributeElement.h
+++ b/content/base/src/nsMappedAttributeElement.h
@@ -55,17 +55,17 @@ typedef void (*nsMapRuleToAttributesFunc
 
 typedef nsStyledElement nsMappedAttributeElementBase;
 
 class nsMappedAttributeElement : public nsMappedAttributeElementBase
 {
 
 protected:
 
-  nsMappedAttributeElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+  nsMappedAttributeElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsMappedAttributeElementBase(aNodeInfo)
   {}
 
 public:
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
 
   static void MapNoAttributesInto(const nsMappedAttributes* aAttributes, 
                                   nsRuleData* aRuleData);
--- a/content/base/src/nsNameSpaceManager.cpp
+++ b/content/base/src/nsNameSpaceManager.cpp
@@ -38,17 +38,17 @@
 /*
  * A class for managing namespace IDs and mapping back and forth
  * between namespace IDs and namespace URIs.
  */
 
 #include "nscore.h"
 #include "nsINameSpaceManager.h"
 #include "nsAutoPtr.h"
-#include "nsNodeInfo.h"
+#include "nsINodeInfo.h"
 #include "nsCOMArray.h"
 #include "nsTArray.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsDataHashtable.h"
 #include "nsString.h"
 
 #ifdef MOZ_XTF
 #include "nsIServiceManager.h"
@@ -221,17 +221,17 @@ NameSpaceManagerImpl::GetNameSpaceID(con
     return nameSpaceID;
   }
 
   return kNameSpaceID_Unknown;
 }
 
 nsresult
 NS_NewElement(nsIContent** aResult,
-              already_AddRefed<nsNodeInfo> aNodeInfo, FromParser aFromParser)
+              already_AddRefed<nsINodeInfo> aNodeInfo, FromParser aFromParser)
 {
   PRInt32 ns = aNodeInfo.get()->NamespaceID();
   if (ns == kNameSpaceID_XHTML) {
     return NS_NewHTMLElement(aResult, aNodeInfo, aFromParser);
   }
 #ifdef MOZ_XUL
   if (ns == kNameSpaceID_XUL) {
     return NS_NewXULElement(aResult, aNodeInfo);
--- a/content/base/src/nsNodeInfo.cpp
+++ b/content/base/src/nsNodeInfo.cpp
@@ -171,34 +171,32 @@ nsNodeInfo::nsNodeInfo(nsIAtom *aName, n
                         "Unknown node type");
   }
 }
 
 
 // nsISupports
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsNodeInfo)
-NS_IMPL_CYCLE_COLLECTION_UNLINK_NATIVE_0(nsNodeInfo)
-NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsNodeInfo, AddRef)
-NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsNodeInfo, Release)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_0(nsNodeInfo)
 
 static const char* kNSURIs[] = {
   " ([none])",
   " (xmlns)",
   " (xml)",
   " (xhtml)",
   " (XLink)",
   " (XSLT)",
   " (XBL)",
   " (MathML)",
   " (RDF)",
   " (XUL)"
 };
 
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_BEGIN_INTERNAL(nsNodeInfo)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsNodeInfo)
   if (NS_UNLIKELY(cb.WantDebugInfo())) {
     char name[72];
     PRUint32 nsid = tmp->NamespaceID();
     nsAtomCString localName(tmp->NameAtom());
     if (nsid < ArrayLength(kNSURIs)) {
       PR_snprintf(name, sizeof(name), "nsNodeInfo%s %s", kNSURIs[nsid],
                   localName.get());
     }
@@ -211,17 +209,24 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE
   else {
     NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsNodeInfo, tmp->mRefCnt.get())
   }
 
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_MEMBER(mOwnerManager,
                                                   nsNodeInfoManager)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-// nsNodeInfo
+NS_IMPL_CYCLE_COLLECTING_ADDREF(nsNodeInfo)
+NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_DESTROY(nsNodeInfo, LastRelease())
+NS_INTERFACE_TABLE_HEAD(nsNodeInfo)
+  NS_INTERFACE_TABLE1(nsNodeInfo, nsINodeInfo)
+  NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsNodeInfo)
+NS_INTERFACE_MAP_END
+
+// nsINodeInfo
 
 nsresult
 nsNodeInfo::GetNamespaceURI(nsAString& aNameSpaceURI) const
 {
   nsresult rv = NS_OK;
 
   if (mInner.mNamespaceID > 0) {
     rv = nsContentUtils::NameSpaceManager()->GetNameSpaceURI(mInner.mNamespaceID,
@@ -235,17 +240,17 @@ nsNodeInfo::GetNamespaceURI(nsAString& a
 
 
 bool
 nsNodeInfo::NamespaceEquals(const nsAString& aNamespaceURI) const
 {
   PRInt32 nsid =
     nsContentUtils::NameSpaceManager()->GetNameSpaceID(aNamespaceURI);
 
-  return nsNodeInfo::NamespaceEquals(nsid);
+  return nsINodeInfo::NamespaceEquals(nsid);
 }
 
 // static
 void
 nsNodeInfo::ClearCache()
 {
   // Clear our cache.
   delete sNodeInfoPool;
--- a/content/base/src/nsNodeInfo.h
+++ b/content/base/src/nsNodeInfo.h
@@ -39,342 +39,52 @@
  * Class that represents a prefix/namespace/localName triple; a single
  * nodeinfo is shared by all elements in a document that have that
  * prefix, namespace, and localName.
  */
 
 #ifndef nsNodeInfo_h___
 #define nsNodeInfo_h___
 
+#include "nsINodeInfo.h"
 #include "nsNodeInfoManager.h"
 #include "plhash.h"
 #include "nsIAtom.h"
-#include "nsINameSpaceManager.h"
 #include "nsCOMPtr.h"
-#include "nsDOMString.h"
 
 class nsFixedSizeAllocator;
 
-class nsNodeInfo
+class nsNodeInfo : public nsINodeInfo
 {
 public:
-  NS_INLINE_DECL_REFCOUNTING_WITH_DESTROY(nsNodeInfo, LastRelease())
-  NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(nsNodeInfo)
+  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+  NS_DECL_CYCLE_COLLECTION_CLASS(nsNodeInfo)
+
+  // nsINodeInfo
+  virtual nsresult GetNamespaceURI(nsAString& aNameSpaceURI) const;
+  virtual bool NamespaceEquals(const nsAString& aNamespaceURI) const;
 
   // nsNodeInfo
   // Create objects with Create
+public:
   /*
    * aName and aOwnerManager may not be null.
    */
   static nsNodeInfo *Create(nsIAtom *aName, nsIAtom *aPrefix,
                             PRInt32 aNamespaceID, PRUint16 aNodeType,
                             nsIAtom *aExtraName,
                             nsNodeInfoManager *aOwnerManager);
-
-  /*
-   * Get the name from this node as a string, this does not include the prefix.
-   *
-   * For the HTML element "<body>" this will return "body" and for the XML
-   * element "<html:body>" this will return "body".
-   */
-  void GetName(nsAString& aName) const
-  {
-    mInner.mName->ToString(aName);
-  }
-
-  /*
-   * Get the name from this node as an atom, this does not include the prefix.
-   * This function never returns a null atom.
-   *
-   * For the HTML element "<body>" this will return the "body" atom and for
-   * the XML element "<html:body>" this will return the "body" atom.
-   */
-  nsIAtom* NameAtom() const
-  {
-    return mInner.mName;
-  }
-
-  /*
-   * Get the qualified name from this node as a string, the qualified name
-   * includes the prefix, if one exists.
-   *
-   * For the HTML element "<body>" this will return "body" and for the XML
-   * element "<html:body>" this will return "html:body".
-   */
-  const nsString& QualifiedName() const {
-    return mQualifiedName;
-  }
-
-  /*
-   * Returns the node's nodeName as defined in DOM Core
-   */
-  const nsString& NodeName() const {
-    return mNodeName;
-  }
-
-  /*
-   * Returns the node's localName as defined in DOM Core
-   */
-  const nsString& LocalName() const {
-    return mLocalName;
-  }
-
-  /*
-   * Get the prefix from this node as a string.
-   *
-   * For the HTML element "<body>" this will return a null string and for
-   * the XML element "<html:body>" this will return the string "html".
-   */
-  void GetPrefix(nsAString& aPrefix) const
-  {
-    if (mInner.mPrefix) {
-      mInner.mPrefix->ToString(aPrefix);
-    } else {
-      SetDOMStringToNull(aPrefix);
-    }
-  }
-
-  /*
-   * Get the prefix from this node as an atom.
-   *
-   * For the HTML element "<body>" this will return a null atom and for
-   * the XML element "<html:body>" this will return the "html" atom.
-   */
-  nsIAtom* GetPrefixAtom() const
-  {
-    return mInner.mPrefix;
-  }
-
-  /*
-   * Get the namespace URI for a node, if the node has a namespace URI.
-   */
-  nsresult GetNamespaceURI(nsAString& aNameSpaceURI) const;
-
-  /*
-   * Get the namespace ID for a node if the node has a namespace, if not this
-   * returns kNameSpaceID_None.
-   */
-  PRInt32 NamespaceID() const
-  {
-    return mInner.mNamespaceID;
-  }
-
-  /*
-   * Get the nodetype for the node. Returns the values specified in nsIDOMNode
-   * for nsIDOMNode.nodeType
-   */
-  PRUint16 NodeType() const
-  {
-    return mInner.mNodeType;
-  }
-
-  /*
-   * Get the extra name, used by PIs and DocTypes, for the node.
-   */
-  nsIAtom* GetExtraName() const
-  {
-    return mInner.mExtraName;
-  }
-
-  /*
-   * Get and set the ID attribute atom for this node.
-   * See http://www.w3.org/TR/1998/REC-xml-19980210#sec-attribute-types
-   * for the definition of an ID attribute.
-   *
-   */
-  nsIAtom* GetIDAttributeAtom() const
-  {
-    return mIDAttributeAtom;
-  }
-
-  void SetIDAttributeAtom(nsIAtom* aID)
-  {
-    mIDAttributeAtom = aID;
-  }
-
-  /**
-   * Get the owning node info manager. Only to be used inside Gecko, you can't
-   * really do anything with the pointer outside Gecko anyway.
-   */
-  nsNodeInfoManager *NodeInfoManager() const
-  {
-    return mOwnerManager;
-  }
-
-  /*
-   * Utility functions that can be used to check if a nodeinfo holds a specific
-   * name, name and prefix, name and prefix and namespace ID, or just
-   * namespace ID.
-   */
-  bool Equals(nsNodeInfo *aNodeInfo) const
-  {
-    return aNodeInfo == this || aNodeInfo->Equals(mInner.mName, mInner.mPrefix,
-                                                  mInner.mNamespaceID);
-  }
-
-  bool NameAndNamespaceEquals(nsNodeInfo *aNodeInfo) const
-  {
-    return aNodeInfo == this || aNodeInfo->Equals(mInner.mName,
-                                                  mInner.mNamespaceID);
-  }
-
-  bool Equals(nsIAtom *aNameAtom) const
-  {
-    return mInner.mName == aNameAtom;
-  }
-
-  bool Equals(nsIAtom *aNameAtom, nsIAtom *aPrefixAtom) const
-  {
-    return (mInner.mName == aNameAtom) && (mInner.mPrefix == aPrefixAtom);
-  }
-
-  bool Equals(nsIAtom *aNameAtom, PRInt32 aNamespaceID) const
-  {
-    return ((mInner.mName == aNameAtom) &&
-            (mInner.mNamespaceID == aNamespaceID));
-  }
-
-  bool Equals(nsIAtom *aNameAtom, nsIAtom *aPrefixAtom,
-              PRInt32 aNamespaceID) const
-  {
-    return ((mInner.mName == aNameAtom) &&
-            (mInner.mPrefix == aPrefixAtom) &&
-            (mInner.mNamespaceID == aNamespaceID));
-  }
-
-  bool NamespaceEquals(PRInt32 aNamespaceID) const
-  {
-    return mInner.mNamespaceID == aNamespaceID;
-  }
-
-  bool Equals(const nsAString& aName) const
-  {
-    return mInner.mName->Equals(aName);
-  }
-
-  bool Equals(const nsAString& aName, const nsAString& aPrefix) const
-  {
-    return mInner.mName->Equals(aName) &&
-      (mInner.mPrefix ? mInner.mPrefix->Equals(aPrefix) : aPrefix.IsEmpty());
-  }
-
-  bool Equals(const nsAString& aName, PRInt32 aNamespaceID) const
-  {
-    return mInner.mNamespaceID == aNamespaceID &&
-      mInner.mName->Equals(aName);
-  }
-
-  bool Equals(const nsAString& aName, const nsAString& aPrefix,
-                PRInt32 aNamespaceID) const
-  {
-    return mInner.mName->Equals(aName) && mInner.mNamespaceID == aNamespaceID &&
-      (mInner.mPrefix ? mInner.mPrefix->Equals(aPrefix) : aPrefix.IsEmpty());
-  }
-
-  bool NamespaceEquals(const nsAString& aNamespaceURI) const;
-
-  bool QualifiedNameEquals(nsIAtom* aNameAtom) const
-  {
-    NS_PRECONDITION(aNameAtom, "Must have name atom");
-    if (!GetPrefixAtom())
-      return Equals(aNameAtom);
-
-    return aNameAtom->Equals(mQualifiedName);
-  }
-
-  bool QualifiedNameEquals(const nsAString& aQualifiedName) const
-  {
-    return mQualifiedName == aQualifiedName;
-  }
-
-  /*
-   * Retrieve a pointer to the document that owns this node info.
-   */
-  nsIDocument* GetDocument() const
-  {
-    return mDocument;
-  }
-
-protected:
-  /*
-   * nsNodeInfoInner is used for two things:
-   *
-   *   1. as a member in nsNodeInfo for holding the name, prefix and
-   *      namespace ID
-   *   2. as the hash key in the hash table in nsNodeInfoManager
-   *
-   * nsNodeInfoInner does not do any kind of reference counting,
-   * that's up to the user of this class. Since nsNodeInfoInner is
-   * typically used as a member of nsNodeInfo, the hash table doesn't
-   * need to delete the keys. When the value (nsNodeInfo) is deleted
-   * the key is automatically deleted.
-   */
-
-  class nsNodeInfoInner
-  {
-  public:
-    nsNodeInfoInner()
-      : mName(nsnull), mPrefix(nsnull), mNamespaceID(kNameSpaceID_Unknown),
-        mNodeType(0), mNameString(nsnull), mExtraName(nsnull)
-    {
-    }
-    nsNodeInfoInner(nsIAtom *aName, nsIAtom *aPrefix, PRInt32 aNamespaceID,
-                    PRUint16 aNodeType, nsIAtom* aExtraName)
-      : mName(aName), mPrefix(aPrefix), mNamespaceID(aNamespaceID),
-        mNodeType(aNodeType), mNameString(nsnull), mExtraName(aExtraName)
-    {
-    }
-    nsNodeInfoInner(const nsAString& aTmpName, nsIAtom *aPrefix,
-                    PRInt32 aNamespaceID, PRUint16 aNodeType)
-      : mName(nsnull), mPrefix(aPrefix), mNamespaceID(aNamespaceID),
-        mNodeType(aNodeType), mNameString(&aTmpName), mExtraName(nsnull)
-    {
-    }
-
-    nsIAtom*            mName;
-    nsIAtom*            mPrefix;
-    PRInt32             mNamespaceID;
-    PRUint16            mNodeType; // As defined by nsIDOMNode.nodeType
-    const nsAString*    mNameString;
-    nsIAtom*            mExtraName; // Only used by PIs and DocTypes
-  };
-
-  // nsNodeInfoManager needs to pass mInner to the hash table.
-  friend class nsNodeInfoManager;
-
-  nsIDocument* mDocument; // Weak. Cache of mOwnerManager->mDocument
-
-  nsNodeInfoInner mInner;
-
-  nsCOMPtr<nsIAtom> mIDAttributeAtom;
-  nsNodeInfoManager* mOwnerManager; // Strong reference!
-
-  /*
-   * Members for various functions of mName+mPrefix that we can be
-   * asked to compute.
-   */
-
-  // Qualified name
-  nsString mQualifiedName;
-
-  // nodeName for the node.
-  nsString mNodeName;
-
-  // localName for the node. This is either equal to mInner.mName, or a
-  // void string, depending on mInner.mNodeType.
-  nsString mLocalName;
-
 private:
   nsNodeInfo(); // Unimplemented
   nsNodeInfo(const nsNodeInfo& aOther); // Unimplemented
   nsNodeInfo(nsIAtom *aName, nsIAtom *aPrefix, PRInt32 aNamespaceID,
              PRUint16 aNodeType, nsIAtom *aExtraName,
              nsNodeInfoManager *aOwnerManager);
 protected:
-  ~nsNodeInfo();
+  virtual ~nsNodeInfo();
 
 public:
   /**
    * Call before shutdown to clear the cache and free memory for this class.
    */
   static void ClearCache();
 
 private:
--- a/content/base/src/nsNodeInfoManager.cpp
+++ b/content/base/src/nsNodeInfoManager.cpp
@@ -68,38 +68,38 @@ using namespace mozilla;
 static PRLogModuleInfo* gNodeInfoManagerLeakPRLog;
 #endif
 
 PLHashNumber
 nsNodeInfoManager::GetNodeInfoInnerHashValue(const void *key)
 {
   NS_ASSERTION(key, "Null key passed to nsNodeInfo::GetHashValue!");
 
-  const nsNodeInfo::nsNodeInfoInner *node =
-    reinterpret_cast<const nsNodeInfo::nsNodeInfoInner *>(key);
+  const nsINodeInfo::nsNodeInfoInner *node =
+    reinterpret_cast<const nsINodeInfo::nsNodeInfoInner *>(key);
 
   if (node->mName) {
     // Ideally, we'd return node->mName->hash() here.  But that doesn't work at
     // the moment because node->mName->hash() is not the same as
     // HashString(*(node->mNameString)).  See bug 732815.
     return HashString(nsDependentAtomString(node->mName));
   }
   return HashString(*(node->mNameString));
 }
 
 
 PRIntn
 nsNodeInfoManager::NodeInfoInnerKeyCompare(const void *key1, const void *key2)
 {
   NS_ASSERTION(key1 && key2, "Null key passed to NodeInfoInnerKeyCompare!");
 
-  const nsNodeInfo::nsNodeInfoInner *node1 =
-    reinterpret_cast<const nsNodeInfo::nsNodeInfoInner *>(key1);
-  const nsNodeInfo::nsNodeInfoInner *node2 =
-    reinterpret_cast<const nsNodeInfo::nsNodeInfoInner *>(key2);
+  const nsINodeInfo::nsNodeInfoInner *node1 =
+    reinterpret_cast<const nsINodeInfo::nsNodeInfoInner *>(key1);
+  const nsINodeInfo::nsNodeInfoInner *node2 =
+    reinterpret_cast<const nsINodeInfo::nsNodeInfoInner *>(key2);
 
   if (node1->mPrefix != node2->mPrefix ||
       node1->mNamespaceID != node2->mNamespaceID ||
       node1->mNodeType != node2->mNodeType ||
       node1->mExtraName != node2->mExtraName) {
     return 0;
   }
 
@@ -208,17 +208,17 @@ nsNodeInfoManager::Init(nsIDocument *aDo
 
   return NS_OK;
 }
 
 // static
 PRIntn
 nsNodeInfoManager::DropNodeInfoDocument(PLHashEntry *he, PRIntn hashIndex, void *arg)
 {
-  static_cast<nsNodeInfo*>(he->value)->mDocument = nsnull;
+  static_cast<nsINodeInfo*>(he->value)->mDocument = nsnull;
   return HT_ENUMERATE_NEXT;
 }
 
 void
 nsNodeInfoManager::DropDocumentReference()
 {
   if (mBindingManager) {
     mBindingManager->DropDocumentReference();
@@ -227,77 +227,77 @@ nsNodeInfoManager::DropDocumentReference
   // This is probably not needed anymore.
   PL_HashTableEnumerateEntries(mNodeInfoHash, DropNodeInfoDocument, nsnull);
 
   NS_ASSERTION(!mNonDocumentNodeInfos, "Shouldn't have non-document nodeinfos!");
   mDocument = nsnull;
 }
 
 
-already_AddRefed<nsNodeInfo>
+already_AddRefed<nsINodeInfo>
 nsNodeInfoManager::GetNodeInfo(nsIAtom *aName, nsIAtom *aPrefix,
                                PRInt32 aNamespaceID, PRUint16 aNodeType,
                                nsIAtom* aExtraName /* = nsnull */)
 {
   CHECK_VALID_NODEINFO(aNodeType, aName, aNamespaceID, aExtraName);
 
-  nsNodeInfo::nsNodeInfoInner tmpKey(aName, aPrefix, aNamespaceID, aNodeType,
-                                     aExtraName);
+  nsINodeInfo::nsNodeInfoInner tmpKey(aName, aPrefix, aNamespaceID, aNodeType,
+                                      aExtraName);
 
   void *node = PL_HashTableLookup(mNodeInfoHash, &tmpKey);
 
   if (node) {
-    nsNodeInfo* nodeInfo = static_cast<nsNodeInfo *>(node);
+    nsINodeInfo* nodeInfo = static_cast<nsINodeInfo *>(node);
 
     NS_ADDREF(nodeInfo);
 
     return nodeInfo;
   }
 
   nsRefPtr<nsNodeInfo> newNodeInfo =
     nsNodeInfo::Create(aName, aPrefix, aNamespaceID, aNodeType, aExtraName,
                        this);
   NS_ENSURE_TRUE(newNodeInfo, nsnull);
   
   PLHashEntry *he;
   he = PL_HashTableAdd(mNodeInfoHash, &newNodeInfo->mInner, newNodeInfo);
   NS_ENSURE_TRUE(he, nsnull);
 
   // Have to do the swap thing, because already_AddRefed<nsNodeInfo>
-  // doesn't cast to already_AddRefed<nsNodeInfo>
+  // doesn't cast to already_AddRefed<nsINodeInfo>
   ++mNonDocumentNodeInfos;
   if (mNonDocumentNodeInfos == 1) {
     NS_IF_ADDREF(mDocument);
   }
 
   nsNodeInfo *nodeInfo = nsnull;
   newNodeInfo.swap(nodeInfo);
 
   return nodeInfo;
 }
 
 
 nsresult
 nsNodeInfoManager::GetNodeInfo(const nsAString& aName, nsIAtom *aPrefix,
                                PRInt32 aNamespaceID, PRUint16 aNodeType,
-                               nsNodeInfo** aNodeInfo)
+                               nsINodeInfo** aNodeInfo)
 {
 #ifdef DEBUG
   {
     nsCOMPtr<nsIAtom> nameAtom = do_GetAtom(aName);
     CHECK_VALID_NODEINFO(aNodeType, nameAtom, aNamespaceID, nsnull);
   }
 #endif
 
-  nsNodeInfo::nsNodeInfoInner tmpKey(aName, aPrefix, aNamespaceID, aNodeType);
+  nsINodeInfo::nsNodeInfoInner tmpKey(aName, aPrefix, aNamespaceID, aNodeType);
 
   void *node = PL_HashTableLookup(mNodeInfoHash, &tmpKey);
 
   if (node) {
-    nsNodeInfo* nodeInfo = static_cast<nsNodeInfo *>(node);
+    nsINodeInfo* nodeInfo = static_cast<nsINodeInfo *>(node);
 
     NS_ADDREF(*aNodeInfo = nodeInfo);
 
     return NS_OK;
   }
 
   
   nsCOMPtr<nsIAtom> nameAtom = do_GetAtom(aName);
@@ -322,60 +322,60 @@ nsNodeInfoManager::GetNodeInfo(const nsA
   return NS_OK;
 }
 
 
 nsresult
 nsNodeInfoManager::GetNodeInfo(const nsAString& aName, nsIAtom *aPrefix,
                                const nsAString& aNamespaceURI,
                                PRUint16 aNodeType,
-                               nsNodeInfo** aNodeInfo)
+                               nsINodeInfo** aNodeInfo)
 {
   PRInt32 nsid = kNameSpaceID_None;
 
   if (!aNamespaceURI.IsEmpty()) {
     nsresult rv = nsContentUtils::NameSpaceManager()->
       RegisterNameSpace(aNamespaceURI, nsid);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return GetNodeInfo(aName, aPrefix, nsid, aNodeType, aNodeInfo);
 }
 
-already_AddRefed<nsNodeInfo>
+already_AddRefed<nsINodeInfo>
 nsNodeInfoManager::GetTextNodeInfo()
 {
   if (!mTextNodeInfo) {
     mTextNodeInfo = GetNodeInfo(nsGkAtoms::textTagName, nsnull,
                                 kNameSpaceID_None,
                                 nsIDOMNode::TEXT_NODE, nsnull).get();
   }
   else {
     NS_ADDREF(mTextNodeInfo);
   }
 
   return mTextNodeInfo;
 }
 
-already_AddRefed<nsNodeInfo>
+already_AddRefed<nsINodeInfo>
 nsNodeInfoManager::GetCommentNodeInfo()
 {
   if (!mCommentNodeInfo) {
     mCommentNodeInfo = GetNodeInfo(nsGkAtoms::commentTagName, nsnull,
                                    kNameSpaceID_None,
                                    nsIDOMNode::COMMENT_NODE, nsnull).get();
   }
   else {
     NS_ADDREF(mCommentNodeInfo);
   }
 
   return mCommentNodeInfo;
 }
 
-already_AddRefed<nsNodeInfo>
+already_AddRefed<nsINodeInfo>
 nsNodeInfoManager::GetDocumentNodeInfo()
 {
   if (!mDocumentNodeInfo) {
     NS_ASSERTION(mDocument, "Should have mDocument!");
     mDocumentNodeInfo = GetNodeInfo(nsGkAtoms::documentNodeName, nsnull,
                                     kNameSpaceID_None,
                                     nsIDOMNode::DOCUMENT_NODE, nsnull).get();
     --mNonDocumentNodeInfos;
@@ -428,10 +428,10 @@ nsNodeInfoManager::RemoveNodeInfo(nsNode
     }
   }
 
 #ifdef DEBUG
   bool ret =
 #endif
   PL_HashTableRemove(mNodeInfoHash, &aNodeInfo->mInner);
 
-  NS_POSTCONDITION(ret, "Can't find nsNodeInfo to remove!!!");
+  NS_POSTCONDITION(ret, "Can't find nsINodeInfo to remove!!!");
 }
--- a/content/base/src/nsNodeInfoManager.h
+++ b/content/base/src/nsNodeInfoManager.h
@@ -43,16 +43,17 @@
 #define nsNodeInfoManager_h___
 
 #include "nsCOMPtr.h" // for already_AddRefed
 #include "plhash.h"
 #include "nsCycleCollectionParticipant.h"
 
 class nsIAtom;
 class nsIDocument;
+class nsINodeInfo;
 class nsNodeInfo;
 class nsIPrincipal;
 class nsIURI;
 class nsDocument;
 class nsIDOMDocumentType;
 class nsIDOMDocument;
 class nsAString;
 class nsIDOMNamedNodeMap;
@@ -78,41 +79,41 @@ public:
    * Release the reference to the document, this will be called when
    * the document is going away.
    */
   void DropDocumentReference();
 
   /**
    * Methods for creating nodeinfo's from atoms and/or strings.
    */
-  already_AddRefed<nsNodeInfo> GetNodeInfo(nsIAtom *aName, nsIAtom *aPrefix,
-                                           PRInt32 aNamespaceID,
-                                           PRUint16 aNodeType,
-                                           nsIAtom* aExtraName = nsnull);
+  already_AddRefed<nsINodeInfo> GetNodeInfo(nsIAtom *aName, nsIAtom *aPrefix,
+                                            PRInt32 aNamespaceID,
+                                            PRUint16 aNodeType,
+                                            nsIAtom* aExtraName = nsnull);
   nsresult GetNodeInfo(const nsAString& aName, nsIAtom *aPrefix,
                        PRInt32 aNamespaceID, PRUint16 aNodeType,
-                       nsNodeInfo** aNodeInfo);
+                       nsINodeInfo** aNodeInfo);
   nsresult GetNodeInfo(const nsAString& aName, nsIAtom *aPrefix,
                        const nsAString& aNamespaceURI, PRUint16 aNodeType,
-                       nsNodeInfo** aNodeInfo);
+                       nsINodeInfo** aNodeInfo);
 
   /**
    * Returns the nodeinfo for text nodes. Can return null if OOM.
    */
-  already_AddRefed<nsNodeInfo> GetTextNodeInfo();
+  already_AddRefed<nsINodeInfo> GetTextNodeInfo();
 
   /**
    * Returns the nodeinfo for comment nodes. Can return null if OOM.
    */
-  already_AddRefed<nsNodeInfo> GetCommentNodeInfo();
+  already_AddRefed<nsINodeInfo> GetCommentNodeInfo();
 
   /**
    * Returns the nodeinfo for the document node. Can return null if OOM.
    */
-  already_AddRefed<nsNodeInfo> GetDocumentNodeInfo();     
+  already_AddRefed<nsINodeInfo> GetDocumentNodeInfo();     
 
   /**
    * Retrieve a pointer to the document that owns this node info
    * manager.
    */
   nsIDocument* GetDocument() const
   {
     return mDocument;
@@ -156,17 +157,17 @@ private:
 
   PLHashTable *mNodeInfoHash;
   nsIDocument *mDocument; // WEAK
   PRUint32 mNonDocumentNodeInfos;
   nsIPrincipal *mPrincipal; // STRONG, but not nsCOMPtr to avoid include hell
                             // while inlining DocumentPrincipal().  Never null
                             // after Init() succeeds.
   nsCOMPtr<nsIPrincipal> mDefaultPrincipal; // Never null after Init() succeeds
-  nsNodeInfo *mTextNodeInfo; // WEAK to avoid circular ownership
-  nsNodeInfo *mCommentNodeInfo; // WEAK to avoid circular ownership
-  nsNodeInfo *mDocumentNodeInfo; // WEAK to avoid circular ownership
+  nsINodeInfo *mTextNodeInfo; // WEAK to avoid circular ownership
+  nsINodeInfo *mCommentNodeInfo; // WEAK to avoid circular ownership
+  nsINodeInfo *mDocumentNodeInfo; // WEAK to avoid circular ownership
   nsBindingManager* mBindingManager; // STRONG, but not nsCOMPtr to avoid
                                      // include hell while inlining
                                      // GetBindingManager().
 };
 
 #endif /* nsNodeInfoManager_h___ */
--- a/content/base/src/nsNodeUtils.cpp
+++ b/content/base/src/nsNodeUtils.cpp
@@ -451,18 +451,18 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNod
   if (aCx && (wrapper = aNode->GetWrapper())) {
       rv = xpc_MorphSlimWrapper(aCx, aNode);
       NS_ENSURE_SUCCESS(rv, rv);
   }
 
   nsNodeInfoManager *nodeInfoManager = aNewNodeInfoManager;
 
   // aNode.
-  nsNodeInfo *nodeInfo = aNode->mNodeInfo;
-  nsRefPtr<nsNodeInfo> newNodeInfo;
+  nsINodeInfo *nodeInfo = aNode->mNodeInfo;
+  nsCOMPtr<nsINodeInfo> newNodeInfo;
   if (nodeInfoManager) {
 
     // Don't allow importing/adopting nodes from non-privileged "scriptable"
     // documents to "non-scriptable" documents.
     nsIDocument* newDoc = nodeInfoManager->GetDocument();
     NS_ENSURE_STATE(newDoc);
     bool hasHadScriptHandlingObject = false;
     if (!newDoc->GetScriptHandlingObject(hasHadScriptHandlingObject) &&
--- a/content/base/src/nsStyledElement.h
+++ b/content/base/src/nsStyledElement.h
@@ -57,17 +57,17 @@ class StyleRule;
 
 typedef nsGenericElement nsStyledElementBase;
 
 class nsStyledElementNotElementCSSInlineStyle : public nsStyledElementBase
 {
 
 protected:
 
-  inline nsStyledElementNotElementCSSInlineStyle(already_AddRefed<nsNodeInfo> aNodeInfo)
+  inline nsStyledElementNotElementCSSInlineStyle(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsStyledElementBase(aNodeInfo)
   {}
 
 public:
   // nsIContent interface methods
   virtual nsIAtom* GetClassAttributeName() const;
   virtual nsIAtom* GetIDAttributeName() const;
   virtual nsIAtom* DoGetID() const;
@@ -107,14 +107,14 @@ protected:
    * string.  If aForceInDataDoc is true, will reparse even if we're in a data
    * document.
    */
   nsresult  ReparseStyleAttribute(bool aForceInDataDoc);
 };
 
 class nsStyledElement : public nsStyledElementNotElementCSSInlineStyle {
 protected:
-  inline nsStyledElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+  inline nsStyledElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsStyledElementNotElementCSSInlineStyle(aNodeInfo)
   {}
 };
 
 #endif // __NS_STYLEDELEMENT_H_
--- a/content/base/src/nsTextNode.cpp
+++ b/content/base/src/nsTextNode.cpp
@@ -56,17 +56,17 @@ using namespace mozilla::dom;
  * class used to implement attr() generated content
  */
 class nsAttributeTextNode : public nsTextNode,
                             public nsStubMutationObserver
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   
-  nsAttributeTextNode(already_AddRefed<nsNodeInfo> aNodeInfo,
+  nsAttributeTextNode(already_AddRefed<nsINodeInfo> aNodeInfo,
                       PRInt32 aNameSpaceID,
                       nsIAtom* aAttrName) :
     nsTextNode(aNodeInfo),
     mGrandparent(nsnull),
     mNameSpaceID(aNameSpaceID),
     mAttrName(aAttrName)
   {
     NS_ASSERTION(mNameSpaceID != kNameSpaceID_Unknown, "Must know namespace");
@@ -81,20 +81,20 @@ public:
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers);
   virtual void UnbindFromTree(bool aDeep = true,
                               bool aNullParent = true);
 
   NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
   NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
 
-  virtual nsGenericDOMDataNode *CloneDataNode(nsNodeInfo *aNodeInfo,
+  virtual nsGenericDOMDataNode *CloneDataNode(nsINodeInfo *aNodeInfo,
                                               bool aCloneText) const
   {
-    nsRefPtr<nsNodeInfo> ni = aNodeInfo;
+    nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
     nsAttributeTextNode *it = new nsAttributeTextNode(ni.forget(),
                                                       mNameSpaceID,
                                                       mAttrName);
     if (it && aCloneText) {
       it->mText = mText;
     }
 
     return it;
@@ -122,32 +122,32 @@ private:
 nsresult
 NS_NewTextNode(nsIContent** aInstancePtrResult,
                nsNodeInfoManager *aNodeInfoManager)
 {
   NS_PRECONDITION(aNodeInfoManager, "Missing nodeInfoManager");
 
   *aInstancePtrResult = nsnull;
 
-  nsRefPtr<nsNodeInfo> ni = aNodeInfoManager->GetTextNodeInfo();
+  nsCOMPtr<nsINodeInfo> ni = aNodeInfoManager->GetTextNodeInfo();
   if (!ni) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   nsTextNode *instance = new nsTextNode(ni.forget());
   if (!instance) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   NS_ADDREF(*aInstancePtrResult = instance);
 
   return NS_OK;
 }
 
-nsTextNode::nsTextNode(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsTextNode::nsTextNode(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericDOMDataNode(aNodeInfo)
 {
   NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::TEXT_NODE,
                     "Bad NodeType in aNodeInfo");
 }
 
 nsTextNode::~nsTextNode()
 {
@@ -168,19 +168,19 @@ NS_INTERFACE_MAP_END_INHERITING(nsGeneri
 
 bool
 nsTextNode::IsNodeOfType(PRUint32 aFlags) const
 {
   return !(aFlags & ~(eCONTENT | eTEXT | eDATA_NODE));
 }
 
 nsGenericDOMDataNode*
-nsTextNode::CloneDataNode(nsNodeInfo *aNodeInfo, bool aCloneText) const
+nsTextNode::CloneDataNode(nsINodeInfo *aNodeInfo, bool aCloneText) const
 {
-  nsRefPtr<nsNodeInfo> ni = aNodeInfo;
+  nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
   nsTextNode *it = new nsTextNode(ni.forget());
   if (it && aCloneText) {
     it->mText = mText;
   }
 
   return it;
 }
 
@@ -266,17 +266,17 @@ NS_NewAttributeContent(nsNodeInfoManager
                        nsIContent** aResult)
 {
   NS_PRECONDITION(aNodeInfoManager, "Missing nodeInfoManager");
   NS_PRECONDITION(aAttrName, "Must have an attr name");
   NS_PRECONDITION(aNameSpaceID != kNameSpaceID_Unknown, "Must know namespace");
   
   *aResult = nsnull;
 
-  nsRefPtr<nsNodeInfo> ni = aNodeInfoManager->GetTextNodeInfo();
+  nsCOMPtr<nsINodeInfo> ni = aNodeInfoManager->GetTextNodeInfo();
   if (!ni) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   nsAttributeTextNode* textNode = new nsAttributeTextNode(ni.forget(),
                                                           aNameSpaceID,
                                                           aAttrName);
   if (!textNode) {
--- a/content/base/src/nsTextNode.h
+++ b/content/base/src/nsTextNode.h
@@ -48,17 +48,17 @@
 
 /**
  * Class used to implement DOM text nodes
  */
 class nsTextNode : public nsGenericDOMDataNode,
                    public nsIDOMText
 {
 public:
-  nsTextNode(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsTextNode(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsTextNode();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericDOMDataNode::)
 
@@ -66,17 +66,17 @@ public:
   NS_FORWARD_NSIDOMCHARACTERDATA(nsGenericDOMDataNode::)
 
   // nsIDOMText
   NS_FORWARD_NSIDOMTEXT(nsGenericDOMDataNode::)
 
   // nsINode
   virtual bool IsNodeOfType(PRUint32 aFlags) const;
 
-  virtual nsGenericDOMDataNode* CloneDataNode(nsNodeInfo *aNodeInfo,
+  virtual nsGenericDOMDataNode* CloneDataNode(nsINodeInfo *aNodeInfo,
                                               bool aCloneText) const;
 
   void BindToAttribute(nsIAttribute* aAttr);
   void UnbindFromAttribute();
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   nsresult AppendTextForNormalize(const PRUnichar* aBuffer, PRUint32 aLength,
--- a/content/base/src/nsTreeSanitizer.cpp
+++ b/content/base/src/nsTreeSanitizer.cpp
@@ -1446,17 +1446,17 @@ nsTreeSanitizer::Sanitize(nsIDocument* a
 
 void
 nsTreeSanitizer::SanitizeChildren(nsINode* aRoot)
 {
   nsIContent* node = aRoot->GetFirstChild();
   while (node) {
     if (node->IsElement()) {
       mozilla::dom::Element* elt = node->AsElement();
-      nsNodeInfo* nodeInfo = node->NodeInfo();
+      nsINodeInfo* nodeInfo = node->NodeInfo();
       nsIAtom* localName = nodeInfo->NameAtom();
       PRInt32 ns = nodeInfo->NamespaceID();
 
       if (MustPrune(ns, localName, elt)) {
         nsIContent* next = node->GetNextNonChildNode(aRoot);
         node->GetParent()->RemoveChild(node);
         node = next;
         continue;
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -47,16 +47,17 @@
 #include "mozilla/dom/TabParent.h"
 
 #include "nsCOMPtr.h"
 #include "nsEventStateManager.h"
 #include "nsEventListenerManager.h"
 #include "nsIMEStateManager.h"
 #include "nsContentEventHandler.h"
 #include "nsIContent.h"
+#include "nsINodeInfo.h"
 #include "nsIDocument.h"
 #include "nsIFrame.h"
 #include "nsIWidget.h"
 #include "nsPresContext.h"
 #include "nsIPresShell.h"
 #include "nsDOMEvent.h"
 #include "nsGkAtoms.h"
 #include "nsIEditorDocShell.h"
--- a/content/events/src/nsXMLEventsElement.cpp
+++ b/content/events/src/nsXMLEventsElement.cpp
@@ -37,28 +37,28 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsXMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsIDocument.h"
 
 class nsXMLEventsElement : public nsXMLElement {
 public:
-  nsXMLEventsElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsXMLEventsElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsXMLEventsElement();
   NS_FORWARD_NSIDOMNODE(nsXMLElement::)
 
   virtual nsIAtom *GetIDAttributeName() const;
   virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, 
                            nsIAtom* aPrefix, const nsAString& aValue,
                            bool aNotify);
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 };
 
-nsXMLEventsElement::nsXMLEventsElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsXMLEventsElement::nsXMLEventsElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsXMLElement(aNodeInfo)
 {
 }
 
 nsXMLEventsElement::~nsXMLEventsElement()
 {
 }
 
@@ -81,17 +81,17 @@ nsXMLEventsElement::SetAttr(PRInt32 aNam
   return nsXMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
                                    aNotify);
 }
 
 NS_IMPL_ELEMENT_CLONE(nsXMLEventsElement)
 
 nsresult
 NS_NewXMLEventsElement(nsIContent** aInstancePtrResult,
-                       already_AddRefed<nsNodeInfo> aNodeInfo)
+                       already_AddRefed<nsINodeInfo> aNodeInfo)
 {
   nsXMLEventsElement* it = new nsXMLEventsElement(aNodeInfo);
   if (!it) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
   NS_ADDREF(*aInstancePtrResult = it);
   return NS_OK;
 }
--- a/content/events/src/nsXMLEventsManager.cpp
+++ b/content/events/src/nsXMLEventsManager.cpp
@@ -41,16 +41,17 @@
 #include "nsGkAtoms.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMEventTarget.h"
 #include "nsNetUtil.h"
 #include "nsIURL.h"
 #include "nsIDOMEventListener.h"
 #include "nsINameSpaceManager.h"
+#include "nsINodeInfo.h"
 #include "mozilla/dom/Element.h"
 
 using namespace mozilla::dom;
 
 bool nsXMLEventsListener::InitXMLEventsListener(nsIDocument * aDocument,
                                                   nsXMLEventsManager * aManager,
                                                   nsIContent * aContent)
 {
--- a/content/html/content/public/nsHTMLAudioElement.h
+++ b/content/html/content/public/nsHTMLAudioElement.h
@@ -45,17 +45,17 @@
 typedef PRUint16 nsMediaNetworkState;
 typedef PRUint16 nsMediaReadyState;
 
 class nsHTMLAudioElement : public nsHTMLMediaElement,
                            public nsIDOMHTMLAudioElement,
                            public nsIJSNativeInitializer
 {
 public:
-  nsHTMLAudioElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLAudioElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLAudioElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsHTMLMediaElement::)
 
@@ -70,15 +70,15 @@ public:
 
   // nsIDOMHTMLAudioElement
   NS_DECL_NSIDOMHTMLAUDIOELEMENT
 
   // nsIJSNativeInitializer
   NS_IMETHOD Initialize(nsISupports* aOwner, JSContext* aContext,
                         JSObject* aObj, PRUint32 argc, jsval* argv);
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual nsresult SetAcceptHeader(nsIHttpChannel* aChannel);
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 #endif
--- a/content/html/content/public/nsHTMLCanvasElement.h
+++ b/content/html/content/public/nsHTMLCanvasElement.h
@@ -60,17 +60,17 @@ class nsIDOMFile;
 class nsHTMLCanvasElement : public nsGenericHTMLElement,
                             public nsICanvasElementExternal,
                             public nsIDOMHTMLCanvasElement
 {
   typedef mozilla::layers::CanvasLayer CanvasLayer;
   typedef mozilla::layers::LayerManager LayerManager;
 
 public:
-  nsHTMLCanvasElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLCanvasElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLCanvasElement();
 
   static nsHTMLCanvasElement* FromContent(nsIContent* aPossibleCanvas)
   {
     if (!aPossibleCanvas || !aPossibleCanvas->IsHTML(nsGkAtoms::canvas)) {
       return nsnull;
     }
     return static_cast<nsHTMLCanvasElement*>(aPossibleCanvas);
@@ -157,17 +157,17 @@ public:
   nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
                    const nsAString& aValue, bool aNotify)
   {
     return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify);
   }
   virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
                            nsIAtom* aPrefix, const nsAString& aValue,
                            bool aNotify);
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   nsresult CopyInnerTo(nsGenericElement* aDest) const;
 
   /*
    * Helpers called by various users of Canvas
    */
 
   already_AddRefed<CanvasLayer> GetCanvasLayer(nsDisplayListBuilder* aBuilder,
                                                CanvasLayer *aOldLayer,
--- a/content/html/content/public/nsHTMLMediaElement.h
+++ b/content/html/content/public/nsHTMLMediaElement.h
@@ -71,17 +71,17 @@ public:
     CANPLAY_MAYBE,
     CANPLAY_YES
   };
 
   mozilla::CORSMode GetCORSMode() {
     return mCORSMode;
   }
 
-  nsHTMLMediaElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLMediaElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLMediaElement();
 
   /**
    * This is used when the browser is constructing a video element to play
    * a channel that we've already started loading. The src attribute and
    * <source> children are ignored.
    * @param aChannel the channel to use
    * @param aListener returns a stream listener that should receive
--- a/content/html/content/public/nsHTMLVideoElement.h
+++ b/content/html/content/public/nsHTMLVideoElement.h
@@ -40,17 +40,17 @@
 
 #include "nsIDOMHTMLVideoElement.h"
 #include "nsHTMLMediaElement.h"
 
 class nsHTMLVideoElement : public nsHTMLMediaElement,
                            public nsIDOMHTMLVideoElement
 {
 public:
-  nsHTMLVideoElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLVideoElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLVideoElement();
 
   static nsHTMLVideoElement* FromContent(nsIContent* aPossibleVideo)
   {
     if (!aPossibleVideo || !aPossibleVideo->IsHTML(nsGkAtoms::video)) {
       return NULL;
     }
     return static_cast<nsHTMLVideoElement*>(aPossibleVideo);
@@ -76,17 +76,17 @@ public:
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   // Returns the current video frame width and height.
   // If there is no video frame, returns the given default size.
   nsIntSize GetVideoSize(nsIntSize defaultSize);
 
   virtual nsresult SetAcceptHeader(nsIHttpChannel* aChannel);
 
   virtual nsXPCClassInfo* GetClassInfo();
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -124,32 +124,32 @@
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/FromParser.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 #include "nsThreadUtils.h"
 
-class nsNodeInfo;
+class nsINodeInfo;
 class nsIDOMNodeList;
 class nsRuleWalker;
 
 // XXX todo: add in missing out-of-memory checks
 
 //----------------------------------------------------------------------
 
 #ifdef GATHER_ELEMENT_USEAGE_STATISTICS
 
 // static objects that have constructors are kinda bad, but we don't
 // care here, this is only debugging code!
 
 static nsHashtable sGEUS_ElementCounts;
 
-void GEUS_ElementCreated(nsNodeInfo *aNodeInfo)
+void GEUS_ElementCreated(nsINodeInfo *aNodeInfo)
 {
   nsAutoString name;
   aNodeInfo->GetName(name);
 
   nsStringKey key(name);
 
   PRInt32 count = (PRInt32)sGEUS_ElementCounts.Get(&key);
 
@@ -173,17 +173,17 @@ void GEUS_DumpElementCounts()
   printf ("Element count statistics:\n");
 
   sGEUS_ElementCounts.Enumerate(GEUS_enum_func, nsnull);
 
   printf ("End of element count statistics:\n");
 }
 
 nsresult
-nsGenericHTMLElement::Init(nsNodeInfo *aNodeInfo)
+nsGenericHTMLElement::Init(nsINodeInfo *aNodeInfo)
 {
   GEUS_ElementCreated(aNodeInfo);
 
   return nsGenericHTMLElementBase::Init(aNodeInfo);
 }
 
 #endif
 
@@ -841,17 +841,17 @@ nsGenericHTMLElement::SetOuterHTML(const
   }
 
   nsCOMPtr<nsINode> context;
   if (parent->IsElement()) {
     context = parent;
   } else {
     NS_ASSERTION(parent->NodeType() == nsIDOMNode::DOCUMENT_FRAGMENT_NODE,
       "How come the parent isn't a document, a fragment or an element?");
-    nsRefPtr<nsNodeInfo> info =
+    nsCOMPtr<nsINodeInfo> info =
       OwnerDoc()->NodeInfoManager()->GetNodeInfo(nsGkAtoms::body,
                                                  nsnull,
                                                  kNameSpaceID_XHTML,
                                                  nsIDOMNode::ELEMENT_NODE);
     context = NS_NewHTMLBodyElement(info.forget(), FROM_PARSER_FRAGMENT);
   }
 
   nsCOMPtr<nsIDOMDocumentFragment> df;
@@ -2553,17 +2553,17 @@ nsGenericHTMLElement::GetContextMenu(nsI
     element.forget(aContextMenu);
   }
 
   return NS_OK;
 }
 
 //----------------------------------------------------------------------
 
-nsGenericHTMLFormElement::nsGenericHTMLFormElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsGenericHTMLFormElement::nsGenericHTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
   , mForm(nsnull)
   , mFieldSet(nsnull)
 {
   // We should add the NS_EVENT_STATE_ENABLED bit here as needed, but
   // that depends on our type, which is not initialized yet.  So we
   // have to do this in subclasses.
 }
--- a/content/html/content/src/nsGenericHTMLElement.h
+++ b/content/html/content/src/nsGenericHTMLElement.h
@@ -69,17 +69,17 @@ class nsIDOMHTMLMenuElement;
 typedef nsMappedAttributeElement nsGenericHTMLElementBase;
 
 /**
  * A common superclass for HTML elements
  */
 class nsGenericHTMLElement : public nsGenericHTMLElementBase
 {
 public:
-  nsGenericHTMLElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+  nsGenericHTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsGenericHTMLElementBase(aNodeInfo)
   {
     NS_ASSERTION(mNodeInfo->NamespaceID() == kNameSpaceID_XHTML,
                  "Unexpected namespace");
   }
 
   /** Typesafe, non-refcounting cast from nsIContent.  Cheaper than QI. **/
   static nsGenericHTMLElement* FromContent(nsIContent *aContent)
@@ -835,17 +835,17 @@ class nsHTMLFieldSetElement;
 
 /**
  * A helper class for form elements that can contain children
  */
 class nsGenericHTMLFormElement : public nsGenericHTMLElement,
                                  public nsIFormControl
 {
 public:
-  nsGenericHTMLFormElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsGenericHTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsGenericHTMLFormElement();
 
   NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
 
   virtual bool IsNodeOfType(PRUint32 aFlags) const;
   virtual void SaveSubtreeState();
 
   // nsIFormControl
@@ -1530,50 +1530,50 @@ PR_STATIC_ASSERT(ELEMENT_TYPE_SPECIFIC_B
     return _to GetOffsetHeight(aOffsetHeight); \
   }
 
 /**
  * A macro to declare the NS_NewHTMLXXXElement() functions.
  */
 #define NS_DECLARE_NS_NEW_HTML_ELEMENT(_elementName)                       \
 nsGenericHTMLElement*                                                      \
-NS_NewHTML##_elementName##Element(already_AddRefed<nsNodeInfo> aNodeInfo,  \
+NS_NewHTML##_elementName##Element(already_AddRefed<nsINodeInfo> aNodeInfo, \
                                   mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
 
 #define NS_DECLARE_NS_NEW_HTML_ELEMENT_AS_SHARED(_elementName)             \
 inline nsGenericHTMLElement*                                               \
-NS_NewHTML##_elementName##Element(already_AddRefed<nsNodeInfo> aNodeInfo,  \
+NS_NewHTML##_elementName##Element(already_AddRefed<nsINodeInfo> aNodeInfo, \
                                   mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER) \
 {                                                                          \
   return NS_NewHTMLSharedElement(aNodeInfo, aFromParser);                  \
 }
 
 /**
  * A macro to implement the NS_NewHTMLXXXElement() functions.
  */
 #define NS_IMPL_NS_NEW_HTML_ELEMENT(_elementName)                            \
 nsGenericHTMLElement*                                                        \
-NS_NewHTML##_elementName##Element(already_AddRefed<nsNodeInfo> aNodeInfo,    \
+NS_NewHTML##_elementName##Element(already_AddRefed<nsINodeInfo> aNodeInfo,   \
                                   mozilla::dom::FromParser aFromParser)      \
 {                                                                            \
   return new nsHTML##_elementName##Element(aNodeInfo);                       \
 }
 
 #define NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(_elementName)               \
 nsGenericHTMLElement*                                                        \
-NS_NewHTML##_elementName##Element(already_AddRefed<nsNodeInfo> aNodeInfo,    \
+NS_NewHTML##_elementName##Element(already_AddRefed<nsINodeInfo> aNodeInfo,   \
                                   mozilla::dom::FromParser aFromParser)      \
 {                                                                            \
   return new nsHTML##_elementName##Element(aNodeInfo, aFromParser);          \
 }
 
 // Here, we expand 'NS_DECLARE_NS_NEW_HTML_ELEMENT()' by hand.
 // (Calling the macro directly (with no args) produces compiler warnings.)
 nsGenericHTMLElement*
-NS_NewHTMLElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+NS_NewHTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                   mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
 
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Shared)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(SharedList)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(SharedObject)
 
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Anchor)
 NS_DECLARE_NS_NEW_HTML_ELEMENT(Area)
--- a/content/html/content/src/nsGenericHTMLFrameElement.h
+++ b/content/html/content/src/nsGenericHTMLFrameElement.h
@@ -13,17 +13,17 @@
 /**
  * A helper class for frame elements
  */
 class nsGenericHTMLFrameElement : public nsGenericHTMLElement,
                                   public nsIFrameLoaderOwner,
                                   public nsIMozBrowserFrame
 {
 public:
-  nsGenericHTMLFrameElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+  nsGenericHTMLFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                             mozilla::dom::FromParser aFromParser)
     : nsGenericHTMLElement(aNodeInfo)
     , mNetworkCreated(aFromParser == mozilla::dom::FROM_PARSER_NETWORK)
     , mBrowserFrameListenersRegistered(false)
   {
   }
 
   virtual ~nsGenericHTMLFrameElement();
--- a/content/html/content/src/nsHTMLAnchorElement.cpp
+++ b/content/html/content/src/nsHTMLAnchorElement.cpp
@@ -58,17 +58,17 @@ class nsHTMLAnchorElement : public nsGen
                             public nsIDOMHTMLAnchorElement,
                             public nsILink,
                             public Link
 {
 public:
   using nsGenericElement::GetText;
   using nsGenericElement::SetText;
 
-  nsHTMLAnchorElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLAnchorElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLAnchorElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -127,17 +127,17 @@ public:
                            bool aNotify);
   virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
                              bool aNotify);
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsEventStates IntrinsicState() const;
 
   virtual nsXPCClassInfo* GetClassInfo();
   
   virtual void OnDNSPrefetchDeferred();
   virtual void OnDNSPrefetchRequested();
   virtual bool HasDeferredDNSPrefetchRequest();
@@ -150,17 +150,17 @@ public:
 #define HTML_ANCHOR_DNS_PREFETCH_DEFERRED \
   (1 << (ELEMENT_TYPE_SPECIFIC_BITS_OFFSET+1))
 
 // Make sure we have enough space for those bits
 PR_STATIC_ASSERT(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET+1 < 32);
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Anchor)
 
-nsHTMLAnchorElement::nsHTMLAnchorElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLAnchorElement::nsHTMLAnchorElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
   , Link(this)
 {
 }
 
 nsHTMLAnchorElement::~nsHTMLAnchorElement()
 {
 }
--- a/content/html/content/src/nsHTMLAreaElement.cpp
+++ b/content/html/content/src/nsHTMLAreaElement.cpp
@@ -50,17 +50,17 @@
 using namespace mozilla::dom;
 
 class nsHTMLAreaElement : public nsGenericHTMLElement,
                           public nsIDOMHTMLAreaElement,
                           public nsILink,
                           public Link
 {
 public:
-  nsHTMLAreaElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLAreaElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLAreaElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // DOM memory reporter participant
   NS_DECL_SIZEOF_EXCLUDING_THIS
 
@@ -115,28 +115,28 @@ public:
     return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify);
   }
   virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
                            nsIAtom* aPrefix, const nsAString& aValue,
                            bool aNotify);
   virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
                              bool aNotify);
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsEventStates IntrinsicState() const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Area)
 
 
-nsHTMLAreaElement::nsHTMLAreaElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLAreaElement::nsHTMLAreaElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo),
     Link(this)
 {
 }
 
 nsHTMLAreaElement::~nsHTMLAreaElement()
 {
 }
--- a/content/html/content/src/nsHTMLAudioElement.cpp
+++ b/content/html/content/src/nsHTMLAudioElement.cpp
@@ -64,25 +64,25 @@
 
 #include "nsEventDispatcher.h"
 #include "nsIDOMProgressEvent.h"
 #include "nsContentUtils.h"
 
 using namespace mozilla::dom;
 
 nsGenericHTMLElement*
-NS_NewHTMLAudioElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+NS_NewHTMLAudioElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                        FromParser aFromParser)
 {
   /*
-   * nsHTMLAudioElement's will be created without a nsNodeInfo passed in
+   * nsHTMLAudioElement's will be created without a nsINodeInfo passed in
    * if someone says "var audio = new Audio();" in JavaScript, in a case like
-   * that we request the nsNodeInfo from the document's nodeinfo list.
+   * that we request the nsINodeInfo from the document's nodeinfo list.
    */
-  nsRefPtr<nsNodeInfo> nodeInfo(aNodeInfo);
+  nsCOMPtr<nsINodeInfo> nodeInfo(aNodeInfo);
   if (!nodeInfo) {
     nsCOMPtr<nsIDocument> doc =
       do_QueryInterface(nsContentUtils::GetDocumentFromCaller());
     NS_ENSURE_TRUE(doc, nsnull);
 
     nodeInfo = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::audio, nsnull,
                                                    kNameSpaceID_XHTML,
                                                    nsIDOMNode::ELEMENT_NODE);
@@ -102,17 +102,17 @@ NS_HTML_CONTENT_INTERFACE_TABLE3(nsHTMLA
                                  nsIDOMHTMLAudioElement, nsIJSNativeInitializer)
 NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLAudioElement,
                                                nsHTMLMediaElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLAudioElement)
 
 NS_IMPL_ELEMENT_CLONE(nsHTMLAudioElement)
 
 
-nsHTMLAudioElement::nsHTMLAudioElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLAudioElement::nsHTMLAudioElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsHTMLMediaElement(aNodeInfo)
 {
 }
 
 nsHTMLAudioElement::~nsHTMLAudioElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLBRElement.cpp
+++ b/content/html/content/src/nsHTMLBRElement.cpp
@@ -46,17 +46,17 @@
 #include "nsRuleData.h"
 
 using namespace mozilla;
 
 class nsHTMLBRElement : public nsGenericHTMLElement,
                         public nsIDOMHTMLBRElement
 {
 public:
-  nsHTMLBRElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLBRElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLBRElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -70,25 +70,25 @@ public:
   NS_DECL_NSIDOMHTMLBRELEMENT    
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(BR)
 
 
-nsHTMLBRElement::nsHTMLBRElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLBRElement::nsHTMLBRElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLBRElement::~nsHTMLBRElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLBodyElement.cpp
+++ b/content/html/content/src/nsHTMLBodyElement.cpp
@@ -87,17 +87,17 @@ public:
 
 class nsHTMLBodyElement : public nsGenericHTMLElement,
                           public nsIDOMHTMLBodyElement
 {
 public:
   using nsGenericElement::GetText;
   using nsGenericElement::SetText;
 
-  nsHTMLBodyElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLBodyElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLBodyElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -125,17 +125,17 @@ public:
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   virtual void UnbindFromTree(bool aDeep = true,
                               bool aNullParent = true);
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
   virtual already_AddRefed<nsIEditor> GetAssociatedEditor();
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual nsXPCClassInfo* GetClassInfo();
 private:
   nsresult GetColorHelper(nsIAtom* aAtom, nsAString& aColor);
 
 protected:
   BodyRule* mContentStyleRule;
 };
 
@@ -295,17 +295,17 @@ BodyRule::List(FILE* out, PRInt32 aInden
 #endif
 
 //----------------------------------------------------------------------
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Body)
 
 
-nsHTMLBodyElement::nsHTMLBodyElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLBodyElement::nsHTMLBodyElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo),
     mContentStyleRule(nsnull)
 {
 }
 
 nsHTMLBodyElement::~nsHTMLBodyElement()
 {
   if (mContentStyleRule) {
--- a/content/html/content/src/nsHTMLButtonElement.cpp
+++ b/content/html/content/src/nsHTMLButtonElement.cpp
@@ -81,17 +81,17 @@ static const nsAttrValue::EnumTable* kBu
 
 class nsHTMLButtonElement : public nsGenericHTMLFormElement,
                             public nsIDOMHTMLButtonElement,
                             public nsIConstraintValidation
 {
 public:
   using nsIConstraintValidation::GetValidationMessage;
 
-  nsHTMLButtonElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+  nsHTMLButtonElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                       FromParser aFromParser = NOT_FROM_PARSER);
   virtual ~nsHTMLButtonElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLFormElement::)
@@ -153,17 +153,17 @@ public:
   virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
 
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers);
   virtual void UnbindFromTree(bool aDeep = true,
                               bool aNullParent = true);
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual void DoneCreatingElement();
   virtual nsXPCClassInfo* GetClassInfo();
 
 protected:
   PRUint8 mType;
   bool mDisabledChanged;
   bool mInInternalActivate;
   bool mInhibitStateRestoration;
@@ -176,17 +176,17 @@ private:
 
 
 // Construction, destruction
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Button)
 
 
-nsHTMLButtonElement::nsHTMLButtonElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+nsHTMLButtonElement::nsHTMLButtonElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                                          FromParser aFromParser)
   : nsGenericHTMLFormElement(aNodeInfo),
     mType(kButtonDefaultType->value),
     mDisabledChanged(false),
     mInInternalActivate(false),
     mInhibitStateRestoration(!!(aFromParser & FROM_PARSER_FRAGMENT))
 {
   // <button> is always barred from constraint validation.
--- a/content/html/content/src/nsHTMLCanvasElement.cpp
+++ b/content/html/content/src/nsHTMLCanvasElement.cpp
@@ -64,23 +64,23 @@
 #define DEFAULT_CANVAS_WIDTH 300
 #define DEFAULT_CANVAS_HEIGHT 150
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::layers;
 
 nsGenericHTMLElement*
-NS_NewHTMLCanvasElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+NS_NewHTMLCanvasElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                         FromParser aFromParser)
 {
   return new nsHTMLCanvasElement(aNodeInfo);
 }
 
-nsHTMLCanvasElement::nsHTMLCanvasElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLCanvasElement::nsHTMLCanvasElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo), mWriteOnly(false)
 {
 }
 
 nsHTMLCanvasElement::~nsHTMLCanvasElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLDataListElement.cpp
+++ b/content/html/content/src/nsHTMLDataListElement.cpp
@@ -41,17 +41,17 @@
 #include "nsGkAtoms.h"
 #include "nsIDOMHTMLOptionElement.h"
 
 
 class nsHTMLDataListElement : public nsGenericHTMLElement,
                               public nsIDOMHTMLDataListElement
 {
 public:
-  nsHTMLDataListElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLDataListElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLDataListElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -59,17 +59,17 @@ public:
   NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLDataListElement
   NS_DECL_NSIDOMHTMLDATALISTELEMENT
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   // This function is used to generate the nsContentList (option elements).
   static bool MatchOptions(nsIContent* aContent, PRInt32 aNamespaceID,
                              nsIAtom* aAtom, void* aData);
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsHTMLDataListElement,
                                            nsGenericHTMLElement)
 
@@ -80,17 +80,17 @@ protected:
   // <option>'s list inside the datalist element.
   nsRefPtr<nsContentList> mOptions;
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(DataList)
 
 
-nsHTMLDataListElement::nsHTMLDataListElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLDataListElement::nsHTMLDataListElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLDataListElement::~nsHTMLDataListElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLDivElement.cpp
+++ b/content/html/content/src/nsHTMLDivElement.cpp
@@ -45,17 +45,17 @@
 #include "nsMappedAttributes.h"
 
 using namespace mozilla;
 
 class nsHTMLDivElement : public nsGenericHTMLElement,
                          public nsIDOMHTMLDivElement
 {
 public:
-  nsHTMLDivElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLDivElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLDivElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -69,26 +69,26 @@ public:
   NS_DECL_NSIDOMHTMLDIVELEMENT
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Div)
 
 
-nsHTMLDivElement::nsHTMLDivElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLDivElement::nsHTMLDivElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLDivElement::~nsHTMLDivElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLElement.cpp
+++ b/content/html/content/src/nsHTMLElement.cpp
@@ -41,17 +41,17 @@
 #include "nsContentUtils.h"
 
 using namespace mozilla::dom;
 
 class nsHTMLElement : public nsGenericHTMLElement,
                       public nsIDOMHTMLElement
 {
 public:
-  nsHTMLElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -75,31 +75,31 @@ public:
   NS_SCRIPTABLE NS_IMETHOD GetDraggable(bool* aDraggable) {
     return nsGenericHTMLElement::GetDraggable(aDraggable);
   }
   NS_SCRIPTABLE NS_IMETHOD GetInnerHTML(nsAString& aInnerHTML);
   NS_SCRIPTABLE NS_IMETHOD SetInnerHTML(const nsAString& aInnerHTML) {
     return nsGenericHTMLElement::SetInnerHTML(aInnerHTML);
   }
 
-  nsresult Clone(nsNodeInfo* aNodeInfo, nsINode** aResult) const;
+  nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 // Here, we expand 'NS_IMPL_NS_NEW_HTML_ELEMENT()' by hand.
 // (Calling the macro directly (with no args) produces compiler warnings.)
 nsGenericHTMLElement*
-NS_NewHTMLElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+NS_NewHTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                   FromParser aFromParser)
 {
   return new nsHTMLElement(aNodeInfo);
 }
 
-nsHTMLElement::nsHTMLElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLElement::nsHTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLElement::~nsHTMLElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLFieldSetElement.cpp
+++ b/content/html/content/src/nsHTMLFieldSetElement.cpp
@@ -43,17 +43,17 @@
 #include "nsIFormControl.h"
 #include "nsGUIEvent.h"
 #include "nsEventDispatcher.h"
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(FieldSet)
 
 
-nsHTMLFieldSetElement::nsHTMLFieldSetElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLFieldSetElement::nsHTMLFieldSetElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLFormElement(aNodeInfo)
   , mElements(nsnull)
   , mFirstLegend(nsnull)
 {
   // <fieldset> is always barred from constraint validation.
   SetBarredFromConstraintValidation(true);
 
   // We start out enabled
--- a/content/html/content/src/nsHTMLFieldSetElement.h
+++ b/content/html/content/src/nsHTMLFieldSetElement.h
@@ -45,17 +45,17 @@
 
 class nsHTMLFieldSetElement : public nsGenericHTMLFormElement,
                               public nsIDOMHTMLFieldSetElement,
                               public nsIConstraintValidation
 {
 public:
   using nsIConstraintValidation::GetValidationMessage;
 
-  nsHTMLFieldSetElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLFieldSetElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLFieldSetElement();
 
   /** Typesafe, non-refcounting cast from nsIContent.  Cheaper than QI. **/
   static nsHTMLFieldSetElement* FromContent(nsIContent* aContent)
   {
     if (!aContent || !aContent->IsHTML(nsGkAtoms::fieldset)) {
       return nsnull;
     }
@@ -85,17 +85,17 @@ public:
   virtual nsresult InsertChildAt(nsIContent* aChild, PRUint32 aIndex,
                                      bool aNotify);
   virtual nsresult RemoveChildAt(PRUint32 aIndex, bool aNotify);
 
   // nsIFormControl
   NS_IMETHOD_(PRUint32) GetType() const { return NS_FORM_FIELDSET; }
   NS_IMETHOD Reset();
   NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission);
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual nsXPCClassInfo* GetClassInfo();
 
   const nsIContent* GetFirstLegend() const { return mFirstLegend; }
 
   void AddElement(nsGenericHTMLFormElement* aElement) {
     mDependentElements.AppendElement(aElement);
   }
 
--- a/content/html/content/src/nsHTMLFontElement.cpp
+++ b/content/html/content/src/nsHTMLFontElement.cpp
@@ -50,17 +50,17 @@
 #include "nsAlgorithm.h"
 
 using namespace mozilla;
 
 class nsHTMLFontElement : public nsGenericHTMLElement,
                           public nsIDOMHTMLFontElement
 {
 public:
-  nsHTMLFontElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLFontElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLFontElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -74,25 +74,25 @@ public:
   NS_DECL_NSIDOMHTMLFONTELEMENT
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Font)
 
 
-nsHTMLFontElement::nsHTMLFontElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLFontElement::nsHTMLFontElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLFontElement::~nsHTMLFontElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLFormElement.cpp
+++ b/content/html/content/src/nsHTMLFormElement.cpp
@@ -227,32 +227,32 @@ ShouldBeInElements(nsIFormControl* aForm
 
   return false;
 }
 
 // nsHTMLFormElement implementation
 
 // construction, destruction
 nsGenericHTMLElement*
-NS_NewHTMLFormElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+NS_NewHTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                       FromParser aFromParser)
 {
   nsHTMLFormElement* it = new nsHTMLFormElement(aNodeInfo);
 
   nsresult rv = it->Init();
 
   if (NS_FAILED(rv)) {
     delete it;
     return nsnull;
   }
 
   return it;
 }
 
-nsHTMLFormElement::nsHTMLFormElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLFormElement::nsHTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo),
     mGeneratingSubmit(false),
     mGeneratingReset(false),
     mIsSubmitting(false),
     mDeferSubmission(false),
     mNotifiedObservers(false),
     mNotifiedObserversResult(false),
     mSubmitPopupState(openAbused),
--- a/content/html/content/src/nsHTMLFormElement.h
+++ b/content/html/content/src/nsHTMLFormElement.h
@@ -58,17 +58,17 @@ class nsIMutableArray;
 
 class nsHTMLFormElement : public nsGenericHTMLElement,
                           public nsIDOMHTMLFormElement,
                           public nsIWebProgressListener,
                           public nsIForm,
                           public nsIRadioGroupContainer
 {
 public:
-  nsHTMLFormElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLFormElement();
 
   nsresult Init();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
@@ -145,17 +145,17 @@ public:
                                 const nsAttrValue* aValue, bool aNotify);
 
   /**
    * Forget all information about the current submission (and the fact that we
    * are currently submitting at all).
    */
   void ForgetCurrentSubmission();
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLFormElement,
                                                      nsGenericHTMLElement)
 
   /**
    * Remove an element from this form's list of elements
    *
    * @param aElement the element to remove
--- a/content/html/content/src/nsHTMLFrameElement.cpp
+++ b/content/html/content/src/nsHTMLFrameElement.cpp
@@ -46,17 +46,17 @@
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 class nsHTMLFrameElement : public nsGenericHTMLFrameElement,
                            public nsIDOMHTMLFrameElement
 {
 public:
-  nsHTMLFrameElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+  nsHTMLFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                      mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
   virtual ~nsHTMLFrameElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLFrameElement::)
@@ -72,25 +72,25 @@ public:
 
   // nsIContent
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
   nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Frame)
 
 
-nsHTMLFrameElement::nsHTMLFrameElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+nsHTMLFrameElement::nsHTMLFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                                        FromParser aFromParser)
   : nsGenericHTMLFrameElement(aNodeInfo, aFromParser)
 {
 }
 
 nsHTMLFrameElement::~nsHTMLFrameElement()
 {
 }
--- a/content/html/content/src/nsHTMLFrameSetElement.cpp
+++ b/content/html/content/src/nsHTMLFrameSetElement.cpp
@@ -36,17 +36,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsHTMLFrameSetElement.h"
 #include "jsapi.h"
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(FrameSet)
 
 
-nsHTMLFrameSetElement::nsHTMLFrameSetElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLFrameSetElement::nsHTMLFrameSetElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo), mNumRows(0), mNumCols(0),
     mCurrentRowColHint(NS_STYLE_HINT_REFLOW)
 {
 }
 
 nsHTMLFrameSetElement::~nsHTMLFrameSetElement()
 {
 }
--- a/content/html/content/src/nsHTMLFrameSetElement.h
+++ b/content/html/content/src/nsHTMLFrameSetElement.h
@@ -75,17 +75,17 @@ struct nsFramesetSpec {
 #define NS_MAX_FRAMESET_SPEC_COUNT 16000
 
 //----------------------------------------------------------------------
 
 class nsHTMLFrameSetElement : public nsGenericHTMLElement,
                               public nsIDOMHTMLFrameSetElement
 {
 public:
-  nsHTMLFrameSetElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLFrameSetElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLFrameSetElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -139,17 +139,17 @@ public:
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
                                               PRInt32 aModType) const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual nsXPCClassInfo* GetClassInfo();
   static nsHTMLFrameSetElement* FromContent(nsIContent *aContent)
   {
     if (aContent->IsHTML(nsGkAtoms::frameset))
       return static_cast<nsHTMLFrameSetElement*>(aContent);
     return nsnull;
   }
 
--- a/content/html/content/src/nsHTMLHRElement.cpp
+++ b/content/html/content/src/nsHTMLHRElement.cpp
@@ -49,17 +49,17 @@
 #include "nsCSSProps.h"
 
 using namespace mozilla;
 
 class nsHTMLHRElement : public nsGenericHTMLElement,
                         public nsIDOMHTMLHRElement
 {
 public:
-  nsHTMLHRElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLHRElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLHRElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -73,25 +73,25 @@ public:
   NS_DECL_NSIDOMHTMLHRELEMENT
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(HR)
 
 
-nsHTMLHRElement::nsHTMLHRElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLHRElement::nsHTMLHRElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLHRElement::~nsHTMLHRElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLHeadingElement.cpp
+++ b/content/html/content/src/nsHTMLHeadingElement.cpp
@@ -47,17 +47,17 @@
 #include "mozAutoDocUpdate.h"
 
 using namespace mozilla;
 
 class nsHTMLHeadingElement : public nsGenericHTMLElement,
                              public nsIDOMHTMLHeadingElement
 {
 public:
-  nsHTMLHeadingElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLHeadingElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLHeadingElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -71,25 +71,25 @@ public:
   NS_DECL_NSIDOMHTMLHEADINGELEMENT
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
   nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Heading)
 
 
-nsHTMLHeadingElement::nsHTMLHeadingElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLHeadingElement::nsHTMLHeadingElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLHeadingElement::~nsHTMLHeadingElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLIFrameElement.cpp
+++ b/content/html/content/src/nsHTMLIFrameElement.cpp
@@ -52,17 +52,17 @@
 using namespace mozilla;
 using namespace mozilla::dom;
 
 class nsHTMLIFrameElement : public nsGenericHTMLFrameElement
                           , public nsIDOMHTMLIFrameElement
                           , public nsIDOMGetSVGDocument
 {
 public:
-  nsHTMLIFrameElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+  nsHTMLIFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                       mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
   virtual ~nsHTMLIFrameElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLFrameElement::)
@@ -82,25 +82,25 @@ public:
   // nsIContent
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(IFrame)
 
 
-nsHTMLIFrameElement::nsHTMLIFrameElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+nsHTMLIFrameElement::nsHTMLIFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                                          FromParser aFromParser)
   : nsGenericHTMLFrameElement(aNodeInfo, aFromParser)
 {
 }
 
 nsHTMLIFrameElement::~nsHTMLIFrameElement()
 {
 }
--- a/content/html/content/src/nsHTMLImageElement.cpp
+++ b/content/html/content/src/nsHTMLImageElement.cpp
@@ -83,17 +83,17 @@ using namespace mozilla::dom;
 // XXX nav attrs: suppress
 
 class nsHTMLImageElement : public nsGenericHTMLElement,
                            public nsImageLoadingContent,
                            public nsIDOMHTMLImageElement,
                            public nsIJSNativeInitializer
 {
 public:
-  nsHTMLImageElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLImageElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLImageElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -159,51 +159,51 @@ public:
   virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
                              bool aNotify);
 
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers);
 
   virtual nsEventStates IntrinsicState() const;
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   nsresult CopyInnerTo(nsGenericElement* aDest) const;
 
   void MaybeLoadImage();
   virtual nsXPCClassInfo* GetClassInfo();
 protected:
   nsSize GetWidthHeight();
 };
 
 nsGenericHTMLElement*
-NS_NewHTMLImageElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+NS_NewHTMLImageElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                        FromParser aFromParser)
 {
   /*
-   * nsHTMLImageElement's will be created without a nsNodeInfo passed in
+   * nsHTMLImageElement's will be created without a nsINodeInfo passed in
    * if someone says "var img = new Image();" in JavaScript, in a case like
-   * that we request the nsNodeInfo from the document's nodeinfo list.
+   * that we request the nsINodeInfo from the document's nodeinfo list.
    */
-  nsRefPtr<nsNodeInfo> nodeInfo(aNodeInfo);
+  nsCOMPtr<nsINodeInfo> nodeInfo(aNodeInfo);
   if (!nodeInfo) {
     nsCOMPtr<nsIDocument> doc =
       do_QueryInterface(nsContentUtils::GetDocumentFromCaller());
     NS_ENSURE_TRUE(doc, nsnull);
 
     nodeInfo = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::img, nsnull,
                                                    kNameSpaceID_XHTML,
                                                    nsIDOMNode::ELEMENT_NODE);
     NS_ENSURE_TRUE(nodeInfo, nsnull);
   }
 
   return new nsHTMLImageElement(nodeInfo.forget());
 }
 
-nsHTMLImageElement::nsHTMLImageElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLImageElement::nsHTMLImageElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
   // We start out broken
   AddStatesSilently(NS_EVENT_STATE_BROKEN);
 }
 
 nsHTMLImageElement::~nsHTMLImageElement()
 {
--- a/content/html/content/src/nsHTMLInputElement.cpp
+++ b/content/html/content/src/nsHTMLInputElement.cpp
@@ -546,17 +546,17 @@ static nsresult FireEventForAccessibilit
 #endif
 
 //
 // construction, destruction
 //
 
 NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Input)
 
-nsHTMLInputElement::nsHTMLInputElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+nsHTMLInputElement::nsHTMLInputElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                                        FromParser aFromParser)
   : nsGenericHTMLFormElement(aNodeInfo)
   , mType(kInputDefaultType->value)
   , mDisabledChanged(false)
   , mValueChanged(false)
   , mCheckedChanged(false)
   , mChecked(false)
   , mHandlingSelectEvent(false)
@@ -666,21 +666,21 @@ NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLInputElement)
 
 // nsIConstraintValidation
 NS_IMPL_NSICONSTRAINTVALIDATION_EXCEPT_SETCUSTOMVALIDITY(nsHTMLInputElement)
 
 // nsIDOMNode
 
 nsresult
-nsHTMLInputElement::Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const
+nsHTMLInputElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
 {
   *aResult = nsnull;
 
-  nsRefPtr<nsNodeInfo> ni = aNodeInfo;
+  nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
   nsRefPtr<nsHTMLInputElement> it =
     new nsHTMLInputElement(ni.forget(), NOT_FROM_PARSER);
 
   nsresult rv = CopyInnerTo(it);
   NS_ENSURE_SUCCESS(rv, rv);
 
   switch (mType) {
     case NS_FORM_INPUT_EMAIL:
--- a/content/html/content/src/nsHTMLInputElement.h
+++ b/content/html/content/src/nsHTMLInputElement.h
@@ -87,17 +87,17 @@ class nsHTMLInputElement : public nsGene
                            public nsITextControlElement,
                            public nsIPhonetic,
                            public nsIDOMNSEditableElement,
                            public nsIConstraintValidation
 {
 public:
   using nsIConstraintValidation::GetValidationMessage;
 
-  nsHTMLInputElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+  nsHTMLInputElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                      mozilla::dom::FromParser aFromParser);
   virtual ~nsHTMLInputElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLFormElement::)
@@ -214,17 +214,17 @@ public:
    * Helper function returning the currently selected button in the radio group.
    * Returning null if the element is not a button or if there is no selectied
    * button in the group.
    *
    * @return the selected button (or null).
    */
   already_AddRefed<nsIDOMHTMLInputElement> GetSelectedRadioButton();
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   NS_IMETHOD FireAsyncClickHandler();
 
   virtual void UpdateEditableState(bool aNotify)
   {
     return UpdateEditableFormControlState(aNotify);
   }
 
--- a/content/html/content/src/nsHTMLLIElement.cpp
+++ b/content/html/content/src/nsHTMLLIElement.cpp
@@ -46,17 +46,17 @@
 #include "nsRuleData.h"
 
 using namespace mozilla;
 
 class nsHTMLLIElement : public nsGenericHTMLElement,
                         public nsIDOMHTMLLIElement
 {
 public:
-  nsHTMLLIElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLLIElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLLIElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -70,25 +70,25 @@ public:
   NS_DECL_NSIDOMHTMLLIELEMENT
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(LI)
 
 
-nsHTMLLIElement::nsHTMLLIElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLLIElement::nsHTMLLIElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLLIElement::~nsHTMLLIElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLLabelElement.cpp
+++ b/content/html/content/src/nsHTMLLabelElement.cpp
@@ -56,17 +56,17 @@
 
 // construction, destruction
 
 using namespace mozilla::dom;
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Label)
 
 
-nsHTMLLabelElement::nsHTMLLabelElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLLabelElement::nsHTMLLabelElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLFormElement(aNodeInfo)
   , mHandlingEvent(false)
 {
 }
 
 nsHTMLLabelElement::~nsHTMLLabelElement()
 {
 }
--- a/content/html/content/src/nsHTMLLabelElement.h
+++ b/content/html/content/src/nsHTMLLabelElement.h
@@ -43,17 +43,17 @@
 
 #include "nsGenericHTMLElement.h"
 #include "nsIDOMHTMLLabelElement.h"
 
 class nsHTMLLabelElement : public nsGenericHTMLFormElement,
                            public nsIDOMHTMLLabelElement
 {
 public:
-  nsHTMLLabelElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLLabelElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLLabelElement();
 
   static nsHTMLLabelElement* FromContent(nsIContent* aPossibleLabel)
   {
     if (aPossibleLabel->IsHTML(nsGkAtoms::label)) {
       return static_cast<nsHTMLLabelElement*>(aPossibleLabel);
     }
 
@@ -117,17 +117,17 @@ public:
   }
   virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
                            nsIAtom* aPrefix, const nsAString& aValue,
                            bool aNotify);
   virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
                              bool aNotify);
   virtual void PerformAccesskey(bool aKeyCausesActivation,
                                 bool aIsTrustedEvent);
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   mozilla::dom::Element* GetLabeledElement();
 protected:
   mozilla::dom::Element* GetFirstDescendantFormControl();
 
   // XXX It would be nice if we could use an event flag instead.
--- a/content/html/content/src/nsHTMLLegendElement.cpp
+++ b/content/html/content/src/nsHTMLLegendElement.cpp
@@ -45,17 +45,17 @@
 #include "nsIDocument.h"
 #include "nsPIDOMWindow.h"
 #include "nsFocusManager.h"
 #include "nsIFrame.h"
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Legend)
 
 
-nsHTMLLegendElement::nsHTMLLegendElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLLegendElement::nsHTMLLegendElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLLegendElement::~nsHTMLLegendElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLLegendElement.h
+++ b/content/html/content/src/nsHTMLLegendElement.h
@@ -40,17 +40,17 @@
 
 #include "nsIDOMHTMLLegendElement.h"
 #include "nsGenericHTMLElement.h"
 
 class nsHTMLLegendElement : public nsGenericHTMLElement,
                             public nsIDOMHTMLLegendElement
 {
 public:
-  nsHTMLLegendElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLLegendElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLLegendElement();
 
   static nsHTMLLegendElement* FromContent(nsIContent *aContent)
   {
     if (aContent->IsHTML(nsGkAtoms::legend)) {
       return static_cast<nsHTMLLegendElement*>(aContent);
     }
     return nsnull;
@@ -111,17 +111,17 @@ public:
     return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify);
   }
   virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
                            nsIAtom* aPrefix, const nsAString& aValue,
                            bool aNotify);
   virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
                              bool aNotify);
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   mozilla::dom::Element *GetFormElement()
   {
     nsCOMPtr<nsIFormControl> fieldsetControl = do_QueryInterface(GetFieldSet());
 
     return fieldsetControl ? fieldsetControl->GetFormElement() : nsnull;
   }
 
--- a/content/html/content/src/nsHTMLLinkElement.cpp
+++ b/content/html/content/src/nsHTMLLinkElement.cpp
@@ -61,17 +61,17 @@ using namespace mozilla::dom;
 
 class nsHTMLLinkElement : public nsGenericHTMLElement,
                           public nsIDOMHTMLLinkElement,
                           public nsILink,
                           public nsStyleLinkElement,
                           public Link
 {
 public:
-  nsHTMLLinkElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLLinkElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLLinkElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -110,34 +110,34 @@ public:
 
   virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
   virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
   virtual bool IsLink(nsIURI** aURI) const;
   virtual void GetLinkTarget(nsAString& aTarget);
   virtual nsLinkState GetLinkState() const;
   virtual already_AddRefed<nsIURI> GetHrefURI() const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsEventStates IntrinsicState() const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 protected:
   virtual already_AddRefed<nsIURI> GetStyleSheetURL(bool* aIsInline);
   virtual void GetStyleSheetInfo(nsAString& aTitle,
                                  nsAString& aType,
                                  nsAString& aMedia,
                                  bool* aIsAlternate);
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Link)
 
 
-nsHTMLLinkElement::nsHTMLLinkElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLLinkElement::nsHTMLLinkElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo),
     Link(this)
 {
 }
 
 nsHTMLLinkElement::~nsHTMLLinkElement()
 {
 }
--- a/content/html/content/src/nsHTMLMapElement.cpp
+++ b/content/html/content/src/nsHTMLMapElement.cpp
@@ -44,48 +44,48 @@
 #include "nsIHTMLDocument.h"
 #include "nsCOMPtr.h"
 
 
 class nsHTMLMapElement : public nsGenericHTMLElement,
                          public nsIDOMHTMLMapElement
 {
 public:
-  nsHTMLMapElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLMapElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
   // nsIDOMElement
   NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLMapElement
   NS_DECL_NSIDOMHTMLMAPELEMENT
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLMapElement,
                                                      nsGenericHTMLElement)
 
   virtual nsXPCClassInfo* GetClassInfo();
 protected:
   nsRefPtr<nsContentList> mAreas;
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Map)
 
 
-nsHTMLMapElement::nsHTMLMapElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLMapElement::nsHTMLMapElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLMapElement)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLMapElement,
                                                   nsGenericHTMLElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mAreas,
--- a/content/html/content/src/nsHTMLMediaElement.cpp
+++ b/content/html/content/src/nsHTMLMediaElement.cpp
@@ -1415,17 +1415,17 @@ nsHTMLMediaElement::LookupMediaElementUR
       if (resource->CanClone()) {
         return elem;
       }
     }
   }
   return nsnull;
 }
 
-nsHTMLMediaElement::nsHTMLMediaElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLMediaElement::nsHTMLMediaElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo),
     mCurrentLoadID(0),
     mNetworkState(nsIDOMHTMLMediaElement::NETWORK_EMPTY),
     mReadyState(nsIDOMHTMLMediaElement::HAVE_NOTHING),
     mLoadWaitStatus(NOT_WAITING),
     mVolume(1.0),
     mChannels(0),
     mRate(0),
--- a/content/html/content/src/nsHTMLMenuElement.cpp
+++ b/content/html/content/src/nsHTMLMenuElement.cpp
@@ -65,17 +65,17 @@ enum SeparatorType
   ST_TRUE_INIT = -1,
   ST_FALSE = 0,
   ST_TRUE = 1
 };
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Menu)
 
 
-nsHTMLMenuElement::nsHTMLMenuElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLMenuElement::nsHTMLMenuElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo), mType(MENU_TYPE_LIST)
 {
 }
 
 nsHTMLMenuElement::~nsHTMLMenuElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLMenuElement.h
+++ b/content/html/content/src/nsHTMLMenuElement.h
@@ -38,17 +38,17 @@
 #include "nsIHTMLMenu.h"
 #include "nsGenericHTMLElement.h"
 
 class nsHTMLMenuElement : public nsGenericHTMLElement,
                           public nsIDOMHTMLMenuElement,
                           public nsIHTMLMenu
 {
 public:
-  nsHTMLMenuElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLMenuElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLMenuElement();
 
   /** Typesafe, non-refcounting cast from nsIContent.  Cheaper than QI. **/
   static nsHTMLMenuElement* FromContent(nsIContent* aContent)
   {
     if (aContent && aContent->IsHTML(nsGkAtoms::menu))
       return static_cast<nsHTMLMenuElement*>(aContent);
     return nsnull;
@@ -72,17 +72,17 @@ public:
   // nsIHTMLMenu
   NS_DECL_NSIHTMLMENU
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   PRUint8 GetType() const { return mType; }
 
 protected:
   static bool CanLoadIcon(nsIContent* aContent, const nsAString& aIcon);
 
--- a/content/html/content/src/nsHTMLMenuItemElement.cpp
+++ b/content/html/content/src/nsHTMLMenuItemElement.cpp
@@ -177,17 +177,17 @@ protected:
   bool mContinue1;
   bool mContinue2;
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(MenuItem)
 
 nsHTMLMenuItemElement::nsHTMLMenuItemElement(
-  already_AddRefed<nsNodeInfo> aNodeInfo, FromParser aFromParser)
+  already_AddRefed<nsINodeInfo> aNodeInfo, FromParser aFromParser)
   : nsGenericHTMLElement(aNodeInfo),
     mType(kMenuItemDefaultType->value),
     mParserCreating(false),
     mShouldInitChecked(false),
     mCheckedDirty(false),
     mChecked(false)
 {
   mParserCreating = aFromParser;
@@ -210,20 +210,20 @@ NS_INTERFACE_TABLE_HEAD(nsHTMLMenuItemEl
                                    nsIDOMHTMLCommandElement,
                                    nsIDOMHTMLMenuItemElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLMenuItemElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLMenuItemElement)
 
 //NS_IMPL_ELEMENT_CLONE(nsHTMLMenuItemElement)
 nsresult
-nsHTMLMenuItemElement::Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const
+nsHTMLMenuItemElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
 {
   *aResult = nsnull;
-  nsRefPtr<nsNodeInfo> ni = aNodeInfo;
+  nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
   nsRefPtr<nsHTMLMenuItemElement> it =
     new nsHTMLMenuItemElement(ni.forget(), NOT_FROM_PARSER);
   nsresult rv = CopyInnerTo(it);
   if (NS_SUCCEEDED(rv)) {
     switch (mType) {
       case CMD_TYPE_CHECKBOX:
       case CMD_TYPE_RADIO:
         if (mCheckedDirty) {
--- a/content/html/content/src/nsHTMLMenuItemElement.h
+++ b/content/html/content/src/nsHTMLMenuItemElement.h
@@ -40,17 +40,17 @@
 class Visitor;
 
 class nsHTMLMenuItemElement : public nsGenericHTMLElement,
                               public nsIDOMHTMLMenuItemElement
 {
 public:
   using nsGenericElement::GetText;
 
-  nsHTMLMenuItemElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+  nsHTMLMenuItemElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                         mozilla::dom::FromParser aFromParser);
   virtual ~nsHTMLMenuItemElement();
 
   /** Typesafe, non-refcounting cast from nsIContent.  Cheaper than QI. **/
   static nsHTMLMenuItemElement* FromContent(nsIContent* aContent)
   {
     if (aContent && aContent->IsHTML(nsGkAtoms::menuitem)) {
       return static_cast<nsHTMLMenuItemElement*>(aContent);
@@ -85,17 +85,17 @@ public:
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
 
   virtual void DoneCreatingElement();
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   PRUint8 GetType() const { return mType; }
 
   /**
    * Syntax sugar to make it easier to check for checked and checked dirty
    */
--- a/content/html/content/src/nsHTMLMetaElement.cpp
+++ b/content/html/content/src/nsHTMLMetaElement.cpp
@@ -42,17 +42,17 @@
 #include "nsAsyncDOMEvent.h"
 #include "nsContentUtils.h"
 
 
 class nsHTMLMetaElement : public nsGenericHTMLElement,
                           public nsIDOMHTMLMetaElement
 {
 public:
-  nsHTMLMetaElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLMetaElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLMetaElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -67,26 +67,26 @@ public:
 
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers);
   virtual void UnbindFromTree(bool aDeep = true,
                               bool aNullParent = true);
   void CreateAndDispatchEvent(nsIDocument* aDoc, const nsAString& aEventName);
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Meta)
 
 
-nsHTMLMetaElement::nsHTMLMetaElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLMetaElement::nsHTMLMetaElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLMetaElement::~nsHTMLMetaElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLModElement.cpp
+++ b/content/html/content/src/nsHTMLModElement.cpp
@@ -41,17 +41,17 @@
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 
 class nsHTMLModElement : public nsGenericHTMLElement,
                          public nsIDOMHTMLModElement
 {
 public:
-  nsHTMLModElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLModElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLModElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -59,25 +59,25 @@ public:
   NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLModElement
   NS_DECL_NSIDOMHTMLMODELEMENT
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Mod)
 
-nsHTMLModElement::nsHTMLModElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLModElement::nsHTMLModElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLModElement::~nsHTMLModElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLOListElement.cpp
+++ b/content/html/content/src/nsHTMLOListElement.cpp
@@ -50,17 +50,17 @@
 using namespace mozilla;
 
 class nsHTMLSharedListElement : public nsGenericHTMLElement,
                                 public nsIDOMHTMLOListElement,
                                 public nsIDOMHTMLDListElement,
                                 public nsIDOMHTMLUListElement
 {
 public:
-  nsHTMLSharedListElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLSharedListElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLSharedListElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -80,29 +80,29 @@ public:
   // fully declared by NS_DECL_NSIDOMHTMLOLISTELEMENT
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual nsXPCClassInfo* GetClassInfo()
   {
     return static_cast<nsXPCClassInfo*>(GetClassInfoInternal());
   }
   nsIClassInfo* GetClassInfoInternal();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(SharedList)
 
 
-nsHTMLSharedListElement::nsHTMLSharedListElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLSharedListElement::nsHTMLSharedListElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLSharedListElement::~nsHTMLSharedListElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLObjectElement.cpp
+++ b/content/html/content/src/nsHTMLObjectElement.cpp
@@ -61,17 +61,17 @@ class nsHTMLObjectElement : public nsGen
                           , public nsObjectLoadingContent
                           , public nsIDOMHTMLObjectElement
                           , public nsIConstraintValidation
                           , public nsIDOMGetSVGDocument
 {
 public:
   using nsIConstraintValidation::GetValidationMessage;
 
-  nsHTMLObjectElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+  nsHTMLObjectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                       mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
   virtual ~nsHTMLObjectElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLFormElement::)
@@ -140,17 +140,17 @@ public:
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom *aAttribute) const;
   virtual nsEventStates IntrinsicState() const;
   virtual void DestroyContent();
 
   // nsObjectLoadingContent
   virtual PRUint32 GetCapabilities() const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   nsresult CopyInnerTo(nsGenericElement* aDest) const;
 
   void StartObjectLoad() { StartObjectLoad(true); }
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLObjectElement,
                                                      nsGenericHTMLFormElement)
 
@@ -169,17 +169,17 @@ private:
 
   bool mIsDoneAddingChildren;
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Object)
 
 
-nsHTMLObjectElement::nsHTMLObjectElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+nsHTMLObjectElement::nsHTMLObjectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                                          FromParser aFromParser)
   : nsGenericHTMLFormElement(aNodeInfo),
     mIsDoneAddingChildren(!aFromParser)
 {
   RegisterFreezableElement();
   SetIsNetworkCreated(aFromParser == FROM_PARSER_NETWORK);
 
   // <object> is always barred from constraint validation.
--- a/content/html/content/src/nsHTMLOptGroupElement.cpp
+++ b/content/html/content/src/nsHTMLOptGroupElement.cpp
@@ -49,17 +49,17 @@
 
 /**
  * The implementation of &lt;optgroup&gt;
  */
 class nsHTMLOptGroupElement : public nsGenericHTMLElement,
                               public nsIDOMHTMLOptGroupElement
 {
 public:
-  nsHTMLOptGroupElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLOptGroupElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLOptGroupElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -77,17 +77,17 @@ public:
                                  bool aNotify);
   virtual nsresult RemoveChildAt(PRUint32 aIndex, bool aNotify);
 
   // nsIContent
   virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
 
   virtual nsEventStates IntrinsicState() const;
  
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual bool IsDisabled() const {
     return HasAttr(kNameSpaceID_None, nsGkAtoms::disabled);
   }
 protected:
 
@@ -97,17 +97,17 @@ protected:
    */
   nsIContent* GetSelect();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(OptGroup)
 
 
-nsHTMLOptGroupElement::nsHTMLOptGroupElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLOptGroupElement::nsHTMLOptGroupElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
   // We start off enabled
   AddStatesSilently(NS_EVENT_STATE_ENABLED);
 }
 
 nsHTMLOptGroupElement::~nsHTMLOptGroupElement()
 {
--- a/content/html/content/src/nsHTMLOptionElement.cpp
+++ b/content/html/content/src/nsHTMLOptionElement.cpp
@@ -65,40 +65,40 @@
 
 using namespace mozilla::dom;
 
 /**
  * Implementation of &lt;option&gt;
  */
 
 nsGenericHTMLElement*
-NS_NewHTMLOptionElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+NS_NewHTMLOptionElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                         FromParser aFromParser)
 {
   /*
-   * nsHTMLOptionElement's will be created without a nsNodeInfo passed in
+   * nsHTMLOptionElement's will be created without a nsINodeInfo passed in
    * if someone says "var opt = new Option();" in JavaScript, in a case like
-   * that we request the nsNodeInfo from the document's nodeinfo list.
+   * that we request the nsINodeInfo from the document's nodeinfo list.
    */
-  nsRefPtr<nsNodeInfo> nodeInfo(aNodeInfo);
+  nsCOMPtr<nsINodeInfo> nodeInfo(aNodeInfo);
   if (!nodeInfo) {
     nsCOMPtr<nsIDocument> doc =
       do_QueryInterface(nsContentUtils::GetDocumentFromCaller());
     NS_ENSURE_TRUE(doc, nsnull);
 
     nodeInfo = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::option, nsnull,
                                                    kNameSpaceID_XHTML,
                                                    nsIDOMNode::ELEMENT_NODE);
     NS_ENSURE_TRUE(nodeInfo, nsnull);
   }
 
   return new nsHTMLOptionElement(nodeInfo.forget());
 }
 
-nsHTMLOptionElement::nsHTMLOptionElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLOptionElement::nsHTMLOptionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo),
     mSelectedChanged(false),
     mIsSelected(false),
     mIsInSetDefaultSelected(false)
 {
   // We start off enabled
   AddStatesSilently(NS_EVENT_STATE_ENABLED);
 }
--- a/content/html/content/src/nsHTMLOptionElement.h
+++ b/content/html/content/src/nsHTMLOptionElement.h
@@ -47,17 +47,17 @@
 
 class nsHTMLSelectElement;
 
 class nsHTMLOptionElement : public nsGenericHTMLElement,
                             public nsIDOMHTMLOptionElement,
                             public nsIJSNativeInitializer
 {
 public:
-  nsHTMLOptionElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLOptionElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLOptionElement();
 
   /** Typesafe, non-refcounting cast from nsIContent.  Cheaper than QI. **/
   static nsHTMLOptionElement* FromContent(nsIContent *aContent)
   {
     if (aContent && aContent->IsHTML(nsGkAtoms::option))
       return static_cast<nsHTMLOptionElement*>(aContent);
     return nsnull;
@@ -94,17 +94,17 @@ public:
                                  const nsAttrValueOrString* aValue,
                                  bool aNotify);
 
   void SetSelectedInternal(bool aValue, bool aNotify);
 
   // nsIContent
   virtual nsEventStates IntrinsicState() const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   nsresult CopyInnerTo(nsGenericElement* aDest) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual bool IsDisabled() const {
     return HasAttr(kNameSpaceID_None, nsGkAtoms::disabled);
   }
--- a/content/html/content/src/nsHTMLOutputElement.cpp
+++ b/content/html/content/src/nsHTMLOutputElement.cpp
@@ -49,17 +49,17 @@
 class nsHTMLOutputElement : public nsGenericHTMLFormElement,
                             public nsIDOMHTMLOutputElement,
                             public nsStubMutationObserver,
                             public nsIConstraintValidation
 {
 public:
   using nsIConstraintValidation::GetValidationMessage;
 
-  nsHTMLOutputElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLOutputElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLOutputElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLFormElement::)
 
@@ -74,17 +74,17 @@ public:
 
   // nsIFormControl
   NS_IMETHOD_(PRUint32) GetType() const { return NS_FORM_OUTPUT; }
   NS_IMETHOD Reset();
   NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission);
 
   virtual bool IsDisabled() const { return false; }
 
-  nsresult Clone(nsNodeInfo* aNodeInfo, nsINode** aResult) const;
+  nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const;
 
   bool ParseAttribute(PRInt32 aNamespaceID, nsIAtom* aAttribute,
                         const nsAString& aValue, nsAttrValue& aResult);
 
   nsEventStates IntrinsicState() const;
 
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                                nsIContent* aBindingParent,
@@ -114,17 +114,17 @@ protected:
   nsString                          mDefaultValue;
   nsRefPtr<nsDOMSettableTokenList>  mTokenList;
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Output)
 
 
-nsHTMLOutputElement::nsHTMLOutputElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLOutputElement::nsHTMLOutputElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLFormElement(aNodeInfo)
   , mValueModeFlag(eModeDefault)
 {
   AddMutationObserver(this);
 
   // We start out valid and ui-valid (since we have no form).
   AddStatesSilently(NS_EVENT_STATE_VALID | NS_EVENT_STATE_MOZ_UI_VALID);
 }
--- a/content/html/content/src/nsHTMLParagraphElement.cpp
+++ b/content/html/content/src/nsHTMLParagraphElement.cpp
@@ -48,17 +48,17 @@
 using namespace mozilla;
 
 // XXX missing nav attributes
 
 class nsHTMLParagraphElement : public nsGenericHTMLElement,
                                public nsIDOMHTMLParagraphElement
 {
 public:
-  nsHTMLParagraphElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLParagraphElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLParagraphElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -73,26 +73,26 @@ public:
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Paragraph)
 
 
-nsHTMLParagraphElement::nsHTMLParagraphElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLParagraphElement::nsHTMLParagraphElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLParagraphElement::~nsHTMLParagraphElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLPreElement.cpp
+++ b/content/html/content/src/nsHTMLPreElement.cpp
@@ -46,17 +46,17 @@
 #include "nsRuleData.h"
 
 using namespace mozilla;
 
 class nsHTMLPreElement : public nsGenericHTMLElement,
                          public nsIDOMHTMLPreElement
 {
 public:
-  nsHTMLPreElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLPreElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLPreElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -72,26 +72,26 @@ public:
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Pre)
 
 
-nsHTMLPreElement::nsHTMLPreElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLPreElement::nsHTMLPreElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLPreElement::~nsHTMLPreElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLProgressElement.cpp
+++ b/content/html/content/src/nsHTMLProgressElement.cpp
@@ -40,17 +40,17 @@
 #include "nsAttrValue.h"
 #include "nsEventStateManager.h"
 
 
 class nsHTMLProgressElement : public nsGenericHTMLFormElement,
                               public nsIDOMHTMLProgressElement
 {
 public:
-  nsHTMLProgressElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLProgressElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLProgressElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLFormElement::)
 
@@ -65,17 +65,17 @@ public:
 
   // nsIFormControl
   NS_IMETHOD_(PRUint32) GetType() const { return NS_FORM_PROGRESS; }
   NS_IMETHOD Reset();
   NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission);
 
   nsEventStates IntrinsicState() const;
 
-  nsresult Clone(nsNodeInfo* aNodeInfo, nsINode** aResult) const;
+  nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const;
 
   bool ParseAttribute(PRInt32 aNamespaceID, nsIAtom* aAttribute,
                         const nsAString& aValue, nsAttrValue& aResult);
 
   virtual nsXPCClassInfo* GetClassInfo();
 
 protected:
   /**
@@ -94,17 +94,17 @@ protected:
 
 const double nsHTMLProgressElement::kIndeterminatePosition = -1.0;
 const double nsHTMLProgressElement::kDefaultValue          =  0.0;
 const double nsHTMLProgressElement::kDefaultMax            =  1.0;
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Progress)
 
 
-nsHTMLProgressElement::nsHTMLProgressElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLProgressElement::nsHTMLProgressElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLFormElement(aNodeInfo)
 {
   // We start out indeterminate
   AddStatesSilently(NS_EVENT_STATE_INDETERMINATE);
 }
 
 nsHTMLProgressElement::~nsHTMLProgressElement()
 {
--- a/content/html/content/src/nsHTMLScriptElement.cpp
+++ b/content/html/content/src/nsHTMLScriptElement.cpp
@@ -63,17 +63,17 @@ using namespace mozilla::dom;
 class nsHTMLScriptElement : public nsGenericHTMLElement,
                             public nsIDOMHTMLScriptElement,
                             public nsScriptElement
 {
 public:
   using nsGenericElement::GetText;
   using nsGenericElement::SetText;
 
-  nsHTMLScriptElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+  nsHTMLScriptElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                       FromParser aFromParser);
   virtual ~nsHTMLScriptElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
@@ -115,33 +115,33 @@ public:
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers);
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                               nsIAtom* aAttribute,
                               const nsAString& aValue,
                               nsAttrValue& aResult);
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   // nsGenericElement
   virtual nsresult AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
                                 const nsAttrValue* aValue, bool aNotify);
 
   virtual nsXPCClassInfo* GetClassInfo();
 protected:
   // nsScriptElement
   virtual bool HasScriptContent();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Script)
 
 
-nsHTMLScriptElement::nsHTMLScriptElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+nsHTMLScriptElement::nsHTMLScriptElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                                          FromParser aFromParser)
   : nsGenericHTMLElement(aNodeInfo)
   , nsScriptElement(aFromParser)
 {
   AddMutationObserver(this);
 }
 
 nsHTMLScriptElement::~nsHTMLScriptElement()
@@ -196,21 +196,21 @@ nsHTMLScriptElement::ParseAttribute(PRIn
     return true;
   }
 
   return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
                                               aResult);
 }
 
 nsresult
-nsHTMLScriptElement::Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const
+nsHTMLScriptElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
 {
   *aResult = nsnull;
 
-  nsRefPtr<nsNodeInfo> ni = aNodeInfo;
+  nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
   nsHTMLScriptElement* it =
     new nsHTMLScriptElement(ni.forget(), NOT_FROM_PARSER);
 
   nsCOMPtr<nsINode> kungFuDeathGrip = it;
   nsresult rv = CopyInnerTo(it);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // The clone should be marked evaluated if we are.
--- a/content/html/content/src/nsHTMLSelectElement.cpp
+++ b/content/html/content/src/nsHTMLSelectElement.cpp
@@ -133,17 +133,17 @@ nsSafeOptionListMutation::~nsSafeOptionL
 // nsHTMLSelectElement
 //
 
 // construction, destruction
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Select)
 
-nsHTMLSelectElement::nsHTMLSelectElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+nsHTMLSelectElement::nsHTMLSelectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                                          FromParser aFromParser)
   : nsGenericHTMLFormElement(aNodeInfo),
     mOptions(new nsHTMLOptionCollection(this)),
     mIsDoneAddingChildren(!aFromParser),
     mDisabledChanged(false),
     mMutating(false),
     mInhibitStateRestoration(!!(aFromParser & FROM_PARSER_FRAGMENT)),
     mSelectionHasChanged(false),
@@ -774,17 +774,17 @@ nsHTMLSelectElement::SetLength(PRUint32 
       rv = Remove(i - 1);
     }
   } else if (aLength > curlen) {
     if (aLength > MAX_DYNAMIC_SELECT_LENGTH) {
       return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
     }
     
     // This violates the W3C DOM but we do this for backwards compatibility
-    nsRefPtr<nsNodeInfo> nodeInfo;
+    nsCOMPtr<nsINodeInfo> nodeInfo;
 
     nsContentUtils::NameChanged(mNodeInfo, nsGkAtoms::option,
                                 getter_AddRefs(nodeInfo));
 
     nsCOMPtr<nsIContent> element = NS_NewHTMLOptionElement(nodeInfo.forget());
     if (!element) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
--- a/content/html/content/src/nsHTMLSelectElement.h
+++ b/content/html/content/src/nsHTMLSelectElement.h
@@ -240,17 +240,17 @@ private:
  */
 class nsHTMLSelectElement : public nsGenericHTMLFormElement,
                             public nsIDOMHTMLSelectElement,
                             public nsIConstraintValidation
 {
 public:
   using nsIConstraintValidation::GetValidationMessage;
 
-  nsHTMLSelectElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+  nsHTMLSelectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                       mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
   virtual ~nsHTMLSelectElement();
 
   /** Typesafe, non-refcounting cast from nsIContent.  Cheaper than QI. **/
   static nsHTMLSelectElement* FromContent(nsIContent* aContent)
   {
     if (aContent && aContent->IsHTML(nsGkAtoms::select))
       return static_cast<nsHTMLSelectElement*>(aContent);
@@ -410,17 +410,17 @@ public:
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
                                               PRInt32 aModType) const;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLSelectElement,
                                                      nsGenericHTMLFormElement)
 
   nsHTMLOptionCollection *GetOptions()
   {
     return mOptions;
   }
--- a/content/html/content/src/nsHTMLSharedElement.cpp
+++ b/content/html/content/src/nsHTMLSharedElement.cpp
@@ -60,17 +60,17 @@ class nsHTMLSharedElement : public nsGen
                             public nsIDOMHTMLParamElement,
                             public nsIDOMHTMLBaseElement,
                             public nsIDOMHTMLDirectoryElement,
                             public nsIDOMHTMLQuoteElement,
                             public nsIDOMHTMLHeadElement,
                             public nsIDOMHTMLHtmlElement
 {
 public:
-  nsHTMLSharedElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLSharedElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLSharedElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -120,29 +120,29 @@ public:
                               bool aCompileEventHandlers);
 
   virtual void UnbindFromTree(bool aDeep = true,
                               bool aNullParent = true);
 
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo()
   {
     return static_cast<nsXPCClassInfo*>(GetClassInfoInternal());
   }
   nsIClassInfo* GetClassInfoInternal();
 };
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Shared)
 
 
-nsHTMLSharedElement::nsHTMLSharedElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLSharedElement::nsHTMLSharedElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLSharedElement::~nsHTMLSharedElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLSharedObjectElement.cpp
+++ b/content/html/content/src/nsHTMLSharedObjectElement.cpp
@@ -57,17 +57,17 @@ using namespace mozilla::dom;
 
 class nsHTMLSharedObjectElement : public nsGenericHTMLElement
                                 , public nsObjectLoadingContent
                                 , public nsIDOMHTMLAppletElement
                                 , public nsIDOMHTMLEmbedElement
                                 , public nsIDOMGetSVGDocument
 {
 public:
-  nsHTMLSharedObjectElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+  nsHTMLSharedObjectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                             mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
   virtual ~nsHTMLSharedObjectElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
@@ -132,17 +132,17 @@ public:
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom *aAttribute) const;
   virtual nsEventStates IntrinsicState() const;
   virtual void DestroyContent();
 
   // nsObjectLoadingContent
   virtual PRUint32 GetCapabilities() const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   nsresult CopyInnerTo(nsGenericElement* aDest) const;
 
   void StartObjectLoad() { StartObjectLoad(true); }
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLSharedObjectElement,
                                                      nsGenericHTMLElement)
 
@@ -181,17 +181,17 @@ private:
   // always true for <embed>, per the documentation in nsIContent.h.
   bool mIsDoneAddingChildren;
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(SharedObject)
 
 
-nsHTMLSharedObjectElement::nsHTMLSharedObjectElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+nsHTMLSharedObjectElement::nsHTMLSharedObjectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                                                      FromParser aFromParser)
   : nsGenericHTMLElement(aNodeInfo),
     mIsDoneAddingChildren(mNodeInfo->Equals(nsGkAtoms::embed) || !aFromParser)
 {
   RegisterFreezableElement();
   SetIsNetworkCreated(aFromParser == FROM_PARSER_NETWORK);
 
   // By default we're in the loading state
--- a/content/html/content/src/nsHTMLSourceElement.cpp
+++ b/content/html/content/src/nsHTMLSourceElement.cpp
@@ -45,17 +45,17 @@
 #include "nsHTMLMediaElement.h"
 #include "nsCOMPtr.h"
 #include "nsThreadUtils.h"
 
 class nsHTMLSourceElement : public nsGenericHTMLElement,
                             public nsIDOMHTMLSourceElement
 {
 public:
-  nsHTMLSourceElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLSourceElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLSourceElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -63,32 +63,32 @@ public:
   NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLSourceElement
   NS_DECL_NSIDOMHTMLSOURCEELEMENT
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   // Override BindToTree() so that we can trigger a load when we add a
   // child source element.
   virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent,
                               nsIContent *aBindingParent,
                               bool aCompileEventHandlers);
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Source)
 
 
-nsHTMLSourceElement::nsHTMLSourceElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLSourceElement::nsHTMLSourceElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLSourceElement::~nsHTMLSourceElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLSpanElement.cpp
+++ b/content/html/content/src/nsHTMLSpanElement.cpp
@@ -41,41 +41,41 @@
 #include "nsStyleConsts.h"
 #include "nsIAtom.h"
 #include "nsRuleData.h"
 
 class nsHTMLSpanElement : public nsGenericHTMLElement,
                           public nsIDOMHTMLElement
 {
 public:
-  nsHTMLSpanElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLSpanElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLSpanElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
   // nsIDOMElement
   NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Span)
 
 
-nsHTMLSpanElement::nsHTMLSpanElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLSpanElement::nsHTMLSpanElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLSpanElement::~nsHTMLSpanElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLStyleElement.cpp
+++ b/content/html/content/src/nsHTMLStyleElement.cpp
@@ -51,17 +51,17 @@
 #include "nsContentUtils.h"
 
 class nsHTMLStyleElement : public nsGenericHTMLElement,
                            public nsIDOMHTMLStyleElement,
                            public nsStyleLinkElement,
                            public nsStubMutationObserver
 {
 public:
-  nsHTMLStyleElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLStyleElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLStyleElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -102,17 +102,17 @@ public:
     return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify);
   }
   virtual nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
                            nsIAtom* aPrefix, const nsAString& aValue,
                            bool aNotify);
   virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
                              bool aNotify);
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   // nsIMutationObserver
   NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
 
   virtual nsXPCClassInfo* GetClassInfo();
@@ -129,17 +129,17 @@ protected:
    */
   void ContentChanged(nsIContent* aContent);
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Style)
 
 
-nsHTMLStyleElement::nsHTMLStyleElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLStyleElement::nsHTMLStyleElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
   AddMutationObserver(this);
 }
 
 nsHTMLStyleElement::~nsHTMLStyleElement()
 {
 }
--- a/content/html/content/src/nsHTMLTableCaptionElement.cpp
+++ b/content/html/content/src/nsHTMLTableCaptionElement.cpp
@@ -46,17 +46,17 @@
 #include "nsRuleData.h"
 
 using namespace mozilla;
 
 class nsHTMLTableCaptionElement :  public nsGenericHTMLElement,
                                    public nsIDOMHTMLTableCaptionElement
 {
 public:
-  nsHTMLTableCaptionElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLTableCaptionElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLTableCaptionElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -71,26 +71,26 @@ public:
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(TableCaption)
 
 
-nsHTMLTableCaptionElement::nsHTMLTableCaptionElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLTableCaptionElement::nsHTMLTableCaptionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLTableCaptionElement::~nsHTMLTableCaptionElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLTableCellElement.cpp
+++ b/content/html/content/src/nsHTMLTableCellElement.cpp
@@ -53,17 +53,17 @@
 #include "celldata.h"
 
 using namespace mozilla;
 
 class nsHTMLTableCellElement : public nsGenericHTMLElement,
                                public nsIDOMHTMLTableCellElement
 {
 public:
-  nsHTMLTableCellElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLTableCellElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLTableCellElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -79,30 +79,30 @@ public:
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 protected:
   nsHTMLTableElement* GetTable() const;
 
   already_AddRefed<nsIDOMHTMLTableRowElement> GetRow() const;
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(TableCell)
 
 
-nsHTMLTableCellElement::nsHTMLTableCellElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLTableCellElement::nsHTMLTableCellElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLTableCellElement::~nsHTMLTableCellElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLTableColElement.cpp
+++ b/content/html/content/src/nsHTMLTableColElement.cpp
@@ -50,17 +50,17 @@ using namespace mozilla;
 // use the same protection as ancient code did 
 // http://lxr.mozilla.org/classic/source/lib/layout/laytable.c#46
 #define MAX_COLSPAN 1000
 
 class nsHTMLTableColElement : public nsGenericHTMLElement,
                               public nsIDOMHTMLTableColElement
 {
 public:
-  nsHTMLTableColElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLTableColElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLTableColElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -75,26 +75,26 @@ public:
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(TableCol)
 
 
-nsHTMLTableColElement::nsHTMLTableColElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLTableColElement::nsHTMLTableColElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLTableColElement::~nsHTMLTableColElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLTableElement.cpp
+++ b/content/html/content/src/nsHTMLTableElement.cpp
@@ -322,17 +322,17 @@ TableRowsCollection::ParentDestroyed()
 
 /* -------------------------- nsHTMLTableElement --------------------------- */
 // the class declaration is at the top of this file
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Table)
 
 
-nsHTMLTableElement::nsHTMLTableElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLTableElement::nsHTMLTableElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo),
     mTableInheritedAttributes(TABLE_ATTRS_DIRTY)
 {
 }
 
 nsHTMLTableElement::~nsHTMLTableElement()
 {
   if (mRows) {
@@ -546,17 +546,17 @@ nsHTMLTableElement::CreateTHead(nsIDOMHT
 
   nsRefPtr<nsIDOMHTMLTableSectionElement> head = GetTHead();
   if (head) {
     // return the existing thead
     head.forget(aValue);
     return NS_OK;
   }
 
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   nsContentUtils::NameChanged(mNodeInfo, nsGkAtoms::thead,
                               getter_AddRefs(nodeInfo));
 
   nsCOMPtr<nsIContent> newHead =
     NS_NewHTMLTableSectionElement(nodeInfo.forget());
 
   if (!newHead) {
     return NS_OK;
@@ -596,17 +596,17 @@ nsHTMLTableElement::CreateTFoot(nsIDOMHT
 
   nsRefPtr<nsIDOMHTMLTableSectionElement> foot = GetTFoot();
   if (foot) {
     // return the existing tfoot
     foot.forget(aValue);
     return NS_OK;
   }
   // create a new foot rowgroup
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   nsContentUtils::NameChanged(mNodeInfo, nsGkAtoms::tfoot,
                               getter_AddRefs(nodeInfo));
 
   nsCOMPtr<nsIContent> newFoot = NS_NewHTMLTableSectionElement(nodeInfo.forget());
 
   if (!newFoot) {
     return NS_OK;
   }
@@ -638,17 +638,17 @@ nsHTMLTableElement::CreateCaption(nsIDOM
 
   if (nsRefPtr<nsIDOMHTMLTableCaptionElement> caption = GetCaption()) {
     // return the existing caption
     caption.forget(aValue);
     return NS_OK;
   }
 
   // create a new head rowgroup
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   nsContentUtils::NameChanged(mNodeInfo, nsGkAtoms::caption,
                               getter_AddRefs(nodeInfo));
 
   nsCOMPtr<nsIContent> newCaption = NS_NewHTMLTableCaptionElement(nodeInfo.forget());
 
   if (!newCaption) {
     return NS_OK;
   }
@@ -715,17 +715,17 @@ nsHTMLTableElement::InsertRow(PRInt32 aI
 
     nsCOMPtr<nsIDOMNode> refRow;
     rows->Item(refIndex, getter_AddRefs(refRow));
 
     nsCOMPtr<nsIDOMNode> parent;
 
     refRow->GetParentNode(getter_AddRefs(parent));
     // create the row
-    nsRefPtr<nsNodeInfo> nodeInfo;
+    nsCOMPtr<nsINodeInfo> nodeInfo;
     nsContentUtils::NameChanged(mNodeInfo, nsGkAtoms::tr,
                                 getter_AddRefs(nodeInfo));
 
     nsCOMPtr<nsIContent> newRow = NS_NewHTMLTableRowElement(nodeInfo.forget());
 
     if (newRow) {
       nsCOMPtr<nsIDOMNode> newRowNode(do_QueryInterface(newRow));
       nsCOMPtr<nsIDOMNode> retChild;
@@ -751,46 +751,46 @@ nsHTMLTableElement::InsertRow(PRInt32 aI
   } else {
     // the row count was 0, so 
     // find the first row group and insert there as first child
     nsCOMPtr<nsIDOMNode> rowGroup;
 
     for (nsIContent* child = nsINode::GetFirstChild();
          child;
          child = child->GetNextSibling()) {
-      nsNodeInfo *childInfo = child->NodeInfo();
+      nsINodeInfo *childInfo = child->NodeInfo();
       nsIAtom *localName = childInfo->NameAtom();
       if (childInfo->NamespaceID() == kNameSpaceID_XHTML &&
           (localName == nsGkAtoms::thead ||
            localName == nsGkAtoms::tbody ||
            localName == nsGkAtoms::tfoot)) {
         rowGroup = do_QueryInterface(child);
         NS_ASSERTION(rowGroup, "HTML node did not QI to nsIDOMNode");
         break;
       }
     }
 
     if (!rowGroup) { // need to create a TBODY
-      nsRefPtr<nsNodeInfo> nodeInfo;
+      nsCOMPtr<nsINodeInfo> nodeInfo;
       nsContentUtils::NameChanged(mNodeInfo, nsGkAtoms::tbody,
                                   getter_AddRefs(nodeInfo));
 
       nsCOMPtr<nsIContent> newRowGroup =
         NS_NewHTMLTableSectionElement(nodeInfo.forget());
 
       if (newRowGroup) {
         rv = AppendChildTo(newRowGroup, true);
         NS_ENSURE_SUCCESS(rv, rv);
 
         rowGroup = do_QueryInterface(newRowGroup);
       }
     }
 
     if (rowGroup) {
-      nsRefPtr<nsNodeInfo> nodeInfo;
+      nsCOMPtr<nsINodeInfo> nodeInfo;
       nsContentUtils::NameChanged(mNodeInfo, nsGkAtoms::tr,
                                   getter_AddRefs(nodeInfo));
 
       nsCOMPtr<nsIContent> newRow = NS_NewHTMLTableRowElement(nodeInfo.forget());
       if (newRow) {
         nsCOMPtr<nsIDOMNode> firstRow;
 
         nsCOMPtr<nsIDOMHTMLTableSectionElement> section =
--- a/content/html/content/src/nsHTMLTableElement.h
+++ b/content/html/content/src/nsHTMLTableElement.h
@@ -42,17 +42,17 @@
 
 
 class TableRowsCollection;
 
 class nsHTMLTableElement :  public nsGenericHTMLElement,
                             public nsIDOMHTMLTableElement
 {
 public:
-  nsHTMLTableElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLTableElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLTableElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -67,17 +67,17 @@ public:
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers);
   virtual void UnbindFromTree(bool aDeep = true,
                               bool aNullParent = true);
   /**
--- a/content/html/content/src/nsHTMLTableRowElement.cpp
+++ b/content/html/content/src/nsHTMLTableRowElement.cpp
@@ -53,17 +53,17 @@
 #include "nsContentUtils.h"
 
 using namespace mozilla;
 
 class nsHTMLTableRowElement : public nsGenericHTMLElement,
                               public nsIDOMHTMLTableRowElement
 {
 public:
-  nsHTMLTableRowElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLTableRowElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
   // nsIDOMElement
@@ -77,34 +77,34 @@ public:
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLTableRowElement,
                                                      nsGenericHTMLElement)
 
 protected:
   nsresult GetSection(nsIDOMHTMLTableSectionElement** aSection);
   nsresult GetTable(nsIDOMHTMLTableElement** aTable);
   nsRefPtr<nsContentList> mCells;
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(TableRow)
 
 
-nsHTMLTableRowElement::nsHTMLTableRowElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLTableRowElement::nsHTMLTableRowElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLTableRowElement)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLTableRowElement,
                                                   nsGenericHTMLElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mCells,
@@ -276,17 +276,17 @@ nsHTMLTableRowElement::InsertCell(PRInt3
       cells->GetLength(&cellCount);
       if (aIndex > PRInt32(cellCount)) {
         return NS_ERROR_DOM_INDEX_SIZE_ERR;
       }
     }
   }
 
   // create the cell
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   nsContentUtils::NameChanged(mNodeInfo, nsGkAtoms::td,
                               getter_AddRefs(nodeInfo));
 
   nsCOMPtr<nsIContent> cellContent = NS_NewHTMLTableCellElement(nodeInfo.forget());
   if (!cellContent) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
--- a/content/html/content/src/nsHTMLTableSectionElement.cpp
+++ b/content/html/content/src/nsHTMLTableSectionElement.cpp
@@ -53,17 +53,17 @@
 using namespace mozilla;
 
 // you will see the phrases "rowgroup" and "section" used interchangably
 
 class nsHTMLTableSectionElement : public nsGenericHTMLElement,
                                   public nsIDOMHTMLTableSectionElement
 {
 public:
-  nsHTMLTableSectionElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
   // nsIDOMElement
@@ -77,31 +77,31 @@ public:
 
   virtual bool ParseAttribute(PRInt32 aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLTableSectionElement,
                                                      nsGenericHTMLElement)
 
   virtual nsXPCClassInfo* GetClassInfo();
 protected:
   nsRefPtr<nsContentList> mRows;
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(TableSection)
 
 
-nsHTMLTableSectionElement::nsHTMLTableSectionElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLTableSectionElement::nsHTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLTableSectionElement)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLTableSectionElement,
                                                   nsGenericHTMLElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mRows,
@@ -166,17 +166,17 @@ nsHTMLTableSectionElement::InsertRow(PRI
 
   if (aIndex > (PRInt32)rowCount) {
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
   }
 
   bool doInsert = (aIndex < PRInt32(rowCount)) && (aIndex != -1);
 
   // create the row
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   nsContentUtils::NameChanged(mNodeInfo, nsGkAtoms::tr,
                               getter_AddRefs(nodeInfo));
 
   nsCOMPtr<nsIContent> rowContent = NS_NewHTMLTableRowElement(nodeInfo.forget());
   if (!rowContent) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
--- a/content/html/content/src/nsHTMLTextAreaElement.cpp
+++ b/content/html/content/src/nsHTMLTextAreaElement.cpp
@@ -93,17 +93,17 @@ class nsHTMLTextAreaElement : public nsG
                               public nsITextControlElement,
                               public nsIDOMNSEditableElement,
                               public nsStubMutationObserver,
                               public nsIConstraintValidation
 {
 public:
   using nsIConstraintValidation::GetValidationMessage;
 
-  nsHTMLTextAreaElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+  nsHTMLTextAreaElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                         mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLFormElement::)
 
@@ -197,17 +197,17 @@ public:
   virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
   virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
 
   virtual bool IsHTMLFocusable(bool aWithMouse, bool *aIsFocusable, PRInt32 *aTabIndex);
 
   virtual void DoneAddingChildren(bool aHaveNotified);
   virtual bool IsDoneAddingChildren();
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   nsresult CopyInnerTo(nsGenericElement* aDest) const;
 
   /**
    * Called when an attribute is about to be changed
    */
   virtual nsresult BeforeSetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
                                  const nsAttrValueOrString* aValue,
@@ -318,17 +318,17 @@ protected:
    */
   bool IsValueEmpty() const;
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(TextArea)
 
 
-nsHTMLTextAreaElement::nsHTMLTextAreaElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+nsHTMLTextAreaElement::nsHTMLTextAreaElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                                              FromParser aFromParser)
   : nsGenericHTMLFormElement(aNodeInfo),
     mValueChanged(false),
     mHandlingSelect(false),
     mDoneAddingChildren(!aFromParser),
     mInhibitStateRestoration(!!(aFromParser & FROM_PARSER_FRAGMENT)),
     mDisabledChanged(false),
     mCanShowInvalidUI(true),
--- a/content/html/content/src/nsHTMLTitleElement.cpp
+++ b/content/html/content/src/nsHTMLTitleElement.cpp
@@ -46,17 +46,17 @@
 class nsHTMLTitleElement : public nsGenericHTMLElement,
                            public nsIDOMHTMLTitleElement,
                            public nsStubMutationObserver
 {
 public:
   using nsGenericElement::GetText;
   using nsGenericElement::SetText;
 
-  nsHTMLTitleElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLTitleElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLTitleElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
@@ -70,17 +70,17 @@ public:
   NS_DECL_NSIDOMHTMLTITLEELEMENT
 
   // nsIMutationObserver
   NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent,
                               nsIContent *aBindingParent,
                               bool aCompileEventHandlers);
 
   virtual void UnbindFromTree(bool aDeep = true,
                               bool aNullParent = true);
 
@@ -90,17 +90,17 @@ public:
 private:
   void SendTitleChangeEvent(bool aBound);
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Title)
 
 
-nsHTMLTitleElement::nsHTMLTitleElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLTitleElement::nsHTMLTitleElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
   AddMutationObserver(this);
 }
 
 nsHTMLTitleElement::~nsHTMLTitleElement()
 {
 }
--- a/content/html/content/src/nsHTMLUnknownElement.cpp
+++ b/content/html/content/src/nsHTMLUnknownElement.cpp
@@ -38,41 +38,41 @@
 
 #include "nsGenericHTMLElement.h"
 #include "nsIDOMHTMLUnknownElement.h"
 
 class nsHTMLUnknownElement : public nsGenericHTMLElement
                            , public nsIDOMHTMLUnknownElement
 {
 public:
-  nsHTMLUnknownElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsHTMLUnknownElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLUnknownElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
 
   // nsIDOMElement
   NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Unknown)
 
 
-nsHTMLUnknownElement::nsHTMLUnknownElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLUnknownElement::nsHTMLUnknownElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLUnknownElement::~nsHTMLUnknownElement()
 {
 }
 
--- a/content/html/content/src/nsHTMLVideoElement.cpp
+++ b/content/html/content/src/nsHTMLVideoElement.cpp
@@ -98,17 +98,17 @@ NS_IMETHODIMP nsHTMLVideoElement::GetVid
 
 /* readonly attribute unsigned long videoHeight; */
 NS_IMETHODIMP nsHTMLVideoElement::GetVideoHeight(PRUint32 *aVideoHeight)
 {
   *aVideoHeight = mMediaSize.height == -1 ? 0 : mMediaSize.height;
   return NS_OK;
 }
 
-nsHTMLVideoElement::nsHTMLVideoElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsHTMLVideoElement::nsHTMLVideoElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsHTMLMediaElement(aNodeInfo)
 {
 }
 
 nsHTMLVideoElement::~nsHTMLVideoElement()
 {
 }
 
--- a/content/html/content/src/nsTextEditorState.cpp
+++ b/content/html/content/src/nsTextEditorState.cpp
@@ -1533,17 +1533,17 @@ nsTextEditorState::CreateRootNode()
 
   nsIPresShell *shell = mBoundFrame->PresContext()->GetPresShell();
   NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
 
   nsIDocument *doc = shell->GetDocument();
   NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
 
   // Now create a DIV and add it to the anonymous content child list.
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   nodeInfo = doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::div, nsnull,
                                                  kNameSpaceID_XHTML,
                                                  nsIDOMNode::ELEMENT_NODE);
   NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
 
   nsresult rv = NS_NewHTMLElement(getter_AddRefs(mRootNode), nodeInfo.forget(),
                                   NOT_FROM_PARSER);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1615,17 +1615,17 @@ be called if @placeholder is the empty s
   nsNodeInfoManager* pNodeInfoManager = doc->NodeInfoManager();
   NS_ENSURE_TRUE(pNodeInfoManager, NS_ERROR_OUT_OF_MEMORY);
 
   nsresult rv;
   nsCOMPtr<nsIContent> placeholderText;
 
   // Create a DIV for the placeholder
   // and add it to the anonymous content child list
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   nodeInfo = pNodeInfoManager->GetNodeInfo(nsGkAtoms::div, nsnull,
                                            kNameSpaceID_XHTML,
                                            nsIDOMNode::ELEMENT_NODE);
   NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
 
   rv = NS_NewHTMLElement(getter_AddRefs(mPlaceholderDiv), nodeInfo.forget(),
                          NOT_FROM_PARSER);
   NS_ENSURE_SUCCESS(rv, rv);
--- a/content/html/document/src/ImageDocument.cpp
+++ b/content/html/document/src/ImageDocument.cpp
@@ -628,17 +628,17 @@ ImageDocument::CreateSyntheticDocument()
   // an inline element, our parent LineBox will be inline too and
   // ignore the available height during reflow.
   // This is bad during printing, it means tall image frames won't know
   // the size of the paper and cannot break into continuations along
   // multiple pages.
   Element* head = GetHeadElement();
   NS_ENSURE_TRUE(head, NS_ERROR_FAILURE);
 
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   if (nsContentUtils::IsChildOfSameType(this)) {
     nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::style, nsnull,
                                              kNameSpaceID_XHTML,
                                              nsIDOMNode::ELEMENT_NODE);
     NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
     nsRefPtr<nsGenericHTMLElement> styleContent = NS_NewHTMLStyleElement(nodeInfo.forget());
     NS_ENSURE_TRUE(styleContent, NS_ERROR_OUT_OF_MEMORY);
 
--- a/content/html/document/src/MediaDocument.cpp
+++ b/content/html/document/src/MediaDocument.cpp
@@ -228,17 +228,17 @@ MediaDocument::StartDocumentLoad(const c
 }
 
 nsresult
 MediaDocument::CreateSyntheticDocument()
 {
   // Synthesize an empty html document
   nsresult rv;
 
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::html, nsnull,
                                            kNameSpaceID_XHTML,
                                            nsIDOMNode::ELEMENT_NODE);
   NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
 
   nsRefPtr<nsGenericHTMLElement> root = NS_NewHTMLHtmlElement(nodeInfo.forget());
   NS_ENSURE_TRUE(root, NS_ERROR_OUT_OF_MEMORY);
 
@@ -340,17 +340,17 @@ MediaDocument::GetFileName(nsAString& aR
   } else {
     CopyUTF8toUTF16(fileName, aResult);
   }
 }
 
 nsresult
 MediaDocument::LinkStylesheet(const nsAString& aStylesheet)
 {
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::link, nsnull,
                                            kNameSpaceID_XHTML,
                                            nsIDOMNode::ELEMENT_NODE);
   NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
 
   nsRefPtr<nsGenericHTMLElement> link = NS_NewHTMLLinkElement(nodeInfo.forget());
   NS_ENSURE_TRUE(link, NS_ERROR_OUT_OF_MEMORY);
 
--- a/content/html/document/src/PluginDocument.cpp
+++ b/content/html/document/src/PluginDocument.cpp
@@ -287,17 +287,17 @@ PluginDocument::CreateSyntheticPluginDoc
 
   // remove margins from body
   NS_NAMED_LITERAL_STRING(zero, "0");
   body->SetAttr(kNameSpaceID_None, nsGkAtoms::marginwidth, zero, false);
   body->SetAttr(kNameSpaceID_None, nsGkAtoms::marginheight, zero, false);
 
 
   // make plugin content
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::embed, nsnull,
                                            kNameSpaceID_XHTML,
                                            nsIDOMNode::ELEMENT_NODE);
   NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
   rv = NS_NewHTMLElement(getter_AddRefs(mPluginContent), nodeInfo.forget(),
                          NOT_FROM_PARSER);
   NS_ENSURE_SUCCESS(rv, rv);
 
--- a/content/html/document/src/VideoDocument.cpp
+++ b/content/html/document/src/VideoDocument.cpp
@@ -117,17 +117,17 @@ VideoDocument::CreateSyntheticVideoDocum
 
   Element* body = GetBodyElement();
   if (!body) {
     NS_WARNING("no body on video document!");
     return NS_ERROR_FAILURE;
   }
 
   // make content
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::video, nsnull,
                                            kNameSpaceID_XHTML,
                                            nsIDOMNode::ELEMENT_NODE);
   NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);
 
   nsRefPtr<nsHTMLMediaElement> element =
     static_cast<nsHTMLMediaElement*>(NS_NewHTMLVideoElement(nodeInfo.forget(),
                                                             NOT_FROM_PARSER));
--- a/content/html/document/src/nsHTMLContentSink.cpp
+++ b/content/html/document/src/nsHTMLContentSink.cpp
@@ -55,17 +55,17 @@
 #include "nsIHTMLContentSink.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsScriptLoader.h"
 #include "nsIURI.h"
 #include "nsNetUtil.h"
 #include "nsIContentViewer.h"
 #include "nsIMarkupDocumentViewer.h"
-#include "nsNodeInfo.h"
+#include "nsINodeInfo.h"
 #include "nsHTMLTokens.h"
 #include "nsIAppShell.h"
 #include "nsCRT.h"
 #include "prtime.h"
 #include "prlog.h"
 #include "nsNodeUtils.h"
 #include "nsIContent.h"
 #include "mozilla/dom/Element.h"
@@ -129,21 +129,21 @@ static PRLogModuleInfo* gSinkLogModuleIn
 
 #else
 #define SINK_TRACE_NODE(_bit, _msg, _tag, _sp, _obj)
 #endif
 
 //----------------------------------------------------------------------
 
 typedef nsGenericHTMLElement*
-  (*contentCreatorCallback)(already_AddRefed<nsNodeInfo>,
+  (*contentCreatorCallback)(already_AddRefed<nsINodeInfo>,
                             FromParser aFromParser);
 
 nsGenericHTMLElement*
-NS_NewHTMLNOTUSEDElement(already_AddRefed<nsNodeInfo> aNodeInfo,
+NS_NewHTMLNOTUSEDElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                          FromParser aFromParser)
 {
   NS_NOTREACHED("The element ctor should never be called");
   return nsnull;
 }
 
 #define HTML_TAG(_tag, _classname) NS_NewHTML##_classname##Element,
 #define HTML_HTMLELEMENT_TAG(_tag) NS_NewHTMLElement,
@@ -252,17 +252,17 @@ protected:
   // Boolean indicating whether we've notified insertion of our root content
   // yet.  We want to make sure to only do this once.
   bool mNotifiedRootInsertion;
 
   PRUint8 mScriptEnabled : 1;
   PRUint8 mFramesEnabled : 1;
   PRUint8 unused : 6;  // bits available if someone needs one
 
-  nsNodeInfo* mNodeInfoCache[NS_HTML_TAG_MAX + 1];
+  nsINodeInfo* mNodeInfoCache[NS_HTML_TAG_MAX + 1];
 
   nsresult FlushTags();
 
   // Routines for tags that require special handling
   nsresult CloseHTML();
   nsresult OpenBody(const nsIParserNode& aNode);
   nsresult CloseBody();
 
@@ -458,17 +458,17 @@ HTMLContentSink::AddAttributes(const nsI
  * Factory subroutine to create all of the html content objects.
  */
 already_AddRefed<nsGenericHTMLElement>
 HTMLContentSink::CreateContentObject(const nsIParserNode& aNode,
                                      nsHTMLTag aNodeType)
 {
   // Find/create atom for the tag name
 
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
 
   if (aNodeType == eHTMLTag_userdefined) {
     nsAutoString lower;
     nsContentUtils::ASCIIToLower(aNode.GetText(), lower);
     nsCOMPtr<nsIAtom> name = do_GetAtom(lower);
     nodeInfo = mNodeInfoManager->GetNodeInfo(name, nsnull, kNameSpaceID_XHTML,
                                              nsIDOMNode::ELEMENT_NODE);
   }
@@ -490,22 +490,22 @@ HTMLContentSink::CreateContentObject(con
 
   NS_ENSURE_TRUE(nodeInfo, nsnull);
 
   // Make the content object
   return CreateHTMLElement(aNodeType, nodeInfo.forget(), FROM_PARSER_NETWORK);
 }
 
 nsresult
-NS_NewHTMLElement(nsIContent** aResult, already_AddRefed<nsNodeInfo> aNodeInfo,
+NS_NewHTMLElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo,
                   FromParser aFromParser)
 {
   *aResult = nsnull;
 
-  nsRefPtr<nsNodeInfo> nodeInfo = aNodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo = aNodeInfo;
 
   nsIParserService* parserService = nsContentUtils::GetParserService();
   if (!parserService)
     return NS_ERROR_OUT_OF_MEMORY;
 
   nsIAtom *name = nodeInfo->NameAtom();
 
   NS_ASSERTION(nodeInfo->NamespaceEquals(kNameSpaceID_XHTML), 
@@ -513,17 +513,17 @@ NS_NewHTMLElement(nsIContent** aResult, 
   
   *aResult = CreateHTMLElement(parserService->
                                  HTMLCaseSensitiveAtomTagToId(name),
                                nodeInfo.forget(), aFromParser).get();
   return *aResult ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 already_AddRefed<nsGenericHTMLElement>
-CreateHTMLElement(PRUint32 aNodeType, already_AddRefed<nsNodeInfo> aNodeInfo,
+CreateHTMLElement(PRUint32 aNodeType, already_AddRefed<nsINodeInfo> aNodeInfo,
                   FromParser aFromParser)
 {
   NS_ASSERTION(aNodeType <= NS_HTML_TAG_MAX ||
                aNodeType == eHTMLTag_userdefined,
                "aNodeType is out of bounds");
 
   contentCreatorCallback cb = sContentCreatorCallbacks[aNodeType];
 
@@ -1338,17 +1338,17 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLContentSink,
                                                   nsContentSink)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mHTMLDocument)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mRoot)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mBody)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mHead)
   for (PRUint32 i = 0; i < ArrayLength(tmp->mNodeInfoCache); ++i) {
     NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mNodeInfoCache[i]");
-    cb.NoteNativeChild(tmp->mNodeInfoCache[i], &NS_CYCLE_COLLECTION_NAME(nsNodeInfo));
+    cb.NoteXPCOMChild(tmp->mNodeInfoCache[i]);
   }
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLContentSink)
   NS_INTERFACE_TABLE_BEGIN
     NS_INTERFACE_TABLE_ENTRY(HTMLContentSink, nsIContentSink)
     NS_INTERFACE_TABLE_ENTRY(HTMLContentSink, nsIHTMLContentSink)
 #if DEBUG
@@ -1422,17 +1422,17 @@ HTMLContentSink::Init(nsIDocument* aDoc,
     mScriptEnabled = true;
   }
 
 
   // Changed from 8192 to greatly improve page loading performance on
   // large pages.  See bugzilla bug 77540.
   mMaxTextRun = Preferences::GetInt("content.maxtextrun", 8191);
 
-  nsRefPtr<nsNodeInfo> nodeInfo;
+  nsCOMPtr<nsINodeInfo> nodeInfo;
   nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::html, nsnull,
                                            kNameSpaceID_XHTML,
                                            nsIDOMNode::ELEMENT_NODE);
   NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
 
   // Make root part
   mRoot = NS_NewHTMLHtmlElement(nodeInfo.forget());
   if (!mRoot) {
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -1186,17 +1186,17 @@ nsHTMLDocument::MatchLinks(nsIContent *a
       nsCOMPtr<nsIHTMLDocument> htmldoc =
         do_QueryInterface(aContent->GetCurrentDoc());
       NS_ASSERTION(htmldoc,
                    "Huh, how did this happen? This should only be used with "
                    "HTML documents!");
     }
 #endif
 
-    nsNodeInfo *ni = aContent->NodeInfo();
+    nsINodeInfo *ni = aContent->NodeInfo();
 
     nsIAtom *localName = ni->NameAtom();
     if (ni->NamespaceID() == kNameSpaceID_XHTML &&
         (localName == nsGkAtoms::a || localName == nsGkAtoms::area)) {
       return aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::href);
     }
   }
 
@@ -3419,17 +3419,17 @@ nsHTMLDocument::QueryCommandValue(const 
   rv = cmdParams->GetCStringValue("state_attribute",
                                   getter_Copies(cStringResult));
   CopyUTF8toUTF16(cStringResult, _retval);
 
   return rv;
 }
 
 nsresult
-nsHTMLDocument::Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const
+nsHTMLDocument::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
 {
   NS_ASSERTION(aNodeInfo->NodeInfoManager() == mNodeInfoManager,
                "Can't import this document into another document!");
 
   nsRefPtr<nsHTMLDocument> clone = new nsHTMLDocument();
   NS_ENSURE_TRUE(clone, NS_ERROR_OUT_OF_MEMORY);
   nsresult rv = CloneDocHelper(clone.get());
   NS_ENSURE_SUCCESS(rv, rv);
--- a/content/html/document/src/nsHTMLDocument.h
+++ b/content/html/document/src/nsHTMLDocument.h
@@ -189,17 +189,17 @@ public:
   friend class nsAutoEditingState;
 
   void EndUpdate(nsUpdateType aUpdateType);
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsHTMLDocument, nsDocument)
 
   virtual nsresult SetEditingState(EditingState aState);
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual NS_HIDDEN_(void) RemovedFromDocShell();
 
   virtual mozilla::dom::Element *GetElementById(const nsAString& aElementId)
   {
     return nsDocument::GetElementById(aElementId);
   }
 
--- a/content/mathml/content/src/nsMathMLElement.h
+++ b/content/mathml/content/src/nsMathMLElement.h
@@ -53,17 +53,17 @@ typedef nsMappedAttributeElement nsMathM
  * The base class for MathML elements.
  */
 class nsMathMLElement : public nsMathMLElementBase,
                         public nsIDOMElement,
                         public nsILink,
                         public mozilla::dom::Link
 {
 public:
-  nsMathMLElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+  nsMathMLElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsMathMLElementBase(aNodeInfo), Link(this),
       mIncrementScriptLevel(false)
   {}
 
   // Implementation of nsISupports is inherited from nsMathMLElementBase
   NS_DECL_ISUPPORTS_INHERITED
 
   // Forward implementations of parent interfaces of nsMathMLElement to 
@@ -93,17 +93,17 @@ public:
                                   nsCSSValue&     aCSSValue,
                                   PRUint32        aFlags);
 
   static void MapMathMLAttributesInto(const nsMappedAttributes* aAttributes, 
                                       nsRuleData* aRuleData);
   
   virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
   virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
-  nsresult Clone(nsNodeInfo*, nsINode**) const;
+  nsresult Clone(nsINodeInfo*, nsINode**) const;
   virtual nsEventStates IntrinsicState() const;
   virtual bool IsNodeOfType(PRUint32 aFlags) const;
 
   // Set during reflow as necessary. Does a style change notification,
   // aNotify must be true.
   void SetIncrementScriptLevel(bool aIncrementScriptLevel, bool aNotify);
   bool GetIncrementScriptLevel() const {
     return mIncrementScriptLevel;
--- a/content/mathml/content/src/nsMathMLElementFactory.cpp
+++ b/content/mathml/content/src/nsMathMLElementFactory.cpp
@@ -38,17 +38,17 @@
 
 #include "nsContentCreatorFunctions.h"
 #include "nsGkAtoms.h"
 #include "nsIDocument.h"
 #include "nsMathMLElement.h"
 
 // MathML Element Factory (declared in nsContentCreatorFunctions.h)
 nsresult
-NS_NewMathMLElement(nsIContent** aResult, already_AddRefed<nsNodeInfo> aNodeInfo)
+NS_NewMathMLElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo)
 {
   aNodeInfo.get()->SetIDAttributeAtom(nsGkAtoms::id);
 
   nsMathMLElement* it = new nsMathMLElement(aNodeInfo);
   NS_ENSURE_TRUE(it, NS_ERROR_OUT_OF_MEMORY);
 
   NS_ADDREF(*aResult = it);
   return NS_OK;
--- a/content/svg/content/src/nsSVGAElement.cpp
+++ b/content/svg/content/src/nsSVGAElement.cpp
@@ -78,17 +78,17 @@ NS_INTERFACE_TABLE_HEAD(nsSVGAElement)
                            Link)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAElement)
 NS_INTERFACE_MAP_END_INHERITING(nsSVGAElementBase)
 
 
 //----------------------------------------------------------------------
 // Implementation
 
-nsSVGAElement::nsSVGAElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsSVGAElement::nsSVGAElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGAElementBase(aNodeInfo),
     Link(this)
 {
 }
 
 //----------------------------------------------------------------------
 // nsIDOMSVGURIReference methods
 
--- a/content/svg/content/src/nsSVGAElement.h
+++ b/content/svg/content/src/nsSVGAElement.h
@@ -52,35 +52,35 @@ class nsSVGAElement : public nsSVGAEleme
                       public nsIDOMSVGAElement,
                       public DOMSVGTests,
                       public nsIDOMSVGURIReference,
                       public nsILink,
                       public mozilla::dom::Link
 {
 protected:
   friend nsresult NS_NewSVGAElement(nsIContent **aResult,
-                                    already_AddRefed<nsNodeInfo> aNodeInfo);
-  nsSVGAElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+                                    already_AddRefed<nsINodeInfo> aNodeInfo);
+  nsSVGAElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
 public:
   // interfaces:
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMSVGAELEMENT
   NS_DECL_NSIDOMSVGURIREFERENCE
 
   // XXX: I wish we could use virtual inheritance
   NS_FORWARD_NSIDOMNODE(nsSVGAElementBase::)
   NS_FORWARD_NSIDOMELEMENT(nsSVGAElementBase::)
   NS_FORWARD_NSIDOMSVGELEMENT(nsSVGAElementBase::)
 
   // nsINode interface methods
   virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
   virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   // nsILink
   NS_IMETHOD LinkAdded() { return NS_OK; }
   NS_IMETHOD LinkRemoved() { return NS_OK; }
 
   // nsIContent
   virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent,
                               nsIContent *aBindingParent,
--- a/content/svg/content/src/nsSVGAltGlyphElement.cpp
+++ b/content/svg/content/src/nsSVGAltGlyphElement.cpp
@@ -46,18 +46,18 @@ using namespace mozilla;
 typedef nsSVGTextPositioningElement nsSVGAltGlyphElementBase;
 
 class nsSVGAltGlyphElement : public nsSVGAltGlyphElementBase, // = nsIDOMSVGTextPositioningElement
                              public nsIDOMSVGAltGlyphElement,
                              public nsIDOMSVGURIReference
 {
 protected:
   friend nsresult NS_NewSVGAltGlyphElement(nsIContent **aResult,
-                                           already_AddRefed<nsNodeInfo> aNodeInfo);
-  nsSVGAltGlyphElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+                                           already_AddRefed<nsINodeInfo> aNodeInfo);
+  nsSVGAltGlyphElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   
 public:
   // interfaces:
   
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMSVGALTGLYPHELEMENT
   NS_DECL_NSIDOMSVGURIREFERENCE
 
@@ -67,17 +67,17 @@ public:
   NS_FORWARD_NSIDOMELEMENT(nsSVGAltGlyphElementBase::)
   NS_FORWARD_NSIDOMSVGELEMENT(nsSVGAltGlyphElementBase::)
   NS_FORWARD_NSIDOMSVGTEXTCONTENTELEMENT(nsSVGAltGlyphElementBase::)
   NS_FORWARD_NSIDOMSVGTEXTPOSITIONINGELEMENT(nsSVGAltGlyphElementBase::)
 
   // nsIContent interface
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 protected:
 
   // nsSVGElement overrides
   virtual StringAttributesInfo GetStringInfo();
 
   virtual bool IsEventName(nsIAtom* aName);
@@ -110,17 +110,17 @@ NS_INTERFACE_TABLE_HEAD(nsSVGAltGlyphEle
                            nsIDOMSVGTests,
                            nsIDOMSVGURIReference)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAltGlyphElement)
 NS_INTERFACE_MAP_END_INHERITING(nsSVGAltGlyphElementBase)
 
 //----------------------------------------------------------------------
 // Implementation
 
-nsSVGAltGlyphElement::nsSVGAltGlyphElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsSVGAltGlyphElement::nsSVGAltGlyphElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGAltGlyphElementBase(aNodeInfo)
 {
 }
 
 
 //----------------------------------------------------------------------
 // nsIDOMNode methods
 
--- a/content/svg/content/src/nsSVGAnimateElement.cpp
+++ b/content/svg/content/src/nsSVGAnimateElement.cpp
@@ -41,33 +41,33 @@
 
 typedef nsSVGAnimationElement nsSVGAnimateElementBase;
 
 class nsSVGAnimateElement : public nsSVGAnimateElementBase,
                             public nsIDOMSVGAnimateElement
 {
 protected:
   friend nsresult NS_NewSVGAnimateElement(nsIContent **aResult,
-                                          already_AddRefed<nsNodeInfo> aNodeInfo);
-  nsSVGAnimateElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+                                          already_AddRefed<nsINodeInfo> aNodeInfo);
+  nsSVGAnimateElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
   nsSMILAnimationFunction mAnimationFunction;
 
 public:
   // interfaces:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMSVGANIMATEELEMENT
 
   NS_FORWARD_NSIDOMNODE(nsSVGAnimateElementBase::)
   NS_FORWARD_NSIDOMELEMENT(nsSVGAnimateElementBase::)
   NS_FORWARD_NSIDOMSVGELEMENT(nsSVGAnimateElementBase::)
   NS_FORWARD_NSIDOMSVGANIMATIONELEMENT(nsSVGAnimateElementBase::)
   
   // nsIDOMNode
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   // nsISMILAnimationElement
   virtual nsSMILAnimationFunction& AnimationFunction();
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 NS_IMPL_NS_NEW_SVG_ELEMENT(Animate)
@@ -85,17 +85,17 @@ NS_INTERFACE_TABLE_HEAD(nsSVGAnimateElem
                            nsIDOMSVGElement, nsIDOMSVGAnimationElement,
                            nsIDOMSVGTests, nsIDOMSVGAnimateElement)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAnimateElement)
 NS_INTERFACE_MAP_END_INHERITING(nsSVGAnimateElementBase)
 
 //----------------------------------------------------------------------
 // Implementation
 
-nsSVGAnimateElement::nsSVGAnimateElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsSVGAnimateElement::nsSVGAnimateElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGAnimateElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
 // nsIDOMNode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGAnimateElement)
--- a/content/svg/content/src/nsSVGAnimateMotionElement.cpp
+++ b/content/svg/content/src/nsSVGAnimateMotionElement.cpp
@@ -56,17 +56,17 @@ NS_INTERFACE_TABLE_HEAD(nsSVGAnimateMoti
                            nsIDOMSVGAnimationElement, nsIDOMSVGTests,
                            nsIDOMSVGAnimateMotionElement)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAnimateMotionElement)
 NS_INTERFACE_MAP_END_INHERITING(nsSVGAnimateMotionElementBase)
 
 //----------------------------------------------------------------------
 // Implementation
 
-nsSVGAnimateMotionElement::nsSVGAnimateMotionElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsSVGAnimateMotionElement::nsSVGAnimateMotionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGAnimateMotionElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
 // nsIDOMNode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGAnimateMotionElement)
--- a/content/svg/content/src/nsSVGAnimateMotionElement.h
+++ b/content/svg/content/src/nsSVGAnimateMotionElement.h
@@ -45,33 +45,33 @@
 
 typedef nsSVGAnimationElement nsSVGAnimateMotionElementBase;
 
 class nsSVGAnimateMotionElement : public nsSVGAnimateMotionElementBase,
                                   public nsIDOMSVGAnimateMotionElement
 {
 protected:
   friend nsresult NS_NewSVGAnimateMotionElement(nsIContent **aResult,
-                                                already_AddRefed<nsNodeInfo> aNodeInfo);
-  nsSVGAnimateMotionElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+                                                already_AddRefed<nsINodeInfo> aNodeInfo);
+  nsSVGAnimateMotionElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
   mozilla::SVGMotionSMILAnimationFunction mAnimationFunction;
 
 public:
   // interfaces:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMSVGANIMATEMOTIONELEMENT
 
   NS_FORWARD_NSIDOMNODE(nsSVGAnimateMotionElementBase::)
   NS_FORWARD_NSIDOMELEMENT(nsSVGAnimateMotionElementBase::)
   NS_FORWARD_NSIDOMSVGELEMENT(nsSVGAnimateMotionElementBase::)
   NS_FORWARD_NSIDOMSVGANIMATIONELEMENT(nsSVGAnimateMotionElementBase::)
 
   // nsIDOMNode specializations
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   // nsISMILAnimationElement
   virtual nsSMILAnimationFunction& AnimationFunction();
   virtual bool GetTargetAttributeName(PRInt32 *aNamespaceID,
                                         nsIAtom **aLocalName) const;
   virtual nsSMILTargetAttrType GetTargetAttributeType() const;
 
   // nsSVGElement
--- a/content/svg/content/src/nsSVGAnimateTransformElement.cpp
+++ b/content/svg/content/src/nsSVGAnimateTransformElement.cpp
@@ -46,33 +46,33 @@
 
 typedef nsSVGAnimationElement nsSVGAnimateTransformElementBase;
 
 class nsSVGAnimateTransformElement : public nsSVGAnimateTransformElementBase,
                                      public nsIDOMSVGAnimateTransformElement
 {
 protected:
   friend nsresult NS_NewSVGAnimateTransformElement(nsIContent **aResult,
-                                                   already_AddRefed<nsNodeInfo> aNodeInfo);
-  nsSVGAnimateTransformElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+                                                   already_AddRefed<nsINodeInfo> aNodeInfo);
+  nsSVGAnimateTransformElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
   nsSMILAnimationFunction mAnimationFunction;
 
 public:
   // interfaces:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMSVGANIMATETRANSFORMELEMENT
 
   NS_FORWARD_NSIDOMNODE(nsSVGAnimateTransformElementBase::)
   NS_FORWARD_NSIDOMELEMENT(nsSVGAnimateTransformElementBase::)
   NS_FORWARD_NSIDOMSVGELEMENT(nsSVGAnimateTransformElementBase::)
   NS_FORWARD_NSIDOMSVGANIMATIONELEMENT(nsSVGAnimateTransformElementBase::)
 
   // nsIDOMNode specializations
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   // nsGenericElement specializations
   bool ParseAttribute(PRInt32 aNamespaceID,
                         nsIAtom* aAttribute,
                         const nsAString& aValue,
                         nsAttrValue& aResult);
 
   // nsISMILAnimationElement
@@ -98,17 +98,17 @@ NS_INTERFACE_TABLE_HEAD(nsSVGAnimateTran
                            nsIDOMSVGTests,
                            nsIDOMSVGAnimateTransformElement)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAnimateTransformElement)
 NS_INTERFACE_MAP_END_INHERITING(nsSVGAnimateTransformElementBase)
 
 //----------------------------------------------------------------------
 // Implementation
 
-nsSVGAnimateTransformElement::nsSVGAnimateTransformElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsSVGAnimateTransformElement::nsSVGAnimateTransformElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGAnimateTransformElementBase(aNodeInfo)
 {
 }
 
 bool
 nsSVGAnimateTransformElement::ParseAttribute(PRInt32 aNamespaceID,
                                              nsIAtom* aAttribute,
                                              const nsAString& aValue,
--- a/content/svg/content/src/nsSVGAnimationElement.cpp
+++ b/content/svg/content/src/nsSVGAnimationElement.cpp
@@ -77,17 +77,17 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 #ifdef _MSC_VER
 // Disable "warning C4355: 'this' : used in base member initializer list".
 // We can ignore that warning because we know that mHrefTarget's constructor 
 // doesn't dereference the pointer passed to it.
 #pragma warning(push)
 #pragma warning(disable:4355)
 #endif
-nsSVGAnimationElement::nsSVGAnimationElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsSVGAnimationElement::nsSVGAnimationElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGAnimationElementBase(aNodeInfo),
     mHrefTarget(this)
 #ifdef _MSC_VER
 #pragma warning(pop)
 #endif
 {
 }
 
--- a/content/svg/content/src/nsSVGAnimationElement.h
+++ b/content/svg/content/src/nsSVGAnimationElement.h
@@ -50,17 +50,17 @@
 typedef nsSVGElement nsSVGAnimationElementBase;
 
 class nsSVGAnimationElement : public nsSVGAnimationElementBase,
                               public DOMSVGTests,
                               public nsISMILAnimationElement,
                               public nsIDOMElementTimeControl
 {
 protected:
-  nsSVGAnimationElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsSVGAnimationElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   nsresult Init();
 
 public:
   // interfaces:
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsSVGAnimationElement,
                                            nsSVGAnimationElementBase)
--- a/content/svg/content/src/nsSVGCircleElement.cpp
+++ b/content/svg/content/src/nsSVGCircleElement.cpp
@@ -49,18 +49,18 @@ using namespace mozilla;
 
 typedef nsSVGPathGeometryElement nsSVGCircleElementBase;
 
 class nsSVGCircleElement : public nsSVGCircleElementBase,
                            public nsIDOMSVGCircleElement
 {
 protected:
   friend nsresult NS_NewSVGCircleElement(nsIContent **aResult,
-                                         already_AddRefed<nsNodeInfo> aNodeInfo);
-  nsSVGCircleElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+                                         already_AddRefed<nsINodeInfo> aNodeInfo);
+  nsSVGCircleElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
 public:
   // interfaces:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMSVGCIRCLEELEMENT
 
   // xxx I wish we could use virtual inheritance
   NS_FORWARD_NSIDOMNODE(nsSVGCircleElementBase::)
@@ -68,17 +68,17 @@ public:
   NS_FORWARD_NSIDOMSVGELEMENT(nsSVGCircleElementBase::)
 
   // nsSVGSVGElement methods:
   virtual bool HasValidDimensions() const;
 
   // nsSVGPathGeometryElement methods:
   virtual void ConstructPath(gfxContext *aCtx);
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 protected:
 
   virtual LengthAttributesInfo GetLengthInfo();
 
   enum { CX, CY, R };
   nsSVGLength2 mLengthAttributes[3];
@@ -107,17 +107,17 @@ NS_INTERFACE_TABLE_HEAD(nsSVGCircleEleme
                            nsIDOMSVGElement, nsIDOMSVGTests,
                            nsIDOMSVGCircleElement)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGCircleElement)
 NS_INTERFACE_MAP_END_INHERITING(nsSVGCircleElementBase)
 
 //----------------------------------------------------------------------
 // Implementation
 
-nsSVGCircleElement::nsSVGCircleElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsSVGCircleElement::nsSVGCircleElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGCircleElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
 // nsIDOMNode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGCircleElement)
--- a/content/svg/content/src/nsSVGClipPathElement.cpp
+++ b/content/svg/content/src/nsSVGClipPathElement.cpp
@@ -65,17 +65,17 @@ NS_INTERFACE_TABLE_HEAD(nsSVGClipPathEle
                            nsIDOMSVGClipPathElement,
                            nsIDOMSVGUnitTypes)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGClipPathElement)
 NS_INTERFACE_MAP_END_INHERITING(nsSVGClipPathElementBase)
 
 //----------------------------------------------------------------------
 // Implementation
 
-nsSVGClipPathElement::nsSVGClipPathElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsSVGClipPathElement::nsSVGClipPathElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGClipPathElementBase(aNodeInfo)
 {
 }
 
 /* readonly attribute nsIDOMSVGAnimatedEnumeration clipPathUnits; */
 NS_IMETHODIMP nsSVGClipPathElement::GetClipPathUnits(nsIDOMSVGAnimatedEnumeration * *aClipPathUnits)
 {
   return mEnumAttributes[CLIPPATHUNITS].ToDOMAnimatedEnum(aClipPathUnits, this);
--- a/content/svg/content/src/nsSVGClipPathElement.h
+++ b/content/svg/content/src/nsSVGClipPathElement.h
@@ -49,31 +49,31 @@ class nsSVGClipPathElement : public nsSV
                              public nsIDOMSVGClipPathElement,
                              public DOMSVGTests,
                              public nsIDOMSVGUnitTypes
 {
   friend class nsSVGClipPathFrame;
 
 protected:
   friend nsresult NS_NewSVGClipPathElement(nsIContent **aResult,
-                                           already_AddRefed<nsNodeInfo> aNodeInfo);
-  nsSVGClipPathElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+                                           already_AddRefed<nsINodeInfo> aNodeInfo);
+  nsSVGClipPathElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
 public:
   // interfaces:
   
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMSVGCLIPPATHELEMENT
 
   // xxx I wish we could use virtual inheritance
   NS_FORWARD_NSIDOMNODE(nsSVGClipPathElementBase::)
   NS_FORWARD_NSIDOMELEMENT(nsSVGClipPathElementBase::)
   NS_FORWARD_NSIDOMSVGELEMENT(nsSVGClipPathElementBase::)
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 protected:
 
   // nsIDOMSVGClipPathElement values
   enum { CLIPPATHUNITS };
   nsSVGEnum mEnumAttributes[1];
   static EnumInfo sEnumInfo[1];
--- a/content/svg/content/src/nsSVGDefsElement.cpp
+++ b/content/svg/content/src/nsSVGDefsElement.cpp
@@ -47,34 +47,34 @@ using namespace mozilla;
 typedef nsSVGGraphicElement nsSVGDefsElementBase;
 
 class nsSVGDefsElement : public nsSVGDefsElementBase,
                          public nsIDOMSVGDefsElement,
                          public DOMSVGTests
 {
 protected:
   friend nsresult NS_NewSVGDefsElement(nsIContent **aResult,
-                                       already_AddRefed<nsNodeInfo> aNodeInfo);
-  nsSVGDefsElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+                                       already_AddRefed<nsINodeInfo> aNodeInfo);
+  nsSVGDefsElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   
 public:
   // interfaces:
   
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMSVGDEFSELEMENT
 
   // xxx I wish we could use virtual inheritance
   NS_FORWARD_NSIDOMNODE(nsSVGDefsElementBase::)
   NS_FORWARD_NSIDOMELEMENT(nsSVGDefsElementBase::)
   NS_FORWARD_NSIDOMSVGELEMENT(nsSVGDefsElementBase::)
 
   // nsIContent
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 ////////////////////////////////////////////////////////////////////////
 // implementation
 
 
@@ -94,17 +94,17 @@ NS_INTERFACE_TABLE_HEAD(nsSVGDefsElement
                            nsIDOMSVGElement, nsIDOMSVGTests,
                            nsIDOMSVGDefsElement)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGDefsElement)
 NS_INTERFACE_MAP_END_INHERITING(nsSVGDefsElementBase)
 
 //----------------------------------------------------------------------
 // Implementation
 
-nsSVGDefsElement::nsSVGDefsElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsSVGDefsElement::nsSVGDefsElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGDefsElementBase(aNodeInfo)
 {
 
 }
 
 //----------------------------------------------------------------------
 // nsIDOMNode methods
 
--- a/content/svg/content/src/nsSVGDescElement.cpp
+++ b/content/svg/content/src/nsSVGDescElement.cpp
@@ -41,32 +41,32 @@
 
 typedef nsSVGStylableElement nsSVGDescElementBase;
 
 class nsSVGDescElement : public nsSVGDescElementBase,
                          public nsIDOMSVGDescElement
 {
 protected:
   friend nsresult NS_NewSVGDescElement(nsIContent **aResult,
-                                       already_AddRefed<nsNodeInfo> aNodeInfo);
-  nsSVGDescElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+                                       already_AddRefed<nsINodeInfo> aNodeInfo);
+  nsSVGDescElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   nsresult Init();
 
 public:
   // interfaces:
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMSVGDESCELEMENT
 
   // xxx I wish we could use virtual inheritance
   NS_FORWARD_NSIDOMNODE(nsSVGDescElementBase::)
   NS_FORWARD_NSIDOMELEMENT(nsSVGDescElementBase::)
   NS_FORWARD_NSIDOMSVGELEMENT(nsSVGDescElementBase::)
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 };
 
 NS_IMPL_NS_NEW_SVG_ELEMENT(Desc)
 
 
 //----------------------------------------------------------------------
@@ -82,17 +82,17 @@ NS_INTERFACE_TABLE_HEAD(nsSVGDescElement
                            nsIDOMSVGElement, nsIDOMSVGDescElement)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGDescElement)
 NS_INTERFACE_MAP_END_INHERITING(nsSVGDescElementBase)
 
 
 //----------------------------------------------------------------------
 // Implementation
 
-nsSVGDescElement::nsSVGDescElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsSVGDescElement::nsSVGDescElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGDescElementBase(aNodeInfo)
 {
 }
 
 
 nsresult
 nsSVGDescElement::Init()
 {
--- a/content/svg/content/src/nsSVGElement.cpp
+++ b/content/svg/content/src/nsSVGElement.cpp
@@ -101,17 +101,17 @@ PR_STATIC_ASSERT(sizeof(void*) == sizeof
 
 
 nsSVGEnumMapping nsSVGElement::sSVGUnitTypesMap[] = {
   {&nsGkAtoms::userSpaceOnUse, nsIDOMSVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE},
   {&nsGkAtoms::objectBoundingBox, nsIDOMSVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX},
   {nsnull, 0}
 };
 
-nsSVGElement::nsSVGElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsSVGElement::nsSVGElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGElementBase(aNodeInfo)
 {
 }
 
 nsresult
 nsSVGElement::Init()
 {
   // Set up length attributes - can't do this in the constructor
--- a/content/svg/content/src/nsSVGElement.h
+++ b/content/svg/content/src/nsSVGElement.h
@@ -84,17 +84,17 @@ class DOMSVGStringList;
 struct gfxMatrix;
 struct nsSVGEnumMapping;
 
 typedef nsStyledElementNotElementCSSInlineStyle nsSVGElementBase;
 
 class nsSVGElement : public nsSVGElementBase    // nsIContent
 {
 protected:
-  nsSVGElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+  nsSVGElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   nsresult Init();
   virtual ~nsSVGElement(){}
 
 public:
   typedef mozilla::SVGNumberList SVGNumberList;
   typedef mozilla::SVGAnimatedNumberList SVGAnimatedNumberList;
   typedef mozilla::SVGUserUnitList SVGUserUnitList;
   typedef mozilla::SVGAnimatedLengthList SVGAnimatedLengthList;
@@ -611,17 +611,17 @@ private:
 };
 
 /**
  * A macro to implement the NS_NewSVGXXXElement() functions.
  */
 #define NS_IMPL_NS_NEW_SVG_ELEMENT(_elementName)                             \
 nsresult                                                                     \
 NS_NewSVG##_elementName##Element(nsIContent **aResult,                       \
-                                 already_AddRefed<nsNodeInfo> aNodeInfo)    \
+                                 already_AddRefed<nsINodeInfo> aNodeInfo)    \
 {                                                                            \
   nsRefPtr<nsSVG##_elementName##Element> it =                                \
     new nsSVG##_elementName##Element(aNodeInfo);                             \
   if (!it)                                                                   \
     return NS_ERROR_OUT_OF_MEMORY;                                           \
                                                                              \
   nsresult rv = it->Init();                                                  \
                                                                              \
@@ -632,17 +632,17 @@ NS_NewSVG##_elementName##Element(nsICont
   *aResult = it.forget().get();                                              \
                                                                              \
   return rv;                                                                 \
 }
 
 #define NS_IMPL_NS_NEW_SVG_ELEMENT_CHECK_PARSER(_elementName)                \
 nsresult                                                                     \
 NS_NewSVG##_elementName##Element(nsIContent **aResult,                       \
-                                 already_AddRefed<nsNodeInfo> aNodeInfo,    \
+                                 already_AddRefed<nsINodeInfo> aNodeInfo,    \
                                  FromParser aFromParser)                     \
 {                                                                            \
   nsRefPtr<nsSVG##_elementName##Element> it =                                \
     new nsSVG##_elementName##Element(aNodeInfo, aFromParser);                \
   if (!it)                                                                   \
     return NS_ERROR_OUT_OF_MEMORY;                                           \
                                                                              \
   nsresult rv = it->Init();                                                  \
--- a/content/svg/content/src/nsSVGElementFactory.cpp
+++ b/content/svg/content/src/nsSVGElementFactory.cpp
@@ -35,221 +35,221 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsCOMPtr.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsIAtom.h"
-#include "nsNodeInfo.h"
+#include "nsINodeInfo.h"
 #include "nsGkAtoms.h"
 #include "nsContentDLF.h"
 #include "nsContentUtils.h"
 #include "nsSVGUtils.h"
 #include "nsDebug.h"
 
 using namespace mozilla::dom;
 
 nsresult
 NS_NewSVGAElement(nsIContent **aResult,
-                  already_AddRefed<nsNodeInfo> aNodeInfo);
+                  already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGAltGlyphElement(nsIContent **aResult,
-                         already_AddRefed<nsNodeInfo> aNodeInfo);
+                         already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGPolylineElement(nsIContent **aResult,
-                         already_AddRefed<nsNodeInfo> aNodeInfo);
+                         already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGPolygonElement(nsIContent **aResult,
-                        already_AddRefed<nsNodeInfo> aNodeInfo);
+                        already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGCircleElement(nsIContent **aResult,
-                       already_AddRefed<nsNodeInfo> aNodeInfo);
+                       already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGEllipseElement(nsIContent **aResult,
-                        already_AddRefed<nsNodeInfo> aNodeInfo);
+                        already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGLineElement(nsIContent **aResult,
-                     already_AddRefed<nsNodeInfo> aNodeInfo);
+                     already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGRectElement(nsIContent **aResult,
-                     already_AddRefed<nsNodeInfo> aNodeInfo);
+                     already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGGElement(nsIContent **aResult,
-                  already_AddRefed<nsNodeInfo> aNodeInfo);
+                  already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGSVGElement(nsIContent **aResult,
-                    already_AddRefed<nsNodeInfo> aNodeInfo,
+                    already_AddRefed<nsINodeInfo> aNodeInfo,
                     FromParser aFromParser);
 nsresult
 NS_NewSVGForeignObjectElement(nsIContent **aResult,
-                              already_AddRefed<nsNodeInfo> aNodeInfo);
+                              already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGPathElement(nsIContent **aResult,
-                     already_AddRefed<nsNodeInfo> aNodeInfo);
+                     already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGTextElement(nsIContent **aResult,
-                     already_AddRefed<nsNodeInfo> aNodeInfo);
+                     already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGTSpanElement(nsIContent **aResult,
-                      already_AddRefed<nsNodeInfo> aNodeInfo);
+                      already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGImageElement(nsIContent **aResult,
-                      already_AddRefed<nsNodeInfo> aNodeInfo);
+                      already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGStyleElement(nsIContent **aResult,
-                      already_AddRefed<nsNodeInfo> aNodeInfo);
+                      already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGLinearGradientElement(nsIContent **aResult,
-                               already_AddRefed<nsNodeInfo> aNodeInfo);
+                               already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGMetadataElement(nsIContent **aResult,
-                         already_AddRefed<nsNodeInfo> aNodeInfo);
+                         already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGRadialGradientElement(nsIContent **aResult,
-                               already_AddRefed<nsNodeInfo> aNodeInfo);
+                               already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGStopElement(nsIContent **aResult,
-                     already_AddRefed<nsNodeInfo> aNodeInfo);
+                     already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGDefsElement(nsIContent **aResult,
-                     already_AddRefed<nsNodeInfo> aNodeInfo);
+                     already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGDescElement(nsIContent **aResult,
-                     already_AddRefed<nsNodeInfo> aNodeInfo);
+                     already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGScriptElement(nsIContent **aResult,
-                       already_AddRefed<nsNodeInfo> aNodeInfo,
+                       already_AddRefed<nsINodeInfo> aNodeInfo,
                        FromParser aFromParser);
 nsresult
 NS_NewSVGUseElement(nsIContent **aResult,
-                    already_AddRefed<nsNodeInfo> aNodeInfo);
+                    already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGSymbolElement(nsIContent **aResult,
-                       already_AddRefed<nsNodeInfo> aNodeInfo);
+                       already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGMarkerElement(nsIContent **aResult,
-                       already_AddRefed<nsNodeInfo> aNodeInfo);
+                       already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGTitleElement(nsIContent **aResult,
-                      already_AddRefed<nsNodeInfo> aNodeInfo);
+                      already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGClipPathElement(nsIContent **aResult,
-                         already_AddRefed<nsNodeInfo> aNodeInfo);
+                         already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGTextPathElement(nsIContent **aResult,
-                         already_AddRefed<nsNodeInfo> aNodeInfo);
+                         already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFilterElement(nsIContent **aResult,
-                       already_AddRefed<nsNodeInfo> aNodeInfo);
+                       already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEBlendElement(nsIContent **aResult,
-                        already_AddRefed<nsNodeInfo> aNodeInfo);
+                        already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEColorMatrixElement(nsIContent **aResult,
-                              already_AddRefed<nsNodeInfo> aNodeInfo);
+                              already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEComponentTransferElement(nsIContent **aResult,
-                                    already_AddRefed<nsNodeInfo> aNodeInfo);
+                                    already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFECompositeElement(nsIContent **aResult,
-                            already_AddRefed<nsNodeInfo> aNodeInfo);
+                            already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEFuncRElement(nsIContent **aResult,
-                        already_AddRefed<nsNodeInfo> aNodeInfo);
+                        already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEFuncGElement(nsIContent **aResult,
-                        already_AddRefed<nsNodeInfo> aNodeInfo);
+                        already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEFuncBElement(nsIContent **aResult,
-                        already_AddRefed<nsNodeInfo> aNodeInfo);
+                        already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEFuncAElement(nsIContent **aResult,
-                        already_AddRefed<nsNodeInfo> aNodeInfo);
+                        already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEGaussianBlurElement(nsIContent **aResult,
-                               already_AddRefed<nsNodeInfo> aNodeInfo);
+                               already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEMergeElement(nsIContent **aResult,
-                        already_AddRefed<nsNodeInfo> aNodeInfo);
+                        already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEMergeNodeElement(nsIContent **aResult,
-                            already_AddRefed<nsNodeInfo> aNodeInfo);
+                            already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEMorphologyElement(nsIContent **aResult,
-                             already_AddRefed<nsNodeInfo> aNodeInfo);
+                             already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEOffsetElement(nsIContent **aResult,
-                         already_AddRefed<nsNodeInfo> aNodeInfo);
+                         already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGPatternElement(nsIContent **aResult,
-                        already_AddRefed<nsNodeInfo> aNodeInfo);
+                        already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGMaskElement(nsIContent **aResult,
-                     already_AddRefed<nsNodeInfo> aNodeInfo);
+                     already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEFloodElement(nsIContent **aResult,
-                        already_AddRefed<nsNodeInfo> aNodeInfo);
+                        already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFETileElement(nsIContent **aResult,
-                       already_AddRefed<nsNodeInfo> aNodeInfo);
+                       already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFETurbulenceElement(nsIContent **aResult,
-                             already_AddRefed<nsNodeInfo> aNodeInfo);
+                             already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGSwitchElement(nsIContent **aResult,
-                       already_AddRefed<nsNodeInfo> aNodeInfo);
+                       already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEConvolveMatrixElement(nsIContent **aResult,
-                                 already_AddRefed<nsNodeInfo> aNodeInfo);
+                                 already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEDistantLightElement(nsIContent **aResult,
-                               already_AddRefed<nsNodeInfo> aNodeInfo);
+                               already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEPointLightElement(nsIContent **aResult,
-                             already_AddRefed<nsNodeInfo> aNodeInfo);
+                             already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFESpotLightElement(nsIContent **aResult,
-                            already_AddRefed<nsNodeInfo> aNodeInfo);
+                            already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEDiffuseLightingElement(nsIContent **aResult,
-                                  already_AddRefed<nsNodeInfo> aNodeInfo);
+                                  already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFESpecularLightingElement(nsIContent **aResult,
-                                   already_AddRefed<nsNodeInfo> aNodeInfo);
+                                   already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEImageElement(nsIContent **aResult,
-                        already_AddRefed<nsNodeInfo> aNodeInfo);
+                        already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGFEDisplacementMapElement(nsIContent **aResult,
-                                  already_AddRefed<nsNodeInfo> aNodeInfo);
+                                  already_AddRefed<nsINodeInfo> aNodeInfo);
 
 nsresult
 NS_NewSVGAnimateElement(nsIContent **aResult,
-                        already_AddRefed<nsNodeInfo> aNodeInfo);
+                        already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGAnimateTransformElement(nsIContent **aResult,
-                                 already_AddRefed<nsNodeInfo> aNodeInfo);
+                                 already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGAnimateMotionElement(nsIContent **aResult,
-                              already_AddRefed<nsNodeInfo> aNodeInfo);
+                              already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGMpathElement(nsIContent **aResult,
-                      already_AddRefed<nsNodeInfo> aNodeInfo);
+                      already_AddRefed<nsINodeInfo> aNodeInfo);
 nsresult
 NS_NewSVGSetElement(nsIContent **aResult,
-                    already_AddRefed<nsNodeInfo> aNodeInfo);
+                    already_AddRefed<nsINodeInfo> aNodeInfo);
 
 nsresult
 NS_NewSVGUnknownElement(nsIContent **aResult,
-                        already_AddRefed<nsNodeInfo> aNodeInfo);
+                        already_AddRefed<nsINodeInfo> aNodeInfo);
 
 nsresult
-NS_NewSVGElement(nsIContent** aResult, already_AddRefed<nsNodeInfo> aNodeInfo,
+NS_NewSVGElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo,
                  FromParser aFromParser)
 {
   static const char kSVGStyleSheetURI[] = "resource://gre/res/svg.css";
 
   // this bit of code is to load svg.css on demand
   nsIDocument *doc = aNodeInfo.get()->GetDocument();
   if (doc)
     doc->EnsureCatalogStyleSheet(kSVGStyleSheetURI);
--- a/content/svg/content/src/nsSVGEllipseElement.cpp
+++ b/content/svg/content/src/nsSVGEllipseElement.cpp
@@ -50,18 +50,18 @@ using namespace mozilla;
 
 typedef nsSVGPathGeometryElement nsSVGEllipseElementBase;
 
 class nsSVGEllipseElement : public nsSVGEllipseElementBase,
                             public nsIDOMSVGEllipseElement
 {
 protected:
   friend nsresult NS_NewSVGEllipseElement(nsIContent **aResult,
-                                          already_AddRefed<nsNodeInfo> aNodeInfo);
-  nsSVGEllipseElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+                                          already_AddRefed<nsINodeInfo> aNodeInfo);
+  nsSVGEllipseElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
 public:
   // interfaces:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMSVGELLIPSEELEMENT
 
   // xxx I wish we could use virtual inheritance
   NS_FORWARD_NSIDOMNODE(nsSVGEllipseElementBase::)
@@ -69,17 +69,17 @@ public:
   NS_FORWARD_NSIDOMSVGELEMENT(nsSVGEllipseElementBase::)
 
   // nsSVGSVGElement methods:
   virtual bool HasValidDimensions() const;
 
   // nsSVGPathGeometryElement methods:
   virtual void ConstructPath(gfxContext *aCtx);
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 protected:
 
   virtual LengthAttributesInfo GetLengthInfo();
 
   enum { CX, CY, RX, RY };
   nsSVGLength2 mLengthAttributes[4];
@@ -109,17 +109,17 @@ NS_INTERFACE_TABLE_HEAD(nsSVGEllipseElem
                            nsIDOMSVGElement, nsIDOMSVGTests,
                            nsIDOMSVGEllipseElement)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGEllipseElement)
 NS_INTERFACE_MAP_END_INHERITING(nsSVGEllipseElementBase)
 
 //----------------------------------------------------------------------
 // Implementation
 
-nsSVGEllipseElement::nsSVGEllipseElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsSVGEllipseElement::nsSVGEllipseElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGEllipseElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
 // nsIDOMNode methods
 
 NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGEllipseElement)
--- a/content/svg/content/src/nsSVGFilterElement.cpp
+++ b/content/svg/content/src/nsSVGFilterElement.cpp
@@ -89,17 +89,17 @@ NS_INTERFACE_TABLE_HEAD(nsSVGFilterEleme
                            nsIDOMSVGFilterElement,
                            nsIDOMSVGURIReference)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGFilterElement)
 NS_INTERFACE_MAP_END_INHERITING(nsSVGFilterElementBase)
 
 //----------------------------------------------------------------------
 // Implementation
 
-nsSVGFilterElement::nsSVGFilterElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+nsSVGFilterElement::nsSVGFilterElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsSVGFilterElementBase(aNodeInfo)
 {
 }
 
 //----------------------------------------------------------------------
 // nsIDOMNode methods
 
 
--- a/content/svg/content/src/nsSVGFilterElement.h
+++ b/content/svg/content/src/nsSVGFilterElement.h
@@ -55,33 +55,33 @@ class nsSVGFilterElement : public nsSVGF
                            public nsIDOMSVGURIReference,
                            public nsIDOMSVGUnitTypes
 {
   friend class nsSVGFilterFrame;
   friend class nsAutoFilterInstance;
 
 protected:
   friend nsresult NS_NewSVGFilterElement(nsIContent **aResult,
-                                         already_AddRefed<nsNodeInfo> aNodeInfo);
-  nsSVGFilterElement(already_AddRefed<nsNodeInfo> aNodeInfo);
+                                         already_AddRefed<nsINodeInfo> aNodeInfo);
+  nsSVGFilterElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
 public:
   // interfaces:
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMSVGFILTERELEMENT
   NS_DECL_NSIDOMSVGURIREFERENCE
 
   // xxx I wish we could use virtual inheritance
   NS_FORWARD_NSIDOMNODE(nsSVGFilterElementBase::)
   NS_FORWARD_NSIDOMELEMENT(nsSVGFilterElementBase::)
   NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFilterElementBase::)
 
   // nsIContent
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
   // Invalidate users of this filter
   void Invalidate();
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   // nsSVGSVGElement methods:
--- a/content/svg/content/src/nsSVGFilters.cpp
+++ b/content/svg/content/src/nsSVGFilters.cpp
@@ -329,19 +329,19 @@ nsSVGFE::GetLengthInfo()
 //---------------------Gaussian Blur------------------------
 
 typedef nsSVGFE nsSVGFEGaussianBlurElementBase;
 
 class nsSVGFEGaussianBlurElement : public nsSVGFEGaussianBlurElementBase,
                                    public nsIDOMSVGFEGaussianBlurElement
 {
   friend nsresult NS_NewSVGFEGaussianBlurElement(nsIContent **aResult,
-                                                 already_AddRefed<nsNodeInfo> aNodeInfo);
+                                                 already_AddRefed<nsINodeInfo> aNodeInfo);
 protected:
-  nsSVGFEGaussianBlurElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+  nsSVGFEGaussianBlurElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsSVGFEGaussianBlurElementBase(aNodeInfo) {}
 
 public:
   // interfaces:
   NS_DECL_ISUPPORTS_INHERITED
 
   // FE Base
   NS_FORWARD_NSIDOMSVGFILTERPRIMITIVESTANDARDATTRIBUTES(nsSVGFEGaussianBlurElementBase::)
@@ -364,17 +364,17 @@ public:
   // Gaussian
   NS_DECL_NSIDOMSVGFEGAUSSIANBLURELEMENT
 
   NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEGaussianBlurElementBase::)
 
   NS_FORWARD_NSIDOMNODE(nsSVGFEGaussianBlurElementBase::)
   NS_FORWARD_NSIDOMELEMENT(nsSVGFEGaussianBlurElementBase::)
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 protected:
   virtual NumberPairAttributesInfo GetNumberPairInfo();
   virtual StringAttributesInfo GetStringInfo();
 
   enum { STD_DEV };
   nsSVGNumberPair mNumberPairAttributes[1];
@@ -811,19 +811,19 @@ nsSVGFEGaussianBlurElement::GetStringInf
 //---------------------Blend------------------------
 
 typedef nsSVGFE nsSVGFEBlendElementBase;
 
 class nsSVGFEBlendElement : public nsSVGFEBlendElementBase,
                             public nsIDOMSVGFEBlendElement
 {
   friend nsresult NS_NewSVGFEBlendElement(nsIContent **aResult,
-                                          already_AddRefed<nsNodeInfo> aNodeInfo);
+                                          already_AddRefed<nsINodeInfo> aNodeInfo);
 protected:
-  nsSVGFEBlendElement(already_AddRefed<nsNodeInfo> aNodeInfo)
+  nsSVGFEBlendElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsSVGFEBlendElementBase(aNodeInfo) {}
 
 public:
   // interfaces:
   NS_DECL_ISUPPORTS_INHERITED
 
   // FE Base
   NS_FORWARD_NSIDOMSVGFILTERPRIMITIVESTANDARDATTRIBUTES(nsSVGFEBlendElementBase::)
@@ -840,17 +840,17 @@ public:
   // Blend
   NS_DECL_NSIDOMSVGFEBLENDELEMENT
 
   NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEBlendElementBase::)
 
   NS_FORWARD_NSIDOMNODE(nsSVGFEBlendElementBase::)
   NS_FORWARD_NSIDOMELEMENT(nsSVGFEBlendElementBase::)
 
-  virtual nsresult Clone(nsNodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsresu