Bug 824448 part 1. Rename nsHTMLHeadingElement to mozilla::dom::HTMLHeadingElement. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 26 Dec 2012 13:40:44 -0800
changeset 126171 dc616866209937ed941d1abeb1c939c32888a003
parent 126170 d194e4b71bb3b4bbf978a621b2cd5673046f9ecf
child 126172 f5638aa67e2330897e40e4cdf25ddf1a7eb55ec8
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs824448
milestone20.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 824448 part 1. Rename nsHTMLHeadingElement to mozilla::dom::HTMLHeadingElement. r=peterv
content/html/content/src/HTMLHeadingElement.cpp
content/html/content/src/HTMLHeadingElement.h
content/html/content/src/Makefile.in
content/html/content/src/nsHTMLHeadingElement.cpp
rename from content/html/content/src/nsHTMLHeadingElement.cpp
rename to content/html/content/src/HTMLHeadingElement.cpp
--- a/content/html/content/src/nsHTMLHeadingElement.cpp
+++ b/content/html/content/src/HTMLHeadingElement.cpp
@@ -1,100 +1,55 @@
 /* -*- 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 "mozilla/Util.h"
+#include "mozilla/dom/HTMLHeadingElement.h"
 
-#include "nsIDOMHTMLHeadingElement.h"
-#include "nsIDOMEventTarget.h"
-#include "nsGenericHTMLElement.h"
+#include "mozilla/Util.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();
-
-  // nsISupports
-  NS_DECL_ISUPPORTS_INHERITED
-
-  // nsIDOMNode
-  NS_FORWARD_NSIDOMNODE_TO_NSINODE
-
-  // nsIDOMElement
-  NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
-
-  // nsIDOMHTMLElement
-  NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
-
-  // nsIDOMHTMLHeadingElement
-  NS_DECL_NSIDOMHTMLHEADINGELEMENT
-
-  virtual bool ParseAttribute(int32_t aNamespaceID,
-                                nsIAtom* aAttribute,
-                                const nsAString& aValue,
-                                nsAttrValue& aResult);
-  NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
-  nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-  virtual nsXPCClassInfo* GetClassInfo();
-  virtual nsIDOMNode* AsDOMNode() { return this; }
-};
-
-
+DOMCI_NODE_DATA(HTMLHeadingElement, mozilla::dom::HTMLHeadingElement)
 NS_IMPL_NS_NEW_HTML_ELEMENT(Heading)
 
+namespace mozilla {
+namespace dom {
 
-nsHTMLHeadingElement::nsHTMLHeadingElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsGenericHTMLElement(aNodeInfo)
+HTMLHeadingElement::~HTMLHeadingElement()
 {
 }
 
-nsHTMLHeadingElement::~nsHTMLHeadingElement()
-{
-}
-
-
-NS_IMPL_ADDREF_INHERITED(nsHTMLHeadingElement, Element)
-NS_IMPL_RELEASE_INHERITED(nsHTMLHeadingElement, Element)
+NS_IMPL_ADDREF_INHERITED(HTMLHeadingElement, Element)
+NS_IMPL_RELEASE_INHERITED(HTMLHeadingElement, Element)
 
-
-DOMCI_NODE_DATA(HTMLHeadingElement, nsHTMLHeadingElement)
-
-// QueryInterface implementation for nsHTMLHeadingElement
-NS_INTERFACE_TABLE_HEAD(nsHTMLHeadingElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLHeadingElement,
+// QueryInterface implementation for HTMLHeadingElement
+NS_INTERFACE_TABLE_HEAD(HTMLHeadingElement)
+  NS_HTML_CONTENT_INTERFACE_TABLE1(HTMLHeadingElement,
                                    nsIDOMHTMLHeadingElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLHeadingElement,
+  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLHeadingElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLHeadingElement)
 
 
-NS_IMPL_ELEMENT_CLONE(nsHTMLHeadingElement)
+NS_IMPL_ELEMENT_CLONE(HTMLHeadingElement)
 
 
-NS_IMPL_STRING_ATTR(nsHTMLHeadingElement, Align, align)
+NS_IMPL_STRING_ATTR(HTMLHeadingElement, Align, align)
 
 
 bool
-nsHTMLHeadingElement::ParseAttribute(int32_t aNamespaceID,
-                                     nsIAtom* aAttribute,
-                                     const nsAString& aValue,
-                                     nsAttrValue& aResult)
+HTMLHeadingElement::ParseAttribute(int32_t aNamespaceID,
+                                   nsIAtom* aAttribute,
+                                   const nsAString& aValue,
+                                   nsAttrValue& aResult)
 {
   if (aAttribute == nsGkAtoms::align && aNamespaceID == kNameSpaceID_None) {
     return ParseDivAlignValue(aValue, aResult);
   }
 
   return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
                                               aResult);
 }
@@ -102,24 +57,27 @@ nsHTMLHeadingElement::ParseAttribute(int
 static void
 MapAttributesIntoRule(const nsMappedAttributes* aAttributes, nsRuleData* aData)
 {
   nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aData);
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
-nsHTMLHeadingElement::IsAttributeMapped(const nsIAtom* aAttribute) const
+HTMLHeadingElement::IsAttributeMapped(const nsIAtom* aAttribute) const
 {
   static const MappedAttributeEntry* const map[] = {
     sDivAlignAttributeMap,
     sCommonAttributeMap
   };
 
   return FindAttributeDependence(aAttribute, map);
 }
 
 
 nsMapRuleToAttributesFunc
-nsHTMLHeadingElement::GetAttributeMappingFunction() const
+HTMLHeadingElement::GetAttributeMappingFunction() const
 {
   return &MapAttributesIntoRule;
 }
+
+} // namespace dom
+} // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/content/html/content/src/HTMLHeadingElement.h
@@ -0,0 +1,54 @@
+/* -*- 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 mozilla_dom_HTMLHeadingElement_h
+#define mozilla_dom_HTMLHeadingElement_h
+
+#include "nsIDOMHTMLHeadingElement.h"
+#include "nsGenericHTMLElement.h"
+
+namespace mozilla {
+namespace dom {
+
+class HTMLHeadingElement MOZ_FINAL : public nsGenericHTMLElement,
+				     public nsIDOMHTMLHeadingElement
+{
+public:
+  HTMLHeadingElement(already_AddRefed<nsINodeInfo> aNodeInfo)
+    : nsGenericHTMLElement(aNodeInfo)
+  {
+  }
+  virtual ~HTMLHeadingElement();
+
+  // nsISupports
+  NS_DECL_ISUPPORTS_INHERITED
+
+  // nsIDOMNode
+  NS_FORWARD_NSIDOMNODE_TO_NSINODE
+
+  // nsIDOMElement
+  NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
+
+  // nsIDOMHTMLElement
+  NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
+
+  // nsIDOMHTMLHeadingElement
+  NS_DECL_NSIDOMHTMLHEADINGELEMENT
+
+  virtual bool ParseAttribute(int32_t aNamespaceID,
+                              nsIAtom* aAttribute,
+                              const nsAString& aValue,
+                              nsAttrValue& aResult);
+  NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
+  nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
+  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
+  virtual nsXPCClassInfo* GetClassInfo();
+  virtual nsIDOMNode* AsDOMNode() { return this; }
+};
+
+} // namespace mozilla
+} // namespace dom
+
+#endif // mozilla_dom_HTMLHeadingElement_h
--- a/content/html/content/src/Makefile.in
+++ b/content/html/content/src/Makefile.in
@@ -28,16 +28,17 @@ EXPORTS		= \
 EXPORTS_NAMESPACES = mozilla/dom
 
 EXPORTS_mozilla/dom = \
 		HTMLBodyElement.h \
 		HTMLDataListElement.h \
 		HTMLDivElement.h \
 		HTMLFontElement.h \
 		HTMLFrameSetElement.h \
+		HTMLHeadingElement.h \
 		HTMLLabelElement.h \
 		HTMLUnknownElement.h
 
 CPPSRCS		= \
 		HTMLPropertiesCollection.cpp \
 		nsClientRect.cpp \
 		nsHTMLDNSPrefetch.cpp \
 		nsGenericHTMLElement.cpp \
@@ -54,17 +55,17 @@ CPPSRCS		= \
 		HTMLDataListElement.cpp \
 		HTMLDivElement.cpp \
 		nsHTMLFieldSetElement.cpp \
 		HTMLFontElement.cpp \
 		nsHTMLFormElement.cpp \
 		nsHTMLFrameElement.cpp \
 		HTMLFrameSetElement.cpp \
 		nsHTMLHRElement.cpp \
-		nsHTMLHeadingElement.cpp \
+		HTMLHeadingElement.cpp \
 		nsHTMLIFrameElement.cpp \
 		nsHTMLImageElement.cpp \
 		nsHTMLInputElement.cpp \
 		nsHTMLLIElement.cpp \
 		HTMLLabelElement.cpp \
 		nsHTMLLegendElement.cpp \
 		nsHTMLLinkElement.cpp \
 		nsHTMLMapElement.cpp \