Bug 811449 part 8. Get rid of nsGenericElement. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 14 Nov 2012 14:10:08 -0800
changeset 121236 ac584cdc2b14779f023e056464059639ed39b19a
parent 121235 87aa54d557dd5a5180066c6fefd09f8cbac18d82
child 121237 d391bed7d0fd2c52e3abfd27c24c850a1d46a750
push id1997
push userakeybl@mozilla.com
push dateMon, 07 Jan 2013 21:25:26 +0000
treeherdermozilla-beta@4baf45cdcf21 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs811449
milestone19.0a1
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
Bug 811449 part 8. Get rid of nsGenericElement. r=peterv
content/base/public/Element.h
content/base/src/Comment.cpp
content/base/src/DocumentFragment.cpp
content/base/src/Makefile.in
content/base/src/nsAttrAndChildArray.cpp
content/base/src/nsCCUncollectableMarker.cpp
content/base/src/nsContentList.cpp
content/base/src/nsContentUtils.cpp
content/base/src/nsDOMAttribute.cpp
content/base/src/nsDOMAttribute.h
content/base/src/nsDOMAttributeMap.cpp
content/base/src/nsDOMSettableTokenList.cpp
content/base/src/nsDOMSettableTokenList.h
content/base/src/nsDOMTokenList.cpp
content/base/src/nsDOMTokenList.h
content/base/src/nsDocument.cpp
content/base/src/nsDocument.h
content/base/src/nsGenericDOMDataNode.cpp
content/base/src/nsGenericDOMDataNode.h
content/base/src/nsGenericElement.h
content/base/src/nsINode.cpp
content/base/src/nsImageLoadingContent.cpp
content/base/src/nsNodeUtils.cpp
content/base/src/nsScriptLoader.cpp
content/base/src/nsStyledElement.cpp
content/base/src/nsStyledElement.h
content/canvas/src/CanvasRenderingContext2D.cpp
content/html/content/public/nsHTMLCanvasElement.h
content/html/content/public/nsHTMLMediaElement.h
content/html/content/src/HTMLPropertiesCollection.cpp
content/html/content/src/nsGenericHTMLElement.cpp
content/html/content/src/nsGenericHTMLElement.h
content/html/content/src/nsGenericHTMLFrameElement.cpp
content/html/content/src/nsGenericHTMLFrameElement.h
content/html/content/src/nsHTMLAnchorElement.cpp
content/html/content/src/nsHTMLAreaElement.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/nsHTMLFontElement.cpp
content/html/content/src/nsHTMLFormElement.cpp
content/html/content/src/nsHTMLFrameElement.cpp
content/html/content/src/nsHTMLFrameSetElement.cpp
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/nsHTMLImageElement.h
content/html/content/src/nsHTMLInputElement.cpp
content/html/content/src/nsHTMLLIElement.cpp
content/html/content/src/nsHTMLLabelElement.cpp
content/html/content/src/nsHTMLLegendElement.cpp
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/nsHTMLMenuItemElement.cpp
content/html/content/src/nsHTMLMenuItemElement.h
content/html/content/src/nsHTMLMetaElement.cpp
content/html/content/src/nsHTMLMeterElement.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/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/mathml/content/src/nsMathMLElement.cpp
content/smil/nsISMILAnimationElement.h
content/svg/content/src/SVGAnimatedLengthList.cpp
content/svg/content/src/SVGAnimatedNumberList.cpp
content/svg/content/src/SVGAnimatedPathSegList.cpp
content/svg/content/src/SVGAnimatedPointList.cpp
content/svg/content/src/SVGAnimatedTransformList.cpp
content/svg/content/src/nsSVGAElement.cpp
content/svg/content/src/nsSVGAnimateTransformElement.cpp
content/svg/content/src/nsSVGAnimationElement.h
content/svg/content/src/nsSVGBoolean.cpp
content/svg/content/src/nsSVGElement.cpp
content/svg/content/src/nsSVGElement.h
content/svg/content/src/nsSVGEnum.cpp
content/svg/content/src/nsSVGImageElement.cpp
content/svg/content/src/nsSVGImageElement.h
content/svg/content/src/nsSVGIntegerPair.cpp
content/svg/content/src/nsSVGMpathElement.h
content/svg/content/src/nsSVGNumber2.cpp
content/svg/content/src/nsSVGNumberPair.cpp
content/svg/content/src/nsSVGSVGElement.h
content/svg/document/src/nsSVGDocument.cpp
content/xml/content/src/nsXMLElement.cpp
content/xml/content/src/nsXMLElement.h
content/xml/content/src/nsXMLProcessingInstruction.cpp
content/xml/document/src/nsXMLContentSink.cpp
content/xml/document/src/nsXMLDocument.cpp
content/xtf/src/nsXTFElementWrapper.h
content/xul/content/src/nsXULElement.cpp
content/xul/content/src/nsXULElement.h
dom/base/nsDOMClassInfo.cpp
dom/base/nsIScriptGlobalObject.h
dom/bindings/Bindings.conf
dom/ipc/TabChild.cpp
js/xpconnect/src/dom_quickstubs.qsconf
layout/style/nsCSSRuleProcessor.cpp
layout/style/nsComputedDOMStyle.cpp
layout/style/nsDOMCSSAttrDeclaration.cpp
layout/style/nsTransitionManager.cpp
layout/svg/nsSVGOuterSVGFrame.cpp
tools/trace-malloc/types.dat
--- a/content/base/public/Element.h
+++ b/content/base/public/Element.h
@@ -110,25 +110,16 @@ enum {
 };
 
 #undef ELEMENT_FLAG_BIT
 
 namespace mozilla {
 namespace dom {
 
 class Link;
-class Element;
-
-} // namespace dom
-} // namespace mozilla
-
-typedef mozilla::dom::Element nsGenericElement;
-
-namespace mozilla {
-namespace dom {
 
 // IID for the dom::Element interface
 #define NS_ELEMENT_IID \
 { 0xc6c049a1, 0x96e8, 0x4580, \
   { 0xa6, 0x93, 0xb9, 0x5f, 0x53, 0xbe, 0xe8, 0x1c } }
 
 class Element : public FragmentOrElement
 {
--- a/content/base/src/Comment.cpp
+++ b/content/base/src/Comment.cpp
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Implementations of DOM Core's nsIDOMComment node.
  */
 
 #include "nsCOMPtr.h"
-#include "nsGenericElement.h" // DOMCI_NODE_DATA
+#include "mozilla/dom/Element.h" // DOMCI_NODE_DATA
 #include "Comment.h"
 
 using namespace mozilla;
 using namespace dom;
 
 // DOMCI_NODE_DATA needs to be outside our namespaces
 DOMCI_NODE_DATA(Comment, Comment)
 
--- a/content/base/src/DocumentFragment.cpp
+++ b/content/base/src/DocumentFragment.cpp
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Implementation of DOM Core's nsIDOMDocumentFragment.
  */
 
 #include "mozilla/dom/DocumentFragment.h"
-#include "nsGenericElement.h" // for DOMCI_NODE_DATA
+#include "mozilla/dom/Element.h" // for DOMCI_NODE_DATA
 #include "nsINameSpaceManager.h"
 #include "nsINodeInfo.h"
 #include "nsNodeInfoManager.h"
 #include "nsError.h"
 #include "nsGkAtoms.h"
 #include "nsDOMString.h"
 #include "nsContentUtils.h"
 
--- a/content/base/src/Makefile.in
+++ b/content/base/src/Makefile.in
@@ -32,17 +32,16 @@ EXPORTS		= \
 		nsTextFragment.h \
 		mozAutoDocUpdate.h \
 		nsFrameMessageManager.h \
 		nsAttrAndChildArray.h \
 		nsAttrValue.h \
 		nsAttrValueInlines.h \
 		nsCrossSiteListenerProxy.h \
 		nsDOMAttributeMap.h \
-		nsGenericElement.h \
 		nsMappedAttributeElement.h \
 		nsStyledElement.h \
     nsSandboxFlags.h \
 		$(NULL)
 
 EXPORTS_NAMESPACES = mozilla/dom
 
 EXPORTS_mozilla/dom = \
--- a/content/base/src/nsAttrAndChildArray.cpp
+++ b/content/base/src/nsAttrAndChildArray.cpp
@@ -26,17 +26,17 @@ It should be small enough to not cause c
 large enough to make sure that all indexes are used. The size below is based
 on the size of the smallest possible element (currently 24[*] bytes) which is
 the smallest distance between two nsAttrAndChildArray. 24/(2^_5_) is 0.75.
 This means that two adjacent nsAttrAndChildArrays will overlap one in 4 times.
 However not all elements will have enough children to get cached. And any
 allocator that doesn't return addresses aligned to 64 bytes will ensure that
 any index will get used.
 
-[*] sizeof(nsGenericElement) + 4 bytes for nsIDOMElement vtable pointer.
+[*] sizeof(Element) + 4 bytes for nsIDOMElement vtable pointer.
 */
 
 #define CACHE_POINTER_SHIFT 5
 #define CACHE_NUM_SLOTS 128
 #define CACHE_CHILD_LIMIT 10
 
 #define CACHE_GET_INDEX(_array) \
   ((NS_PTR_TO_INT32(_array) >> CACHE_POINTER_SHIFT) & \
--- a/content/base/src/nsCCUncollectableMarker.cpp
+++ b/content/base/src/nsCCUncollectableMarker.cpp
@@ -22,20 +22,22 @@
 #include "nsIAppShellService.h"
 #include "nsAppShellCID.h"
 #include "nsEventListenerManager.h"
 #include "nsContentUtils.h"
 #include "nsGlobalWindow.h"
 #include "nsJSEnvironment.h"
 #include "nsInProcessTabChildGlobal.h"
 #include "nsFrameLoader.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h"
 #include "xpcpublic.h"
 #include "nsObserverService.h"
 
+using namespace mozilla::dom;
+
 static bool sInited = 0;
 uint32_t nsCCUncollectableMarker::sGeneration = 0;
 #ifdef MOZ_XUL
 #include "nsXULPrototypeCache.h"
 #endif
 
 NS_IMPL_ISUPPORTS1(nsCCUncollectableMarker, nsIObserver)
 
@@ -71,26 +73,26 @@ nsCCUncollectableMarker::Init()
   return NS_OK;
 }
 
 static void
 MarkUserData(void* aNode, nsIAtom* aKey, void* aValue, void* aData)
 {
   nsIDocument* d = static_cast<nsINode*>(aNode)->GetCurrentDoc();
   if (d && nsCCUncollectableMarker::InGeneration(d->GetMarkedCCGeneration())) {
-    nsGenericElement::MarkUserData(aNode, aKey, aValue, aData);
+    Element::MarkUserData(aNode, aKey, aValue, aData);
   }
 }
 
 static void
 MarkUserDataHandler(void* aNode, nsIAtom* aKey, void* aValue, void* aData)
 {
   nsIDocument* d = static_cast<nsINode*>(aNode)->GetCurrentDoc();
   if (d && nsCCUncollectableMarker::InGeneration(d->GetMarkedCCGeneration())) {
-    nsGenericElement::MarkUserDataHandler(aNode, aKey, aValue, aData);
+    Element::MarkUserDataHandler(aNode, aKey, aValue, aData);
   }
 }
 
 static void
 MarkMessageManagers()
 {
   nsCOMPtr<nsIMessageBroadcaster> strongGlobalMM =
     do_GetService("@mozilla.org/globalmessagemanager;1");
@@ -291,17 +293,17 @@ MarkWindowList(nsISimpleEnumerator* aWin
   }
 }
 
 nsresult
 nsCCUncollectableMarker::Observe(nsISupports* aSubject, const char* aTopic,
                                  const PRUnichar* aData)
 {
   if (!strcmp(aTopic, "xpcom-shutdown")) {
-    nsGenericElement::ClearContentUnbinder();
+    Element::ClearContentUnbinder();
 
     nsCOMPtr<nsIObserverService> obs =
       mozilla::services::GetObserverService();
     if (!obs)
       return NS_ERROR_FAILURE;
 
     // No need for kungFuDeathGrip here, yay observerservice!
     obs->RemoveObserver(this, "xpcom-shutdown");
@@ -318,17 +320,17 @@ nsCCUncollectableMarker::Observe(nsISupp
 
   // JS cleanup can be slow. Do it only if there has been a GC.
   bool cleanupJS =
     nsJSContext::CleanupsSinceLastGC() == 0 &&
     !strcmp(aTopic, "cycle-collector-forget-skippable");
 
   bool prepareForCC = !strcmp(aTopic, "cycle-collector-begin");
   if (prepareForCC) {
-    nsGenericElement::ClearContentUnbinder();
+    Element::ClearContentUnbinder();
   }
 
   // Increase generation to effectivly unmark all current objects
   if (!++sGeneration) {
     ++sGeneration;
   }
 
   nsresult rv;
--- a/content/base/src/nsContentList.cpp
+++ b/content/base/src/nsContentList.cpp
@@ -9,17 +9,17 @@
  * is a commonly used NodeList implementation (used for
  * getElementsByTagName, some properties on nsIDOMHTMLDocument, etc).
  */
 
 #include "nsContentList.h"
 #include "nsIContent.h"
 #include "nsIDOMNode.h"
 #include "nsIDocument.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h"
 #include "nsWrapperCacheInlines.h"
 #include "nsContentUtils.h"
 #include "nsCCUncollectableMarker.h"
 #include "nsGkAtoms.h"
 #include "mozilla/dom/HTMLCollectionBinding.h"
 #include "mozilla/dom/NodeListBinding.h"
 #include "mozilla/Likely.h"
 #include "nsGenericHTMLElement.h"
@@ -61,17 +61,17 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsBaseContentList)
   if (nsCCUncollectableMarker::sGeneration && tmp->IsBlack()) {
     for (uint32_t i = 0; i < tmp->mElements.Length(); ++i) {
       nsIContent* c = tmp->mElements[i];
       if (c->IsPurple()) {
         c->RemovePurple();
       }
-      nsGenericElement::MarkNodeChildren(c);
+      Element::MarkNodeChildren(c);
     }
     return true;
   }
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsBaseContentList)
   return nsCCUncollectableMarker::sGeneration && tmp->IsBlack();
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
@@ -695,20 +695,20 @@ nsContentList::NamedItem(const nsAString
     return CallQueryInterface(content, aReturn);
   }
 
   *aReturn = nullptr;
 
   return NS_OK;
 }
 
-nsGenericElement*
+Element*
 nsContentList::GetElementAt(uint32_t aIndex)
 {
-  return static_cast<nsGenericElement*>(Item(aIndex, true));
+  return static_cast<Element*>(Item(aIndex, true));
 }
 
 nsIContent*
 nsContentList::Item(uint32_t aIndex)
 {
   return GetElementAt(aIndex);
 }
 
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -415,17 +415,17 @@ nsContentUtils::Init()
                                "full-screen-api.allow-trusted-requests-only");
 
   sIsIdleObserverAPIEnabled = Preferences::GetBool("dom.idle-observers-api.enabled", true);
 
   Preferences::AddUintVarCache(&sHandlingInputTimeout,
                                "dom.event.handling-user-input-time-limit",
                                1000);
 
-  nsGenericElement::InitCCCallbacks();
+  Element::InitCCCallbacks();
 
   sInitialized = true;
 
   return NS_OK;
 }
 
 void
 nsContentUtils::GetShiftText(nsAString& text)
--- a/content/base/src/nsDOMAttribute.cpp
+++ b/content/base/src/nsDOMAttribute.cpp
@@ -3,17 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Implementation of DOM Core's nsIDOMAttr node.
  */
 
 #include "nsDOMAttribute.h"
-#include "nsGenericElement.h"
 #include "mozilla/dom/Element.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsINameSpaceManager.h"
 #include "nsError.h"
 #include "nsUnicharUtils.h"
 #include "nsDOMString.h"
 #include "nsIDocument.h"
 #include "nsIDOMDocument.h"
--- a/content/base/src/nsDOMAttribute.h
+++ b/content/base/src/nsDOMAttribute.h
@@ -15,17 +15,16 @@
 #include "nsIDOMText.h"
 #include "nsIDOMNodeList.h"
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsINodeInfo.h"
 #include "nsDOMAttributeMap.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsStubMutationObserver.h"
-#include "nsGenericElement.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:
   nsDOMAttribute(nsDOMAttributeMap* aAttrMap,
--- a/content/base/src/nsDOMAttributeMap.cpp
+++ b/content/base/src/nsDOMAttributeMap.cpp
@@ -5,17 +5,17 @@
 
 /*
  * Implementation of the |attributes| property of DOM Core's nsIDOMNode object.
  */
 
 #include "nsDOMAttributeMap.h"
 #include "nsDOMAttribute.h"
 #include "nsIDOMDocument.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h"
 #include "nsIDocument.h"
 #include "nsINameSpaceManager.h"
 #include "nsError.h"
 #include "nsContentUtils.h"
 #include "nsNodeInfoManager.h"
 #include "nsAttrName.h"
 #include "nsUnicharUtils.h"
 
--- a/content/base/src/nsDOMSettableTokenList.cpp
+++ b/content/base/src/nsDOMSettableTokenList.cpp
@@ -3,20 +3,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Implementation of nsIDOMDOMSettableTokenList specified by HTML5.
  */
 
 #include "nsDOMSettableTokenList.h"
 #include "mozilla/dom/DOMSettableTokenListBinding.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h"
 
 
-nsDOMSettableTokenList::nsDOMSettableTokenList(nsGenericElement *aElement, nsIAtom* aAttrAtom)
+nsDOMSettableTokenList::nsDOMSettableTokenList(Element *aElement, nsIAtom* aAttrAtom)
   : nsDOMTokenList(aElement, aAttrAtom)
 {
 }
 
 nsDOMSettableTokenList::~nsDOMSettableTokenList()
 {
 }
 
--- a/content/base/src/nsDOMSettableTokenList.h
+++ b/content/base/src/nsDOMSettableTokenList.h
@@ -16,17 +16,17 @@ namespace mozilla {
 namespace dom {
 class Element;
 } // namespace dom
 } // namespace mozilla
 
 class nsIAtom;
 
 // nsISupports must be on the primary inheritance chain 
-// because nsDOMSettableTokenList is traversed by nsGenericElement.
+// because nsDOMSettableTokenList is traversed by Element.
 class nsDOMSettableTokenList : public nsDOMTokenList,
                                public nsIDOMDOMSettableTokenList
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMDOMSETTABLETOKENLIST
 
   NS_FORWARD_NSIDOMDOMTOKENLIST(nsDOMTokenList::);
--- a/content/base/src/nsDOMTokenList.cpp
+++ b/content/base/src/nsDOMTokenList.cpp
@@ -6,24 +6,24 @@
  * Implementation of nsIDOMDOMTokenList specified by HTML5.
  */
 
 #include "nsDOMTokenList.h"
 
 #include "nsAttrValue.h"
 #include "nsContentUtils.h"
 #include "nsError.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h"
 #include "mozilla/dom/DOMTokenListBinding.h"
 #include "mozilla/ErrorResult.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
-nsDOMTokenList::nsDOMTokenList(nsGenericElement* aElement, nsIAtom* aAttrAtom)
+nsDOMTokenList::nsDOMTokenList(Element* aElement, nsIAtom* aAttrAtom)
   : mElement(aElement),
     mAttrAtom(aAttrAtom)
 {
   // We don't add a reference to our element. If it goes away,
   // we'll be told to drop our reference
   SetIsDOMBinding();
 }
 
--- a/content/base/src/nsDOMTokenList.h
+++ b/content/base/src/nsDOMTokenList.h
@@ -25,16 +25,17 @@ class Element;
 class nsAttrValue;
 class nsIAtom;
 
 // nsISupports must be on the primary inheritance chain 
 // because nsDOMSettableTokenList is traversed by Element.
 class nsDOMTokenList : public nsIDOMDOMTokenList,
                        public nsWrapperCache
 {
+protected:
   typedef mozilla::dom::Element Element;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMTokenList)
   NS_DECL_NSIDOMDOMTOKENLIST
 
   nsDOMTokenList(Element* aElement, nsIAtom* aAttrAtom);
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -37,17 +37,17 @@
 #include "nsAsyncDOMEvent.h"
 #include "nsIDOMNodeFilter.h"
 
 #include "nsIDOMStyleSheet.h"
 #include "nsDOMAttribute.h"
 #include "nsIDOMDOMStringList.h"
 #include "nsIDOMDOMImplementation.h"
 #include "nsIDOMDocumentXBL.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIDOMCDATASection.h"
 #include "nsIDOMProcessingInstruction.h"
 #include "nsDOMString.h"
 #include "nsNodeUtils.h"
 #include "nsLayoutUtils.h" // for GetFrameForPoint
 #include "nsIFrame.h"
 #include "nsITabChild.h"
@@ -1500,31 +1500,31 @@ NS_INTERFACE_TABLE_HEAD(nsDocument)
 NS_INTERFACE_MAP_END
 
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDocument)
 NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_DESTROY(nsDocument,
                                               nsNodeUtils::LastRelease(this))
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsDocument)
-  if (nsGenericElement::CanSkip(tmp, aRemovingAllowed)) {
+  if (Element::CanSkip(tmp, aRemovingAllowed)) {
     nsEventListenerManager* elm = tmp->GetListenerManager(false);
     if (elm) {
       elm->MarkForCC();
     }
     return true;
   }
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsDocument)
-  return nsGenericElement::CanSkipInCC(tmp);
+  return Element::CanSkipInCC(tmp);
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsDocument)
-  return nsGenericElement::CanSkipThis(tmp);
+  return Element::CanSkipThis(tmp);
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
 
 static PLDHashOperator
 SubDocTraverser(PLDHashTable *table, PLDHashEntryHdr *hdr, uint32_t number,
                 void *arg)
 {
   SubDocMapEntry *entry = static_cast<SubDocMapEntry*>(hdr);
   nsCycleCollectionTraversalCallback *cb =
@@ -5703,17 +5703,17 @@ BlastFunc(nsAttrHashKey::KeyType aKey, n
 
   return PL_DHASH_STOP;
 }
 
 static void
 BlastSubtreeToPieces(nsINode *aNode)
 {
   if (aNode->IsElement()) {
-    nsGenericElement *element = static_cast<nsGenericElement*>(aNode);
+    Element *element = aNode->AsElement();
     const nsDOMAttributeMap *map = element->GetAttributeMap();
     if (map) {
       nsCOMPtr<nsIAttribute> attr;
       while (map->Enumerate(BlastFunc, &attr) > 0) {
         BlastSubtreeToPieces(attr);
 
 #ifdef DEBUG
         nsresult rv =
@@ -7460,17 +7460,17 @@ nsDocument::MaybePreLoadImage(nsIURI* ur
   int16_t blockingStatus;
   if (nsContentUtils::IsImageInCache(uri, static_cast<nsIDocument *>(this)) ||
       !nsContentUtils::CanLoadImage(uri, static_cast<nsIDocument *>(this),
                                     this, NodePrincipal(), &blockingStatus)) {
     return;
   }
 
   nsLoadFlags loadFlags = nsIRequest::LOAD_NORMAL;
-  switch (nsGenericElement::StringToCORSMode(aCrossOriginAttr)) {
+  switch (Element::StringToCORSMode(aCrossOriginAttr)) {
   case CORS_NONE:
     // Nothing to do
     break;
   case CORS_ANONYMOUS:
     loadFlags |= imgILoader::LOAD_CORS_ANONYMOUS;
     break;
   case CORS_USE_CREDENTIALS:
     loadFlags |= imgILoader::LOAD_CORS_USE_CREDENTIALS;
@@ -7544,17 +7544,17 @@ nsDocument::PreloadStyle(nsIURI* uri, co
 {
   // The CSSLoader will retain this object after we return.
   nsCOMPtr<nsICSSLoaderObserver> obs = new StubCSSLoaderObserver();
 
   // Charset names are always ASCII.
   CSSLoader()->LoadSheet(uri, NodePrincipal(),
                          NS_LossyConvertUTF16toASCII(charset),
                          obs,
-                         nsGenericElement::StringToCORSMode(aCrossOriginAttr));
+                         Element::StringToCORSMode(aCrossOriginAttr));
 }
 
 nsresult
 nsDocument::LoadChromeSheetSync(nsIURI* uri, bool isAgentSheet,
                                 nsCSSStyleSheet** sheet)
 {
   return CSSLoader()->LoadSheetSync(uri, isAgentSheet, isAgentSheet, sheet);
 }
@@ -8306,17 +8306,17 @@ nsDocument::MozCancelFullScreen()
   }
   return NS_OK;
 }
 
 // Runnable to set window full-screen mode. Used as a script runner
 // to ensure we only call nsGlobalWindow::SetFullScreen() when it's safe to
 // run script. nsGlobalWindow::SetFullScreen() dispatches a synchronous event
 // (handled in chome code) which is unsafe to run if this is called in
-// nsGenericElement::UnbindFromTree().
+// Element::UnbindFromTree().
 class nsSetWindowFullScreen : public nsRunnable {
 public:
   nsSetWindowFullScreen(nsIDocument* aDoc, bool aValue)
     : mDoc(aDoc), mValue(aValue) {}
 
   NS_IMETHOD Run()
   {
     if (mDoc->GetWindow()) {
--- a/content/base/src/nsDocument.h
+++ b/content/base/src/nsDocument.h
@@ -64,17 +64,16 @@
 #include "nsIChannelEventSink.h"
 #include "imgIRequest.h"
 #include "nsIDOMDOMImplementation.h"
 #include "nsIDOMTouchEvent.h"
 #include "nsIInlineEventHandlers.h"
 #include "nsDataHashtable.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Attributes.h"
-#include "nsGenericElement.h"
 
 #define XML_DECLARATION_BITS_DECLARATION_EXISTS   (1 << 0)
 #define XML_DECLARATION_BITS_ENCODING_EXISTS      (1 << 1)
 #define XML_DECLARATION_BITS_STANDALONE_EXISTS    (1 << 2)
 #define XML_DECLARATION_BITS_STANDALONE_YES       (1 << 3)
 
 
 class nsEventListenerManager;
--- a/content/base/src/nsGenericDOMDataNode.cpp
+++ b/content/base/src/nsGenericDOMDataNode.cpp
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Base class for DOM Core's nsIDOMComment, nsIDOMDocumentType, nsIDOMText,
  * nsIDOMCDATASection, and nsIDOMProcessingInstruction nodes.
  */
 
 #include "nsGenericDOMDataNode.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h"
 #include "nsIDocument.h"
 #include "nsEventListenerManager.h"
 #include "nsIDOMDocument.h"
 #include "nsReadableUtils.h"
 #include "nsMutationEvent.h"
 #include "nsINameSpaceManager.h"
 #include "nsIURI.h"
 #include "nsIDOMEvent.h"
@@ -31,16 +31,17 @@
 #include "mozAutoDocUpdate.h"
 #include "nsAsyncDOMEvent.h"
 
 #include "pldhash.h"
 #include "prprf.h"
 #include "nsWrapperCacheInlines.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 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() ==
@@ -60,25 +61,25 @@ nsGenericDOMDataNode::~nsGenericDOMDataN
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsGenericDOMDataNode)
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsGenericDOMDataNode)
   nsINode::Trace(tmp, aCallback, aClosure);
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsGenericDOMDataNode)
-  return nsGenericElement::CanSkip(tmp, aRemovingAllowed);
+  return Element::CanSkip(tmp, aRemovingAllowed);
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsGenericDOMDataNode)
-  return nsGenericElement::CanSkipInCC(tmp);
+  return Element::CanSkipInCC(tmp);
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsGenericDOMDataNode)
-  return nsGenericElement::CanSkipThis(tmp);
+  return Element::CanSkipThis(tmp);
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGenericDOMDataNode)
   // Always need to traverse script objects, so do that before we check
   // if we're uncollectable.
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
 
   if (!nsINode::Traverse(tmp, cb)) {
@@ -464,17 +465,17 @@ nsGenericDOMDataNode::BindToTree(nsIDocu
   // XXXbz sXBL/XBL2 issue!
 
   // Set document
   if (aDocument) {
     // We no longer need to track the subtree pointer (and in fact we'll assert
     // if we do this any later).
     ClearSubtreeRootPointer();
 
-    // XXX See the comment in nsGenericElement::BindToTree
+    // XXX See the comment in Element::BindToTree
     SetInDocument();
     if (mText.IsBidi()) {
       aDocument->SetBidiEnabled();
     }
     // Clear the lazy frame construction bits.
     UnsetFlags(NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES);
   } else {
     // If we're not in the doc, update our subtree pointer.
--- a/content/base/src/nsGenericDOMDataNode.h
+++ b/content/base/src/nsGenericDOMDataNode.h
@@ -11,17 +11,17 @@
 #ifndef nsGenericDOMDataNode_h___
 #define nsGenericDOMDataNode_h___
 
 #include "nsIContent.h"
 
 #include "nsTextFragment.h"
 #include "nsError.h"
 #include "nsEventListenerManager.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h"
 #include "nsCycleCollectionParticipant.h"
 
 #include "nsISMILAttr.h"
 
 class nsIDOMAttr;
 class nsIDOMEventListener;
 class nsIDOMNodeList;
 class nsIFrame;
deleted file mode 100644
--- a/content/base/src/nsGenericElement.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsGenericElement_h___
-#define nsGenericElement_h___
-
-#include "mozilla/dom/Element.h"
-
-#endif /* nsGenericElement_h___ */
--- a/content/base/src/nsINode.cpp
+++ b/content/base/src/nsINode.cpp
@@ -36,17 +36,17 @@
 #include "nsDOMString.h"
 #include "nsDOMTokenList.h"
 #include "nsEventDispatcher.h"
 #include "nsEventListenerManager.h"
 #include "nsEventStateManager.h"
 #include "nsFocusManager.h"
 #include "nsFrameManager.h"
 #include "nsFrameSelection.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsIAnonymousContentCreator.h"
 #include "nsIAtom.h"
 #include "nsIBaseWindow.h"
 #include "nsICategoryManager.h"
 #include "nsIContentIterator.h"
 #include "nsIControllers.h"
@@ -1572,17 +1572,17 @@ nsINode::ReplaceOrInsertBefore(bool aRep
     if (oldParent) {
       nsContentUtils::MaybeFireNodeRemoved(aNewChild, oldParent,
                                            aNewChild->OwnerDoc());
     }
 
     // If we're inserting a fragment, fire for all the children of the
     // fragment
     if (nodeType == nsIDOMNode::DOCUMENT_FRAGMENT_NODE) {
-      static_cast<nsGenericElement*>(aNewChild)->FireNodeRemovedForChildren();
+      static_cast<FragmentOrElement*>(aNewChild)->FireNodeRemovedForChildren();
     }
     // Verify that our aRefChild is still sensible
     if (aRefChild && aRefChild->GetParentNode() != this) {
       aError.Throw(NS_ERROR_DOM_NOT_FOUND_ERR);
       return nullptr;
     }
   }
 
@@ -1888,17 +1888,17 @@ nsINode::ReplaceOrInsertBefore(bool aRep
       nsNodeUtils::ContentAppended(static_cast<nsIContent*>(this),
                                    firstInsertedContent, firstInsPos);
       if (mutationBatch) {
         mutationBatch->NodesAdded();
       }
       // Optimize for the case when there are no listeners
       if (nsContentUtils::
             HasMutationListeners(doc, NS_EVENT_BITS_MUTATION_NODEINSERTED)) {
-        nsGenericElement::FireNodeInserted(doc, this, fragChildren.ref());
+        Element::FireNodeInserted(doc, this, fragChildren.ref());
       }
     }
   }
   else {
     // Not inserting a fragment but rather a single node.
 
     // FIXME https://bugzilla.mozilla.org/show_bug.cgi?id=544654
     //       We need to reparent here for nodes for which the parent of their
@@ -2267,22 +2267,22 @@ FindMatchingElements(nsINode* aRoot, con
 
   return NS_OK;
 }
 
 struct ElementHolder {
   ElementHolder() : mElement(nullptr) {}
   void AppendElement(Element* aElement) {
     NS_ABORT_IF_FALSE(!mElement, "Should only get one element");
-    mElement = static_cast<nsGenericElement*>(aElement);
+    mElement = aElement;
   }
-  nsGenericElement* mElement;
+  Element* mElement;
 };
 
-nsGenericElement*
+Element*
 nsINode::QuerySelector(const nsAString& aSelector, ErrorResult& aResult)
 {
   ElementHolder holder;
   aResult = FindMatchingElements<true>(this, aSelector, holder);
 
   return holder.mElement;
 }
 
@@ -2327,20 +2327,20 @@ nsINode::WrapObject(JSContext *aCx, JSOb
 }
 
 bool
 nsINode::IsSupported(const nsAString& aFeature, const nsAString& aVersion)
 {
   return nsContentUtils::InternalIsSupported(this, aFeature, aVersion);
 }
 
-nsGenericElement*
+Element*
 nsINode::GetParentElement() const
 {
-  return static_cast<nsGenericElement*>(GetElementParent());
+  return GetElementParent();
 }
 
 already_AddRefed<nsINode>
 nsINode::CloneNode(bool aDeep, ErrorResult& aError)
 {
   bool callUserDataHandlers = NodeType() != nsIDOMNode::DOCUMENT_NODE ||
                               !static_cast<nsIDocument*>(this)->CreatingStaticClone();
 
@@ -2351,17 +2351,17 @@ nsINode::CloneNode(bool aDeep, ErrorResu
 }
 
 nsDOMAttributeMap*
 nsINode::GetAttributes()
 {
   if (!IsElement()) {
     return nullptr;
   }
-  return static_cast<nsGenericElement*>(nsINode::AsElement())->GetAttributes();
+  return AsElement()->GetAttributes();
 }
 
 nsresult
 nsINode::GetAttributes(nsIDOMNamedNodeMap** aAttributes)
 {
   if (!IsElement()) {
     *aAttributes = nullptr;
     return NS_OK;
--- a/content/base/src/nsImageLoadingContent.cpp
+++ b/content/base/src/nsImageLoadingContent.cpp
@@ -21,17 +21,16 @@
 #include "nsContentPolicyUtils.h"
 #include "nsIURI.h"
 #include "nsILoadGroup.h"
 #include "imgIContainer.h"
 #include "imgILoader.h"
 #include "nsThreadUtils.h"
 #include "nsNetUtil.h"
 #include "nsAsyncDOMEvent.h"
-#include "nsGenericElement.h"
 #include "nsImageFrame.h"
 
 #include "nsIPresShell.h"
 #include "nsEventStates.h"
 #include "nsGUIEvent.h"
 
 #include "nsIChannel.h"
 #include "nsIStreamListener.h"
--- a/content/base/src/nsNodeUtils.cpp
+++ b/content/base/src/nsNodeUtils.cpp
@@ -9,17 +9,16 @@
 #include "nsINode.h"
 #include "nsIContent.h"
 #include "mozilla/dom/Element.h"
 #include "nsIMutationObserver.h"
 #include "nsIDocument.h"
 #include "nsIDOMUserDataHandler.h"
 #include "nsEventListenerManager.h"
 #include "nsIXPConnect.h"
-#include "nsGenericElement.h"
 #include "pldhash.h"
 #include "nsIDOMAttr.h"
 #include "nsCOMArray.h"
 #include "nsPIDOMWindow.h"
 #include "nsDocument.h"
 #ifdef MOZ_XUL
 #include "nsXULElement.h"
 #endif
@@ -431,19 +430,17 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNod
                                                nodeInfo->NamespaceID(),
                                                nodeInfo->NodeType(),
                                                nodeInfo->GetExtraName());
     NS_ENSURE_TRUE(newNodeInfo, NS_ERROR_OUT_OF_MEMORY);
 
     nodeInfo = newNodeInfo;
   }
 
-  nsGenericElement *elem = aNode->IsElement() ?
-                           static_cast<nsGenericElement*>(aNode) :
-                           nullptr;
+  Element *elem = aNode->IsElement() ? aNode->AsElement() : nullptr;
 
   nsCOMPtr<nsINode> clone;
   if (aClone) {
     rv = aNode->Clone(nodeInfo, getter_AddRefs(clone));
     NS_ENSURE_SUCCESS(rv, rv);
 
     if (aParent) {
       // If we're cloning we need to insert the cloned children into the cloned
--- a/content/base/src/nsScriptLoader.cpp
+++ b/content/base/src/nsScriptLoader.cpp
@@ -35,17 +35,17 @@
 #include "nsThreadUtils.h"
 #include "nsDocShellCID.h"
 #include "nsIContentSecurityPolicy.h"
 #include "prlog.h"
 #include "nsIChannelPolicy.h"
 #include "nsChannelPolicy.h"
 #include "nsCRT.h"
 #include "nsContentCreatorFunctions.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h"
 #include "nsCrossSiteListenerProxy.h"
 #include "nsSandboxFlags.h"
 
 #include "mozilla/CORSMode.h"
 #include "mozilla/Attributes.h"
 
 #ifdef PR_LOGGING
 static PRLogModuleInfo* gCspPRLog;
@@ -1240,17 +1240,17 @@ nsScriptLoader::PreloadURI(nsIURI *aURI,
 {
   // Check to see if scripts has been turned off.
   if (!mEnabled || !mDocument->IsScriptEnabled()) {
     return;
   }
 
   nsRefPtr<nsScriptLoadRequest> request =
     new nsScriptLoadRequest(nullptr, 0,
-                            nsGenericElement::StringToCORSMode(aCrossOrigin));
+                            Element::StringToCORSMode(aCrossOrigin));
   request->mURI = aURI;
   request->mIsInline = false;
   request->mLoading = true;
   nsresult rv = StartLoad(request, aType);
   if (NS_FAILED(rv)) {
     return;
   }
 
--- a/content/base/src/nsStyledElement.cpp
+++ b/content/base/src/nsStyledElement.cpp
@@ -3,31 +3,32 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsStyledElement.h"
 #include "nsGkAtoms.h"
 #include "nsAttrValue.h"
 #include "nsAttrValueInlines.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h"
 #include "nsMutationEvent.h"
 #include "nsDOMCSSDeclaration.h"
 #include "nsDOMCSSAttrDeclaration.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIDocument.h"
 #include "mozilla/css/StyleRule.h"
 #include "nsCSSParser.h"
 #include "mozilla/css/Loader.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsXULElement.h"
 #include "nsIDOMSVGStylable.h"
 #include "nsContentUtils.h"
 
 namespace css = mozilla::css;
+using namespace mozilla::dom;
 
 //----------------------------------------------------------------------
 // nsIContent methods
 
 nsIAtom*
 nsStyledElementNotElementCSSInlineStyle::GetClassAttributeName() const
 {
   return nsGkAtoms::_class;
@@ -39,17 +40,17 @@ nsStyledElementNotElementCSSInlineStyle:
   return nsGkAtoms::id;
 }
 
 nsIAtom*
 nsStyledElementNotElementCSSInlineStyle::DoGetID() const
 {
   NS_ASSERTION(HasID(), "Unexpected call");
 
-  // The nullcheck here is needed because nsGenericElement::UnsetAttr calls
+  // The nullcheck here is needed because Element::UnsetAttr calls
   // out to various code between removing the attribute and we get a chance to
   // ClearHasID().
 
   const nsAttrValue* attr = mAttrsAndChildren.GetAttr(nsGkAtoms::id);
 
   return attr ? attr->GetAtomValue() : nullptr;
 }
 
@@ -102,35 +103,34 @@ nsStyledElementNotElementCSSInlineStyle:
                                                    bool aNotify)
 {
   nsAutoScriptBlocker scriptBlocker;
   if (aAttribute == nsGkAtoms::id && aNameSpaceID == kNameSpaceID_None) {
     // Have to do this before clearing flag. See RemoveFromIdTable
     RemoveFromIdTable();
   }
 
-  return nsGenericElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
+  return Element::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
 }
 
 nsresult
 nsStyledElementNotElementCSSInlineStyle::AfterSetAttr(int32_t aNamespaceID,
                                                       nsIAtom* aAttribute,
                                                       const nsAttrValue* aValue,
                                                       bool aNotify)
 {
   if (aNamespaceID == kNameSpaceID_None && !aValue &&
       aAttribute == nsGkAtoms::id) {
     // The id has been removed when calling UnsetAttr but we kept it because
     // the id is used for some layout stuff between UnsetAttr and AfterSetAttr.
     // Now. the id is really removed so it would not be safe to keep this flag.
     ClearHasID();
   }
 
-  return nsGenericElement::AfterSetAttr(aNamespaceID, aAttribute, aValue,
-                                        aNotify);
+  return Element::AfterSetAttr(aNamespaceID, aAttribute, aValue, aNotify);
 }
 
 nsresult
 nsStyledElementNotElementCSSInlineStyle::SetInlineStyleRule(css::StyleRule* aStyleRule,
                                                             const nsAString* aSerialized,
                                                             bool aNotify)
 {
   SetMayHaveStyle();
@@ -189,17 +189,17 @@ nsStyledElementNotElementCSSInlineStyle:
 }
 
 // ---------------------------------------------------------------
 // Others and helpers
 
 nsICSSDeclaration*
 nsStyledElementNotElementCSSInlineStyle::GetStyle(nsresult* retval)
 {
-  nsGenericElement::nsDOMSlots *slots = DOMSlots();
+  Element::nsDOMSlots *slots = DOMSlots();
 
   if (!slots->mStyle) {
     // Just in case...
     ReparseStyleAttribute(true);
 
     slots->mStyle = new nsDOMCSSAttributeDeclaration(this, false);
     SetMayHaveStyle();
   }
--- a/content/base/src/nsStyledElement.h
+++ b/content/base/src/nsStyledElement.h
@@ -9,25 +9,25 @@
  * id/class/style attributes; it is a common base for their support in HTML,
  * SVG and MathML.
  */
 
 #ifndef __NS_STYLEDELEMENT_H_
 #define __NS_STYLEDELEMENT_H_
 
 #include "nsString.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h"
 
 namespace mozilla {
 namespace css {
 class StyleRule;
 }
 }
 
-typedef nsGenericElement nsStyledElementBase;
+typedef mozilla::dom::Element nsStyledElementBase;
 
 class nsStyledElementNotElementCSSInlineStyle : public nsStyledElementBase
 {
 
 protected:
 
   inline nsStyledElementNotElementCSSInlineStyle(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsStyledElementBase(aNodeInfo)
--- a/content/canvas/src/CanvasRenderingContext2D.cpp
+++ b/content/canvas/src/CanvasRenderingContext2D.cpp
@@ -497,22 +497,22 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Can
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(CanvasRenderingContext2D)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mCanvasElement, nsINode)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(CanvasRenderingContext2D)
  if (nsCCUncollectableMarker::sGeneration && tmp->IsBlack()) {
-    nsGenericElement* canvasElement = tmp->mCanvasElement;
+   dom::Element* canvasElement = tmp->mCanvasElement;
     if (canvasElement) {
       if (canvasElement->IsPurple()) {
         canvasElement->RemovePurple();
       }
-      nsGenericElement::MarkNodeChildren(canvasElement);
+      dom::Element::MarkNodeChildren(canvasElement);
     }
     return true;
   }
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(CanvasRenderingContext2D)
   return nsCCUncollectableMarker::sGeneration && tmp->IsBlack();
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
--- a/content/html/content/public/nsHTMLCanvasElement.h
+++ b/content/html/content/public/nsHTMLCanvasElement.h
@@ -126,17 +126,17 @@ public:
                    const nsAString& aValue, bool aNotify)
   {
     return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
   }
   virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                            nsIAtom* aPrefix, const nsAString& aValue,
                            bool aNotify);
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-  nsresult CopyInnerTo(nsGenericElement* aDest);
+  nsresult CopyInnerTo(mozilla::dom::Element* aDest);
 
   /*
    * Helpers called by various users of Canvas
    */
 
   already_AddRefed<CanvasLayer> GetCanvasLayer(nsDisplayListBuilder* aBuilder,
                                                CanvasLayer *aOldLayer,
                                                LayerManager *aManager);
@@ -194,12 +194,12 @@ public:
   void ResetPrintCallback();
 
   nsIDOMHTMLCanvasElement* GetOriginalCanvas();
 };
 
 inline nsISupports*
 GetISupports(nsHTMLCanvasElement* p)
 {
-  return static_cast<nsGenericElement*>(p);
+  return static_cast<mozilla::dom::Element*>(p);
 }
 
 #endif /* nsHTMLCanvasElement_h__ */
--- a/content/html/content/public/nsHTMLMediaElement.h
+++ b/content/html/content/public/nsHTMLMediaElement.h
@@ -353,17 +353,17 @@ public:
   already_AddRefed<nsILoadGroup> GetDocumentLoadGroup();
 
   /**
    * Returns true if the media has played or completed a seek.
    * Used by video frame to determine whether to paint the poster.
    */
   bool GetPlayedOrSeeked() const { return mHasPlayedOrSeeked; }
 
-  nsresult CopyInnerTo(nsGenericElement* aDest);
+  nsresult CopyInnerTo(mozilla::dom::Element* aDest);
 
   /**
    * Sets the Accept header on the HTTP channel to the required
    * video or audio MIME types.
    */
   virtual nsresult SetAcceptHeader(nsIHttpChannel* aChannel) = 0;
 
   /**
--- a/content/html/content/src/HTMLPropertiesCollection.cpp
+++ b/content/html/content/src/HTMLPropertiesCollection.cpp
@@ -145,17 +145,17 @@ HTMLPropertiesCollection::NamedItem(JSCo
                                     mozilla::ErrorResult& error)
 {
   // HTMLPropertiesCollection.namedItem and the named getter call the NamedItem
   // that returns a PropertyNodeList, calling HTMLCollection.namedItem doesn't
   // make sense so this returns null.
   return nullptr;
 }
 
-nsGenericElement*
+Element*
 HTMLPropertiesCollection::GetElementAt(uint32_t aIndex)
 {
   EnsureFresh();
   return mProperties.SafeElementAt(aIndex);
 }
 
 nsINode*
 HTMLPropertiesCollection::GetParentObject()
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -273,17 +273,17 @@ nsGenericHTMLElement::DOMQueryInterface(
   NS_INTERFACE_TABLE_TO_MAP_SEGUE
   NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMElementCSSInlineStyle,
                                  new nsGenericHTMLElementTearoff(this))
   NS_INTERFACE_MAP_END
 
 // No closing bracket, because NS_INTERFACE_MAP_END does that for us.
 
 nsresult
-nsGenericHTMLElement::CopyInnerTo(nsGenericElement* aDst)
+nsGenericHTMLElement::CopyInnerTo(Element* aDst)
 {
   nsresult rv;
   int32_t i, count = GetAttrCount();
   for (i = 0; i < count; ++i) {
     const nsAttrName *name = mAttrsAndChildren.AttrNameAt(i);
     const nsAttrValue *value = mAttrsAndChildren.AttrAt(i);
 
     nsAutoString valStr;
@@ -375,17 +375,17 @@ static bool IS_TABLE_CELL(nsIAtom* frame
 static bool
 IsOffsetParent(nsIFrame* aFrame)
 {
   nsIAtom* frameType = aFrame->GetType();
   return (IS_TABLE_CELL(frameType) ||
           frameType == nsGkAtoms::tableFrame);
 }
 
-nsGenericElement*
+Element*
 nsGenericHTMLElement::GetOffsetRect(nsRect& aRect)
 {
   aRect = nsRect();
 
   nsIFrame* frame = GetStyledFrame();
   if (!frame) {
     return nullptr;
   }
@@ -476,19 +476,17 @@ nsGenericHTMLElement::GetOffsetRect(nsRe
 
   // Get the union of all rectangles in this and continuation frames.
   // It doesn't really matter what we use as aRelativeTo here, since
   // we only care about the size. We just have to use something non-null.
   nsRect rcFrame = nsLayoutUtils::GetAllInFlowRectsUnion(frame, frame);
   aRect.width = nsPresContext::AppUnitsToIntCSSPixels(rcFrame.width);
   aRect.height = nsPresContext::AppUnitsToIntCSSPixels(rcFrame.height);
 
-  return offsetParent ?
-         static_cast<nsGenericElement*>(offsetParent->AsElement()) :
-         nullptr;
+  return offsetParent ? offsetParent->AsElement() : nullptr;
 }
 
 // Try to keep the size of StringBuilder close to a jemalloc bucket size.
 #define STRING_BUFFER_UNITS 1020
 
 class StringBuilder
 {
 private:
@@ -1177,17 +1175,17 @@ nsGenericHTMLElement::FireMutationEvents
     NS_ASSERTION(newChildCount - aOldChildCount >= 0,
                  "What, some unexpected dom mutation has happened?");
     childNodes.SetCapacity(newChildCount - aOldChildCount);
     for (nsIContent* child = aDest->GetFirstChild();
          child;
          child = child->GetNextSibling()) {
       childNodes.AppendElement(child);
     }
-    nsGenericElement::FireNodeInserted(aDoc, aDest, childNodes);
+    Element::FireNodeInserted(aDoc, aDest, childNodes);
   }
 }
 
 void
 nsGenericHTMLElement::SetInnerHTML(const nsAString& aInnerHTML,
                                    ErrorResult& aError)
 {
   nsIDocument* doc = OwnerDoc();
@@ -2331,57 +2329,57 @@ nsGenericHTMLElement::MapCommonAttribute
 /* static */ const nsGenericHTMLElement::MappedAttributeEntry
 nsGenericHTMLElement::sCommonAttributeMap[] = {
   { &nsGkAtoms::contenteditable },
   { &nsGkAtoms::lang },
   { &nsGkAtoms::hidden },
   { nullptr }
 };
 
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsGenericHTMLElement::sImageMarginSizeAttributeMap[] = {
   { &nsGkAtoms::width },
   { &nsGkAtoms::height },
   { &nsGkAtoms::hspace },
   { &nsGkAtoms::vspace },
   { nullptr }
 };
 
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsGenericHTMLElement::sImageAlignAttributeMap[] = {
   { &nsGkAtoms::align },
   { nullptr }
 };
 
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsGenericHTMLElement::sDivAlignAttributeMap[] = {
   { &nsGkAtoms::align },
   { nullptr }
 };
 
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsGenericHTMLElement::sImageBorderAttributeMap[] = {
   { &nsGkAtoms::border },
   { nullptr }
 };
 
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsGenericHTMLElement::sBackgroundAttributeMap[] = {
   { &nsGkAtoms::background },
   { &nsGkAtoms::bgcolor },
   { nullptr }
 };
 
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsGenericHTMLElement::sBackgroundColorAttributeMap[] = {
   { &nsGkAtoms::bgcolor },
   { nullptr }
 };
 
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsGenericHTMLElement::sScrollingAttributeMap[] = {
   { &nsGkAtoms::scrolling },
   { nullptr }
 };
 
 void
 nsGenericHTMLElement::MapImageAlignAttributeInto(const nsMappedAttributes* aAttributes,
                                                  nsRuleData* aRuleData)
--- a/content/html/content/src/nsGenericHTMLElement.h
+++ b/content/html/content/src/nsGenericHTMLElement.h
@@ -70,18 +70,18 @@ public:
    * @param aElement the element as nsIDOMHTMLElement*
    * @param aIID the IID to QI to
    * @param aInstancePtr the QI'd method [OUT]
    * @see nsGenericHTMLElementTearoff
    */
   nsresult DOMQueryInterface(nsIDOMHTMLElement *aElement, REFNSIID aIID,
                              void **aInstancePtr);
 
-  // From nsGenericElement
-  nsresult CopyInnerTo(nsGenericElement* aDest);
+  // From Element
+  nsresult CopyInnerTo(mozilla::dom::Element* aDest);
 
   void GetTitle(nsAString& aTitle) const
   {
     GetHTMLAttr(nsGkAtoms::title, aTitle);
   }
   void SetTitle(const nsAString& aTitle)
   {
     SetHTMLAttr(nsGkAtoms::title, aTitle);
@@ -250,17 +250,17 @@ public:
   virtual void GetInnerHTML(nsAString& aInnerHTML,
                             mozilla::ErrorResult& aError);
   virtual void SetInnerHTML(const nsAString& aInnerHTML,
                             mozilla::ErrorResult& aError);
   void GetOuterHTML(nsAString& aOuterHTML, mozilla::ErrorResult& aError);
   void SetOuterHTML(const nsAString& aOuterHTML, mozilla::ErrorResult& aError);
   void InsertAdjacentHTML(const nsAString& aPosition, const nsAString& aText,
                           mozilla::ErrorResult& aError);
-  nsGenericElement* GetOffsetParent()
+  mozilla::dom::Element* GetOffsetParent()
   {
     nsRect rcFrame;
     return GetOffsetRect(rcFrame);
   }
   int32_t OffsetTop()
   {
     nsRect rcFrame;
     GetOffsetRect(rcFrame);
@@ -951,17 +951,17 @@ protected:
   virtual already_AddRefed<nsIEditor> GetAssociatedEditor();
 
   /**
    * Get the frame's offset information for offsetTop/Left/Width/Height.
    * Returns the parent the offset is relative to.
    * @note This method flushes pending notifications (Flush_Layout).
    * @param aRect the offset information [OUT]
    */
-  virtual nsGenericElement* GetOffsetRect(nsRect& aRect);
+  virtual mozilla::dom::Element* GetOffsetRect(nsRect& aRect);
 
   /**
    * Returns true if this is the current document's body element
    */
   bool IsCurrentBodyElement();
 
   /**
    * Ensures all editors associated with a subtree are synced, for purposes of
@@ -1549,21 +1549,21 @@ protected:
     NS_INTERFACE_TABLE_ENTRY(_class, _i7)                                     \
     NS_INTERFACE_TABLE_ENTRY(_class, _i8)                                     \
     NS_INTERFACE_TABLE_ENTRY(_class, _i9)                                     \
     NS_INTERFACE_TABLE_ENTRY(_class, _i10)                                    \
   NS_OFFSET_AND_INTERFACE_TABLE_END
 
 #define NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC                                \
   NS_IMETHOD GetId(nsAString& aId) MOZ_FINAL {                                 \
-    nsGenericElement::GetId(aId);                                              \
+    mozilla::dom::Element::GetId(aId);                                         \
     return NS_OK;                                                              \
   }                                                                            \
   NS_IMETHOD SetId(const nsAString& aId) MOZ_FINAL {                           \
-    nsGenericElement::SetId(aId);                                              \
+    mozilla::dom::Element::SetId(aId);                                         \
     return NS_OK;                                                              \
   }                                                                            \
   NS_IMETHOD GetTitle(nsAString& aTitle) MOZ_FINAL {                           \
     nsGenericHTMLElement::GetTitle(aTitle);                                    \
     return NS_OK;                                                              \
   }                                                                            \
   NS_IMETHOD SetTitle(const nsAString& aTitle) MOZ_FINAL {                     \
     nsGenericHTMLElement::SetTitle(aTitle);                                    \
@@ -1718,21 +1718,22 @@ protected:
   NS_IMETHOD InsertAdjacentHTML(const nsAString& position,                     \
                                 const nsAString& text) MOZ_FINAL {             \
     return nsGenericHTMLElement::InsertAdjacentHTML(position, text);           \
   }                                                                            \
   NS_IMETHOD ScrollIntoView(bool top, uint8_t _argc) MOZ_FINAL {               \
     if (!_argc) {                                                              \
       top = true;                                                              \
     }                                                                          \
-    nsGenericElement::ScrollIntoView(top);                                     \
+    mozilla::dom::Element::ScrollIntoView(top);                                \
     return NS_OK;                                                              \
   }                                                                            \
   NS_IMETHOD GetOffsetParent(nsIDOMElement** aOffsetParent) MOZ_FINAL {        \
-    nsGenericElement* offsetParent = nsGenericHTMLElement::GetOffsetParent();  \
+    mozilla::dom::Element* offsetParent =                                      \
+      nsGenericHTMLElement::GetOffsetParent();                                 \
     if (!offsetParent) {                                                       \
       *aOffsetParent = nullptr;                                                \
       return NS_OK;                                                            \
     }                                                                          \
     return CallQueryInterface(offsetParent, aOffsetParent);                    \
   }                                                                            \
   NS_IMETHOD GetOffsetTop(int32_t* aOffsetTop) MOZ_FINAL {                     \
     *aOffsetTop = nsGenericHTMLElement::OffsetTop();                           \
--- a/content/html/content/src/nsGenericHTMLFrameElement.cpp
+++ b/content/html/content/src/nsGenericHTMLFrameElement.cpp
@@ -232,17 +232,17 @@ nsGenericHTMLFrameElement::DestroyConten
     mFrameLoader->Destroy();
     mFrameLoader = nullptr;
   }
 
   nsGenericHTMLElement::DestroyContent();
 }
 
 nsresult
-nsGenericHTMLFrameElement::CopyInnerTo(nsGenericElement* aDest)
+nsGenericHTMLFrameElement::CopyInnerTo(Element* aDest)
 {
   nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsIDocument* doc = aDest->OwnerDoc();
   if (doc->IsStaticDocument() && mFrameLoader) {
     nsGenericHTMLFrameElement* dest =
       static_cast<nsGenericHTMLFrameElement*>(aDest);
--- a/content/html/content/src/nsGenericHTMLFrameElement.h
+++ b/content/html/content/src/nsGenericHTMLFrameElement.h
@@ -48,17 +48,17 @@ public:
   {
     return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
   }
   virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                            nsIAtom* aPrefix, const nsAString& aValue,
                            bool aNotify);
   virtual void DestroyContent();
 
-  nsresult CopyInnerTo(nsGenericElement* aDest);
+  nsresult CopyInnerTo(mozilla::dom::Element* aDest);
 
   virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsGenericHTMLFrameElement,
                                                      nsGenericHTMLElement)
 
 protected:
   /**
--- a/content/html/content/src/nsHTMLAnchorElement.cpp
+++ b/content/html/content/src/nsHTMLAnchorElement.cpp
@@ -20,18 +20,18 @@
 using namespace mozilla::dom;
 
 class nsHTMLAnchorElement : public nsGenericHTMLElement,
                             public nsIDOMHTMLAnchorElement,
                             public nsILink,
                             public Link
 {
 public:
-  using nsGenericElement::GetText;
-  using nsGenericElement::SetText;
+  using Element::GetText;
+  using Element::SetText;
 
   nsHTMLAnchorElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLAnchorElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
@@ -126,18 +126,18 @@ nsHTMLAnchorElement::nsHTMLAnchorElement
 {
 }
 
 nsHTMLAnchorElement::~nsHTMLAnchorElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLAnchorElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLAnchorElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLAnchorElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLAnchorElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLAnchorElement, nsHTMLAnchorElement)
 
 // QueryInterface implementation for nsHTMLAnchorElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLAnchorElement)
   NS_HTML_CONTENT_INTERFACE_TABLE3(nsHTMLAnchorElement,
                                    nsIDOMHTMLAnchorElement,
--- a/content/html/content/src/nsHTMLAreaElement.cpp
+++ b/content/html/content/src/nsHTMLAreaElement.cpp
@@ -91,18 +91,18 @@ nsHTMLAreaElement::nsHTMLAreaElement(alr
     Link(this)
 {
 }
 
 nsHTMLAreaElement::~nsHTMLAreaElement()
 {
 }
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLAreaElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLAreaElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLAreaElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLAreaElement, Element)
 
 DOMCI_NODE_DATA(HTMLAreaElement, nsHTMLAreaElement)
 
 // QueryInterface implementation for nsHTMLAreaElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLAreaElement)
   NS_HTML_CONTENT_INTERFACE_TABLE3(nsHTMLAreaElement,
                                    nsIDOMHTMLAreaElement,
                                    nsILink,
--- a/content/html/content/src/nsHTMLBRElement.cpp
+++ b/content/html/content/src/nsHTMLBRElement.cpp
@@ -10,16 +10,17 @@
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsMappedAttributes.h"
 #include "nsRuleData.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 class nsHTMLBRElement : public nsGenericHTMLElement,
                         public nsIDOMHTMLBRElement
 {
 public:
   nsHTMLBRElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLBRElement();
 
@@ -57,18 +58,18 @@ nsHTMLBRElement::nsHTMLBRElement(already
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLBRElement::~nsHTMLBRElement()
 {
 }
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLBRElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLBRElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLBRElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLBRElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLBRElement, nsHTMLBRElement)
 
 // QueryInterface implementation for nsHTMLBRElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLBRElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLBRElement, nsIDOMHTMLBRElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLBRElement,
--- a/content/html/content/src/nsHTMLBodyElement.cpp
+++ b/content/html/content/src/nsHTMLBodyElement.cpp
@@ -22,16 +22,17 @@
 #include "nsIDocShell.h"
 #include "nsIEditorDocShell.h"
 #include "nsRuleWalker.h"
 #include "jspubtd.h"
 
 //----------------------------------------------------------------------
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 class nsHTMLBodyElement;
 
 class BodyRule: public nsIStyleRule {
 public:
   BodyRule(nsHTMLBodyElement* aPart);
   virtual ~BodyRule();
 
@@ -47,18 +48,18 @@ public:
 };
 
 //----------------------------------------------------------------------
 
 class nsHTMLBodyElement : public nsGenericHTMLElement,
                           public nsIDOMHTMLBodyElement
 {
 public:
-  using nsGenericElement::GetText;
-  using nsGenericElement::SetText;
+  using Element::GetText;
+  using Element::SetText;
 
   nsHTMLBodyElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLBodyElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
@@ -274,18 +275,18 @@ nsHTMLBodyElement::~nsHTMLBodyElement()
 {
   if (mContentStyleRule) {
     mContentStyleRule->mPart = nullptr;
     NS_RELEASE(mContentStyleRule);
   }
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLBodyElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLBodyElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLBodyElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLBodyElement, Element)
 
 DOMCI_NODE_DATA(HTMLBodyElement, nsHTMLBodyElement)
 
 // QueryInterface implementation for nsHTMLBodyElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLBodyElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLBodyElement, nsIDOMHTMLBodyElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLBodyElement,
                                                nsGenericHTMLElement)
--- a/content/html/content/src/nsHTMLButtonElement.cpp
+++ b/content/html/content/src/nsHTMLButtonElement.cpp
@@ -146,18 +146,18 @@ nsHTMLButtonElement::nsHTMLButtonElement
 }
 
 nsHTMLButtonElement::~nsHTMLButtonElement()
 {
 }
 
 // nsISupports
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLButtonElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLButtonElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLButtonElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLButtonElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLButtonElement, nsHTMLButtonElement)
 
 // QueryInterface implementation for nsHTMLButtonElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLButtonElement)
   NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLButtonElement,
                                    nsIDOMHTMLButtonElement,
--- a/content/html/content/src/nsHTMLCanvasElement.cpp
+++ b/content/html/content/src/nsHTMLCanvasElement.cpp
@@ -184,18 +184,18 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsHTMLCanvasElement,
                                                 nsGenericHTMLElement)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mCurrentContext)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mPrintCallback)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mPrintState)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mOriginalCanvas)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLCanvasElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLCanvasElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLCanvasElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLCanvasElement, Element)
 
 DOMCI_NODE_DATA(HTMLCanvasElement, nsHTMLCanvasElement)
 
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLCanvasElement)
   NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLCanvasElement,
                                    nsIDOMHTMLCanvasElement,
                                    nsICanvasElementExternal)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLCanvasElement,
@@ -309,17 +309,17 @@ nsHTMLCanvasElement::IsPrintCallbackDone
 
 nsIDOMHTMLCanvasElement*
 nsHTMLCanvasElement::GetOriginalCanvas()
 {
   return mOriginalCanvas ? mOriginalCanvas.get() : this;
 }
 
 nsresult
-nsHTMLCanvasElement::CopyInnerTo(nsGenericElement* aDest)
+nsHTMLCanvasElement::CopyInnerTo(Element* aDest)
 {
   nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
   NS_ENSURE_SUCCESS(rv, rv);
   if (aDest->OwnerDoc()->IsStaticDocument()) {
     nsHTMLCanvasElement* dest = static_cast<nsHTMLCanvasElement*>(aDest);
     nsHTMLCanvasElement* self = const_cast<nsHTMLCanvasElement*>(this);
     dest->mOriginalCanvas = self;
 
--- a/content/html/content/src/nsHTMLDataListElement.cpp
+++ b/content/html/content/src/nsHTMLDataListElement.cpp
@@ -5,16 +5,17 @@
 
 #include "nsIDOMHTMLDataListElement.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIDOMEventTarget.h"
 #include "nsGkAtoms.h"
 #include "nsIDOMHTMLOptionElement.h"
 #include "nsContentList.h"
 
+using namespace mozilla::dom;
 
 class nsHTMLDataListElement : public nsGenericHTMLElement,
                               public nsIDOMHTMLDataListElement
 {
 public:
   nsHTMLDataListElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLDataListElement();
 
@@ -70,18 +71,18 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_IN
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLDataListElement)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLDataListElement,
                                                   nsGenericHTMLElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mOptions, nsIDOMNodeList)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLDataListElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLDataListElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLDataListElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLDataListElement, Element)
 
 DOMCI_NODE_DATA(HTMLDataListElement, nsHTMLDataListElement)
 
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLDataListElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLDataListElement, nsIDOMHTMLDataListElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLDataListElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLDataListElement)
--- a/content/html/content/src/nsHTMLDivElement.cpp
+++ b/content/html/content/src/nsHTMLDivElement.cpp
@@ -6,32 +6,33 @@
 #include "mozilla/Util.h"
 
 #include "nsHTMLDivElement.h"
 #include "nsGenericHTMLElement.h"
 #include "nsStyleConsts.h"
 #include "nsMappedAttributes.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Div)
 
 
 nsHTMLDivElement::nsHTMLDivElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLDivElement::~nsHTMLDivElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLDivElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLDivElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLDivElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLDivElement, Element)
 
 DOMCI_NODE_DATA(HTMLDivElement, nsHTMLDivElement)
 
 // QueryInterface implementation for nsHTMLDivElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLDivElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLDivElement, nsIDOMHTMLDivElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLDivElement,
                                                nsGenericHTMLElement)
--- a/content/html/content/src/nsHTMLElement.cpp
+++ b/content/html/content/src/nsHTMLElement.cpp
@@ -53,18 +53,18 @@ nsHTMLElement::nsHTMLElement(already_Add
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLElement::~nsHTMLElement()
 {
 }
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLElement, Element)
 
 DOMCI_NODE_DATA(HTMLElement, nsHTMLElement)
 
 NS_INTERFACE_TABLE_HEAD(nsHTMLElement)
   NS_HTML_CONTENT_INTERFACE_TABLE0(nsHTMLElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLElement)
--- a/content/html/content/src/nsHTMLFieldSetElement.cpp
+++ b/content/html/content/src/nsHTMLFieldSetElement.cpp
@@ -8,16 +8,17 @@
 #include "nsIDOMEventTarget.h"
 #include "nsStyleConsts.h"
 #include "nsIForm.h"
 #include "nsIFormControl.h"
 #include "nsGUIEvent.h"
 #include "nsEventDispatcher.h"
 #include "nsContentList.h"
 
+using namespace mozilla::dom;
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(FieldSet)
 
 
 nsHTMLFieldSetElement::nsHTMLFieldSetElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLFormElement(aNodeInfo)
   , mElements(nullptr)
   , mFirstLegend(nullptr)
@@ -45,18 +46,18 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_IN
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLFieldSetElement)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLFieldSetElement,
                                                   nsGenericHTMLFormElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mElements, nsIDOMNodeList)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLFieldSetElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLFieldSetElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLFieldSetElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLFieldSetElement, Element)
 
 DOMCI_NODE_DATA(HTMLFieldSetElement, nsHTMLFieldSetElement)
 
 // QueryInterface implementation for nsHTMLFieldSetElement
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLFieldSetElement)
   NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLFieldSetElement,
                                    nsIDOMHTMLFieldSetElement,
                                    nsIConstraintValidation)
--- a/content/html/content/src/nsHTMLFontElement.cpp
+++ b/content/html/content/src/nsHTMLFontElement.cpp
@@ -14,16 +14,17 @@
 #include "nsStyleConsts.h"
 #include "nsPresContext.h"
 #include "nsMappedAttributes.h"
 #include "nsRuleData.h"
 #include "nsAlgorithm.h"
 #include "nsContentUtils.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 class nsHTMLFontElement : public nsGenericHTMLElement,
                           public nsIDOMHTMLFontElement
 {
 public:
   nsHTMLFontElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLFontElement();
 
@@ -61,18 +62,18 @@ nsHTMLFontElement::nsHTMLFontElement(alr
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLFontElement::~nsHTMLFontElement()
 {
 }
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLFontElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLFontElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLFontElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLFontElement, Element)
 
 DOMCI_NODE_DATA(HTMLFontElement, nsHTMLFontElement)
 
 // QueryInterface implementation for nsHTMLFontElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLFontElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLFontElement, nsIDOMHTMLFontElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLFontElement,
                                                nsGenericHTMLElement)
--- a/content/html/content/src/nsHTMLFormElement.cpp
+++ b/content/html/content/src/nsHTMLFormElement.cpp
@@ -87,17 +87,17 @@ public:
 
   void DropFormReference();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   // nsIDOMHTMLCollection interface
   NS_DECL_NSIDOMHTMLCOLLECTION
 
-  virtual nsGenericElement* GetElementAt(uint32_t index);
+  virtual Element* GetElementAt(uint32_t index);
   virtual nsINode* GetParentObject()
   {
     return mForm;
   }
 
   virtual JSObject* NamedItem(JSContext* cx, const nsAString& name,
                               mozilla::ErrorResult& error);
   virtual void GetSupportedNames(nsTArray<nsString>& aNames);
@@ -286,18 +286,18 @@ ElementTraverser(const nsAString& key, n
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLFormElement)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLFormElement,
                                                   nsGenericHTMLElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mControls,
                                                        nsIDOMHTMLCollection)
   tmp->mSelectedRadioButtons.EnumerateRead(ElementTraverser, &cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLFormElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLFormElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLFormElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLFormElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLFormElement, nsHTMLFormElement)
 
 // QueryInterface implementation for nsHTMLFormElement
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLFormElement)
   NS_HTML_CONTENT_INTERFACE_TABLE4(nsHTMLFormElement,
                                    nsIDOMHTMLFormElement,
@@ -2511,17 +2511,17 @@ nsFormControlList::GetSortedControls(nsT
                "Not all form controls were added to the sorted list");
 #ifdef DEBUG
   AssertDocumentOrder(aControls, mForm);
 #endif
 
   return NS_OK;
 }
 
-nsGenericElement*
+Element*
 nsFormControlList::GetElementAt(uint32_t aIndex)
 {
   FlushPendingNotifications();
 
   return mElements.SafeElementAt(aIndex, nullptr);
 }
 
 JSObject*
--- a/content/html/content/src/nsHTMLFrameElement.cpp
+++ b/content/html/content/src/nsHTMLFrameElement.cpp
@@ -60,18 +60,18 @@ nsHTMLFrameElement::nsHTMLFrameElement(a
 {
 }
 
 nsHTMLFrameElement::~nsHTMLFrameElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLFrameElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLFrameElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLFrameElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLFrameElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLFrameElement, nsHTMLFrameElement)
 
 // QueryInterface implementation for nsHTMLFrameElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLFrameElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLFrameElement, nsIDOMHTMLFrameElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLFrameElement,
--- a/content/html/content/src/nsHTMLFrameSetElement.cpp
+++ b/content/html/content/src/nsHTMLFrameSetElement.cpp
@@ -1,32 +1,33 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsHTMLFrameSetElement.h"
 #include "jsapi.h"
 
+using namespace mozilla::dom;
+
 NS_IMPL_NS_NEW_HTML_ELEMENT(FrameSet)
 
-
 nsHTMLFrameSetElement::nsHTMLFrameSetElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo), mNumRows(0), mNumCols(0),
     mCurrentRowColHint(NS_STYLE_HINT_REFLOW)
 {
 }
 
 nsHTMLFrameSetElement::~nsHTMLFrameSetElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLFrameSetElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLFrameSetElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLFrameSetElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLFrameSetElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLFrameSetElement, nsHTMLFrameSetElement)
 
 // QueryInterface implementation for nsHTMLFrameSetElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLFrameSetElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLFrameSetElement,
                                    nsIDOMHTMLFrameSetElement)
--- a/content/html/content/src/nsHTMLHRElement.cpp
+++ b/content/html/content/src/nsHTMLHRElement.cpp
@@ -13,16 +13,17 @@
 #include "nsStyleConsts.h"
 #include "nsPresContext.h"
 #include "nsMappedAttributes.h"
 #include "nsAttrValueInlines.h"
 #include "nsRuleData.h"
 #include "nsCSSProps.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 class nsHTMLHRElement : public nsGenericHTMLElement,
                         public nsIDOMHTMLHRElement
 {
 public:
   nsHTMLHRElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLHRElement();
 
@@ -61,18 +62,18 @@ nsHTMLHRElement::nsHTMLHRElement(already
 {
 }
 
 nsHTMLHRElement::~nsHTMLHRElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLHRElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLHRElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLHRElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLHRElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLHRElement, nsHTMLHRElement)
 
 // QueryInterface implementation for nsHTMLHRElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLHRElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLHRElement,
                                    nsIDOMHTMLHRElement)
--- a/content/html/content/src/nsHTMLHeadingElement.cpp
+++ b/content/html/content/src/nsHTMLHeadingElement.cpp
@@ -10,16 +10,17 @@
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsMappedAttributes.h"
 #include "nsRuleData.h"
 #include "mozAutoDocUpdate.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 class nsHTMLHeadingElement : public nsGenericHTMLElement,
                              public nsIDOMHTMLHeadingElement
 {
 public:
   nsHTMLHeadingElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLHeadingElement();
 
@@ -58,18 +59,18 @@ nsHTMLHeadingElement::nsHTMLHeadingEleme
 {
 }
 
 nsHTMLHeadingElement::~nsHTMLHeadingElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLHeadingElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLHeadingElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLHeadingElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLHeadingElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLHeadingElement, nsHTMLHeadingElement)
 
 // QueryInterface implementation for nsHTMLHeadingElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLHeadingElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLHeadingElement,
                                    nsIDOMHTMLHeadingElement)
--- a/content/html/content/src/nsHTMLIFrameElement.cpp
+++ b/content/html/content/src/nsHTMLIFrameElement.cpp
@@ -23,18 +23,18 @@ nsHTMLIFrameElement::nsHTMLIFrameElement
   : nsGenericHTMLFrameElement(aNodeInfo, aFromParser)
 {
 }
 
 nsHTMLIFrameElement::~nsHTMLIFrameElement()
 {
 }
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLIFrameElement,nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLIFrameElement,nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLIFrameElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLIFrameElement, Element)
 
 DOMCI_NODE_DATA(HTMLIFrameElement, nsHTMLIFrameElement)
 
 // QueryInterface implementation for nsHTMLIFrameElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLIFrameElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_BEGIN(nsHTMLIFrameElement)
     NS_INTERFACE_TABLE_ENTRY(nsHTMLIFrameElement, nsIDOMHTMLIFrameElement)
     NS_INTERFACE_TABLE_ENTRY(nsHTMLIFrameElement, nsIDOMGetSVGDocument)
--- a/content/html/content/src/nsHTMLImageElement.cpp
+++ b/content/html/content/src/nsHTMLImageElement.cpp
@@ -76,18 +76,18 @@ nsHTMLImageElement::nsHTMLImageElement(a
 }
 
 nsHTMLImageElement::~nsHTMLImageElement()
 {
   DestroyImageLoadingContent();
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLImageElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLImageElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLImageElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLImageElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLImageElement, nsHTMLImageElement)
 
 // QueryInterface implementation for nsHTMLImageElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLImageElement)
   NS_HTML_CONTENT_INTERFACE_TABLE5(nsHTMLImageElement,
                                    nsIDOMHTMLImageElement,
@@ -367,17 +367,17 @@ nsHTMLImageElement::SetAttr(int32_t aNam
       return NS_OK;
     }
 
     // A hack to get animations to reset. See bug 594771.
     mNewRequestsWillNeedAnimationReset = true;
 
     // Force image loading here, so that we'll try to load the image from
     // network if it's set to be not cacheable...  If we change things so that
-    // the state gets in nsGenericElement's attr-setting happen around this
+    // the state gets in Element's attr-setting happen around this
     // LoadImage call, we could start passing false instead of aNotify
     // here.
     LoadImage(aValue, true, aNotify);
 
     mNewRequestsWillNeedAnimationReset = false;
   }
     
   return nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
@@ -526,17 +526,17 @@ nsHTMLImageElement::GetNaturalWidth(uint
   int32_t width;
   if (NS_SUCCEEDED(image->GetWidth(&width))) {
     *aNaturalWidth = width;
   }
   return NS_OK;
 }
 
 nsresult
-nsHTMLImageElement::CopyInnerTo(nsGenericElement* aDest)
+nsHTMLImageElement::CopyInnerTo(Element* aDest)
 {
   if (aDest->OwnerDoc()->IsStaticDocument()) {
     CreateStaticImageClone(static_cast<nsHTMLImageElement*>(aDest));
   }
   return nsGenericHTMLElement::CopyInnerTo(aDest);
 }
 
 CORSMode
--- a/content/html/content/src/nsHTMLImageElement.h
+++ b/content/html/content/src/nsHTMLImageElement.h
@@ -74,17 +74,17 @@ public:
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers);
   virtual void UnbindFromTree(bool aDeep, bool aNullParent);
 
   virtual nsEventStates IntrinsicState() const;
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
-  nsresult CopyInnerTo(nsGenericElement* aDest);
+  nsresult CopyInnerTo(mozilla::dom::Element* aDest);
 
   void MaybeLoadImage();
   virtual nsXPCClassInfo* GetClassInfo();
   virtual nsIDOMNode* AsDOMNode() { return this; }
 protected:
   nsIntPoint GetXY();
   virtual void GetItemValueText(nsAString& text);
   virtual void SetItemValueText(const nsAString& text);
--- a/content/html/content/src/nsHTMLInputElement.cpp
+++ b/content/html/content/src/nsHTMLInputElement.cpp
@@ -643,18 +643,18 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_IN
     tmp->mFileList = nullptr;
   }
   if (tmp->IsSingleLineTextControl(false)) {
     tmp->mInputData.mState->Unlink();
   }
   //XXX should unlink more?
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
                                                               
-NS_IMPL_ADDREF_INHERITED(nsHTMLInputElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLInputElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLInputElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLInputElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLInputElement, nsHTMLInputElement)
 
 // QueryInterface implementation for nsHTMLInputElement
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLInputElement)
   NS_HTML_CONTENT_INTERFACE_TABLE8(nsHTMLInputElement,
                                    nsIDOMHTMLInputElement,
--- a/content/html/content/src/nsHTMLLIElement.cpp
+++ b/content/html/content/src/nsHTMLLIElement.cpp
@@ -10,16 +10,17 @@
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsMappedAttributes.h"
 #include "nsRuleData.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 class nsHTMLLIElement : public nsGenericHTMLElement,
                         public nsIDOMHTMLLIElement
 {
 public:
   nsHTMLLIElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLLIElement();
 
@@ -58,18 +59,18 @@ nsHTMLLIElement::nsHTMLLIElement(already
 {
 }
 
 nsHTMLLIElement::~nsHTMLLIElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLLIElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLLIElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLLIElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLLIElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLLIElement, nsHTMLLIElement)
 
 // QueryInterface implementation for nsHTMLLIElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLLIElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLLIElement, nsIDOMHTMLLIElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLLIElement,
--- a/content/html/content/src/nsHTMLLabelElement.cpp
+++ b/content/html/content/src/nsHTMLLabelElement.cpp
@@ -38,18 +38,18 @@ nsHTMLLabelElement::nsHTMLLabelElement(a
 
 nsHTMLLabelElement::~nsHTMLLabelElement()
 {
 }
 
 // nsISupports 
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLLabelElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLLabelElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLLabelElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLLabelElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLLabelElement, nsHTMLLabelElement)
 
 // QueryInterface implementation for nsHTMLLabelElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLLabelElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLLabelElement,
                                    nsIDOMHTMLLabelElement)
--- a/content/html/content/src/nsHTMLLegendElement.cpp
+++ b/content/html/content/src/nsHTMLLegendElement.cpp
@@ -25,18 +25,18 @@ nsHTMLLegendElement::nsHTMLLegendElement
 {
 }
 
 nsHTMLLegendElement::~nsHTMLLegendElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLLegendElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLLegendElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLLegendElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLLegendElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLLegendElement, nsHTMLLegendElement)
 
 // QueryInterface implementation for nsHTMLLegendElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLLegendElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLLegendElement, nsIDOMHTMLLegendElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLLegendElement,
--- a/content/html/content/src/nsHTMLLinkElement.cpp
+++ b/content/html/content/src/nsHTMLLinkElement.cpp
@@ -129,18 +129,18 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
                                                   nsGenericHTMLElement)
   tmp->nsStyleLinkElement::Traverse(cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsHTMLLinkElement,
                                                 nsGenericHTMLElement)
   tmp->nsStyleLinkElement::Unlink();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLLinkElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLLinkElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLLinkElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLLinkElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLLinkElement, nsHTMLLinkElement)
 
 // QueryInterface implementation for nsHTMLLinkElement
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLLinkElement)
   NS_HTML_CONTENT_INTERFACE_TABLE5(nsHTMLLinkElement,
                                    nsIDOMHTMLLinkElement,
--- a/content/html/content/src/nsHTMLMapElement.cpp
+++ b/content/html/content/src/nsHTMLMapElement.cpp
@@ -5,16 +5,17 @@
 #include "nsIDOMHTMLMapElement.h"
 #include "nsIDOMEventTarget.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsContentList.h"
 #include "nsCOMPtr.h"
 
+using namespace mozilla::dom;
 
 class nsHTMLMapElement : public nsGenericHTMLElement,
                          public nsIDOMHTMLMapElement
 {
 public:
   nsHTMLMapElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
   // nsISupports
@@ -55,18 +56,18 @@ nsHTMLMapElement::nsHTMLMapElement(alrea
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLMapElement)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLMapElement,
                                                   nsGenericHTMLElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mAreas,
                                                        nsIDOMNodeList)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLMapElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLMapElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLMapElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLMapElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLMapElement, nsHTMLMapElement)
 
 // QueryInterface implementation for nsHTMLMapElement
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLMapElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLMapElement, nsIDOMHTMLMapElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLMapElement,
--- a/content/html/content/src/nsHTMLMediaElement.cpp
+++ b/content/html/content/src/nsHTMLMediaElement.cpp
@@ -1051,17 +1051,17 @@ nsresult nsHTMLMediaElement::LoadResourc
     if (NS_SUCCEEDED(rv))
       return rv;
   }
 
   int16_t shouldLoad = nsIContentPolicy::ACCEPT;
   nsresult rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_MEDIA,
                                           mLoadingSrc,
                                           NodePrincipal(),
-                                          static_cast<nsGenericElement*>(this),
+                                          static_cast<Element*>(this),
                                           EmptyCString(), // mime type
                                           nullptr, // extra
                                           &shouldLoad,
                                           nsContentUtils::GetContentPolicy(),
                                           nsContentUtils::GetSecurityManager());
   NS_ENSURE_SUCCESS(rv, rv);
   if (NS_CP_REJECTED(shouldLoad)) {
     return NS_ERROR_FAILURE;
@@ -3564,17 +3564,17 @@ already_AddRefed<nsILoadGroup> nsHTMLMed
 {
   if (!OwnerDoc()->IsActive()) {
     NS_WARNING("Load group requested for media element in inactive document.");
   }
   return OwnerDoc()->GetDocumentLoadGroup();
 }
 
 nsresult
-nsHTMLMediaElement::CopyInnerTo(nsGenericElement* aDest)
+nsHTMLMediaElement::CopyInnerTo(Element* aDest)
 {
   nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
   NS_ENSURE_SUCCESS(rv, rv);
   if (aDest->OwnerDoc()->IsStaticDocument()) {
     nsHTMLMediaElement* dest = static_cast<nsHTMLMediaElement*>(aDest);
     if (mPrintSurface) {
       dest->mPrintSurface = mPrintSurface;
       dest->mMediaSize = mMediaSize;
--- a/content/html/content/src/nsHTMLMenuElement.cpp
+++ b/content/html/content/src/nsHTMLMenuElement.cpp
@@ -8,16 +8,18 @@
 #include "nsIDOMHTMLMenuItemElement.h"
 #include "nsXULContextMenuBuilder.h"
 #include "nsGUIEvent.h"
 #include "nsEventDispatcher.h"
 #include "nsHTMLMenuItemElement.h"
 #include "nsContentUtils.h"
 #include "nsError.h"
 
+using namespace mozilla::dom;
+
 enum MenuType
 {
   MENU_TYPE_CONTEXT = 1,
   MENU_TYPE_TOOLBAR,
   MENU_TYPE_LIST
 };
 
 static const nsAttrValue::EnumTable kMenuTypeTable[] = {
@@ -45,18 +47,18 @@ nsHTMLMenuElement::nsHTMLMenuElement(alr
 {
 }
 
 nsHTMLMenuElement::~nsHTMLMenuElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLMenuElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLMenuElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLMenuElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLMenuElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLMenuElement, nsHTMLMenuElement)
 
 // QueryInterface implementation for nsHTMLMenuElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLMenuElement)
   NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLMenuElement,
                                    nsIDOMHTMLMenuElement,
--- a/content/html/content/src/nsHTMLMenuItemElement.cpp
+++ b/content/html/content/src/nsHTMLMenuItemElement.cpp
@@ -163,18 +163,18 @@ nsHTMLMenuItemElement::nsHTMLMenuItemEle
   mParserCreating = aFromParser;
 }
 
 nsHTMLMenuItemElement::~nsHTMLMenuItemElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLMenuItemElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLMenuItemElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLMenuItemElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLMenuItemElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLMenuItemElement, nsHTMLMenuItemElement)
 
 // QueryInterface implementation for nsHTMLMenuItemElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLMenuItemElement)
   NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLMenuItemElement,
                                    nsIDOMHTMLCommandElement,
--- a/content/html/content/src/nsHTMLMenuItemElement.h
+++ b/content/html/content/src/nsHTMLMenuItemElement.h
@@ -7,17 +7,17 @@
 #include "nsGenericHTMLElement.h"
 
 class Visitor;
 
 class nsHTMLMenuItemElement : public nsGenericHTMLElement,
                               public nsIDOMHTMLMenuItemElement
 {
 public:
-  using nsGenericElement::GetText;
+  using mozilla::dom::Element::GetText;
 
   nsHTMLMenuItemElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                         mozilla::dom::FromParser aFromParser);
   virtual ~nsHTMLMenuItemElement();
 
   NS_IMPL_FROMCONTENT_HTML_WITH_TAG(nsHTMLMenuItemElement, menuitem)
 
   // nsISupports
--- a/content/html/content/src/nsHTMLMetaElement.cpp
+++ b/content/html/content/src/nsHTMLMetaElement.cpp
@@ -5,16 +5,17 @@
 #include "nsIDOMHTMLMetaElement.h"
 #include "nsIDOMEventTarget.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsAsyncDOMEvent.h"
 #include "nsContentUtils.h"
 
+using namespace mozilla::dom;
 
 class nsHTMLMetaElement : public nsGenericHTMLElement,
                           public nsIDOMHTMLMetaElement
 {
 public:
   nsHTMLMetaElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLMetaElement();
 
@@ -60,18 +61,18 @@ nsHTMLMetaElement::nsHTMLMetaElement(alr
 {
 }
 
 nsHTMLMetaElement::~nsHTMLMetaElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLMetaElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLMetaElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLMetaElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLMetaElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLMetaElement, nsHTMLMetaElement)
 
 // QueryInterface implementation for nsHTMLMetaElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLMetaElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLMetaElement, nsIDOMHTMLMetaElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLMetaElement,
--- a/content/html/content/src/nsHTMLMeterElement.cpp
+++ b/content/html/content/src/nsHTMLMeterElement.cpp
@@ -5,16 +5,17 @@
 
 #include "nsIDOMHTMLMeterElement.h"
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValue.h"
 #include "nsAttrValueInlines.h"
 #include "nsEventStateManager.h"
 #include "nsAlgorithm.h"
 
+using namespace mozilla::dom;
 
 class nsHTMLMeterElement : public nsGenericHTMLElement,
                            public nsIDOMHTMLMeterElement
 {
 public:
   nsHTMLMeterElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLMeterElement();
 
@@ -90,18 +91,18 @@ nsHTMLMeterElement::nsHTMLMeterElement(a
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
 nsHTMLMeterElement::~nsHTMLMeterElement()
 {
 }
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLMeterElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLMeterElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLMeterElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLMeterElement, Element)
 
 DOMCI_NODE_DATA(HTMLMeterElement, nsHTMLMeterElement)
 
 NS_INTERFACE_TABLE_HEAD(nsHTMLMeterElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLMeterElement,
                                    nsIDOMHTMLMeterElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLMeterElement,
                                                nsGenericHTMLElement)
--- a/content/html/content/src/nsHTMLModElement.cpp
+++ b/content/html/content/src/nsHTMLModElement.cpp
@@ -4,16 +4,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIDOMHTMLModElement.h"
 #include "nsIDOMEventTarget.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 
+using namespace mozilla::dom;
+
 class nsHTMLModElement : public nsGenericHTMLElement,
                          public nsIDOMHTMLModElement
 {
 public:
   nsHTMLModElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLModElement();
 
   // nsISupports
@@ -46,18 +48,18 @@ nsHTMLModElement::nsHTMLModElement(alrea
 {
 }
 
 nsHTMLModElement::~nsHTMLModElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLModElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLModElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLModElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLModElement, Element)
 
 DOMCI_NODE_DATA(HTMLModElement, nsHTMLModElement)
 
 // QueryInterface implementation for nsHTMLModElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLModElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLModElement,
                                    nsIDOMHTMLModElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLModElement,
--- a/content/html/content/src/nsHTMLOListElement.cpp
+++ b/content/html/content/src/nsHTMLOListElement.cpp
@@ -12,16 +12,17 @@
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsMappedAttributes.h"
 #include "nsRuleData.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 class nsHTMLSharedListElement : public nsGenericHTMLElement,
                                 public nsIDOMHTMLOListElement,
                                 public nsIDOMHTMLDListElement,
                                 public nsIDOMHTMLUListElement
 {
 public:
   nsHTMLSharedListElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@@ -76,18 +77,18 @@ nsHTMLSharedListElement::nsHTMLSharedLis
 {
 }
 
 nsHTMLSharedListElement::~nsHTMLSharedListElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLSharedListElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLSharedListElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLSharedListElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLSharedListElement, Element)
 
 
 DOMCI_DATA(HTMLOListElement, nsHTMLSharedListElement)
 DOMCI_DATA(HTMLDListElement, nsHTMLSharedListElement)
 DOMCI_DATA(HTMLUListElement, nsHTMLSharedListElement)
 
 nsIClassInfo* 
 nsHTMLSharedListElement::GetClassInfoInternal()
--- a/content/html/content/src/nsHTMLObjectElement.cpp
+++ b/content/html/content/src/nsHTMLObjectElement.cpp
@@ -96,17 +96,17 @@ public:
   virtual nsEventStates IntrinsicState() const;
   virtual void DestroyContent();
 
   // nsObjectLoadingContent
   virtual uint32_t GetCapabilities() const;
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
-  nsresult CopyInnerTo(nsGenericElement* aDest);
+  nsresult CopyInnerTo(Element* aDest);
 
   void StartObjectLoad() { StartObjectLoad(true); }
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLObjectElement,
                                                      nsGenericHTMLFormElement)
 
   virtual nsXPCClassInfo* GetClassInfo();
 
@@ -173,18 +173,18 @@ nsHTMLObjectElement::DoneAddingChildren(
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLObjectElement)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLObjectElement,
                                                   nsGenericHTMLFormElement)
   nsObjectLoadingContent::Traverse(tmp, cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLObjectElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLObjectElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLObjectElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLObjectElement, Element)
 
 DOMCI_NODE_DATA(HTMLObjectElement, nsHTMLObjectElement)
 
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLObjectElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_BEGIN(nsHTMLObjectElement)
     NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, nsIDOMHTMLObjectElement)
     NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, imgINotificationObserver)
     NS_INTERFACE_TABLE_ENTRY(nsHTMLObjectElement, nsIRequestObserver)
@@ -533,17 +533,17 @@ nsHTMLObjectElement::GetCapabilities() c
 void
 nsHTMLObjectElement::DestroyContent()
 {
   nsObjectLoadingContent::DestroyContent();
   nsGenericHTMLFormElement::DestroyContent();
 }
 
 nsresult
-nsHTMLObjectElement::CopyInnerTo(nsGenericElement* aDest)
+nsHTMLObjectElement::CopyInnerTo(Element* aDest)
 {
   nsresult rv = nsGenericHTMLFormElement::CopyInnerTo(aDest);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aDest->OwnerDoc()->IsStaticDocument()) {
     CreateStaticClone(static_cast<nsHTMLObjectElement*>(aDest));
   }
 
--- a/content/html/content/src/nsHTMLOptGroupElement.cpp
+++ b/content/html/content/src/nsHTMLOptGroupElement.cpp
@@ -8,16 +8,18 @@
 #include "nsStyleConsts.h"
 #include "nsIFrame.h"
 #include "nsIFormControlFrame.h"
 #include "nsEventStates.h"
 
 #include "nsEventDispatcher.h"
 #include "nsHTMLSelectElement.h"
 
+using namespace mozilla::dom;
+
 /**
  * The implementation of &lt;optgroup&gt;
  */
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(OptGroup)
 
 
 nsHTMLOptGroupElement::nsHTMLOptGroupElement(already_AddRefed<nsINodeInfo> aNodeInfo)
@@ -27,18 +29,18 @@ nsHTMLOptGroupElement::nsHTMLOptGroupEle
   AddStatesSilently(NS_EVENT_STATE_ENABLED);
 }
 
 nsHTMLOptGroupElement::~nsHTMLOptGroupElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLOptGroupElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLOptGroupElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLOptGroupElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLOptGroupElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLOptGroupElement, nsHTMLOptGroupElement)
 
 // QueryInterface implementation for nsHTMLOptGroupElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLOptGroupElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLOptGroupElement,
                                    nsIDOMHTMLOptGroupElement)
--- a/content/html/content/src/nsHTMLOptionElement.cpp
+++ b/content/html/content/src/nsHTMLOptionElement.cpp
@@ -69,18 +69,18 @@ nsHTMLOptionElement::nsHTMLOptionElement
 
 nsHTMLOptionElement::~nsHTMLOptionElement()
 {
 }
 
 // ISupports
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLOptionElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLOptionElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLOptionElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLOptionElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLOptionElement, nsHTMLOptionElement)
 
 // QueryInterface implementation for nsHTMLOptionElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLOptionElement)
   NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLOptionElement,
                                    nsIDOMHTMLOptionElement,
@@ -441,17 +441,17 @@ nsHTMLOptionElement::Initialize(nsISuppo
       }
     }
   }
 
   return result;
 }
 
 nsresult
-nsHTMLOptionElement::CopyInnerTo(nsGenericElement* aDest)
+nsHTMLOptionElement::CopyInnerTo(Element* aDest)
 {
   nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aDest->OwnerDoc()->IsStaticDocument()) {
     static_cast<nsHTMLOptionElement*>(aDest)->SetSelected(Selected());
   }
   return NS_OK;
--- a/content/html/content/src/nsHTMLOptionElement.h
+++ b/content/html/content/src/nsHTMLOptionElement.h
@@ -31,18 +31,18 @@ public:
 
   // nsIDOMElement
   NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
 
   // nsIDOMHTMLOptionElement
-  using nsGenericElement::SetText;
-  using nsGenericElement::GetText;
+  using mozilla::dom::Element::SetText;
+  using mozilla::dom::Element::GetText;
   NS_DECL_NSIDOMHTMLOPTIONELEMENT
 
   bool Selected() const;
   bool DefaultSelected() const;
 
   // nsIJSNativeInitializer
   NS_IMETHOD Initialize(nsISupports* aOwner, JSContext* aContext,
                         JSObject *aObj, uint32_t argc, jsval *argv);
@@ -62,17 +62,17 @@ public:
   virtual void UnbindFromTree(bool aDeep = true,
                               bool aNullParent = true);
 
   // nsIContent
   virtual nsEventStates IntrinsicState() const;
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
-  nsresult CopyInnerTo(nsGenericElement* aDest);
+  nsresult CopyInnerTo(mozilla::dom::Element* aDest);
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
   virtual bool IsDisabled() const {
     return HasAttr(kNameSpaceID_None, nsGkAtoms::disabled);
   }
--- a/content/html/content/src/nsHTMLOutputElement.cpp
+++ b/content/html/content/src/nsHTMLOutputElement.cpp
@@ -8,16 +8,17 @@
 #include "nsFormSubmission.h"
 #include "nsDOMSettableTokenList.h"
 #include "nsStubMutationObserver.h"
 #include "nsIConstraintValidation.h"
 #include "nsEventStates.h"
 #include "mozAutoDocUpdate.h"
 #include "nsHTMLFormElement.h"
 
+using namespace mozilla::dom;
 
 class nsHTMLOutputElement : public nsGenericHTMLFormElement,
                             public nsIDOMHTMLOutputElement,
                             public nsStubMutationObserver,
                             public nsIConstraintValidation
 {
 public:
   using nsIConstraintValidation::GetValidationMessage;
@@ -115,18 +116,18 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_IN
   }
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLOutputElement,
                                                   nsGenericHTMLFormElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mTokenList,
                                                        nsDOMTokenList)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLOutputElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLOutputElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLOutputElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLOutputElement, Element)
 
 DOMCI_NODE_DATA(HTMLOutputElement, nsHTMLOutputElement)
 
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLOutputElement)
   NS_HTML_CONTENT_INTERFACE_TABLE3(nsHTMLOutputElement,
                                    nsIDOMHTMLOutputElement,
                                    nsIMutationObserver,
                                    nsIConstraintValidation)
--- a/content/html/content/src/nsHTMLParagraphElement.cpp
+++ b/content/html/content/src/nsHTMLParagraphElement.cpp
@@ -9,16 +9,17 @@
 #include "nsIDOMEventTarget.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsMappedAttributes.h"
 #include "nsRuleData.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 // XXX missing nav attributes
 
 class nsHTMLParagraphElement : public nsGenericHTMLElement,
                                public nsIDOMHTMLParagraphElement
 {
 public:
   nsHTMLParagraphElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@@ -62,18 +63,18 @@ nsHTMLParagraphElement::nsHTMLParagraphE
 {
 }
 
 nsHTMLParagraphElement::~nsHTMLParagraphElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLParagraphElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLParagraphElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLParagraphElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLParagraphElement, Element)
 
 DOMCI_NODE_DATA(HTMLParagraphElement, nsHTMLParagraphElement)
 
 // QueryInterface implementation for nsHTMLParagraphElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLParagraphElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLParagraphElement,
                                    nsIDOMHTMLParagraphElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLParagraphElement,
--- a/content/html/content/src/nsHTMLPreElement.cpp
+++ b/content/html/content/src/nsHTMLPreElement.cpp
@@ -10,16 +10,17 @@
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsMappedAttributes.h"
 #include "nsRuleData.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 class nsHTMLPreElement : public nsGenericHTMLElement,
                          public nsIDOMHTMLPreElement
 {
 public:
   nsHTMLPreElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLPreElement();
 
@@ -62,18 +63,18 @@ nsHTMLPreElement::nsHTMLPreElement(alrea
 {
 }
 
 nsHTMLPreElement::~nsHTMLPreElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLPreElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLPreElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLPreElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLPreElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLPreElement, nsHTMLPreElement)
 
 // QueryInterface implementation for nsHTMLPreElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLPreElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLPreElement, nsIDOMHTMLPreElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLPreElement,
--- a/content/html/content/src/nsHTMLProgressElement.cpp
+++ b/content/html/content/src/nsHTMLProgressElement.cpp
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIDOMHTMLProgressElement.h"
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValue.h"
 #include "nsAttrValueInlines.h"
 #include "nsEventStateManager.h"
 
+using namespace mozilla::dom;
 
 class nsHTMLProgressElement : public nsGenericHTMLElement,
                               public nsIDOMHTMLProgressElement
 {
 public:
   nsHTMLProgressElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLProgressElement();
 
@@ -71,18 +72,18 @@ nsHTMLProgressElement::nsHTMLProgressEle
   // We start out indeterminate
   AddStatesSilently(NS_EVENT_STATE_INDETERMINATE);
 }
 
 nsHTMLProgressElement::~nsHTMLProgressElement()
 {
 }
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLProgressElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLProgressElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLProgressElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLProgressElement, Element)
 
 DOMCI_NODE_DATA(HTMLProgressElement, nsHTMLProgressElement)
 
 NS_INTERFACE_TABLE_HEAD(nsHTMLProgressElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLProgressElement,
                                    nsIDOMHTMLProgressElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLProgressElement,
                                                nsGenericHTMLElement)
--- a/content/html/content/src/nsHTMLScriptElement.cpp
+++ b/content/html/content/src/nsHTMLScriptElement.cpp
@@ -27,18 +27,18 @@
 using namespace mozilla;
 using namespace mozilla::dom;
 
 class nsHTMLScriptElement : public nsGenericHTMLElement,
                             public nsIDOMHTMLScriptElement,
                             public nsScriptElement
 {
 public:
-  using nsGenericElement::GetText;
-  using nsGenericElement::SetText;
+  using Element::GetText;
+  using Element::SetText;
 
   nsHTMLScriptElement(already_AddRefed<nsINodeInfo> aNodeInfo,
                       FromParser aFromParser);
   virtual ~nsHTMLScriptElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
@@ -72,17 +72,17 @@ public:
                               bool aCompileEventHandlers);
   virtual bool ParseAttribute(int32_t aNamespaceID,
                               nsIAtom* aAttribute,
                               const nsAString& aValue,
                               nsAttrValue& aResult);
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
-  // nsGenericElement
+  // Element
   virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
                                 const nsAttrValue* aValue, bool aNotify);
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 protected:
   // nsScriptElement
@@ -101,18 +101,18 @@ nsHTMLScriptElement::nsHTMLScriptElement
   AddMutationObserver(this);
 }
 
 nsHTMLScriptElement::~nsHTMLScriptElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLScriptElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLScriptElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLScriptElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLScriptElement, Element)
 
 DOMCI_NODE_DATA(HTMLScriptElement, nsHTMLScriptElement)
 
 // QueryInterface implementation for nsHTMLScriptElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLScriptElement)
   NS_HTML_CONTENT_INTERFACE_TABLE4(nsHTMLScriptElement,
                                    nsIDOMHTMLScriptElement,
                                    nsIScriptLoaderObserver,
--- a/content/html/content/src/nsHTMLSelectElement.cpp
+++ b/content/html/content/src/nsHTMLSelectElement.cpp
@@ -137,18 +137,18 @@ nsHTMLSelectElement::~nsHTMLSelectElemen
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLSelectElement)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLSelectElement,
                                                   nsGenericHTMLFormElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mOptions,
                                                        nsIDOMHTMLCollection)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLSelectElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLSelectElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLSelectElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLSelectElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLSelectElement, nsHTMLSelectElement)
 
 // QueryInterface implementation for nsHTMLSelectElement
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLSelectElement)
   NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLSelectElement,
                                    nsIDOMHTMLSelectElement,
@@ -2138,17 +2138,17 @@ nsHTMLOptionCollection::Item(uint32_t aI
     *aReturn = nullptr;
 
     return NS_OK;
   }
 
   return CallQueryInterface(item, aReturn);
 }
 
-nsGenericElement*
+Element*
 nsHTMLOptionCollection::GetElementAt(uint32_t aIndex)
 {
   return ItemAsOption(aIndex);
 }
 
 static nsHTMLOptionElement*
 GetNamedItemHelper(nsTArray<nsRefPtr<nsHTMLOptionElement> > &aElements,
                    const nsAString& aName)
--- a/content/html/content/src/nsHTMLSelectElement.h
+++ b/content/html/content/src/nsHTMLSelectElement.h
@@ -51,17 +51,17 @@ public:
                                bool *triedToWrap);
 
   // nsIDOMHTMLOptionsCollection interface
   NS_DECL_NSIDOMHTMLOPTIONSCOLLECTION
 
   // nsIDOMHTMLCollection interface, all its methods are defined in
   // nsIDOMHTMLOptionsCollection
 
-  virtual nsGenericElement* GetElementAt(uint32_t aIndex);
+  virtual mozilla::dom::Element* GetElementAt(uint32_t aIndex);
   virtual nsINode* GetParentObject();
 
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsHTMLOptionCollection,
                                                          nsIHTMLCollection)
 
   // Helpers for nsHTMLSelectElement
   /**
    * Insert an option
--- a/content/html/content/src/nsHTMLSharedElement.cpp
+++ b/content/html/content/src/nsHTMLSharedElement.cpp
@@ -16,16 +16,17 @@
 
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsRuleData.h"
 #include "nsMappedAttributes.h"
 #include "nsContentUtils.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 // XXX nav4 has type= start= (same as OL/UL)
 extern nsAttrValue::EnumTable kListTypeTable[];
 
 class nsHTMLSharedElement : public nsGenericHTMLElement,
                             public nsIDOMHTMLParamElement,
                             public nsIDOMHTMLBaseElement,
                             public nsIDOMHTMLDirectoryElement,
@@ -116,18 +117,18 @@ nsHTMLSharedElement::nsHTMLSharedElement
 {
 }
 
 nsHTMLSharedElement::~nsHTMLSharedElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLSharedElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLSharedElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLSharedElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLSharedElement, Element)
 
 
 DOMCI_DATA(HTMLParamElement, nsHTMLSharedElement)
 DOMCI_DATA(HTMLBaseElement, nsHTMLSharedElement)
 DOMCI_DATA(HTMLDirectoryElement, nsHTMLSharedElement)
 DOMCI_DATA(HTMLQuoteElement, nsHTMLSharedElement)
 DOMCI_DATA(HTMLHeadElement, nsHTMLSharedElement)
 DOMCI_DATA(HTMLHtmlElement, nsHTMLSharedElement)
--- a/content/html/content/src/nsHTMLSharedObjectElement.cpp
+++ b/content/html/content/src/nsHTMLSharedObjectElement.cpp
@@ -87,17 +87,17 @@ public:
   virtual nsEventStates IntrinsicState() const;
   virtual void DestroyContent();
 
   // nsObjectLoadingContent
   virtual uint32_t GetCapabilities() const;
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
-  nsresult CopyInnerTo(nsGenericElement* aDest);
+  nsresult CopyInnerTo(Element* aDest);
 
   void StartObjectLoad() { StartObjectLoad(true); }
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLSharedObjectElement,
                                                      nsGenericHTMLElement)
 
   virtual nsXPCClassInfo* GetClassInfo()
   {
@@ -206,18 +206,18 @@ nsHTMLSharedObjectElement::DoneAddingChi
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLSharedObjectElement)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLSharedObjectElement,
                                                   nsGenericHTMLElement)
   nsObjectLoadingContent::Traverse(tmp, cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLSharedObjectElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLSharedObjectElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLSharedObjectElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLSharedObjectElement, Element)
 
 DOMCI_DATA(HTMLAppletElement, nsHTMLSharedObjectElement)
 DOMCI_DATA(HTMLEmbedElement, nsHTMLSharedObjectElement)
 
 nsIClassInfo*
 nsHTMLSharedObjectElement::GetClassInfoInternal()
 {
   if (mNodeInfo->Equals(nsGkAtoms::applet)) {
@@ -485,17 +485,17 @@ nsHTMLSharedObjectElement::GetCapabiliti
 void
 nsHTMLSharedObjectElement::DestroyContent()
 {
   nsObjectLoadingContent::DestroyContent();
   nsGenericHTMLElement::DestroyContent();
 }
 
 nsresult
-nsHTMLSharedObjectElement::CopyInnerTo(nsGenericElement* aDest)
+nsHTMLSharedObjectElement::CopyInnerTo(Element* aDest)
 {
   nsresult rv = nsGenericHTMLElement::CopyInnerTo(aDest);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aDest->OwnerDoc()->IsStaticDocument()) {
     CreateStaticClone(static_cast<nsHTMLSharedObjectElement*>(aDest));
   }
 
--- a/content/html/content/src/nsHTMLSourceElement.cpp
+++ b/content/html/content/src/nsHTMLSourceElement.cpp
@@ -9,16 +9,18 @@
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsMappedAttributes.h"
 #include "nsRuleData.h"
 #include "nsHTMLMediaElement.h"
 #include "nsCOMPtr.h"
 #include "nsThreadUtils.h"
 
+using namespace mozilla::dom;
+
 class nsHTMLSourceElement : public nsGenericHTMLElement,
                             public nsIDOMHTMLSourceElement
 {
 public:
   nsHTMLSourceElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLSourceElement();
 
   // nsISupports
@@ -62,18 +64,18 @@ nsHTMLSourceElement::nsHTMLSourceElement
 {
 }
 
 nsHTMLSourceElement::~nsHTMLSourceElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLSourceElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLSourceElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLSourceElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLSourceElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLSourceElement, nsHTMLSourceElement)
 
 // QueryInterface implementation for nsHTMLSourceElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLSourceElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLSourceElement, nsIDOMHTMLSourceElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLSourceElement,
--- a/content/html/content/src/nsHTMLSpanElement.cpp
+++ b/content/html/content/src/nsHTMLSpanElement.cpp
@@ -5,16 +5,18 @@
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMEventTarget.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsIAtom.h"
 #include "nsRuleData.h"
 
+using namespace mozilla::dom;
+
 class nsHTMLSpanElement : public nsGenericHTMLElement,
                           public nsIDOMHTMLElement
 {
 public:
   nsHTMLSpanElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLSpanElement();
 
   // nsISupports
@@ -45,18 +47,18 @@ nsHTMLSpanElement::nsHTMLSpanElement(alr
 {
 }
 
 nsHTMLSpanElement::~nsHTMLSpanElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLSpanElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLSpanElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLSpanElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLSpanElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLSpanElement, nsHTMLSpanElement)
 
 // QueryInterface implementation for nsHTMLSpanElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLSpanElement)
   NS_HTML_CONTENT_INTERFACE_TABLE0(nsHTMLSpanElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLSpanElement,
--- a/content/html/content/src/nsHTMLStyleElement.cpp
+++ b/content/html/content/src/nsHTMLStyleElement.cpp
@@ -114,18 +114,18 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
                                                   nsGenericHTMLElement)
   tmp->nsStyleLinkElement::Traverse(cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsHTMLStyleElement,
                                                 nsGenericHTMLElement)
   tmp->nsStyleLinkElement::Unlink();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLStyleElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLStyleElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLStyleElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLStyleElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLStyleElement, nsHTMLStyleElement)
 
 // QueryInterface implementation for nsHTMLStyleElement
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLStyleElement)
   NS_HTML_CONTENT_INTERFACE_TABLE4(nsHTMLStyleElement,
                                    nsIDOMHTMLStyleElement,
--- a/content/html/content/src/nsHTMLTableCaptionElement.cpp
+++ b/content/html/content/src/nsHTMLTableCaptionElement.cpp
@@ -10,16 +10,17 @@
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsMappedAttributes.h"
 #include "nsRuleData.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 class nsHTMLTableCaptionElement :  public nsGenericHTMLElement,
                                    public nsIDOMHTMLTableCaptionElement
 {
 public:
   nsHTMLTableCaptionElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLTableCaptionElement();
 
@@ -61,18 +62,18 @@ nsHTMLTableCaptionElement::nsHTMLTableCa
 {
 }
 
 nsHTMLTableCaptionElement::~nsHTMLTableCaptionElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLTableCaptionElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLTableCaptionElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsHTMLTableCaptionElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLTableCaptionElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLTableCaptionElement, nsHTMLTableCaptionElement)
 
 // QueryInterface implementation for nsHTMLTableCaptionElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLTableCaptionElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLTableCaptionElement,
                                    nsIDOMHTMLTableCaptionElement)
--- a/content/html/content/src/nsHTMLTableCellElement.cpp
+++ b/content/html/content/src/nsHTMLTableCellElement.cpp
@@ -16,16 +16,17 @@
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsPresContext.h"
 #include "nsRuleData.h"
 #include "nsRuleWalker.h"
 #include "celldata.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 class nsHTMLTableCellElement : public nsGenericHTMLElement,
                                public nsIDOMHTMLTableCellElement
 {
 public:
   nsHTMLTableCellElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLTableCellElement();
 
@@ -72,18 +73,18 @@ nsHTMLTableCellElement::nsHTMLTableCellE
 {
 }
 
 nsHTMLTableCellElement::~nsHTMLTableCellElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLTableCellElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLTableCellElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLTableCellElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLTableCellElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLTableCellElement, nsHTMLTableCellElement)
 
 // QueryInterface implementation for nsHTMLTableCellElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLTableCellElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLTableCellElement,
                                    nsIDOMHTMLTableCellElement)
--- a/content/html/content/src/nsHTMLTableColElement.cpp
+++ b/content/html/content/src/nsHTMLTableColElement.cpp
@@ -10,16 +10,17 @@
 #include "nsMappedAttributes.h"
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsRuleData.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 // 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
 {
@@ -65,18 +66,18 @@ nsHTMLTableColElement::nsHTMLTableColEle
 {
 }
 
 nsHTMLTableColElement::~nsHTMLTableColElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLTableColElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLTableColElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLTableColElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLTableColElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLTableColElement, nsHTMLTableColElement)
 
 // QueryInterface implementation for nsHTMLTableColElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLTableColElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLTableColElement,
                                    nsIDOMHTMLTableColElement)
--- a/content/html/content/src/nsHTMLTableElement.cpp
+++ b/content/html/content/src/nsHTMLTableElement.cpp
@@ -23,33 +23,34 @@
 #include "nsIDocument.h"
 #include "nsContentUtils.h"
 #include "nsIDOMElement.h"
 #include "nsIHTMLCollection.h"
 #include "nsHTMLStyleSheet.h"
 #include "mozilla/dom/HTMLCollectionBinding.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 /* ------------------------------ TableRowsCollection -------------------------------- */
 /**
  * This class provides a late-bound collection of rows in a table.
  * mParent is NOT ref-counted to avoid circular references
  */
 class TableRowsCollection : public nsIHTMLCollection,
                             public nsWrapperCache
 {
 public:
   TableRowsCollection(nsHTMLTableElement *aParent);
   virtual ~TableRowsCollection();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_NSIDOMHTMLCOLLECTION
 
-  virtual nsGenericElement* GetElementAt(uint32_t aIndex);
+  virtual Element* GetElementAt(uint32_t aIndex);
   virtual nsINode* GetParentObject()
   {
     return mParent;
   }
 
   virtual JSObject* NamedItem(JSContext* cx, const nsAString& name,
                               ErrorResult& error);
   virtual void GetSupportedNames(nsTArray<nsString>& aNames);
@@ -192,39 +193,39 @@ TableRowsCollection::GetLength(uint32_t*
   );
 
   return NS_OK;
 }
 
 // Returns the item at index aIndex if available. If null is returned,
 // then aCount will be set to the number of rows in this row collection.
 // Otherwise, the value of aCount is undefined.
-static nsGenericElement*
+static Element*
 GetItemOrCountInRowGroup(nsIDOMHTMLCollection* rows,
                          uint32_t aIndex, uint32_t* aCount)
 {
   *aCount = 0;
 
   if (rows) {
     rows->GetLength(aCount);
     if (aIndex < *aCount) {
       nsIHTMLCollection* list = static_cast<nsIHTMLCollection*>(rows);
       return list->GetElementAt(aIndex);
     }
   }
   
   return nullptr;
 }
 
-nsGenericElement*
+Element*
 TableRowsCollection::GetElementAt(uint32_t aIndex)
 {
   DO_FOR_EACH_ROWGROUP(
     uint32_t count;
-    nsGenericElement* node = GetItemOrCountInRowGroup(rows, aIndex, &count);
+    Element* node = GetItemOrCountInRowGroup(rows, aIndex, &count);
     if (node) {
       return node; 
     }
 
     NS_ASSERTION(count <= aIndex, "GetItemOrCountInRowGroup screwed up");
     aIndex -= count;
   );
 
@@ -351,18 +352,18 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_IN
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLTableElement,
                                                   nsGenericHTMLElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mTBodies,
                                                        nsIDOMNodeList)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mRows)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLTableElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLTableElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLTableElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLTableElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLTableElement, nsHTMLTableElement)
 
 // QueryInterface implementation for nsHTMLTableElement
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLTableElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLTableElement, nsIDOMHTMLTableElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLTableElement,
--- a/content/html/content/src/nsHTMLTableRowElement.cpp
+++ b/content/html/content/src/nsHTMLTableRowElement.cpp
@@ -17,16 +17,17 @@
 #include "nsContentList.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsHTMLParts.h"
 #include "nsRuleData.h"
 #include "nsContentUtils.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 class nsHTMLTableRowElement : public nsGenericHTMLElement,
                               public nsIDOMHTMLTableRowElement
 {
 public:
   nsHTMLTableRowElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
   // nsISupports
@@ -77,18 +78,18 @@ nsHTMLTableRowElement::nsHTMLTableRowEle
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLTableRowElement)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLTableRowElement,
                                                   nsGenericHTMLElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mCells,
                                                        nsIDOMNodeList)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLTableRowElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLTableRowElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLTableRowElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLTableRowElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLTableRowElement, nsHTMLTableRowElement)
 
 // QueryInterface implementation for nsHTMLTableRowElement
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLTableRowElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLTableRowElement,
                                    nsIDOMHTMLTableRowElement)
--- a/content/html/content/src/nsHTMLTableSectionElement.cpp
+++ b/content/html/content/src/nsHTMLTableSectionElement.cpp
@@ -14,16 +14,17 @@
 #include "nsHTMLParts.h"
 #include "nsStyleConsts.h"
 #include "nsContentList.h"
 #include "nsRuleData.h"
 #include "nsError.h"
 #include "nsContentUtils.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 // you will see the phrases "rowgroup" and "section" used interchangably
 
 class nsHTMLTableSectionElement : public nsGenericHTMLElement,
                                   public nsIDOMHTMLTableSectionElement
 {
 public:
   nsHTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@@ -73,18 +74,18 @@ nsHTMLTableSectionElement::nsHTMLTableSe
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLTableSectionElement)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLTableSectionElement,
                                                   nsGenericHTMLElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mRows,
                                                        nsIDOMNodeList)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLTableSectionElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLTableSectionElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLTableSectionElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLTableSectionElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLTableSectionElement, nsHTMLTableSectionElement)
 
 // QueryInterface implementation for nsHTMLTableSectionElement
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLTableSectionElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLTableSectionElement,
                                    nsIDOMHTMLTableSectionElement)
--- a/content/html/content/src/nsHTMLTextAreaElement.cpp
+++ b/content/html/content/src/nsHTMLTextAreaElement.cpp
@@ -149,17 +149,17 @@ public:
 
   virtual bool IsHTMLFocusable(bool aWithMouse, bool *aIsFocusable, int32_t *aTabIndex);
 
   virtual void DoneAddingChildren(bool aHaveNotified);
   virtual bool IsDoneAddingChildren();
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
-  nsresult CopyInnerTo(nsGenericElement* aDest);
+  nsresult CopyInnerTo(Element* aDest);
 
   /**
    * Called when an attribute is about to be changed
    */
   virtual nsresult BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                                  const nsAttrValueOrString* aValue,
                                  bool aNotify);
 
@@ -306,18 +306,18 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_IN
   tmp->mState.Unlink();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLTextAreaElement,
                                                   nsGenericHTMLFormElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mControllers)
   tmp->mState.Traverse(cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLTextAreaElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLTextAreaElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLTextAreaElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLTextAreaElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLTextAreaElement, nsHTMLTextAreaElement)
 
 // QueryInterface implementation for nsHTMLTextAreaElement
 NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLTextAreaElement)
   NS_HTML_CONTENT_INTERFACE_TABLE5(nsHTMLTextAreaElement,
                                    nsIDOMHTMLTextAreaElement,
@@ -1273,17 +1273,17 @@ nsHTMLTextAreaElement::AfterSetAttr(int3
     UpdateState(aNotify);
   }
 
   return nsGenericHTMLFormElement::AfterSetAttr(aNameSpaceID, aName, aValue,
                                                 aNotify);
 }
 
 nsresult
-nsHTMLTextAreaElement::CopyInnerTo(nsGenericElement* aDest)
+nsHTMLTextAreaElement::CopyInnerTo(Element* aDest)
 {
   nsresult rv = nsGenericHTMLFormElement::CopyInnerTo(aDest);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aDest->OwnerDoc()->IsStaticDocument()) {
     nsAutoString value;
     GetValueInternal(value, true);
     static_cast<nsHTMLTextAreaElement*>(aDest)->SetValue(value);
--- a/content/html/content/src/nsHTMLTitleElement.cpp
+++ b/content/html/content/src/nsHTMLTitleElement.cpp
@@ -5,23 +5,25 @@
 #include "nsIDOMHTMLTitleElement.h"
 #include "nsIDOMEventTarget.h"
 #include "nsGenericHTMLElement.h"
 #include "nsStyleConsts.h"
 #include "nsIDocument.h"
 #include "nsContentUtils.h"
 #include "nsStubMutationObserver.h"
 
+using namespace mozilla::dom;
+
 class nsHTMLTitleElement : public nsGenericHTMLElement,
                            public nsIDOMHTMLTitleElement,
                            public nsStubMutationObserver
 {
 public:
-  using nsGenericElement::GetText;
-  using nsGenericElement::SetText;
+  using Element::GetText;
+  using Element::SetText;
 
   nsHTMLTitleElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLTitleElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
@@ -70,18 +72,18 @@ nsHTMLTitleElement::nsHTMLTitleElement(a
   AddMutationObserver(this);
 }
 
 nsHTMLTitleElement::~nsHTMLTitleElement()
 {
 }
 
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLTitleElement, nsGenericElement) 
-NS_IMPL_RELEASE_INHERITED(nsHTMLTitleElement, nsGenericElement) 
+NS_IMPL_ADDREF_INHERITED(nsHTMLTitleElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLTitleElement, Element)
 
 
 DOMCI_NODE_DATA(HTMLTitleElement, nsHTMLTitleElement)
 
 // QueryInterface implementation for nsHTMLTitleElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLTitleElement)
   NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLTitleElement,
                                    nsIDOMHTMLTitleElement,
--- a/content/html/content/src/nsHTMLUnknownElement.cpp
+++ b/content/html/content/src/nsHTMLUnknownElement.cpp
@@ -1,17 +1,19 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsHTMLUnknownElement.h"
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLUnknownElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsHTMLUnknownElement, nsGenericElement)
+using namespace mozilla::dom;
+
+NS_IMPL_ADDREF_INHERITED(nsHTMLUnknownElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsHTMLUnknownElement, Element)
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Unknown)
 
 DOMCI_NODE_DATA(HTMLUnknownElement, nsHTMLUnknownElement)
 
 // QueryInterface implementation for nsHTMLUnknownElement
 NS_INTERFACE_TABLE_HEAD(nsHTMLUnknownElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLUnknownElement,
--- a/content/mathml/content/src/nsMathMLElement.cpp
+++ b/content/mathml/content/src/nsMathMLElement.cpp
@@ -15,16 +15,17 @@
 #include "nsStyleConsts.h"
 #include "nsIDocument.h"
 #include "nsEventStates.h"
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
 #include "mozAutoDocUpdate.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 //----------------------------------------------------------------------
 // nsISupports methods:
 
 DOMCI_NODE_DATA(MathMLElement, nsMathMLElement)
 
 NS_INTERFACE_TABLE_HEAD(nsMathMLElement)
   NS_NODE_OFFSET_AND_INTERFACE_TABLE_BEGIN(nsMathMLElement)
@@ -106,38 +107,38 @@ nsMathMLElement::ParseAttribute(int32_t 
       return aResult.ParseColor(aValue);
     }
   }
 
   return nsMathMLElementBase::ParseAttribute(aNamespaceID, aAttribute,
                                              aValue, aResult);
 }
 
-static nsGenericElement::MappedAttributeEntry sMtableStyles[] = {
+static Element::MappedAttributeEntry sMtableStyles[] = {
   { &nsGkAtoms::width },
   { nullptr }
 };
 
-static nsGenericElement::MappedAttributeEntry sTokenStyles[] = {
+static Element::MappedAttributeEntry sTokenStyles[] = {
   { &nsGkAtoms::mathsize_ },
   { &nsGkAtoms::fontsize_ },
   { &nsGkAtoms::color },
   { &nsGkAtoms::fontfamily_ },
   { nullptr }
 };
 
-static nsGenericElement::MappedAttributeEntry sEnvironmentStyles[] = {
+static Element::MappedAttributeEntry sEnvironmentStyles[] = {
   { &nsGkAtoms::scriptlevel_ },
   { &nsGkAtoms::scriptminsize_ },
   { &nsGkAtoms::scriptsizemultiplier_ },
   { &nsGkAtoms::background },
   { nullptr }
 };
 
-static nsGenericElement::MappedAttributeEntry sCommonPresStyles[] = {
+static Element::MappedAttributeEntry sCommonPresStyles[] = {
   { &nsGkAtoms::mathcolor_ },
   { &nsGkAtoms::mathbackground_ },
   { nullptr }
 };
 
 bool
 nsMathMLElement::IsAttributeMapped(const nsIAtom* aAttribute) const
 {
@@ -600,17 +601,17 @@ nsMathMLElement::MapMathMLAttributesInto
     }
   }
 
 }
 
 nsresult
 nsMathMLElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
 {
-  nsresult rv = nsGenericElement::PreHandleEvent(aVisitor);
+  nsresult rv = Element::PreHandleEvent(aVisitor);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return PreHandleEventForLinks(aVisitor);
 }
 
 nsresult
 nsMathMLElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
 {
--- a/content/smil/nsISMILAnimationElement.h
+++ b/content/smil/nsISMILAnimationElement.h
@@ -55,17 +55,17 @@ public:
    */
   virtual bool PassesConditionalProcessingTests() = 0;
 
   /*
    * Returns the source attribute as an nsAttrValue. The global namespace will
    * be used.
    *
    * (The 'Anim' here and below is largely to avoid conflicts for subclasses
-   * that derive from nsGenericElement)
+   * that derive from Element)
    *
    * @param aName the name of the attr
    * @returns true if the attribute was set (even when set to empty string)
    *          false when not set.
    */
   virtual const nsAttrValue* GetAnimAttr(nsIAtom* aName) const = 0;
 
   /*
--- a/content/svg/content/src/SVGAnimatedLengthList.cpp
+++ b/content/svg/content/src/SVGAnimatedLengthList.cpp
@@ -28,17 +28,17 @@ SVGAnimatedLengthList::SetBaseValueStrin
     // of our baseVal is being reduced, our baseVal's DOM wrapper list may have
     // to remove DOM items from itself, and any removed DOM items need to copy
     // their internal counterpart values *before* we change them.
     //
     domWrapper->InternalBaseValListWillChangeTo(newBaseValue);
   }
 
   // We don't need to call DidChange* here - we're only called by
-  // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr,
+  // nsSVGElement::ParseAttribute under Element::SetAttr,
   // which takes care of notifying.
 
   rv = mBaseVal.CopyFrom(newBaseValue);
   if (NS_FAILED(rv) && domWrapper) {
     // Attempting to increase mBaseVal's length failed - reduce domWrapper
     // back to the same length:
     domWrapper->InternalBaseValListWillChangeTo(mBaseVal);
   }
--- a/content/svg/content/src/SVGAnimatedNumberList.cpp
+++ b/content/svg/content/src/SVGAnimatedNumberList.cpp
@@ -28,17 +28,17 @@ SVGAnimatedNumberList::SetBaseValueStrin
     // of our baseVal is being reduced, our baseVal's DOM wrapper list may have
     // to remove DOM items from itself, and any removed DOM items need to copy
     // their internal counterpart values *before* we change them.
     //
     domWrapper->InternalBaseValListWillChangeTo(newBaseValue);
   }
 
   // We don't need to call DidChange* here - we're only called by
-  // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr,
+  // nsSVGElement::ParseAttribute under Element::SetAttr,
   // which takes care of notifying.
 
   mIsBaseSet = true;
   rv = mBaseVal.CopyFrom(newBaseValue);
   if (NS_FAILED(rv) && domWrapper) {
     // Attempting to increase mBaseVal's length failed - reduce domWrapper
     // back to the same length:
     domWrapper->InternalBaseValListWillChangeTo(mBaseVal);
--- a/content/svg/content/src/SVGAnimatedPathSegList.cpp
+++ b/content/svg/content/src/SVGAnimatedPathSegList.cpp
@@ -43,17 +43,17 @@ SVGAnimatedPathSegList::SetBaseValueStri
     if (animValWrapper) {
       animValWrapper->InternalListWillChangeTo(newBaseValue);
     }
   }
 
   // Only now may we modify mBaseVal!
 
   // We don't need to call DidChange* here - we're only called by
-  // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr,
+  // nsSVGElement::ParseAttribute under Element::SetAttr,
   // which takes care of notifying.
 
   nsresult rv2 = mBaseVal.CopyFrom(newBaseValue);
   if (NS_FAILED(rv2)) {
     // Attempting to increase mBaseVal's length failed (mBaseVal is left
     // unmodified). We MUST keep any DOM wrappers in sync:
     if (baseValWrapper) {
       baseValWrapper->InternalListWillChangeTo(mBaseVal);
--- a/content/svg/content/src/SVGAnimatedPointList.cpp
+++ b/content/svg/content/src/SVGAnimatedPointList.cpp
@@ -43,17 +43,17 @@ SVGAnimatedPointList::SetBaseValueString
     if (animValWrapper) {
       animValWrapper->InternalListWillChangeTo(newBaseValue);
     }
   }
 
   // Only now may we modify mBaseVal!
 
   // We don't need to call DidChange* here - we're only called by
-  // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr,
+  // nsSVGElement::ParseAttribute under Element::SetAttr,
   // which takes care of notifying.
 
   nsresult rv2 = mBaseVal.CopyFrom(newBaseValue);
   if (NS_FAILED(rv2)) {
     // Attempting to increase mBaseVal's length failed (mBaseVal is left
     // unmodified). We MUST keep any DOM wrappers in sync:
     if (baseValWrapper) {
       baseValWrapper->InternalListWillChangeTo(mBaseVal);
--- a/content/svg/content/src/SVGAnimatedTransformList.cpp
+++ b/content/svg/content/src/SVGAnimatedTransformList.cpp
@@ -31,17 +31,17 @@ SVGAnimatedTransformList::SetBaseValueSt
     // of our baseVal is being reduced, our baseVal's DOM wrapper list may have
     // to remove DOM items from itself, and any removed DOM items need to copy
     // their internal counterpart values *before* we change them.
     //
     domWrapper->InternalBaseValListWillChangeLengthTo(newBaseValue.Length());
   }
 
   // We don't need to call DidChange* here - we're only called by
-  // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr,
+  // nsSVGElement::ParseAttribute under Element::SetAttr,
   // which takes care of notifying.
 
   rv = mBaseVal.CopyFrom(newBaseValue);
   if (NS_FAILED(rv) && domWrapper) {
     // Attempting to increase mBaseVal's length failed - reduce domWrapper
     // back to the same length:
     domWrapper->InternalBaseValListWillChangeLengthTo(mBaseVal.Length());
   } else {
--- a/content/svg/content/src/nsSVGAElement.cpp
+++ b/content/svg/content/src/nsSVGAElement.cpp
@@ -11,16 +11,17 @@
 #include "nsIDOMSVGURIReference.h"
 #include "nsILink.h"
 #include "nsSVGString.h"
 #include "nsCOMPtr.h"
 #include "nsGkAtoms.h"
 #include "nsContentUtils.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 nsSVGElement::StringInfo nsSVGAElement::sStringInfo[2] =
 {
   { &nsGkAtoms::href, kNameSpaceID_XLink, true },
   { &nsGkAtoms::target, kNameSpaceID_None, true }
 };
 
 NS_IMPL_NS_NEW_SVG_ELEMENT(A)
@@ -69,17 +70,17 @@ nsSVGAElement::GetHref(nsIDOMSVGAnimated
 
 
 //----------------------------------------------------------------------
 // nsINode methods
 
 nsresult
 nsSVGAElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
 {
-  nsresult rv = nsGenericElement::PreHandleEvent(aVisitor);
+  nsresult rv = Element::PreHandleEvent(aVisitor);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return PreHandleEventForLinks(aVisitor);
 }
 
 nsresult
 nsSVGAElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
 {
--- a/content/svg/content/src/nsSVGAnimateTransformElement.cpp
+++ b/content/svg/content/src/nsSVGAnimateTransformElement.cpp
@@ -30,17 +30,17 @@ public:
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
   NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
   NS_FORWARD_NSIDOMSVGELEMENT(nsSVGAnimateTransformElementBase::)
   NS_FORWARD_NSIDOMSVGANIMATIONELEMENT(nsSVGAnimateTransformElementBase::)
 
   // nsIDOMNode specializations
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
-  // nsGenericElement specializations
+  // Element specializations
   bool ParseAttribute(int32_t aNamespaceID,
                         nsIAtom* aAttribute,
                         const nsAString& aValue,
                         nsAttrValue& aResult);
 
   // nsISMILAnimationElement
   virtual nsSMILAnimationFunction& AnimationFunction();
 
--- a/content/svg/content/src/nsSVGAnimationElement.h
+++ b/content/svg/content/src/nsSVGAnimationElement.h
@@ -40,17 +40,17 @@ public:
                               bool aCompileEventHandlers);
   virtual void UnbindFromTree(bool aDeep, bool aNullParent);
 
   virtual nsresult UnsetAttr(int32_t aNamespaceID, nsIAtom* aAttribute,
                              bool aNotify);
 
   virtual bool IsNodeOfType(uint32_t aFlags) const;
 
-  // nsGenericElement specializations
+  // Element specializations
   virtual bool ParseAttribute(int32_t aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
   virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
                                 const nsAttrValue* aValue, bool aNotify);
 
   // nsISMILAnimationElement interface
--- a/content/svg/content/src/nsSVGBoolean.cpp
+++ b/content/svg/content/src/nsSVGBoolean.cpp
@@ -68,17 +68,17 @@ nsSVGBoolean::SetBaseValueAtom(const nsI
   if (!mIsAnimated) {
     mAnimVal = mBaseVal;
   }
   else {
     aSVGElement->AnimationNeedsResample();
   }
 
   // We don't need to call DidChange* here - we're only called by
-  // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr,
+  // nsSVGElement::ParseAttribute under Element::SetAttr,
   // which takes care of notifying.
   return NS_OK;
 }
 
 nsIAtom*
 nsSVGBoolean::GetBaseValueAtom() const
 {
   return mBaseVal ? nsGkAtoms::_true : nsGkAtoms::_false;
--- a/content/svg/content/src/nsSVGElement.cpp
+++ b/content/svg/content/src/nsSVGElement.cpp
@@ -54,16 +54,17 @@
 #include "prdtoa.h"
 #include <stdarg.h>
 #include "nsSMILMappedAttribute.h"
 #include "SVGMotionSMILAttr.h"
 #include "nsAttrValueOrString.h"
 #include "nsSMILAnimationController.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 // This is needed to ensure correct handling of calls to the
 // vararg-list methods in this file:
 //   nsSVGElement::GetAnimated{Length,Number,Integer}Values
 // See bug 547964 for details:
 PR_STATIC_ASSERT(sizeof(void*) == sizeof(nullptr));
 
 
@@ -175,17 +176,17 @@ nsSVGElement::Init()
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_IMPL_ADDREF_INHERITED(nsSVGElement, nsSVGElementBase)
 NS_IMPL_RELEASE_INHERITED(nsSVGElement, nsSVGElementBase)
 
 NS_INTERFACE_MAP_BEGIN(nsSVGElement)
-// provided by nsGenericElement:
+// provided by Element:
 //  NS_INTERFACE_MAP_ENTRY(nsIContent)
 NS_INTERFACE_MAP_END_INHERITING(nsSVGElementBase)
 
 //----------------------------------------------------------------------
 // Implementation
   
 //----------------------------------------------------------------------
 // nsIContent methods
@@ -882,17 +883,17 @@ nsSVGElement::IsAttributeMapped(const ns
 {
   if (name == nsGkAtoms::lang) {
     return true;
   }
   return nsSVGElementBase::IsAttributeMapped(name);
 }
 
 // PresentationAttributes-FillStroke
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsSVGElement::sFillStrokeMap[] = {
   { &nsGkAtoms::fill },
   { &nsGkAtoms::fill_opacity },
   { &nsGkAtoms::fill_rule },
   { &nsGkAtoms::stroke },
   { &nsGkAtoms::stroke_dasharray },
   { &nsGkAtoms::stroke_dashoffset },
   { &nsGkAtoms::stroke_linecap },
@@ -900,17 +901,17 @@ nsSVGElement::sFillStrokeMap[] = {
   { &nsGkAtoms::stroke_miterlimit },
   { &nsGkAtoms::stroke_opacity },
   { &nsGkAtoms::stroke_width },
   { &nsGkAtoms::vector_effect },
   { nullptr }
 };
 
 // PresentationAttributes-Graphics
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsSVGElement::sGraphicsMap[] = {
   { &nsGkAtoms::clip_path },
   { &nsGkAtoms::clip_rule },
   { &nsGkAtoms::colorInterpolation },
   { &nsGkAtoms::cursor },
   { &nsGkAtoms::display },
   { &nsGkAtoms::filter },
   { &nsGkAtoms::image_rendering },
@@ -919,17 +920,17 @@ nsSVGElement::sGraphicsMap[] = {
   { &nsGkAtoms::pointer_events },
   { &nsGkAtoms::shape_rendering },
   { &nsGkAtoms::text_rendering },
   { &nsGkAtoms::visibility },
   { nullptr }
 };
 
 // PresentationAttributes-TextContentElements
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsSVGElement::sTextContentElementsMap[] = {
   // Properties that we don't support are commented out.
   // { &nsGkAtoms::alignment_baseline },
   // { &nsGkAtoms::baseline_shift },
   { &nsGkAtoms::direction },
   { &nsGkAtoms::dominant_baseline },
   // { &nsGkAtoms::glyph_orientation_horizontal },
   // { &nsGkAtoms::glyph_orientation_vertical },
@@ -938,96 +939,96 @@ nsSVGElement::sTextContentElementsMap[] 
   { &nsGkAtoms::text_anchor },
   { &nsGkAtoms::text_decoration },
   { &nsGkAtoms::unicode_bidi },
   { &nsGkAtoms::word_spacing },
   { nullptr }
 };
 
 // PresentationAttributes-FontSpecification
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsSVGElement::sFontSpecificationMap[] = {
   { &nsGkAtoms::font_family },
   { &nsGkAtoms::font_size },
   { &nsGkAtoms::font_size_adjust },
   { &nsGkAtoms::font_stretch },
   { &nsGkAtoms::font_style },
   { &nsGkAtoms::font_variant },
   { &nsGkAtoms::fontWeight },  
   { nullptr }
 };
 
 // PresentationAttributes-GradientStop
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsSVGElement::sGradientStopMap[] = {
   { &nsGkAtoms::stop_color },
   { &nsGkAtoms::stop_opacity },
   { nullptr }
 };
 
 // PresentationAttributes-Viewports
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsSVGElement::sViewportsMap[] = {
   { &nsGkAtoms::overflow },
   { &nsGkAtoms::clip },
   { nullptr }
 };
 
 // PresentationAttributes-Makers
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsSVGElement::sMarkersMap[] = {
   { &nsGkAtoms::marker_end },
   { &nsGkAtoms::marker_mid },
   { &nsGkAtoms::marker_start },
   { nullptr }
 };
 
 // PresentationAttributes-Color
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsSVGElement::sColorMap[] = {
   { &nsGkAtoms::color },
   { nullptr }
 };
 
 // PresentationAttributes-Filters
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsSVGElement::sFiltersMap[] = {
   { &nsGkAtoms::colorInterpolationFilters },
   { nullptr }
 };
 
 // PresentationAttributes-feFlood
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsSVGElement::sFEFloodMap[] = {
   { &nsGkAtoms::flood_color },
   { &nsGkAtoms::flood_opacity },
   { nullptr }
 };
 
 // PresentationAttributes-LightingEffects
-/* static */ const nsGenericElement::MappedAttributeEntry
+/* static */ const Element::MappedAttributeEntry
 nsSVGElement::sLightingEffectsMap[] = {
   { &nsGkAtoms::lighting_color },
   { nullptr }
 };
 
 //----------------------------------------------------------------------
 // nsIDOMNode methods
 
 NS_IMETHODIMP
 nsSVGElement::IsSupported(const nsAString& aFeature, const nsAString& aVersion, bool* aReturn)
 {
-  *aReturn = nsGenericElement::IsSupported(aFeature, aVersion);
+  *aReturn = Element::IsSupported(aFeature, aVersion);
   return NS_OK;
 }
 
 //----------------------------------------------------------------------
 // nsIDOMElement methods
 
-// forwarded to nsGenericElement implementations
+// forwarded to Element implementations
 
 
 //----------------------------------------------------------------------
 // nsIDOMSVGElement methods
 
 /* attribute DOMString id; */
 NS_IMETHODIMP nsSVGElement::GetId(nsAString & aId)
 {
--- a/content/svg/content/src/nsSVGElement.h
+++ b/content/svg/content/src/nsSVGElement.h
@@ -12,17 +12,17 @@
 */
 
 #include "mozilla/css/StyleRule.h"
 #include "nsAutoPtr.h"
 #include "nsChangeHint.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h"
 #include "nsISupportsImpl.h"
 #include "nsStyledElement.h"
 
 class nsIDOMSVGElement;
 class nsIDOMSVGSVGElement;
 class nsSVGAngle;
 class nsSVGBoolean;
 class nsSVGEnum;
--- a/content/svg/content/src/nsSVGEnum.cpp
+++ b/content/svg/content/src/nsSVGEnum.cpp
@@ -48,17 +48,17 @@ nsSVGEnum::SetBaseValueAtom(const nsIAto
         mBaseVal = mapping->mVal;
         if (!mIsAnimated) {
           mAnimVal = mBaseVal;
         }
         else {
           aSVGElement->AnimationNeedsResample();
         }
         // We don't need to call DidChange* here - we're only called by
-        // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr,
+        // nsSVGElement::ParseAttribute under Element::SetAttr,
         // which takes care of notifying.
       }
       return NS_OK;
     }
     mapping++;
   }
 
   // only a warning since authors may mistype attribute values
--- a/content/svg/content/src/nsSVGImageElement.cpp
+++ b/content/svg/content/src/nsSVGImageElement.cpp
@@ -9,16 +9,17 @@
 #include "nsCOMPtr.h"
 #include "nsIURI.h"
 #include "nsNetUtil.h"
 #include "imgIContainer.h"
 #include "imgINotificationObserver.h"
 #include "gfxContext.h"
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
 nsSVGElement::LengthInfo nsSVGImageElement::sLengthInfo[4] =
 {
   { &nsGkAtoms::x, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X },
   { &nsGkAtoms::y, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::Y },
   { &nsGkAtoms::width, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X },
   { &nsGkAtoms::height, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::Y },
 };
@@ -269,15 +270,15 @@ nsSVGImageElement::GetPreserveAspectRati
 nsSVGElement::StringAttributesInfo
 nsSVGImageElement::GetStringInfo()
 {
   return StringAttributesInfo(mStringAttributes, sStringInfo,
                               ArrayLength(sStringInfo));
 }
 
 nsresult
-nsSVGImageElement::CopyInnerTo(nsGenericElement* aDest)
+nsSVGImageElement::CopyInnerTo(Element* aDest)
 {
   if (aDest->OwnerDoc()->IsStaticDocument()) {
     CreateStaticImageClone(static_cast<nsSVGImageElement*>(aDest));
   }
   return nsSVGImageElementBase::CopyInnerTo(aDest);
 }
--- a/content/svg/content/src/nsSVGImageElement.h
+++ b/content/svg/content/src/nsSVGImageElement.h
@@ -58,17 +58,17 @@ public:
   // nsSVGPathGeometryElement methods:
   virtual void ConstructPath(gfxContext *aCtx);
 
   // nsSVGSVGElement methods:
   virtual bool HasValidDimensions() const;
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
-  nsresult CopyInnerTo(nsGenericElement* aDest);
+  nsresult CopyInnerTo(mozilla::dom::Element* aDest);
 
   void MaybeLoadSVGImage();
 
   bool IsImageSrcSetDisabled() const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
--- a/content/svg/content/src/nsSVGIntegerPair.cpp
+++ b/content/svg/content/src/nsSVGIntegerPair.cpp
@@ -86,17 +86,17 @@ nsSVGIntegerPair::SetBaseValueString(con
     mAnimVal[0] = mBaseVal[0];
     mAnimVal[1] = mBaseVal[1];
   }
   else {
     aSVGElement->AnimationNeedsResample();
   }
 
   // We don't need to call DidChange* here - we're only called by
-  // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr,
+  // nsSVGElement::ParseAttribute under Element::SetAttr,
   // which takes care of notifying.
   return NS_OK;
 }
 
 void
 nsSVGIntegerPair::GetBaseValueString(nsAString &aValueAsString) const
 {
   aValueAsString.Truncate();
--- a/content/svg/content/src/nsSVGMpathElement.h
+++ b/content/svg/content/src/nsSVGMpathElement.h
@@ -49,17 +49,17 @@ public:
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers);
   virtual void UnbindFromTree(bool aDeep, bool aNullParent);
 
   virtual nsresult UnsetAttr(int32_t aNamespaceID, nsIAtom* aAttribute,
                              bool aNotify);
-  // nsGenericElement specializations
+  // Element specializations
   virtual bool ParseAttribute(int32_t aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
 
   // Public helper method: If our xlink:href attribute links to a <path>
   // element, this method returns a pointer to that element. Otherwise,
   // this returns nullptr.
--- a/content/svg/content/src/nsSVGNumber2.cpp
+++ b/content/svg/content/src/nsSVGNumber2.cpp
@@ -101,17 +101,17 @@ nsSVGNumber2::SetBaseValueString(const n
   if (!mIsAnimated) {
     mAnimVal = mBaseVal;
   }
   else {
     aSVGElement->AnimationNeedsResample();
   }
 
   // We don't need to call DidChange* here - we're only called by
-  // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr,
+  // nsSVGElement::ParseAttribute under Element::SetAttr,
   // which takes care of notifying.
   return NS_OK;
 }
 
 void
 nsSVGNumber2::GetBaseValueString(nsAString & aValueAsString)
 {
   aValueAsString.Truncate();
--- a/content/svg/content/src/nsSVGNumberPair.cpp
+++ b/content/svg/content/src/nsSVGNumberPair.cpp
@@ -86,17 +86,17 @@ nsSVGNumberPair::SetBaseValueString(cons
     mAnimVal[0] = mBaseVal[0];
     mAnimVal[1] = mBaseVal[1];
   }
   else {
     aSVGElement->AnimationNeedsResample();
   }
 
   // We don't need to call Will/DidChange* here - we're only called by
-  // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr,
+  // nsSVGElement::ParseAttribute under Element::SetAttr,
   // which takes care of notifying.
   return NS_OK;
 }
 
 void
 nsSVGNumberPair::GetBaseValueString(nsAString &aValueAsString) const
 {
   aValueAsString.Truncate();
--- a/content/svg/content/src/nsSVGSVGElement.h
+++ b/content/svg/content/src/nsSVGSVGElement.h
@@ -298,17 +298,17 @@ private:
     return parent && parent->IsSVG() &&
            parent->Tag() != nsGkAtoms::foreignObject;
   }
 
   /* 
    * While binding to the tree we need to determine if we will be the outermost
    * <svg> element _before_ the children are bound (as they want to know what
    * timed document root to register with) and therefore _before_ our parent is
-   * set (both actions are performed by nsGenericElement::BindToTree) so we
+   * set (both actions are performed by Element::BindToTree) so we
    * can't use GetOwnerSVGElement() as it relies on GetParent(). This code is
    * basically a simplified version of GetOwnerSVGElement that uses the parent
    * parameters passed in instead.
    */
   bool WillBeOutermostSVG(nsIContent* aParent,
                           nsIContent* aBindingParent) const;
 
   // invalidate viewbox -> viewport xform & inform frames
--- a/content/svg/document/src/nsSVGDocument.cpp
+++ b/content/svg/document/src/nsSVGDocument.cpp
@@ -3,17 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsSVGDocument.h"
 #include "nsString.h"
 #include "nsLiteralString.h"
 #include "nsIDOMSVGSVGElement.h"
 #include "mozilla/dom/Element.h"
-#include "nsGenericElement.h"
 
 using namespace mozilla::dom;
 
 //----------------------------------------------------------------------
 // Implementation
 
 nsSVGDocument::nsSVGDocument()
 {
--- a/content/xml/content/src/nsXMLElement.cpp
+++ b/content/xml/content/src/nsXMLElement.cpp
@@ -1,16 +1,18 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsXMLElement.h"
 #include "nsContentUtils.h" // nsAutoScriptBlocker
 
+using namespace mozilla::dom;
+
 nsresult
 NS_NewXMLElement(nsIContent** aInstancePtrResult, already_AddRefed<nsINodeInfo> aNodeInfo)
 {
   nsXMLElement* it = new nsXMLElement(aNodeInfo);
   NS_ADDREF(*aInstancePtrResult = it);
   return NS_OK;
 }
 
@@ -21,18 +23,18 @@ NS_INTERFACE_TABLE_HEAD(nsXMLElement)
   NS_NODE_OFFSET_AND_INTERFACE_TABLE_BEGIN(nsXMLElement)
     NS_INTERFACE_TABLE_ENTRY(nsXMLElement, nsIDOMNode)
     NS_INTERFACE_TABLE_ENTRY(nsXMLElement, nsIDOMElement)
   NS_OFFSET_AND_INTERFACE_TABLE_END
   NS_ELEMENT_INTERFACE_TABLE_TO_MAP_SEGUE
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Element)
 NS_ELEMENT_INTERFACE_MAP_END
 
-NS_IMPL_ADDREF_INHERITED(nsXMLElement, nsGenericElement)
-NS_IMPL_RELEASE_INHERITED(nsXMLElement, nsGenericElement)
+NS_IMPL_ADDREF_INHERITED(nsXMLElement, Element)
+NS_IMPL_RELEASE_INHERITED(nsXMLElement, Element)
 
 NS_IMPL_ELEMENT_CLONE(nsXMLElement)
 
 nsresult
 nsXMLElement::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
                         bool aNotify)
 {
   nsAutoScriptBlocker scriptBlocker;
@@ -41,17 +43,17 @@ nsXMLElement::UnsetAttr(int32_t aNameSpa
       aNameSpaceID == kNameSpaceID_None) {
     // Have to do this before clearing flag. See RemoveFromIdTable
     RemoveFromIdTable();
     isId = true;
   }
 
   nsMutationGuard guard;
 
-  nsresult rv = nsGenericElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
+  nsresult rv = Element::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
 
   if (isId &&
       (!guard.Mutated(0) ||
        !mNodeInfo->GetIDAttributeAtom() ||
        !HasAttr(kNameSpaceID_None, GetIDAttributeName()))) {
     ClearHasID();
   }
   
@@ -135,27 +137,27 @@ nsXMLElement::ParseAttribute(int32_t aNa
   return false;
 }
 
 nsresult
 nsXMLElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                          nsIContent* aBindingParent,
                          bool aCompileEventHandlers)
 {
-  nsresult rv = nsGenericElement::BindToTree(aDocument, aParent,
-                                             aBindingParent,
-                                             aCompileEventHandlers);
+  nsresult rv = Element::BindToTree(aDocument, aParent,
+                                    aBindingParent,
+                                    aCompileEventHandlers);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aDocument && HasID() && !GetBindingParent()) {
     aDocument->AddToIdTable(this, DoGetID());
   }
 
   return NS_OK;
 }
 
 void
 nsXMLElement::UnbindFromTree(bool aDeep, bool aNullParent)
 {
   RemoveFromIdTable();
 
-  return nsGenericElement::UnbindFromTree(aDeep, aNullParent);
+  return Element::UnbindFromTree(aDeep, aNullParent);
 }
--- a/content/xml/content/src/nsXMLElement.h
+++ b/content/xml/content/src/nsXMLElement.h
@@ -2,24 +2,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsXMLElement_h___
 #define nsXMLElement_h___
 
 #include "nsIDOMElement.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h"
 
-class nsXMLElement : public nsGenericElement,
+class nsXMLElement : public mozilla::dom::Element,
                      public nsIDOMElement
 {
 public:
   nsXMLElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-    : nsGenericElement(aNodeInfo)
+    : mozilla::dom::Element(aNodeInfo)
   {
   }
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
@@ -43,15 +43,15 @@ public:
   virtual void UnbindFromTree(bool aDeep, bool aNullParent);
   virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
                              bool aNotify);
   virtual bool ParseAttribute(int32_t aNamespaceID,
                                 nsIAtom* aAttribute,
                                 const nsAString& aValue,
                                 nsAttrValue& aResult);
 
-  // nsGenericElement overrides
+  // Element overrides
   virtual void NodeInfoChanged(nsINodeInfo* aOldNodeInfo);
 
 
 };
 
 #endif // nsXMLElement_h___
--- a/content/xml/content/src/nsXMLProcessingInstruction.cpp
+++ b/content/xml/content/src/nsXMLProcessingInstruction.cpp
@@ -1,14 +1,13 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsGenericElement.h"
 #include "nsGkAtoms.h"
 #include "nsUnicharUtils.h"
 #include "nsXMLProcessingInstruction.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsContentUtils.h"
 
 nsresult
 NS_NewXMLProcessingInstruction(nsIContent** aInstancePtrResult,
--- a/content/xml/document/src/nsXMLContentSink.cpp
+++ b/content/xml/document/src/nsXMLContentSink.cpp
@@ -29,17 +29,16 @@
 #include "nsINameSpaceManager.h"
 #include "nsIServiceManager.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIContentViewer.h"
 #include "prtime.h"
 #include "prlog.h"
 #include "prmem.h"
 #include "nsRect.h"
-#include "nsGenericElement.h"
 #include "nsIWebNavigation.h"
 #include "nsIScriptElement.h"
 #include "nsScriptLoader.h"
 #include "nsStyleLinkElement.h"
 #include "nsReadableUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsICookieService.h"
 #include "nsIPrompt.h"
--- a/content/xml/document/src/nsXMLDocument.cpp
+++ b/content/xml/document/src/nsXMLDocument.cpp
@@ -46,17 +46,17 @@
 #include "nsContentCreatorFunctions.h"
 #include "nsContentPolicyUtils.h"
 #include "nsIDOMUserDataHandler.h"
 #include "nsEventDispatcher.h"
 #include "nsNodeUtils.h"
 #include "nsIConsoleService.h"
 #include "nsIScriptError.h"
 #include "nsIHTMLDocument.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h" // DOMCI_NODE_DATA
 
 // ==================================================================
 // =
 // ==================================================================
 
 
 nsresult
 NS_NewDOMDocument(nsIDOMDocument** aInstancePtrResult,
--- a/content/xtf/src/nsXTFElementWrapper.h
+++ b/content/xtf/src/nsXTFElementWrapper.h
@@ -82,17 +82,17 @@ public:
   virtual void DoneAddingChildren(bool aHaveNotified);
 
   virtual nsIAtom *GetClassAttributeName() const;
   virtual const nsAttrValue* DoGetClasses() const;
 
   virtual void PerformAccesskey(bool aKeyCausesActivation,
                                 bool aIsTrustedEvent);
 
-  // nsGenericElement specializations:
+  // Element specializations:
   using nsXMLElement::GetAttribute;
   using nsXMLElement::RemoveAttribute;
   using nsXMLElement::HasAttribute;
   virtual void GetAttribute(const nsAString& aName,
                             nsString& aReturn) MOZ_OVERRIDE;
   virtual void RemoveAttribute(const nsAString& aName,
                                mozilla::ErrorResult& aError) MOZ_OVERRIDE;
   virtual bool HasAttribute(const nsAString& aName) const MOZ_OVERRIDE;
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -680,17 +680,17 @@ nsXULElement::MaybeAddPopupListener(nsIA
 
 //----------------------------------------------------------------------
 //
 // nsIContent interface
 //
 void
 nsXULElement::UpdateEditableState(bool aNotify)
 {
-    // Don't call through to nsGenericElement here because the things
+    // Don't call through to Element here because the things
     // it does don't work for cases when we're an editable control.
     nsIContent *parent = GetParent();
 
     SetEditableFlag(parent && parent->HasFlag(NODE_IS_EDITABLE));
     UpdateState(aNotify);
 }
 
 nsresult
--- a/content/xul/content/src/nsXULElement.h
+++ b/content/xul/content/src/nsXULElement.h
@@ -343,17 +343,17 @@ public:
     Create(nsXULPrototypeElement* aPrototype, nsIDocument* aDocument,
            bool aIsScriptable, mozilla::dom::Element** aResult);
 
     NS_IMPL_FROMCONTENT(nsXULElement, kNameSpaceID_XUL)
 
     // nsISupports
     NS_DECL_ISUPPORTS_INHERITED
     NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsXULElement,
-                                                       nsGenericElement)
+                                                       mozilla::dom::Element)
 
     // nsINode
     virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
 
     // nsIContent
     virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                                 nsIContent* aBindingParent,
                                 bool aCompileEventHandlers);
@@ -405,17 +405,17 @@ public:
     nsresult GetFrameLoader(nsIFrameLoader** aFrameLoader);
     already_AddRefed<nsFrameLoader> GetFrameLoader();
     nsresult SwapFrameLoaders(nsIFrameLoaderOwner* aOtherOwner);
 
     virtual void RecompileScriptEventListeners();
 
     // This function should ONLY be used by BindToTree implementations.
     // The function exists solely because XUL elements store the binding
-    // parent as a member instead of in the slots, as nsGenericElement does.
+    // parent as a member instead of in the slots, as Element does.
     void SetXULBindingParent(nsIContent* aBindingParent)
     {
       mBindingParent = aBindingParent;
     }
 
     virtual nsXPCClassInfo* GetClassInfo();
 
     virtual nsIDOMNode* AsDOMNode() { return this; }
@@ -432,17 +432,17 @@ protected:
     static nsresult
     ExecuteJSCode(nsIDOMElement* anElement, nsEvent* aEvent);
 
     // Helper routine that crawls a parent chain looking for a tree element.
     NS_IMETHOD GetParentTree(nsIDOMXULMultiSelectControlElement** aTreeElement);
 
     nsresult AddPopupListener(nsIAtom* aName);
 
-    class nsXULSlots : public nsGenericElement::nsDOMSlots
+    class nsXULSlots : public mozilla::dom::Element::nsDOMSlots
     {
     public:
         nsXULSlots();
         virtual ~nsXULSlots();
 
         void Traverse(nsCycleCollectionTraversalCallback &cb);
 
         nsRefPtr<nsFrameLoader> mFrameLoader;
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -125,17 +125,16 @@
 
 // HTMLEmbed/ObjectElement helper includes
 #include "nsNPAPIPluginInstance.h"
 #include "nsIObjectFrame.h"
 #include "nsIObjectLoadingContent.h"
 #include "nsIPluginHost.h"
 
 #include "nsIDOMHTMLOptionElement.h"
-#include "nsGenericElement.h"
 
 // Event related includes
 #include "nsEventListenerManager.h"
 #include "nsIDOMEventTarget.h"
 
 // CSS related includes
 #include "nsCSSRules.h"
 #include "nsIDOMStyleSheet.h"
--- a/dom/base/nsIScriptGlobalObject.h
+++ b/dom/base/nsIScriptGlobalObject.h
@@ -14,31 +14,24 @@
 class nsIScriptContext;
 class nsIDOMEvent;
 class nsIScriptGlobalObjectOwner;
 class nsIArray;
 class nsScriptErrorEvent;
 class nsIScriptGlobalObject;
 struct JSObject; // until we finally remove GetGlobalJSObject...
 
+// XXXbz can we just remove all this script type id stuff?
 // Some helpers for working with integer "script type IDs", and specifically
 // for working with arrays of such objects. For example, it is common for
 // implementations supporting multiple script languages to keep each
 // language's nsIScriptContext in an array indexed by the language ID.
 
-// Implementation note: We always ignore nsIProgrammingLanguage::UNKNOWN and
-// nsIProgrammingLanguage::CPLUSPLUS - this gives javascript slot 0.  An
-// attempted micro-optimization tried to avoid us going all the way to 
-// nsIProgrammingLanguage::MAX; however:
-// * Someone is reportedly working on a PHP impl - that has value 9
-// * nsGenericElement therefore allows 4 bits for the value.
-// So there is no good reason for us to be more restrictive again...
-
 #define NS_STID_FIRST nsIProgrammingLanguage::JAVASCRIPT
-// like nsGenericElement, only 4 bits worth is valid...
+// only 4 bits worth is valid...
 #define NS_STID_LAST (nsIProgrammingLanguage::MAX > 0x000FU ? \
                       0x000FU : nsIProgrammingLanguage::MAX)
 
 // Use to declare the array size
 #define NS_STID_ARRAY_UBOUND (NS_STID_LAST-NS_STID_FIRST+1)
 
 // Is a language ID valid?
 #define NS_STID_VALID(langID) (langID >= NS_STID_FIRST && langID <= NS_STID_LAST)
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -700,17 +700,17 @@ addExternalHTMLElement('HTMLVideoElement
 addExternalIface('CanvasGradient', headerFile='nsIDOMCanvasRenderingContext2D.h')
 addExternalIface('CanvasPattern', headerFile='nsIDOMCanvasRenderingContext2D.h')
 addExternalIface('ClientRect')
 addExternalIface('CSSRule')
 addExternalIface('CSSValue')
 addExternalIface('DocumentType', nativeType='nsIDOMDocumentType')
 addExternalIface('DOMStringList', nativeType='nsDOMStringList',
                  headerFile='nsDOMLists.h')
-addExternalIface('Element', nativeType='nsGenericElement')
+addExternalIface('Element', nativeType='mozilla::dom::Element')
 addExternalIface('File')
 addExternalIface('HitRegionOptions', nativeType='nsISupports')
 addExternalIface('HTMLElement')
 addExternalIface('MediaStream')
 addExternalIface('Node', nativeType='nsINode')
 addExternalIface('PaintRequest')
 addExternalIface('Principal', nativeType='nsIPrincipal',
                  headerFile='nsIPrincipal.h')
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -25,17 +25,17 @@
 #include "mozilla/StaticPtr.h"
 #include "mozilla/unused.h"
 #include "mozIApplication.h"
 #include "nsComponentManagerUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsContentUtils.h"
 #include "nsEmbedCID.h"
 #include "nsEventListenerManager.h"
-#include "nsGenericElement.h"
+#include "mozilla/dom/Element.h"
 #include "nsIAppsService.h"
 #include "nsIBaseWindow.h"
 #include "nsIComponentManager.h"
 #include "nsIDOMClassInfo.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMWindow.h"
 #include "nsIDOMWindowUtils.h"
--- a/js/xpconnect/src/dom_quickstubs.qsconf
+++ b/js/xpconnect/src/dom_quickstubs.qsconf
@@ -470,17 +470,17 @@ irregularFilenames = {
 customIncludes = [
     'nsINode.h',
     'nsIContent.h',
     'nsIDocument.h',
     'nsCSSPropertiesQS.h',
     'nsDocument.h',
     'nsDOMTokenList.h',
     'nsGenericDOMDataNode.h',
-    'nsGenericElement.h',
+    'mozilla/dom/Element.h',
     'nsGenericHTMLElement.h',
     'nsSVGStylableElement.h',
     'nsHTMLDocument.h',
     'nsDOMQS.h',
     'nsDOMStringMap.h',
     'HTMLPropertiesCollection.h',
     'nsHTMLMenuElement.h',
     'nsICSSDeclaration.h'
@@ -652,106 +652,106 @@ customMethodCalls = {
         'code': '    nsRefPtr<nsContentList> result = '
                 'self->GetElementsByName(arg0);',
         'canFail': False
         },
     'nsIDOMStorage_Clear': {
         'code': nsIDOMStorage_Clear_customMethodCallCode
         },
     'nsIDOMElement_GetScrollTop': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'code': '    int32_t result = self->ScrollTop();',
         'canFail': False
         },
     'nsIDOMElement_SetScrollTop': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'canFail': False
         },
     'nsIDOMElement_GetScrollLeft': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'code': '    int32_t result = self->ScrollLeft();',
         'canFail': False
         },
     'nsIDOMElement_SetScrollLeft': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'canFail': False
         },
     'nsIDOMElement_GetScrollHeight': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'code': '    int32_t result = self->ScrollHeight();',
         'canFail': False
         },
     'nsIDOMElement_GetScrollWidth': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'code': '    int32_t result = self->ScrollWidth();',
         'canFail': False
         },
     'nsIDOMElement_GetClientTop': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'code': '    int32_t result = self->ClientTop();',
         'canFail': False
         },
     'nsIDOMElement_SetClientTop': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'canFail': False
         },
     'nsIDOMElement_GetClientLeft': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'code': '    int32_t result = self->ClientLeft();',
         'canFail': False
         },
     'nsIDOMElement_SetClientLeft': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'canFail': False
         },
     'nsIDOMElement_GetClientHeight': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'code': '    int32_t result = self->ClientHeight();',
         'canFail': False
         },
     'nsIDOMElement_GetClientWidth': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'code': '    int32_t result = self->ClientWidth();',
         'canFail': False
         },
     'nsIDOMElement_GetFirstElementChild': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'code': '    nsIContent *result = self->GetFirstElementChild();',
         'canFail': False
         },
     'nsIDOMElement_GetLastElementChild': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'code': '    nsIContent *result = self->GetLastElementChild();',
         'canFail': False
         },
     'nsIDOMElement_GetPreviousElementSibling': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'code': '    nsIContent *result = self->GetPreviousElementSibling();',
         'canFail': False
         },
     'nsIDOMElement_GetNextElementSibling': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'code': '    nsIContent *result = self->GetNextElementSibling();',
         'canFail': False
         },
     'nsIDOMElement_GetClassList': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'code': '    nsDOMTokenList *result = self->ClassList();',
         'canFail': False
         },
     'nsIDOMElement_SetCapture': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'canFail': False
         },
     'nsIDOMElement_ReleaseCapture': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'canFail': False
         },
     'nsIDOMElement_MozMatchesSelector': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'code': '    mozilla::ErrorResult error;\n'
                 '    bool result = self->MozMatchesSelector(arg0, error);\n'
                 '    rv = error.ErrorCode();'
         },
     'nsIDOMNodeSelector_QuerySelector': {
         'thisType': 'nsINode',
         'code': '    mozilla::ErrorResult error;\n'
                 '    nsIContent* result = '
@@ -901,20 +901,20 @@ customMethodCalls = {
         },
     'nsIDOMDocument_GetElementsByTagNameNS': {
         'thisType': 'nsDocument',
         'code': '    nsRefPtr<nsContentList> result ='
                 'self->GetElementsByTagNameNS(arg0, arg1);',
         'canFail': False
         },
     'nsIDOMElement_': {
-        'thisType': 'nsGenericElement'
+        'thisType': 'mozilla::dom::Element'
         },
     'nsIDOMElement_GetTagName': {
-        'thisType': 'nsGenericElement',
+        'thisType': 'mozilla::dom::Element',
         'code': 'nsString result = self->NodeName();',
         'canFail': False
         },
     'nsIDOMDocument_CreateElement': {
         'thisType': 'nsDocument',
         'code': '    nsCOMPtr<nsIContent> result;\n'
                 '    rv = self->CreateElement(arg0, getter_AddRefs(result));'
     },
@@ -948,100 +948,100 @@ customMethodCalls = {
         'thisType' : 'nsDocument',
         'unwrapThisFailureFatal' : False
         },
     'nsIDOMDocument_SetOnmouseleave' : {
         'thisType' : 'nsDocument',
         'unwrapThisFailureFatal' : False
         },
     'nsIDOMElement_GetOnmouseenter' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'unwrapThisFailureFatal' : False
         },
     'nsIDOMElement_SetOnmouseenter' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'unwrapThisFailureFatal' : False
         },
     'nsIDOMElement_GetOnmouseleave' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'unwrapThisFailureFatal' : False
         },
     'nsIDOMElement_SetOnmouseleave' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'unwrapThisFailureFatal' : False
         },
     'nsIDOMElement_RemoveAttributeNS' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'code': '    mozilla::ErrorResult error;\n'
                 '    self->RemoveAttributeNS(arg0, arg1, error);\n'
                 '    rv = error.ErrorCode();'
         },
     'nsIDOMElement_RemoveAttribute' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'code': '    mozilla::ErrorResult error;\n'
                 '    self->RemoveAttribute(arg0, error);\n'
                 '    rv = error.ErrorCode();'
         },
     'nsIDOMElement_GetAttribute' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'code': '    nsString result;\n'
                 '    self->GetAttribute(arg0, result);',
         'canFail': False
         },
     'nsIDOMElement_GetAttributeNS' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'code': '    nsString result;\n'
                 '    self->GetAttributeNS(arg0, arg1, result);',
         'canFail': False
         },
     'nsIDOMElement_SetAttribute' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'code': '    mozilla::ErrorResult error;\n'
                 '    self->SetAttribute(arg0, arg1, error);\n'
                 '    rv = error.ErrorCode();'
         },
     'nsIDOMElement_SetAttributeNS' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'code': '    mozilla::ErrorResult error;\n'
                 '    self->SetAttributeNS(arg0, arg1, arg2, error);\n'
                 '    rv = error.ErrorCode();'
         },
     'nsIDOMElement_HasAttribute' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'code': '    bool result = self->HasAttribute(arg0);',
         'canFail': False
         },
     'nsIDOMElement_HasAttributeNS' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'code': '    bool result = self->HasAttributeNS(arg0, arg1);',
         'canFail': False
         },
     'nsIDOMElement_GetElementsByTagName' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'code': '    nsCOMPtr<nsIHTMLCollection> result = self->GetElementsByTagName(arg0);',
         'canFail': False
         },
     'nsIDOMElement_GetClientRects' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'code': '    mozilla::ErrorResult error;\n'
                 '    nsRefPtr<nsClientRectList> result = self->GetClientRects(error);\n'
                 '    rv = error.ErrorCode();'
         },
     'nsIDOMElement_GetBoundingClientRect' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'code': '    nsRefPtr<nsClientRect> result = self->GetBoundingClientRect();',
         'canFail': False
         },
     'nsIDOMElement_GetChildElementCount' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'code': '    uint32_t result = self->ChildElementCount();',
         'canFail': False
         },
     'nsIDOMElement_GetChildElements' : {
-        'thisType' : 'nsGenericElement',
+        'thisType' : 'mozilla::dom::Element',
         'code': '    nsIHTMLCollection* result = self->Children();',
         'canFail': False
         },
     'nsIDOMHTMLElement_GetTitle': {
         'thisType' : 'nsGenericHTMLElement',
         'canFail': False
         },
     'nsIDOMHTMLElement_SetTitle': {
@@ -1166,17 +1166,17 @@ customMethodCalls = {
         },
     'nsIDOMHTMLElement_GetContextMenu': {
         'thisType' : 'nsGenericHTMLElement',
         'code': '    mozilla::dom::Element* result = self->GetContextMenu();',
         'canFail': False
         },
     'nsIDOMHTMLElement_GetOffsetParent': {
         'thisType' : 'nsGenericHTMLElement',
-        'code': '    nsGenericElement* result = self->GetOffsetParent();',
+        'code': '    mozilla::dom::Element* result = self->GetOffsetParent();',
         'canFail': False
         },
     'nsIDOMHTMLElement_GetOffsetTop': {
         'thisType' : 'nsGenericHTMLElement',
         'code': '    uint32_t result = self->OffsetTop();',
         'canFail': False
         },
     'nsIDOMHTMLElement_GetOffsetLeft': {
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -51,17 +51,16 @@
 #include "nsCSSRules.h"
 #include "nsIPrincipal.h"
 #include "nsStyleSet.h"
 #include "prlog.h"
 #include "nsIObserverService.h"
 #include "nsNetCID.h"
 #include "mozilla/Services.h"
 #include "mozilla/dom/Element.h"
-#include "nsGenericElement.h"
 #include "nsNthIndexCache.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/Likely.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
@@ -1998,18 +1997,17 @@ static bool SelectorMatches(Element* aEl
         }
         break;
 
       case nsCSSPseudoClasses::ePseudoClass_mozTableBorderNonzero:
         {
           if (!aElement->IsHTML(nsGkAtoms::table)) {
             return false;
           }
-          nsGenericElement *ge = static_cast<nsGenericElement*>(aElement);
-          const nsAttrValue *val = ge->GetParsedAttr(nsGkAtoms::border);
+          const nsAttrValue *val = aElement->GetParsedAttr(nsGkAtoms::border);
           if (!val ||
               (val->Type() == nsAttrValue::eInteger &&
                val->GetIntegerValue() == 0)) {
             return false;
           }
         }
         break;
 
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -38,17 +38,16 @@
 #include "nsLayoutUtils.h"
 #include "nsFrameManager.h"
 #include "prlog.h"
 #include "nsCSSKeywords.h"
 #include "nsStyleCoord.h"
 #include "nsDisplayList.h"
 #include "nsDOMCSSDeclaration.h"
 #include "mozilla/dom/Element.h"
-#include "nsGenericElement.h"
 #include "CSSCalc.h"
 #include "nsWrapperCacheInlines.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 #if defined(DEBUG_bzbarsky) || defined(DEBUG_caillon)
 #define DEBUG_ComputedDOMStyle
--- a/layout/style/nsDOMCSSAttrDeclaration.cpp
+++ b/layout/style/nsDOMCSSAttrDeclaration.cpp
@@ -11,17 +11,16 @@
 #include "mozilla/css/Loader.h"
 #include "mozilla/css/StyleRule.h"
 #include "mozilla/dom/Element.h"
 #include "nsIDocument.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsIPrincipal.h"
 #include "nsIURI.h"
 #include "nsNodeUtils.h"
-#include "nsGenericElement.h"
 #include "nsContentUtils.h"
 #include "xpcpublic.h"
 #include "nsWrapperCacheInlines.h"
 
 namespace css = mozilla::css;
 namespace dom = mozilla::dom;
 
 nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(dom::Element* aElement,
@@ -40,36 +39,36 @@ nsDOMCSSAttributeDeclaration::~nsDOMCSSA
 }
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsDOMCSSAttributeDeclaration, mElement)
 
 // mElement holds a strong ref to us, so if it's going to be
 // skipped, the attribute declaration can't be part of a garbage
 // cycle.
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsDOMCSSAttributeDeclaration)
-  if (tmp->mElement && nsGenericElement::CanSkip(tmp->mElement, true)) {
+  if (tmp->mElement && Element::CanSkip(tmp->mElement, true)) {
     if (tmp->PreservingWrapper()) {
       // Not relying on GetWrapper to unmark us gray because the
       // side-effect thing is pretty weird.
       JSObject* o = tmp->GetWrapperPreserveColor();
       xpc_UnmarkGrayObject(o);
     }
     return true;
   }
   return tmp->IsBlack();
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsDOMCSSAttributeDeclaration)
   return tmp->IsBlack() ||
-    (tmp->mElement && nsGenericElement::CanSkipInCC(tmp->mElement));
+    (tmp->mElement && Element::CanSkipInCC(tmp->mElement));
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsDOMCSSAttributeDeclaration)
   return tmp->IsBlack() ||
-    (tmp->mElement && nsGenericElement::CanSkipThis(tmp->mElement));
+    (tmp->mElement && Element::CanSkipThis(tmp->mElement));
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMCSSAttributeDeclaration)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
 NS_IMPL_QUERY_TAIL_INHERITING(nsDOMCSSDeclaration)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMCSSAttributeDeclaration)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMCSSAttributeDeclaration)
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -754,17 +754,17 @@ nsTransitionManager::WillRefresh(mozilla
   {
     PRCList *next = PR_LIST_HEAD(&mElementData);
     while (next != &mElementData) {
       ElementTransitions *et = static_cast<ElementTransitions*>(next);
       next = PR_NEXT_LINK(next);
 
       NS_ABORT_IF_FALSE(et->mElement->GetCurrentDoc() ==
                           mPresContext->Document(),
-                        "nsGenericElement::UnbindFromTree should have "
+                        "Element::UnbindFromTree should have "
                         "destroyed the element transitions object");
 
       uint32_t i = et->mPropertyTransitions.Length();
       NS_ABORT_IF_FALSE(i != 0, "empty transitions list?");
       do {
         --i;
         ElementPropertyTransition &pt = et->mPropertyTransitions[i];
         if (pt.IsRemovedSentinel()) {
--- a/layout/svg/nsSVGOuterSVGFrame.cpp
+++ b/layout/svg/nsSVGOuterSVGFrame.cpp
@@ -854,18 +854,17 @@ nsSVGOuterSVGFrame::IsRootOfReplacedElem
     if (window) {
       nsCOMPtr<nsIDOMElement> frameElement;
       window->GetFrameElement(getter_AddRefs(frameElement));
       nsCOMPtr<nsIObjectLoadingContent> olc = do_QueryInterface(frameElement);
       if (olc) {
         // Our document is inside an HTML 'object', 'embed' or 'applet' element
         if (aEmbeddingFrame) {
           nsCOMPtr<nsIContent> element = do_QueryInterface(frameElement);
-          *aEmbeddingFrame =
-            static_cast<nsGenericElement*>(element.get())->GetPrimaryFrame();
+          *aEmbeddingFrame = element->GetPrimaryFrame();
           NS_ASSERTION(*aEmbeddingFrame, "Yikes, no embedding frame!");
         }
         return true;
       }
     }
   }
   if (aEmbeddingFrame) {
     *aEmbeddingFrame = nullptr;
--- a/tools/trace-malloc/types.dat
+++ b/tools/trace-malloc/types.dat
@@ -4475,19 +4475,19 @@ nsSupportsHashtable::nsSupportsHashtable
 nsControllerCommandManager::nsControllerCommandManager(void)
 
 <nsConsoleService>
 PR_Malloc
 nsMemoryImpl::Alloc(unsigned int)
 nsMemory::Alloc(unsigned int)
 nsConsoleService::nsConsoleService(void)
 
-<nsGenericElement>
-__builtin_new
-nsGenericElement::GetDOMSlots(void)
+<mozilla::dom::Element>
+__builtin_new
+mozilla::dom::Element::GetDOMSlots(void)
 
 <HTMLAttribute>
 __builtin_new
 HTMLAttribute::CopyHTMLAttributes(HTMLAttribute *, HTMLAttribute **)
 
 # ----------------------------------------------------------------------
 #
 # HTMLAttributesImpl