Fix for bug 824907 (Convert HTML table elements to WebIDL) - rename classes. r=bz.
authorPeter Van der Beken <peterv@propagandism.org>
Fri, 28 Dec 2012 03:45:57 +0100
changeset 126845 08a616b1e4f4b24d72ba731afc40521974246094
parent 126844 0b4ce0db7ecbc3ded6700ce9204fb4bc94896d67
child 126846 08e18a8008ec0df4c0160f418df5942764427b0d
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)
reviewersbz
bugs824907
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
Fix for bug 824907 (Convert HTML table elements to WebIDL) - rename classes. r=bz.
content/html/content/src/HTMLTableCaptionElement.cpp
content/html/content/src/HTMLTableCaptionElement.h
content/html/content/src/HTMLTableCellElement.cpp
content/html/content/src/HTMLTableCellElement.h
content/html/content/src/HTMLTableColElement.cpp
content/html/content/src/HTMLTableColElement.h
content/html/content/src/HTMLTableElement.cpp
content/html/content/src/HTMLTableElement.h
content/html/content/src/HTMLTableRowElement.cpp
content/html/content/src/HTMLTableRowElement.h
content/html/content/src/HTMLTableSectionElement.cpp
content/html/content/src/HTMLTableSectionElement.h
content/html/content/src/Makefile.in
content/html/content/src/nsHTMLTableCaptionElement.cpp
content/html/content/src/nsHTMLTableCellElement.cpp
content/html/content/src/nsHTMLTableColElement.cpp
content/html/content/src/nsHTMLTableElement.cpp
content/html/content/src/nsHTMLTableElement.h
content/html/content/src/nsHTMLTableRowElement.cpp
content/html/content/src/nsHTMLTableSectionElement.cpp
rename from content/html/content/src/nsHTMLTableCaptionElement.cpp
rename to content/html/content/src/HTMLTableCaptionElement.cpp
--- a/content/html/content/src/nsHTMLTableCaptionElement.cpp
+++ b/content/html/content/src/HTMLTableCaptionElement.cpp
@@ -1,111 +1,60 @@
 /* -*- 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 "nsIDOMHTMLTableCaptionElem.h"
-#include "nsIDOMEventTarget.h"
-#include "nsGenericHTMLElement.h"
+#include "mozilla/dom/HTMLTableCaptionElement.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();
-
-  // nsISupports
-  NS_DECL_ISUPPORTS_INHERITED
-
-  // nsIDOMNode
-  NS_FORWARD_NSIDOMNODE_TO_NSINODE
-
-  // nsIDOMElement
-  NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
-
-  // nsIDOMHTMLElement
-  NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
+NS_IMPL_NS_NEW_HTML_ELEMENT(TableCaption)
+DOMCI_NODE_DATA(HTMLTableCaptionElement, mozilla::dom::HTMLTableCaptionElement)
 
-  // nsIDOMHTMLTableCaptionElement
-  NS_DECL_NSIDOMHTMLTABLECAPTIONELEMENT
-
-  virtual bool ParseAttribute(int32_t aNamespaceID,
-                                nsIAtom* aAttribute,
-                                const nsAString& aValue,
-                                nsAttrValue& aResult);
-  virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
-  NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
-
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
+namespace mozilla {
+namespace dom {
 
-  virtual nsXPCClassInfo* GetClassInfo();
-
-  virtual nsIDOMNode* AsDOMNode() { return this; }
-};
-
-
-NS_IMPL_NS_NEW_HTML_ELEMENT(TableCaption)
-
-
-nsHTMLTableCaptionElement::nsHTMLTableCaptionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsGenericHTMLElement(aNodeInfo)
+HTMLTableCaptionElement::~HTMLTableCaptionElement()
 {
 }
 
-nsHTMLTableCaptionElement::~nsHTMLTableCaptionElement()
-{
-}
-
-
-NS_IMPL_ADDREF_INHERITED(nsHTMLTableCaptionElement, Element)
-NS_IMPL_RELEASE_INHERITED(nsHTMLTableCaptionElement, Element)
+NS_IMPL_ADDREF_INHERITED(HTMLTableCaptionElement, Element)
+NS_IMPL_RELEASE_INHERITED(HTMLTableCaptionElement, Element)
 
-
-DOMCI_NODE_DATA(HTMLTableCaptionElement, nsHTMLTableCaptionElement)
-
-// QueryInterface implementation for nsHTMLTableCaptionElement
-NS_INTERFACE_TABLE_HEAD(nsHTMLTableCaptionElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLTableCaptionElement,
+// QueryInterface implementation for HTMLTableCaptionElement
+NS_INTERFACE_TABLE_HEAD(HTMLTableCaptionElement)
+  NS_HTML_CONTENT_INTERFACE_TABLE1(HTMLTableCaptionElement,
                                    nsIDOMHTMLTableCaptionElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLTableCaptionElement,
+  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLTableCaptionElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTableCaptionElement)
 
-
-NS_IMPL_ELEMENT_CLONE(nsHTMLTableCaptionElement)
+NS_IMPL_ELEMENT_CLONE(HTMLTableCaptionElement)
 
-
-NS_IMPL_STRING_ATTR(nsHTMLTableCaptionElement, Align, align)
-
+NS_IMPL_STRING_ATTR(HTMLTableCaptionElement, Align, align)
 
 static const nsAttrValue::EnumTable kCaptionAlignTable[] = {
   { "left",   NS_STYLE_CAPTION_SIDE_LEFT },
   { "right",  NS_STYLE_CAPTION_SIDE_RIGHT },
   { "top",    NS_STYLE_CAPTION_SIDE_TOP },
   { "bottom", NS_STYLE_CAPTION_SIDE_BOTTOM },
   { 0 }
 };
 
 bool
-nsHTMLTableCaptionElement::ParseAttribute(int32_t aNamespaceID,
-                                          nsIAtom* aAttribute,
-                                          const nsAString& aValue,
-                                          nsAttrValue& aResult)
+HTMLTableCaptionElement::ParseAttribute(int32_t aNamespaceID,
+                                        nsIAtom* aAttribute,
+                                        const nsAString& aValue,
+                                        nsAttrValue& aResult)
 {
   if (aAttribute == nsGkAtoms::align && aNamespaceID == kNameSpaceID_None) {
     return aResult.ParseEnumValue(aValue, kCaptionAlignTable, false);
   }
 
   return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
                                               aResult);
 }
@@ -121,30 +70,31 @@ void MapAttributesIntoRule(const nsMappe
         captionSide->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
     }
   }
 
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
-nsHTMLTableCaptionElement::IsAttributeMapped(const nsIAtom* aAttribute) const
+HTMLTableCaptionElement::IsAttributeMapped(const nsIAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
     { &nsGkAtoms::align },
     { nullptr }
   };
 
   static const MappedAttributeEntry* const map[] = {
     attributes,
     sCommonAttributeMap,
   };
 
   return FindAttributeDependence(aAttribute, map);
 }
 
-
-
 nsMapRuleToAttributesFunc
-nsHTMLTableCaptionElement::GetAttributeMappingFunction() const
+HTMLTableCaptionElement::GetAttributeMappingFunction() const
 {
   return &MapAttributesIntoRule;
 }
+
+} // namespace dom
+} // namespace mozilla
copy from content/html/content/src/nsHTMLTableCaptionElement.cpp
copy to content/html/content/src/HTMLTableCaptionElement.h
--- a/content/html/content/src/nsHTMLTableCaptionElement.cpp
+++ b/content/html/content/src/HTMLTableCaptionElement.h
@@ -1,33 +1,30 @@
 /* -*- 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"
+#ifndef mozilla_dom_HTMLTableCaptionElement_h
+#define mozilla_dom_HTMLTableCaptionElement_h
 
-#include "nsIDOMHTMLTableCaptionElem.h"
-#include "nsIDOMEventTarget.h"
 #include "nsGenericHTMLElement.h"
-#include "nsAttrValueInlines.h"
-#include "nsGkAtoms.h"
-#include "nsStyleConsts.h"
-#include "nsMappedAttributes.h"
-#include "nsRuleData.h"
+#include "nsIDOMHTMLTableCaptionElem.h"
 
-using namespace mozilla;
-using namespace mozilla::dom;
+namespace mozilla {
+namespace dom {
 
-class nsHTMLTableCaptionElement :  public nsGenericHTMLElement,
-                                   public nsIDOMHTMLTableCaptionElement
+class HTMLTableCaptionElement : public nsGenericHTMLElement,
+                                public nsIDOMHTMLTableCaptionElement
 {
 public:
-  nsHTMLTableCaptionElement(already_AddRefed<nsINodeInfo> aNodeInfo);
-  virtual ~nsHTMLTableCaptionElement();
+  HTMLTableCaptionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
+    : nsGenericHTMLElement(aNodeInfo)
+  {
+  }
+  virtual ~HTMLTableCaptionElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
 
   // nsIDOMElement
@@ -48,103 +45,12 @@ public:
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 };
 
-
-NS_IMPL_NS_NEW_HTML_ELEMENT(TableCaption)
-
-
-nsHTMLTableCaptionElement::nsHTMLTableCaptionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsGenericHTMLElement(aNodeInfo)
-{
-}
-
-nsHTMLTableCaptionElement::~nsHTMLTableCaptionElement()
-{
-}
-
-
-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)
-  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLTableCaptionElement,
-                                               nsGenericHTMLElement)
-NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTableCaptionElement)
-
-
-NS_IMPL_ELEMENT_CLONE(nsHTMLTableCaptionElement)
-
-
-NS_IMPL_STRING_ATTR(nsHTMLTableCaptionElement, Align, align)
-
-
-static const nsAttrValue::EnumTable kCaptionAlignTable[] = {
-  { "left",   NS_STYLE_CAPTION_SIDE_LEFT },
-  { "right",  NS_STYLE_CAPTION_SIDE_RIGHT },
-  { "top",    NS_STYLE_CAPTION_SIDE_TOP },
-  { "bottom", NS_STYLE_CAPTION_SIDE_BOTTOM },
-  { 0 }
-};
+} // namespace dom
+} // namespace mozilla
 
-bool
-nsHTMLTableCaptionElement::ParseAttribute(int32_t aNamespaceID,
-                                          nsIAtom* aAttribute,
-                                          const nsAString& aValue,
-                                          nsAttrValue& aResult)
-{
-  if (aAttribute == nsGkAtoms::align && aNamespaceID == kNameSpaceID_None) {
-    return aResult.ParseEnumValue(aValue, kCaptionAlignTable, false);
-  }
-
-  return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
-                                              aResult);
-}
-
-static 
-void MapAttributesIntoRule(const nsMappedAttributes* aAttributes, nsRuleData* aData)
-{
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(TableBorder)) {
-    nsCSSValue* captionSide = aData->ValueForCaptionSide();
-    if (captionSide->GetUnit() == eCSSUnit_Null) {
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
-      if (value && value->Type() == nsAttrValue::eEnum)
-        captionSide->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
-    }
-  }
-
-  nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
-}
-
-NS_IMETHODIMP_(bool)
-nsHTMLTableCaptionElement::IsAttributeMapped(const nsIAtom* aAttribute) const
-{
-  static const MappedAttributeEntry attributes[] = {
-    { &nsGkAtoms::align },
-    { nullptr }
-  };
-
-  static const MappedAttributeEntry* const map[] = {
-    attributes,
-    sCommonAttributeMap,
-  };
-
-  return FindAttributeDependence(aAttribute, map);
-}
-
-
-
-nsMapRuleToAttributesFunc
-nsHTMLTableCaptionElement::GetAttributeMappingFunction() const
-{
-  return &MapAttributesIntoRule;
-}
+#endif /* mozilla_dom_HTMLTableCaptionElement_h */
rename from content/html/content/src/nsHTMLTableCellElement.cpp
rename to content/html/content/src/HTMLTableCellElement.cpp
--- a/content/html/content/src/nsHTMLTableCellElement.cpp
+++ b/content/html/content/src/HTMLTableCellElement.cpp
@@ -1,145 +1,93 @@
 /* -*- 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/HTMLTableCellElement.h"
+#include "mozilla/dom/HTMLTableElement.h"
 #include "nsIDOMHTMLTableCellElement.h"
 #include "nsIDOMHTMLTableRowElement.h"
-#include "nsHTMLTableElement.h"
 #include "nsIDOMHTMLCollection.h"
-#include "nsIDOMEventTarget.h"
 #include "nsMappedAttributes.h"
-#include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
 #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();
-
-  // nsISupports
-  NS_DECL_ISUPPORTS_INHERITED
-
-  // nsIDOMNode
-  NS_FORWARD_NSIDOMNODE_TO_NSINODE
-
-  // nsIDOMElement
-  NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
-
-  // nsIDOMHTMLElement
-  NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
-
-  // nsIDOMHTMLTableCellElement
-  NS_DECL_NSIDOMHTMLTABLECELLELEMENT
+NS_IMPL_NS_NEW_HTML_ELEMENT(TableCell)
+DOMCI_NODE_DATA(HTMLTableCellElement, mozilla::dom::HTMLTableCellElement)
 
-  virtual bool ParseAttribute(int32_t aNamespaceID,
-                              nsIAtom* aAttribute,
-                              const nsAString& aValue,
-                              nsAttrValue& aResult);
-  virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
-  NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
-  NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
-
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-
-  virtual nsXPCClassInfo* GetClassInfo();
+namespace mozilla {
+namespace dom {
 
-  virtual nsIDOMNode* AsDOMNode() { return this; }
-protected:
-  nsHTMLTableElement* GetTable() const;
-
-  already_AddRefed<nsIDOMHTMLTableRowElement> GetRow() const;
-};
-
-
-NS_IMPL_NS_NEW_HTML_ELEMENT(TableCell)
-
-
-nsHTMLTableCellElement::nsHTMLTableCellElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsGenericHTMLElement(aNodeInfo)
+HTMLTableCellElement::~HTMLTableCellElement()
 {
 }
 
-nsHTMLTableCellElement::~nsHTMLTableCellElement()
-{
-}
-
-
-NS_IMPL_ADDREF_INHERITED(nsHTMLTableCellElement, Element)
-NS_IMPL_RELEASE_INHERITED(nsHTMLTableCellElement, Element)
+NS_IMPL_ADDREF_INHERITED(HTMLTableCellElement, Element)
+NS_IMPL_RELEASE_INHERITED(HTMLTableCellElement, Element)
 
-
-DOMCI_NODE_DATA(HTMLTableCellElement, nsHTMLTableCellElement)
-
-// QueryInterface implementation for nsHTMLTableCellElement
-NS_INTERFACE_TABLE_HEAD(nsHTMLTableCellElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLTableCellElement,
+// QueryInterface implementation for HTMLTableCellElement
+NS_INTERFACE_TABLE_HEAD(HTMLTableCellElement)
+  NS_HTML_CONTENT_INTERFACE_TABLE1(HTMLTableCellElement,
                                    nsIDOMHTMLTableCellElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLTableCellElement,
+  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLTableCellElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTableCellElement)
 
 
-NS_IMPL_ELEMENT_CLONE(nsHTMLTableCellElement)
+NS_IMPL_ELEMENT_CLONE(HTMLTableCellElement)
 
 
 // protected method
 already_AddRefed<nsIDOMHTMLTableRowElement>
-nsHTMLTableCellElement::GetRow() const
+HTMLTableCellElement::GetRow() const
 {
   nsCOMPtr<nsIDOMHTMLTableRowElement> row = do_QueryInterface(GetParent());
   return row.forget();
 }
 
 // protected method
-nsHTMLTableElement*
-nsHTMLTableCellElement::GetTable() const
+HTMLTableElement*
+HTMLTableCellElement::GetTable() const
 {
   nsIContent *parent = GetParent();
   if (!parent) {
     return nullptr;
   }
 
   // parent should be a row.
   nsIContent* section = parent->GetParent();
   if (!section) {
     return nullptr;
   }
 
   if (section->IsHTML(nsGkAtoms::table)) {
     // XHTML, without a row group.
-    return static_cast<nsHTMLTableElement*>(section);
+    return static_cast<HTMLTableElement*>(section);
   }
 
   // We have a row group.
   nsIContent* result = section->GetParent();
   if (result && result->IsHTML(nsGkAtoms::table)) {
-    return static_cast<nsHTMLTableElement*>(result);
+    return static_cast<HTMLTableElement*>(result);
   }
 
   return nullptr;
 }
 
 NS_IMETHODIMP
-nsHTMLTableCellElement::GetCellIndex(int32_t* aCellIndex)
+HTMLTableCellElement::GetCellIndex(int32_t* aCellIndex)
 {
   *aCellIndex = -1;
 
   nsCOMPtr<nsIDOMHTMLTableRowElement> row = GetRow();
   if (!row) {
     return NS_OK;
   }
 
@@ -164,81 +112,81 @@ nsHTMLTableCellElement::GetCellIndex(int
     }
   }
 
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
-nsHTMLTableCellElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
+HTMLTableCellElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
 {
   nsresult rv = nsGenericHTMLElement::WalkContentStyleRules(aRuleWalker);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  if (nsHTMLTableElement* table = GetTable()) {
+  if (HTMLTableElement* table = GetTable()) {
     nsMappedAttributes* tableInheritedAttributes =
       table->GetAttributesMappedForCell();
     if (tableInheritedAttributes) {
       aRuleWalker->Forward(tableInheritedAttributes);
     }
   }
   return NS_OK;
 }
 
 
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Abbr, abbr)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Axis, axis)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, BgColor, bgcolor)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Ch, _char)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, ChOff, charoff)
-NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLTableCellElement, ColSpan, colspan, 1)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Headers, headers)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Height, height)
-NS_IMPL_BOOL_ATTR(nsHTMLTableCellElement, NoWrap, nowrap)
-NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLTableCellElement, RowSpan, rowspan, 1)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Scope, scope)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, VAlign, valign)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Width, width)
+NS_IMPL_STRING_ATTR(HTMLTableCellElement, Abbr, abbr)
+NS_IMPL_STRING_ATTR(HTMLTableCellElement, Axis, axis)
+NS_IMPL_STRING_ATTR(HTMLTableCellElement, BgColor, bgcolor)
+NS_IMPL_STRING_ATTR(HTMLTableCellElement, Ch, _char)
+NS_IMPL_STRING_ATTR(HTMLTableCellElement, ChOff, charoff)
+NS_IMPL_INT_ATTR_DEFAULT_VALUE(HTMLTableCellElement, ColSpan, colspan, 1)
+NS_IMPL_STRING_ATTR(HTMLTableCellElement, Headers, headers)
+NS_IMPL_STRING_ATTR(HTMLTableCellElement, Height, height)
+NS_IMPL_BOOL_ATTR(HTMLTableCellElement, NoWrap, nowrap)
+NS_IMPL_INT_ATTR_DEFAULT_VALUE(HTMLTableCellElement, RowSpan, rowspan, 1)
+NS_IMPL_STRING_ATTR(HTMLTableCellElement, Scope, scope)
+NS_IMPL_STRING_ATTR(HTMLTableCellElement, VAlign, valign)
+NS_IMPL_STRING_ATTR(HTMLTableCellElement, Width, width)
 
 
 NS_IMETHODIMP
-nsHTMLTableCellElement::GetAlign(nsAString& aValue)
+HTMLTableCellElement::GetAlign(nsAString& aValue)
 {
   if (!GetAttr(kNameSpaceID_None, nsGkAtoms::align, aValue)) {
     // There's no align attribute, ask the row for the alignment.
     nsCOMPtr<nsIDOMHTMLTableRowElement> row = GetRow();
     if (row) {
       return row->GetAlign(aValue);
     }
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLTableCellElement::SetAlign(const nsAString& aValue)
+HTMLTableCellElement::SetAlign(const nsAString& aValue)
 {
   return SetAttr(kNameSpaceID_None, nsGkAtoms::align, aValue, true);
 }
 
 
 static const nsAttrValue::EnumTable kCellScopeTable[] = {
   { "row",      NS_STYLE_CELL_SCOPE_ROW },
   { "col",      NS_STYLE_CELL_SCOPE_COL },
   { "rowgroup", NS_STYLE_CELL_SCOPE_ROWGROUP },
   { "colgroup", NS_STYLE_CELL_SCOPE_COLGROUP },
   { 0 }
 };
 
 bool
-nsHTMLTableCellElement::ParseAttribute(int32_t aNamespaceID,
-                                       nsIAtom* aAttribute,
-                                       const nsAString& aValue,
-                                       nsAttrValue& aResult)
+HTMLTableCellElement::ParseAttribute(int32_t aNamespaceID,
+                                     nsIAtom* aAttribute,
+                                     const nsAString& aValue,
+                                     nsAttrValue& aResult)
 {
   if (aNamespaceID == kNameSpaceID_None) {
     /* ignore these attributes, stored simply as strings
        abbr, axis, ch, headers
     */
     if (aAttribute == nsGkAtoms::charoff) {
       /* attributes that resolve to integers with a min of 0 */
       return aResult.ParseIntWithBounds(aValue, 0);
@@ -365,17 +313,17 @@ void MapAttributesIntoRule(const nsMappe
     }
   }
   
   nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
-nsHTMLTableCellElement::IsAttributeMapped(const nsIAtom* aAttribute) const
+HTMLTableCellElement::IsAttributeMapped(const nsIAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
     { &nsGkAtoms::align }, 
     { &nsGkAtoms::valign },
     { &nsGkAtoms::nowrap },
 #if 0
     // XXXldb If these are implemented, they might need to move to
     // GetAttributeChangeHint (depending on how, and preferably not).
@@ -394,12 +342,15 @@ nsHTMLTableCellElement::IsAttributeMappe
     sCommonAttributeMap,
     sBackgroundAttributeMap,
   };
 
   return FindAttributeDependence(aAttribute, map);
 }
 
 nsMapRuleToAttributesFunc
-nsHTMLTableCellElement::GetAttributeMappingFunction() const
+HTMLTableCellElement::GetAttributeMappingFunction() const
 {
   return &MapAttributesIntoRule;
 }
+
+} // namespace dom
+} // namespace mozilla
copy from content/html/content/src/nsHTMLTableCellElement.cpp
copy to content/html/content/src/HTMLTableCellElement.h
--- a/content/html/content/src/nsHTMLTableCellElement.cpp
+++ b/content/html/content/src/HTMLTableCellElement.h
@@ -1,39 +1,34 @@
 /* -*- 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"
+#ifndef mozilla_dom_HTMLTableCellElement_h
+#define mozilla_dom_HTMLTableCellElement_h
 
-#include "nsIDOMHTMLTableCellElement.h"
-#include "nsIDOMHTMLTableRowElement.h"
-#include "nsHTMLTableElement.h"
-#include "nsIDOMHTMLCollection.h"
-#include "nsIDOMEventTarget.h"
-#include "nsMappedAttributes.h"
 #include "nsGenericHTMLElement.h"
-#include "nsAttrValueInlines.h"
-#include "nsGkAtoms.h"
-#include "nsStyleConsts.h"
-#include "nsPresContext.h"
-#include "nsRuleData.h"
-#include "nsRuleWalker.h"
-#include "celldata.h"
+#include "nsIDOMHTMLTableCellElement.h"
+
+class nsIDOMHTMLTableRowElement;
 
-using namespace mozilla;
-using namespace mozilla::dom;
+namespace mozilla {
+namespace dom {
 
-class nsHTMLTableCellElement : public nsGenericHTMLElement,
-                               public nsIDOMHTMLTableCellElement
+class HTMLTableElement;
+
+class HTMLTableCellElement : public nsGenericHTMLElement,
+                             public nsIDOMHTMLTableCellElement
 {
 public:
-  nsHTMLTableCellElement(already_AddRefed<nsINodeInfo> aNodeInfo);
-  virtual ~nsHTMLTableCellElement();
+  HTMLTableCellElement(already_AddRefed<nsINodeInfo> aNodeInfo)
+    : nsGenericHTMLElement(aNodeInfo)
+  {
+  }
+  virtual ~HTMLTableCellElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
 
   // nsIDOMElement
@@ -54,352 +49,17 @@ public:
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 protected:
-  nsHTMLTableElement* GetTable() const;
+  HTMLTableElement* GetTable() const;
 
   already_AddRefed<nsIDOMHTMLTableRowElement> GetRow() const;
 };
 
-
-NS_IMPL_NS_NEW_HTML_ELEMENT(TableCell)
-
-
-nsHTMLTableCellElement::nsHTMLTableCellElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsGenericHTMLElement(aNodeInfo)
-{
-}
-
-nsHTMLTableCellElement::~nsHTMLTableCellElement()
-{
-}
-
-
-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)
-  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLTableCellElement,
-                                               nsGenericHTMLElement)
-NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTableCellElement)
-
-
-NS_IMPL_ELEMENT_CLONE(nsHTMLTableCellElement)
-
-
-// protected method
-already_AddRefed<nsIDOMHTMLTableRowElement>
-nsHTMLTableCellElement::GetRow() const
-{
-  nsCOMPtr<nsIDOMHTMLTableRowElement> row = do_QueryInterface(GetParent());
-  return row.forget();
-}
-
-// protected method
-nsHTMLTableElement*
-nsHTMLTableCellElement::GetTable() const
-{
-  nsIContent *parent = GetParent();
-  if (!parent) {
-    return nullptr;
-  }
-
-  // parent should be a row.
-  nsIContent* section = parent->GetParent();
-  if (!section) {
-    return nullptr;
-  }
-
-  if (section->IsHTML(nsGkAtoms::table)) {
-    // XHTML, without a row group.
-    return static_cast<nsHTMLTableElement*>(section);
-  }
-
-  // We have a row group.
-  nsIContent* result = section->GetParent();
-  if (result && result->IsHTML(nsGkAtoms::table)) {
-    return static_cast<nsHTMLTableElement*>(result);
-  }
-
-  return nullptr;
-}
-
-NS_IMETHODIMP
-nsHTMLTableCellElement::GetCellIndex(int32_t* aCellIndex)
-{
-  *aCellIndex = -1;
-
-  nsCOMPtr<nsIDOMHTMLTableRowElement> row = GetRow();
-  if (!row) {
-    return NS_OK;
-  }
-
-  nsCOMPtr<nsIDOMHTMLCollection> cells;
-
-  row->GetCells(getter_AddRefs(cells));
-
-  if (!cells) {
-    return NS_OK;
-  }
-
-  uint32_t numCells;
-  cells->GetLength(&numCells);
-
-  for (uint32_t i = 0; i < numCells; i++) {
-    nsCOMPtr<nsIDOMNode> node;
-    cells->Item(i, getter_AddRefs(node));
-
-    if (node.get() == static_cast<nsIDOMNode *>(this)) {
-      *aCellIndex = i;
-      break;
-    }
-  }
-
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP
-nsHTMLTableCellElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
-{
-  nsresult rv = nsGenericHTMLElement::WalkContentStyleRules(aRuleWalker);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (nsHTMLTableElement* table = GetTable()) {
-    nsMappedAttributes* tableInheritedAttributes =
-      table->GetAttributesMappedForCell();
-    if (tableInheritedAttributes) {
-      aRuleWalker->Forward(tableInheritedAttributes);
-    }
-  }
-  return NS_OK;
-}
-
-
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Abbr, abbr)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Axis, axis)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, BgColor, bgcolor)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Ch, _char)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, ChOff, charoff)
-NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLTableCellElement, ColSpan, colspan, 1)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Headers, headers)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Height, height)
-NS_IMPL_BOOL_ATTR(nsHTMLTableCellElement, NoWrap, nowrap)
-NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLTableCellElement, RowSpan, rowspan, 1)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Scope, scope)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, VAlign, valign)
-NS_IMPL_STRING_ATTR(nsHTMLTableCellElement, Width, width)
-
-
-NS_IMETHODIMP
-nsHTMLTableCellElement::GetAlign(nsAString& aValue)
-{
-  if (!GetAttr(kNameSpaceID_None, nsGkAtoms::align, aValue)) {
-    // There's no align attribute, ask the row for the alignment.
-    nsCOMPtr<nsIDOMHTMLTableRowElement> row = GetRow();
-    if (row) {
-      return row->GetAlign(aValue);
-    }
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsHTMLTableCellElement::SetAlign(const nsAString& aValue)
-{
-  return SetAttr(kNameSpaceID_None, nsGkAtoms::align, aValue, true);
-}
-
-
-static const nsAttrValue::EnumTable kCellScopeTable[] = {
-  { "row",      NS_STYLE_CELL_SCOPE_ROW },
-  { "col",      NS_STYLE_CELL_SCOPE_COL },
-  { "rowgroup", NS_STYLE_CELL_SCOPE_ROWGROUP },
-  { "colgroup", NS_STYLE_CELL_SCOPE_COLGROUP },
-  { 0 }
-};
+} // namespace dom
+} // namespace mozilla
 
-bool
-nsHTMLTableCellElement::ParseAttribute(int32_t aNamespaceID,
-                                       nsIAtom* aAttribute,
-                                       const nsAString& aValue,
-                                       nsAttrValue& aResult)
-{
-  if (aNamespaceID == kNameSpaceID_None) {
-    /* ignore these attributes, stored simply as strings
-       abbr, axis, ch, headers
-    */
-    if (aAttribute == nsGkAtoms::charoff) {
-      /* attributes that resolve to integers with a min of 0 */
-      return aResult.ParseIntWithBounds(aValue, 0);
-    }
-    if (aAttribute == nsGkAtoms::colspan) {
-      bool res = aResult.ParseIntWithBounds(aValue, -1);
-      if (res) {
-        int32_t val = aResult.GetIntegerValue();
-        // reset large colspan values as IE and opera do
-        // quirks mode does not honor the special html 4 value of 0
-        if (val > MAX_COLSPAN || val < 0 ||
-            (0 == val && InNavQuirksMode(OwnerDoc()))) {
-          aResult.SetTo(1);
-        }
-      }
-      return res;
-    }
-    if (aAttribute == nsGkAtoms::rowspan) {
-      bool res = aResult.ParseIntWithBounds(aValue, -1, MAX_ROWSPAN);
-      if (res) {
-        int32_t val = aResult.GetIntegerValue();
-        // quirks mode does not honor the special html 4 value of 0
-        if (val < 0 || (0 == val && InNavQuirksMode(OwnerDoc()))) {
-          aResult.SetTo(1);
-        }
-      }
-      return res;
-    }
-    if (aAttribute == nsGkAtoms::height) {
-      return aResult.ParseSpecialIntValue(aValue);
-    }
-    if (aAttribute == nsGkAtoms::width) {
-      return aResult.ParseSpecialIntValue(aValue);
-    }
-    if (aAttribute == nsGkAtoms::align) {
-      return ParseTableCellHAlignValue(aValue, aResult);
-    }
-    if (aAttribute == nsGkAtoms::bgcolor) {
-      return aResult.ParseColor(aValue);
-    }
-    if (aAttribute == nsGkAtoms::scope) {
-      return aResult.ParseEnumValue(aValue, kCellScopeTable, false);
-    }
-    if (aAttribute == nsGkAtoms::valign) {
-      return ParseTableVAlignValue(aValue, aResult);
-    }
-  }
-
-  return nsGenericHTMLElement::ParseBackgroundAttribute(aNamespaceID,
-                                                        aAttribute, aValue,
-                                                        aResult) ||
-         nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
-                                              aResult);
-}
-
-static 
-void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
-                           nsRuleData* aData)
-{
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Position)) {
-    // width: value
-    nsCSSValue* width = aData->ValueForWidth();
-    if (width->GetUnit() == eCSSUnit_Null) {
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
-      if (value && value->Type() == nsAttrValue::eInteger) {
-        if (value->GetIntegerValue() > 0)
-          width->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel); 
-        // else 0 implies auto for compatibility.
-      }
-      else if (value && value->Type() == nsAttrValue::ePercent) {
-        if (value->GetPercentValue() > 0.0f)
-          width->SetPercentValue(value->GetPercentValue());
-        // else 0 implies auto for compatibility
-      }
-    }
-
-    // height: value
-    nsCSSValue* height = aData->ValueForHeight();
-    if (height->GetUnit() == eCSSUnit_Null) {
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::height);
-      if (value && value->Type() == nsAttrValue::eInteger) {
-        if (value->GetIntegerValue() > 0)
-          height->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
-        // else 0 implies auto for compatibility.
-      }
-      else if (value && value->Type() == nsAttrValue::ePercent) {
-        if (value->GetPercentValue() > 0.0f)
-          height->SetPercentValue(value->GetPercentValue());
-        // else 0 implies auto for compatibility
-      }
-    }
-  }
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Text)) {
-    nsCSSValue* textAlign = aData->ValueForTextAlign();
-    if (textAlign->GetUnit() == eCSSUnit_Null) {
-      // align: enum
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
-      if (value && value->Type() == nsAttrValue::eEnum)
-        textAlign->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
-    }
-
-    nsCSSValue* whiteSpace = aData->ValueForWhiteSpace();
-    if (whiteSpace->GetUnit() == eCSSUnit_Null) {
-      // nowrap: enum
-      if (aAttributes->GetAttr(nsGkAtoms::nowrap)) {
-        // See if our width is not a nonzero integer width.
-        const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
-        nsCompatibility mode = aData->mPresContext->CompatibilityMode();
-        if (!value || value->Type() != nsAttrValue::eInteger ||
-            value->GetIntegerValue() == 0 ||
-            eCompatibility_NavQuirks != mode) {
-          whiteSpace->SetIntValue(NS_STYLE_WHITESPACE_NOWRAP, eCSSUnit_Enumerated);
-        }
-      }
-    }
-  }
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(TextReset)) {
-    nsCSSValue* verticalAlign = aData->ValueForVerticalAlign();
-    if (verticalAlign->GetUnit() == eCSSUnit_Null) {
-      // valign: enum
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::valign);
-      if (value && value->Type() == nsAttrValue::eEnum)
-        verticalAlign->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
-    }
-  }
-  
-  nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
-  nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
-}
-
-NS_IMETHODIMP_(bool)
-nsHTMLTableCellElement::IsAttributeMapped(const nsIAtom* aAttribute) const
-{
-  static const MappedAttributeEntry attributes[] = {
-    { &nsGkAtoms::align }, 
-    { &nsGkAtoms::valign },
-    { &nsGkAtoms::nowrap },
-#if 0
-    // XXXldb If these are implemented, they might need to move to
-    // GetAttributeChangeHint (depending on how, and preferably not).
-    { &nsGkAtoms::abbr },
-    { &nsGkAtoms::axis },
-    { &nsGkAtoms::headers },
-    { &nsGkAtoms::scope },
-#endif
-    { &nsGkAtoms::width },
-    { &nsGkAtoms::height },
-    { nullptr }
-  };
-
-  static const MappedAttributeEntry* const map[] = {
-    attributes,
-    sCommonAttributeMap,
-    sBackgroundAttributeMap,
-  };
-
-  return FindAttributeDependence(aAttribute, map);
-}
-
-nsMapRuleToAttributesFunc
-nsHTMLTableCellElement::GetAttributeMappingFunction() const
-{
-  return &MapAttributesIntoRule;
-}
+#endif /* mozilla_dom_HTMLTableCellElement_h */
rename from content/html/content/src/nsHTMLTableColElement.cpp
rename to content/html/content/src/HTMLTableColElement.cpp
--- a/content/html/content/src/nsHTMLTableColElement.cpp
+++ b/content/html/content/src/HTMLTableColElement.cpp
@@ -1,111 +1,63 @@
 /* -*- 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 "nsIDOMHTMLTableColElement.h"
-#include "nsIDOMEventTarget.h"
+#include "mozilla/dom/HTMLTableColElement.h"
 #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;
+NS_IMPL_NS_NEW_HTML_ELEMENT(TableCol)
+DOMCI_NODE_DATA(HTMLTableColElement, mozilla::dom::HTMLTableColElement)
+
+namespace mozilla {
+namespace 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
-{
-public:
-  nsHTMLTableColElement(already_AddRefed<nsINodeInfo> aNodeInfo);
-  virtual ~nsHTMLTableColElement();
-
-  // nsISupports
-  NS_DECL_ISUPPORTS_INHERITED
-
-  // nsIDOMNode
-  NS_FORWARD_NSIDOMNODE_TO_NSINODE
-
-  // nsIDOMElement
-  NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
-
-  // nsIDOMHTMLElement
-  NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
-
-  // nsIDOMHTMLTableColElement
-  NS_DECL_NSIDOMHTMLTABLECOLELEMENT
-
-  virtual bool ParseAttribute(int32_t aNamespaceID,
-                                nsIAtom* aAttribute,
-                                const nsAString& aValue,
-                                nsAttrValue& aResult);
-  nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
-  NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
-
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-
-  virtual nsXPCClassInfo* GetClassInfo();
-
-  virtual nsIDOMNode* AsDOMNode() { return this; }
-};
-
-
-NS_IMPL_NS_NEW_HTML_ELEMENT(TableCol)
-
-
-nsHTMLTableColElement::nsHTMLTableColElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsGenericHTMLElement(aNodeInfo)
+HTMLTableColElement::~HTMLTableColElement()
 {
 }
 
-nsHTMLTableColElement::~nsHTMLTableColElement()
-{
-}
-
-
-NS_IMPL_ADDREF_INHERITED(nsHTMLTableColElement, Element)
-NS_IMPL_RELEASE_INHERITED(nsHTMLTableColElement, Element)
+NS_IMPL_ADDREF_INHERITED(HTMLTableColElement, Element)
+NS_IMPL_RELEASE_INHERITED(HTMLTableColElement, Element)
 
-
-DOMCI_NODE_DATA(HTMLTableColElement, nsHTMLTableColElement)
-
-// QueryInterface implementation for nsHTMLTableColElement
-NS_INTERFACE_TABLE_HEAD(nsHTMLTableColElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLTableColElement,
+// QueryInterface implementation for HTMLTableColElement
+NS_INTERFACE_TABLE_HEAD(HTMLTableColElement)
+  NS_HTML_CONTENT_INTERFACE_TABLE1(HTMLTableColElement,
                                    nsIDOMHTMLTableColElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLTableColElement,
+  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLTableColElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTableColElement)
 
-NS_IMPL_ELEMENT_CLONE(nsHTMLTableColElement)
+NS_IMPL_ELEMENT_CLONE(HTMLTableColElement)
 
 
-NS_IMPL_STRING_ATTR(nsHTMLTableColElement, Align, align)
-NS_IMPL_STRING_ATTR(nsHTMLTableColElement, Ch, _char)
-NS_IMPL_STRING_ATTR(nsHTMLTableColElement, ChOff, charoff)
-NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLTableColElement, Span, span, 1)
-NS_IMPL_STRING_ATTR(nsHTMLTableColElement, VAlign, valign)
-NS_IMPL_STRING_ATTR(nsHTMLTableColElement, Width, width)
+NS_IMPL_STRING_ATTR(HTMLTableColElement, Align, align)
+NS_IMPL_STRING_ATTR(HTMLTableColElement, Ch, _char)
+NS_IMPL_STRING_ATTR(HTMLTableColElement, ChOff, charoff)
+NS_IMPL_INT_ATTR_DEFAULT_VALUE(HTMLTableColElement, Span, span, 1)
+NS_IMPL_STRING_ATTR(HTMLTableColElement, VAlign, valign)
+NS_IMPL_STRING_ATTR(HTMLTableColElement, Width, width)
 
 
 bool
-nsHTMLTableColElement::ParseAttribute(int32_t aNamespaceID,
-                                      nsIAtom* aAttribute,
-                                      const nsAString& aValue,
-                                      nsAttrValue& aResult)
+HTMLTableColElement::ParseAttribute(int32_t aNamespaceID,
+                                    nsIAtom* aAttribute,
+                                    const nsAString& aValue,
+                                    nsAttrValue& aResult)
 {
   if (aNamespaceID == kNameSpaceID_None) {
     /* ignore these attributes, stored simply as strings ch */
     if (aAttribute == nsGkAtoms::charoff) {
       return aResult.ParseSpecialIntValue(aValue);
     }
     if (aAttribute == nsGkAtoms::span) {
       /* protection from unrealistic large colspan values */
@@ -184,17 +136,17 @@ void MapAttributesIntoRule(const nsMappe
         verticalAlign->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
     }
   }
 
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
-nsHTMLTableColElement::IsAttributeMapped(const nsIAtom* aAttribute) const
+HTMLTableColElement::IsAttributeMapped(const nsIAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
     { &nsGkAtoms::width },
     { &nsGkAtoms::align },
     { &nsGkAtoms::valign },
     { &nsGkAtoms::span },
     { nullptr }
   };
@@ -204,12 +156,15 @@ nsHTMLTableColElement::IsAttributeMapped
     sCommonAttributeMap,
   };
 
   return FindAttributeDependence(aAttribute, map);
 }
 
 
 nsMapRuleToAttributesFunc
-nsHTMLTableColElement::GetAttributeMappingFunction() const
+HTMLTableColElement::GetAttributeMappingFunction() const
 {
   return &MapAttributesIntoRule;
 }
+
+} // namespace dom
+} // namespace mozilla
copy from content/html/content/src/nsHTMLTableColElement.cpp
copy to content/html/content/src/HTMLTableColElement.h
--- a/content/html/content/src/nsHTMLTableColElement.cpp
+++ b/content/html/content/src/HTMLTableColElement.h
@@ -1,37 +1,30 @@
 /* -*- 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"
+#ifndef mozilla_dom_HTMLTableColElement_h
+#define mozilla_dom_HTMLTableColElement_h
 
-#include "nsIDOMHTMLTableColElement.h"
-#include "nsIDOMEventTarget.h"
-#include "nsMappedAttributes.h"
 #include "nsGenericHTMLElement.h"
-#include "nsAttrValueInlines.h"
-#include "nsGkAtoms.h"
-#include "nsStyleConsts.h"
-#include "nsRuleData.h"
+#include "nsIDOMHTMLTableColElement.h"
 
-using namespace mozilla;
-using namespace mozilla::dom;
+namespace mozilla {
+namespace 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
+class HTMLTableColElement : public nsGenericHTMLElement,
+                            public nsIDOMHTMLTableColElement
 {
 public:
-  nsHTMLTableColElement(already_AddRefed<nsINodeInfo> aNodeInfo);
-  virtual ~nsHTMLTableColElement();
+  HTMLTableColElement(already_AddRefed<nsINodeInfo> aNodeInfo)
+    : nsGenericHTMLElement(aNodeInfo)
+  {
+  }
+  virtual ~HTMLTableColElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
 
   // nsIDOMElement
@@ -52,164 +45,12 @@ public:
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 };
 
-
-NS_IMPL_NS_NEW_HTML_ELEMENT(TableCol)
-
-
-nsHTMLTableColElement::nsHTMLTableColElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsGenericHTMLElement(aNodeInfo)
-{
-}
-
-nsHTMLTableColElement::~nsHTMLTableColElement()
-{
-}
-
-
-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)
-  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLTableColElement,
-                                               nsGenericHTMLElement)
-NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTableColElement)
-
-NS_IMPL_ELEMENT_CLONE(nsHTMLTableColElement)
-
-
-NS_IMPL_STRING_ATTR(nsHTMLTableColElement, Align, align)
-NS_IMPL_STRING_ATTR(nsHTMLTableColElement, Ch, _char)
-NS_IMPL_STRING_ATTR(nsHTMLTableColElement, ChOff, charoff)
-NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLTableColElement, Span, span, 1)
-NS_IMPL_STRING_ATTR(nsHTMLTableColElement, VAlign, valign)
-NS_IMPL_STRING_ATTR(nsHTMLTableColElement, Width, width)
-
-
-bool
-nsHTMLTableColElement::ParseAttribute(int32_t aNamespaceID,
-                                      nsIAtom* aAttribute,
-                                      const nsAString& aValue,
-                                      nsAttrValue& aResult)
-{
-  if (aNamespaceID == kNameSpaceID_None) {
-    /* ignore these attributes, stored simply as strings ch */
-    if (aAttribute == nsGkAtoms::charoff) {
-      return aResult.ParseSpecialIntValue(aValue);
-    }
-    if (aAttribute == nsGkAtoms::span) {
-      /* protection from unrealistic large colspan values */
-      return aResult.ParseIntWithBounds(aValue, 1, MAX_COLSPAN);
-    }
-    if (aAttribute == nsGkAtoms::width) {
-      return aResult.ParseSpecialIntValue(aValue);
-    }
-    if (aAttribute == nsGkAtoms::align) {
-      return ParseTableCellHAlignValue(aValue, aResult);
-    }
-    if (aAttribute == nsGkAtoms::valign) {
-      return ParseTableVAlignValue(aValue, aResult);
-    }
-  }
-
-  return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
-                                              aResult);
-}
+} // namespace dom
+} // namespace mozilla
 
-static 
-void MapAttributesIntoRule(const nsMappedAttributes* aAttributes, nsRuleData* aData)
-{
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Table)) {
-    nsCSSValue *span = aData->ValueForSpan();
-    if (span->GetUnit() == eCSSUnit_Null) {
-      // span: int
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::span);
-      if (value && value->Type() == nsAttrValue::eInteger) {
-        int32_t val = value->GetIntegerValue();
-        // Note: Do NOT use this code for table cells!  The value "0"
-        // means something special for colspan and rowspan, but for <col
-        // span> and <colgroup span> it's just disallowed.
-        if (val > 0) {
-          span->SetIntValue(value->GetIntegerValue(), eCSSUnit_Integer);
-        }
-      }
-    }
-  }
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Position)) {
-    nsCSSValue* width = aData->ValueForWidth();
-    if (width->GetUnit() == eCSSUnit_Null) {
-      // width
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
-      if (value) {
-        switch (value->Type()) {
-        case nsAttrValue::ePercent: {
-          width->SetPercentValue(value->GetPercentValue());
-          break;
-        }
-        case nsAttrValue::eInteger: {
-          width->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
-          break;
-        }
-        default:
-          break;
-        }
-      }
-    }
-  }
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Text)) {
-    nsCSSValue* textAlign = aData->ValueForTextAlign();
-    if (textAlign->GetUnit() == eCSSUnit_Null) {
-      // align: enum
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
-      if (value && value->Type() == nsAttrValue::eEnum)
-        textAlign->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
-    }
-  }
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(TextReset)) {
-    nsCSSValue* verticalAlign = aData->ValueForVerticalAlign();
-    if (verticalAlign->GetUnit() == eCSSUnit_Null) {
-      // valign: enum
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::valign);
-      if (value && value->Type() == nsAttrValue::eEnum)
-        verticalAlign->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
-    }
-  }
-
-  nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
-}
-
-NS_IMETHODIMP_(bool)
-nsHTMLTableColElement::IsAttributeMapped(const nsIAtom* aAttribute) const
-{
-  static const MappedAttributeEntry attributes[] = {
-    { &nsGkAtoms::width },
-    { &nsGkAtoms::align },
-    { &nsGkAtoms::valign },
-    { &nsGkAtoms::span },
-    { nullptr }
-  };
-
-  static const MappedAttributeEntry* const map[] = {
-    attributes,
-    sCommonAttributeMap,
-  };
-
-  return FindAttributeDependence(aAttribute, map);
-}
-
-
-nsMapRuleToAttributesFunc
-nsHTMLTableColElement::GetAttributeMappingFunction() const
-{
-  return &MapAttributesIntoRule;
-}
+#endif /* mozilla_dom_HTMLTableColElement_h */
rename from content/html/content/src/nsHTMLTableElement.cpp
rename to content/html/content/src/HTMLTableElement.cpp
--- a/content/html/content/src/nsHTMLTableElement.cpp
+++ b/content/html/content/src/HTMLTableElement.cpp
@@ -1,16 +1,16 @@
 /* -*- 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 "nsHTMLTableElement.h"
+#include "mozilla/dom/HTMLTableElement.h"
 #include "nsIDOMHTMLTableCaptionElem.h"
 #include "nsIDOMHTMLTableSectionElem.h"
 #include "nsCOMPtr.h"
 #include "nsIDOMEventTarget.h"
 #include "nsError.h"
 #include "nsContentList.h"
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
@@ -23,29 +23,32 @@
 #include "nsIDocument.h"
 #include "nsContentUtils.h"
 #include "nsIDOMElement.h"
 #include "nsIHTMLCollection.h"
 #include "nsHTMLStyleSheet.h"
 #include "mozilla/dom/HTMLCollectionBinding.h"
 #include "mozilla/dom/BindingUtils.h"
 
-using namespace mozilla;
-using namespace mozilla::dom;
+NS_IMPL_NS_NEW_HTML_ELEMENT(Table)
+DOMCI_NODE_DATA(HTMLTableElement, mozilla::dom::HTMLTableElement)
+
+namespace mozilla {
+namespace 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);
+  TableRowsCollection(HTMLTableElement *aParent);
   virtual ~TableRowsCollection();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_NSIDOMHTMLCOLLECTION
 
   virtual Element* GetElementAt(uint32_t aIndex);
   virtual nsINode* GetParentObject()
   {
@@ -65,22 +68,22 @@ public:
                                bool *triedToWrap)
   {
     return mozilla::dom::HTMLCollectionBinding::Wrap(cx, scope, this,
                                                      triedToWrap);
   }
 
 protected:
   // Those rows that are not in table sections
-  nsHTMLTableElement* mParent;
+  HTMLTableElement* mParent;
   nsRefPtr<nsContentList> mOrphanRows;  
 };
 
 
-TableRowsCollection::TableRowsCollection(nsHTMLTableElement *aParent)
+TableRowsCollection::TableRowsCollection(HTMLTableElement *aParent)
   : mParent(aParent)
   , mOrphanRows(new nsContentList(mParent,
                                   kNameSpaceID_XHTML,
                                   nsGkAtoms::tr,
                                   nsGkAtoms::tr,
                                   false))
 {
   SetIsDOMBinding();
@@ -315,143 +318,136 @@ NS_IMETHODIMP
 TableRowsCollection::ParentDestroyed()
 {
   // see comment in destructor, do NOT release mParent!
   mParent = nullptr;
 
   return NS_OK;
 }
 
-/* -------------------------- nsHTMLTableElement --------------------------- */
-// the class declaration is at the top of this file
-
+/* --------------------------- HTMLTableElement ---------------------------- */
 
-NS_IMPL_NS_NEW_HTML_ELEMENT(Table)
-
-
-nsHTMLTableElement::nsHTMLTableElement(already_AddRefed<nsINodeInfo> aNodeInfo)
+HTMLTableElement::HTMLTableElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo),
     mTableInheritedAttributes(TABLE_ATTRS_DIRTY)
 {
 }
 
-nsHTMLTableElement::~nsHTMLTableElement()
+HTMLTableElement::~HTMLTableElement()
 {
   if (mRows) {
     mRows->ParentDestroyed();
   }
   ReleaseInheritedAttributes();
 }
 
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLTableElement)
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsHTMLTableElement, nsGenericHTMLElement)
+NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLTableElement)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLTableElement, nsGenericHTMLElement)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mTBodies)
   if (tmp->mRows) {
     tmp->mRows->ParentDestroyed();
   }
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mRows)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLTableElement,
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLTableElement,
                                                   nsGenericHTMLElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTBodies)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRows)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLTableElement, Element)
-NS_IMPL_RELEASE_INHERITED(nsHTMLTableElement, Element)
+NS_IMPL_ADDREF_INHERITED(HTMLTableElement, Element)
+NS_IMPL_RELEASE_INHERITED(HTMLTableElement, 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,
+// QueryInterface implementation for HTMLTableElement
+NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLTableElement)
+  NS_HTML_CONTENT_INTERFACE_TABLE1(HTMLTableElement, nsIDOMHTMLTableElement)
+  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLTableElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTableElement)
 
 
-NS_IMPL_ELEMENT_CLONE(nsHTMLTableElement)
+NS_IMPL_ELEMENT_CLONE(HTMLTableElement)
 
 
 // the DOM spec says border, cellpadding, cellSpacing are all "wstring"
 // in fact, they are integers or they are meaningless.  so we store them
 // here as ints.
 
-NS_IMPL_STRING_ATTR(nsHTMLTableElement, Align, align)
-NS_IMPL_STRING_ATTR(nsHTMLTableElement, BgColor, bgcolor)
-NS_IMPL_STRING_ATTR(nsHTMLTableElement, Border, border)
-NS_IMPL_STRING_ATTR(nsHTMLTableElement, CellPadding, cellpadding)
-NS_IMPL_STRING_ATTR(nsHTMLTableElement, CellSpacing, cellspacing)
-NS_IMPL_STRING_ATTR(nsHTMLTableElement, Frame, frame)
-NS_IMPL_STRING_ATTR(nsHTMLTableElement, Rules, rules)
-NS_IMPL_STRING_ATTR(nsHTMLTableElement, Summary, summary)
-NS_IMPL_STRING_ATTR(nsHTMLTableElement, Width, width)
+NS_IMPL_STRING_ATTR(HTMLTableElement, Align, align)
+NS_IMPL_STRING_ATTR(HTMLTableElement, BgColor, bgcolor)
+NS_IMPL_STRING_ATTR(HTMLTableElement, Border, border)
+NS_IMPL_STRING_ATTR(HTMLTableElement, CellPadding, cellpadding)
+NS_IMPL_STRING_ATTR(HTMLTableElement, CellSpacing, cellspacing)
+NS_IMPL_STRING_ATTR(HTMLTableElement, Frame, frame)
+NS_IMPL_STRING_ATTR(HTMLTableElement, Rules, rules)
+NS_IMPL_STRING_ATTR(HTMLTableElement, Summary, summary)
+NS_IMPL_STRING_ATTR(HTMLTableElement, Width, width)
 
 
 already_AddRefed<nsIDOMHTMLTableCaptionElement>
-nsHTMLTableElement::GetCaption()
+HTMLTableElement::GetCaption()
 {
   for (nsIContent* cur = nsINode::GetFirstChild(); cur; cur = cur->GetNextSibling()) {
     nsCOMPtr<nsIDOMHTMLTableCaptionElement> caption = do_QueryInterface(cur);
     if (caption) {
       return caption.forget();
     }
   }
   return nullptr;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::GetCaption(nsIDOMHTMLTableCaptionElement** aValue)
+HTMLTableElement::GetCaption(nsIDOMHTMLTableCaptionElement** aValue)
 {
   nsCOMPtr<nsIDOMHTMLTableCaptionElement> caption = GetCaption();
   caption.forget(aValue);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::SetCaption(nsIDOMHTMLTableCaptionElement* aValue)
+HTMLTableElement::SetCaption(nsIDOMHTMLTableCaptionElement* aValue)
 {
   nsresult rv = DeleteCaption();
 
   if (NS_SUCCEEDED(rv)) {
     if (aValue) {
       nsCOMPtr<nsIDOMNode> resultingChild;
       AppendChild(aValue, getter_AddRefs(resultingChild));
     }
   }
 
   return rv;
 }
 
 already_AddRefed<nsIDOMHTMLTableSectionElement>
-nsHTMLTableElement::GetSection(nsIAtom *aTag)
+HTMLTableElement::GetSection(nsIAtom *aTag)
 {
   for (nsIContent* child = nsINode::GetFirstChild();
        child;
        child = child->GetNextSibling()) {
     nsCOMPtr<nsIDOMHTMLTableSectionElement> section = do_QueryInterface(child);
     if (section && child->NodeInfo()->Equals(aTag)) {
       return section.forget();
     }
   }
   return nullptr;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::GetTHead(nsIDOMHTMLTableSectionElement** aValue)
+HTMLTableElement::GetTHead(nsIDOMHTMLTableSectionElement** aValue)
 {
   *aValue = GetTHead().get();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::SetTHead(nsIDOMHTMLTableSectionElement* aValue)
+HTMLTableElement::SetTHead(nsIDOMHTMLTableSectionElement* aValue)
 {
   nsCOMPtr<nsIContent> content(do_QueryInterface(aValue));
   NS_ENSURE_TRUE(content, NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
 
   if (!content->NodeInfo()->Equals(nsGkAtoms::thead)) {
     return NS_ERROR_DOM_HIERARCHY_REQUEST_ERR;
   }
   
@@ -470,25 +466,25 @@ nsHTMLTableElement::SetTHead(nsIDOMHTMLT
     nsCOMPtr<nsIDOMNode> resultChild;
     rv = InsertBefore(aValue, child, getter_AddRefs(resultChild));
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::GetTFoot(nsIDOMHTMLTableSectionElement** aValue)
+HTMLTableElement::GetTFoot(nsIDOMHTMLTableSectionElement** aValue)
 {
   *aValue = GetTFoot().get();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::SetTFoot(nsIDOMHTMLTableSectionElement* aValue)
+HTMLTableElement::SetTFoot(nsIDOMHTMLTableSectionElement* aValue)
 {
   nsCOMPtr<nsIContent> content(do_QueryInterface(aValue));
   NS_ENSURE_TRUE(content, NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
 
   if (!content->NodeInfo()->Equals(nsGkAtoms::tfoot)) {
     return NS_ERROR_DOM_HIERARCHY_REQUEST_ERR;
   }
   
@@ -499,52 +495,52 @@ nsHTMLTableElement::SetTFoot(nsIDOMHTMLT
       AppendChild(aValue, getter_AddRefs(resultingChild));
     }
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::GetRows(nsIDOMHTMLCollection** aValue)
+HTMLTableElement::GetRows(nsIDOMHTMLCollection** aValue)
 {
   if (!mRows) {
     mRows = new TableRowsCollection(this);
   }
 
   *aValue = mRows;
   NS_ADDREF(*aValue);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::GetTBodies(nsIDOMHTMLCollection** aValue)
+HTMLTableElement::GetTBodies(nsIDOMHTMLCollection** aValue)
 {
   NS_ADDREF(*aValue = TBodies());
   return NS_OK;
 }
 
 nsContentList*
-nsHTMLTableElement::TBodies()
+HTMLTableElement::TBodies()
 {
   if (!mTBodies) {
     // Not using NS_GetContentList because this should not be cached
     mTBodies = new nsContentList(this,
                                  kNameSpaceID_XHTML,
                                  nsGkAtoms::tbody,
                                  nsGkAtoms::tbody,
                                  false);
   }
 
   return mTBodies;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::CreateTHead(nsIDOMHTMLElement** aValue)
+HTMLTableElement::CreateTHead(nsIDOMHTMLElement** aValue)
 {
   *aValue = nullptr;
 
   nsRefPtr<nsIDOMHTMLTableSectionElement> head = GetTHead();
   if (head) {
     // return the existing thead
     head.forget(aValue);
     return NS_OK;
@@ -569,32 +565,32 @@ nsHTMLTableElement::CreateTHead(nsIDOMHT
 
   nsCOMPtr<nsIDOMNode> resultChild;
   InsertBefore(newHeadAsDOMElement, child, getter_AddRefs(resultChild));
   newHeadAsDOMElement.forget(aValue);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::DeleteTHead()
+HTMLTableElement::DeleteTHead()
 {
   nsCOMPtr<nsIDOMHTMLTableSectionElement> childToDelete;
   nsresult rv = GetTHead(getter_AddRefs(childToDelete));
 
   if ((NS_SUCCEEDED(rv)) && childToDelete) {
     nsCOMPtr<nsIDOMNode> resultingChild;
     // mInner does the notification
     RemoveChild(childToDelete, getter_AddRefs(resultingChild));
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::CreateTFoot(nsIDOMHTMLElement** aValue)
+HTMLTableElement::CreateTFoot(nsIDOMHTMLElement** aValue)
 {
   *aValue = nullptr;
 
   nsRefPtr<nsIDOMHTMLTableSectionElement> foot = GetTFoot();
   if (foot) {
     // return the existing tfoot
     foot.forget(aValue);
     return NS_OK;
@@ -611,32 +607,32 @@ nsHTMLTableElement::CreateTFoot(nsIDOMHT
   }
   AppendChildTo(newFoot, true);
   nsCOMPtr<nsIDOMHTMLElement> newFootAsDOMElement = do_QueryInterface(newFoot);
   newFootAsDOMElement.forget(aValue);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::DeleteTFoot()
+HTMLTableElement::DeleteTFoot()
 {
   nsCOMPtr<nsIDOMHTMLTableSectionElement> childToDelete;
   nsresult rv = GetTFoot(getter_AddRefs(childToDelete));
 
   if ((NS_SUCCEEDED(rv)) && childToDelete) {
     nsCOMPtr<nsIDOMNode> resultingChild;
     // mInner does the notification
     RemoveChild(childToDelete, getter_AddRefs(resultingChild));
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::CreateCaption(nsIDOMHTMLElement** aValue)
+HTMLTableElement::CreateCaption(nsIDOMHTMLElement** aValue)
 {
   *aValue = nullptr;
 
   if (nsRefPtr<nsIDOMHTMLTableCaptionElement> caption = GetCaption()) {
     // return the existing caption
     caption.forget(aValue);
     return NS_OK;
   }
@@ -655,31 +651,31 @@ nsHTMLTableElement::CreateCaption(nsIDOM
   AppendChildTo(newCaption, true);
   nsCOMPtr<nsIDOMHTMLElement> captionAsDOMElement =
     do_QueryInterface(newCaption);
   captionAsDOMElement.forget(aValue);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::DeleteCaption()
+HTMLTableElement::DeleteCaption()
 {
   nsCOMPtr<nsIDOMHTMLTableCaptionElement> childToDelete;
   nsresult rv = GetCaption(getter_AddRefs(childToDelete));
 
   if ((NS_SUCCEEDED(rv)) && childToDelete) {
     nsCOMPtr<nsIDOMNode> resultingChild;
     RemoveChild(childToDelete, getter_AddRefs(resultingChild));
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::InsertRow(int32_t aIndex, nsIDOMHTMLElement** aValue)
+HTMLTableElement::InsertRow(int32_t aIndex, nsIDOMHTMLElement** aValue)
 {
   /* get the ref row at aIndex
      if there is one, 
        get its parent
        insert the new row just before the ref row
      else
        get the first row group
        insert the new row as its first child
@@ -813,17 +809,17 @@ nsHTMLTableElement::InsertRow(int32_t aI
       }
     }
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLTableElement::DeleteRow(int32_t aValue)
+HTMLTableElement::DeleteRow(int32_t aValue)
 {
   if (aValue < -1) {
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
   }
 
   nsCOMPtr<nsIDOMHTMLCollection> rows;
   GetRows(getter_AddRefs(rows));
 
@@ -884,20 +880,20 @@ static const nsAttrValue::EnumTable kRul
 static const nsAttrValue::EnumTable kLayoutTable[] = {
   { "auto",   NS_STYLE_TABLE_LAYOUT_AUTO },
   { "fixed",  NS_STYLE_TABLE_LAYOUT_FIXED },
   { 0 }
 };
 
 
 bool
-nsHTMLTableElement::ParseAttribute(int32_t aNamespaceID,
-                                   nsIAtom* aAttribute,
-                                   const nsAString& aValue,
-                                   nsAttrValue& aResult)
+HTMLTableElement::ParseAttribute(int32_t aNamespaceID,
+                                 nsIAtom* aAttribute,
+                                 const nsAString& aValue,
+                                 nsAttrValue& aResult)
 {
   /* ignore summary, just a string */
   if (aNamespaceID == kNameSpaceID_None) {
     if (aAttribute == nsGkAtoms::cellspacing ||
         aAttribute == nsGkAtoms::cellpadding) {
       return aResult.ParseNonNegativeIntValue(aValue);
     }
     if (aAttribute == nsGkAtoms::cols ||
@@ -1105,17 +1101,17 @@ MapAttributesIntoRule(const nsMappedAttr
         borderBottomWidth->SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
     }
   }
   nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
-nsHTMLTableElement::IsAttributeMapped(const nsIAtom* aAttribute) const
+HTMLTableElement::IsAttributeMapped(const nsIAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
     { &nsGkAtoms::layout },
     { &nsGkAtoms::cellpadding },
     { &nsGkAtoms::cellspacing },
     { &nsGkAtoms::cols },
     { &nsGkAtoms::border },
     { &nsGkAtoms::width },
@@ -1134,17 +1130,17 @@ nsHTMLTableElement::IsAttributeMapped(co
     sCommonAttributeMap,
     sBackgroundAttributeMap,
   };
 
   return FindAttributeDependence(aAttribute, map);
 }
 
 nsMapRuleToAttributesFunc
-nsHTMLTableElement::GetAttributeMappingFunction() const
+HTMLTableElement::GetAttributeMappingFunction() const
 {
   return &MapAttributesIntoRule;
 }
 
 static void
 MapInheritedTableAttributesIntoRule(const nsMappedAttributes* aAttributes,
                                     nsRuleData* aData)
 {
@@ -1174,29 +1170,29 @@ MapInheritedTableAttributesIntoRule(cons
       if (paddingBottom->GetUnit() == eCSSUnit_Null) {
         *paddingBottom = padVal;
       }
     }
   }
 }
 
 nsMappedAttributes*
-nsHTMLTableElement::GetAttributesMappedForCell()
+HTMLTableElement::GetAttributesMappedForCell()
 {
   if (mTableInheritedAttributes) {
     if (mTableInheritedAttributes == TABLE_ATTRS_DIRTY)
       BuildInheritedAttributes();
     if (mTableInheritedAttributes != TABLE_ATTRS_DIRTY)
       return mTableInheritedAttributes;
   }
   return nullptr;
 }
 
 void
-nsHTMLTableElement::BuildInheritedAttributes()
+HTMLTableElement::BuildInheritedAttributes()
 {
   NS_ASSERTION(mTableInheritedAttributes == TABLE_ATTRS_DIRTY,
                "potential leak, plus waste of work");
   nsIDocument *document = GetCurrentDoc();
   nsHTMLStyleSheet* sheet = document ?
                               document->GetAttributeStyleSheet() : nullptr;
   nsRefPtr<nsMappedAttributes> newAttrs;
   if (sheet) {
@@ -1222,48 +1218,51 @@ nsHTMLTableElement::BuildInheritedAttrib
       }
     }
     mTableInheritedAttributes = newAttrs;
     NS_IF_ADDREF(mTableInheritedAttributes);
   }
 }
 
 nsresult
-nsHTMLTableElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
-                              nsIContent* aBindingParent,
-                              bool aCompileEventHandlers)
+HTMLTableElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
+                             nsIContent* aBindingParent,
+                             bool aCompileEventHandlers)
 {
   ReleaseInheritedAttributes();
   return nsGenericHTMLElement::BindToTree(aDocument, aParent,
                                           aBindingParent,
                                           aCompileEventHandlers);
 }
 
 void
-nsHTMLTableElement::UnbindFromTree(bool aDeep, bool aNullParent)
+HTMLTableElement::UnbindFromTree(bool aDeep, bool aNullParent)
 {
   ReleaseInheritedAttributes();
   nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
 }
 
 nsresult
-nsHTMLTableElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
-                                  const nsAttrValueOrString* aValue,
-                                  bool aNotify)
+HTMLTableElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
+                                const nsAttrValueOrString* aValue,
+                                bool aNotify)
 {
   if (aName == nsGkAtoms::cellpadding && aNameSpaceID == kNameSpaceID_None) {
     ReleaseInheritedAttributes();
   }
   return nsGenericHTMLElement::BeforeSetAttr(aNameSpaceID, aName, aValue,
                                              aNotify);
 }
 
 nsresult
-nsHTMLTableElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
-                                 const nsAttrValue* aValue,
-                                 bool aNotify)
+HTMLTableElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
+                               const nsAttrValue* aValue,
+                               bool aNotify)
 {
   if (aName == nsGkAtoms::cellpadding && aNameSpaceID == kNameSpaceID_None) {
     BuildInheritedAttributes();
   }
   return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue,
                                             aNotify);
 }
+
+} // namespace dom
+} // namespace mozilla
rename from content/html/content/src/nsHTMLTableElement.h
rename to content/html/content/src/HTMLTableElement.h
--- a/content/html/content/src/nsHTMLTableElement.h
+++ b/content/html/content/src/HTMLTableElement.h
@@ -1,27 +1,32 @@
 /* -*- 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 "nsIDOMHTMLTableElement.h"
+#ifndef mozilla_dom_HTMLTableElement_h
+#define mozilla_dom_HTMLTableElement_h
+
 #include "nsGenericHTMLElement.h"
+#include "nsIDOMHTMLTableElement.h"
 #include "nsMappedAttributes.h"
 
+namespace mozilla {
+namespace dom {
+
 #define TABLE_ATTRS_DIRTY ((nsMappedAttributes*)0x1)
 
-
 class TableRowsCollection;
 
-class nsHTMLTableElement :  public nsGenericHTMLElement,
-                            public nsIDOMHTMLTableElement
+class HTMLTableElement : public nsGenericHTMLElement,
+                         public nsIDOMHTMLTableElement
 {
 public:
-  nsHTMLTableElement(already_AddRefed<nsINodeInfo> aNodeInfo);
-  virtual ~nsHTMLTableElement();
+  HTMLTableElement(already_AddRefed<nsINodeInfo> aNodeInfo);
+  virtual ~HTMLTableElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
 
   // nsIDOMElement
@@ -56,17 +61,17 @@ public:
                                  const nsAttrValueOrString* aValue,
                                  bool aNotify);
   /**
    * Called when an attribute has just been changed
    */
   virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                                 const nsAttrValue* aValue, bool aNotify);
 
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsHTMLTableElement,
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLTableElement,
                                            nsGenericHTMLElement)
   nsMappedAttributes* GetAttributesMappedForCell();
   already_AddRefed<nsIDOMHTMLTableSectionElement> GetTHead() {
     return GetSection(nsGkAtoms::thead);
   }
   already_AddRefed<nsIDOMHTMLTableSectionElement> GetTFoot() {
     return GetSection(nsGkAtoms::tfoot);
   }
@@ -84,8 +89,12 @@ protected:
   void ReleaseInheritedAttributes() {
     if (mTableInheritedAttributes &&
         mTableInheritedAttributes != TABLE_ATTRS_DIRTY)
       NS_RELEASE(mTableInheritedAttributes);
       mTableInheritedAttributes = TABLE_ATTRS_DIRTY;
   }
 };
 
+} // namespace dom
+} // namespace mozilla
+
+#endif /* mozilla_dom_HTMLTableElement_h */
rename from content/html/content/src/nsHTMLTableRowElement.cpp
rename to content/html/content/src/HTMLTableRowElement.cpp
--- a/content/html/content/src/nsHTMLTableRowElement.cpp
+++ b/content/html/content/src/HTMLTableRowElement.cpp
@@ -1,122 +1,72 @@
 /* -*- 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 "nsIDOMHTMLTableRowElement.h"
+#include "mozilla/dom/HTMLTableRowElement.h"
 #include "nsIDOMHTMLTableElement.h"
 #include "nsIDOMHTMLTableSectionElem.h"
 #include "nsIDOMHTMLTableCellElement.h"
-#include "nsIDOMEventTarget.h"
-#include "nsError.h"
 #include "nsMappedAttributes.h"
-#include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
 #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
-  NS_DECL_ISUPPORTS_INHERITED
-
-  // nsIDOMNode
-  NS_FORWARD_NSIDOMNODE_TO_NSINODE
-
-  // nsIDOMElement
-  NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
-
-  // nsIDOMHTMLElement
-  NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
-
-  // nsIDOMHTMLTableRowElement
-  NS_DECL_NSIDOMHTMLTABLEROWELEMENT
+NS_IMPL_NS_NEW_HTML_ELEMENT(TableRow)
+DOMCI_NODE_DATA(HTMLTableRowElement, mozilla::dom::HTMLTableRowElement)
 
-  virtual bool ParseAttribute(int32_t aNamespaceID,
-                                nsIAtom* aAttribute,
-                                const nsAString& aValue,
-                                nsAttrValue& aResult);
-  virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
-  NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
-
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-
-  virtual nsXPCClassInfo* GetClassInfo();
-
-  virtual nsIDOMNode* AsDOMNode() { return this; }
+namespace mozilla {
+namespace dom {
 
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLTableRowElement,
-                                                     nsGenericHTMLElement)
-
-protected:
-  already_AddRefed<nsIDOMHTMLTableSectionElement> GetSection() const;
-  already_AddRefed<nsIDOMHTMLTableElement> GetTable() const;
-  nsRefPtr<nsContentList> mCells;
-};
-
-
-NS_IMPL_NS_NEW_HTML_ELEMENT(TableRow)
-
-
-nsHTMLTableRowElement::nsHTMLTableRowElement(already_AddRefed<nsINodeInfo> aNodeInfo)
+HTMLTableRowElement::HTMLTableRowElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLTableRowElement)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLTableRowElement,
+NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLTableRowElement)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLTableRowElement,
                                                   nsGenericHTMLElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCells)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLTableRowElement, Element)
-NS_IMPL_RELEASE_INHERITED(nsHTMLTableRowElement, Element)
-
-
-DOMCI_NODE_DATA(HTMLTableRowElement, nsHTMLTableRowElement)
+NS_IMPL_ADDREF_INHERITED(HTMLTableRowElement, Element)
+NS_IMPL_RELEASE_INHERITED(HTMLTableRowElement, Element)
 
-// QueryInterface implementation for nsHTMLTableRowElement
-NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLTableRowElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLTableRowElement,
+// QueryInterface implementation for HTMLTableRowElement
+NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLTableRowElement)
+  NS_HTML_CONTENT_INTERFACE_TABLE1(HTMLTableRowElement,
                                    nsIDOMHTMLTableRowElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLTableRowElement,
+  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLTableRowElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTableRowElement)
 
 
-NS_IMPL_ELEMENT_CLONE(nsHTMLTableRowElement)
+NS_IMPL_ELEMENT_CLONE(HTMLTableRowElement)
 
 
 // protected method
 already_AddRefed<nsIDOMHTMLTableSectionElement>
-nsHTMLTableRowElement::GetSection() const
+HTMLTableRowElement::GetSection() const
 {
   nsCOMPtr<nsIDOMHTMLTableSectionElement> section =
     do_QueryInterface(GetParent());
   return section.forget();
 }
 
 // protected method
 already_AddRefed<nsIDOMHTMLTableElement>
-nsHTMLTableRowElement::GetTable() const
+HTMLTableRowElement::GetTable() const
 {
   nsIContent* parent = GetParent();
   if (!parent) {
     return nullptr;
   }
 
   // We may not be in a section
   nsCOMPtr<nsIDOMHTMLTableElement> table = do_QueryInterface(parent);
@@ -128,17 +78,17 @@ nsHTMLTableRowElement::GetTable() const
   if (!parent) {
     return nullptr;
   }
   table = do_QueryInterface(parent);
   return table.forget();
 }
 
 NS_IMETHODIMP
-nsHTMLTableRowElement::GetRowIndex(int32_t* aValue)
+HTMLTableRowElement::GetRowIndex(int32_t* aValue)
 {
   *aValue = -1;
   nsCOMPtr<nsIDOMHTMLTableElement> table = GetTable();
   if (!table) {
     return NS_OK;
   }
 
   nsCOMPtr<nsIDOMHTMLCollection> rows;
@@ -152,17 +102,17 @@ nsHTMLTableRowElement::GetRowIndex(int32
       *aValue = i;
       break;
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLTableRowElement::GetSectionRowIndex(int32_t* aValue)
+HTMLTableRowElement::GetSectionRowIndex(int32_t* aValue)
 {
   *aValue = -1;
   nsCOMPtr<nsIDOMHTMLTableSectionElement> section = GetSection();
   if (!section) {
     return NS_OK;
   }
 
   nsCOMPtr<nsIDOMHTMLCollection> rows;
@@ -186,17 +136,17 @@ IsCell(nsIContent *aContent, int32_t aNa
 {
   nsIAtom* tag = aContent->Tag();
 
   return ((tag == nsGkAtoms::td || tag == nsGkAtoms::th) &&
           aContent->IsHTML());
 }
 
 NS_IMETHODIMP
-nsHTMLTableRowElement::GetCells(nsIDOMHTMLCollection** aValue)
+HTMLTableRowElement::GetCells(nsIDOMHTMLCollection** aValue)
 {
   if (!mCells) {
     mCells = new nsContentList(this,
                                IsCell,
                                nullptr, // destroy func
                                nullptr, // closure data
                                false,
                                nullptr,
@@ -204,17 +154,17 @@ nsHTMLTableRowElement::GetCells(nsIDOMHT
                                false);
   }
 
   NS_ADDREF(*aValue = mCells);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLTableRowElement::InsertCell(int32_t aIndex, nsIDOMHTMLElement** aValue)
+HTMLTableRowElement::InsertCell(int32_t aIndex, nsIDOMHTMLElement** aValue)
 {
   *aValue = nullptr;
 
   if (aIndex < -1) {
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
   }
 
   // Make sure mCells is initialized.
@@ -262,17 +212,17 @@ nsHTMLTableRowElement::InsertCell(int32_
     CallQueryInterface(retChild, aValue);
   }
 
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
-nsHTMLTableRowElement::DeleteCell(int32_t aValue)
+HTMLTableRowElement::DeleteCell(int32_t aValue)
 {
   if (aValue < -1) {
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
   }
 
   nsCOMPtr<nsIDOMHTMLCollection> cells;
   GetCells(getter_AddRefs(cells));
 
@@ -299,28 +249,28 @@ nsHTMLTableRowElement::DeleteCell(int32_
   if (!cell) {
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
   }
 
   nsCOMPtr<nsIDOMNode> retChild;
   return RemoveChild(cell, getter_AddRefs(retChild));
 }
 
-NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, Align, align)
-NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, BgColor, bgcolor)
-NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, Ch, _char)
-NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, ChOff, charoff)
-NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, VAlign, valign)
+NS_IMPL_STRING_ATTR(HTMLTableRowElement, Align, align)
+NS_IMPL_STRING_ATTR(HTMLTableRowElement, BgColor, bgcolor)
+NS_IMPL_STRING_ATTR(HTMLTableRowElement, Ch, _char)
+NS_IMPL_STRING_ATTR(HTMLTableRowElement, ChOff, charoff)
+NS_IMPL_STRING_ATTR(HTMLTableRowElement, VAlign, valign)
 
 
 bool
-nsHTMLTableRowElement::ParseAttribute(int32_t aNamespaceID,
-                                      nsIAtom* aAttribute,
-                                      const nsAString& aValue,
-                                      nsAttrValue& aResult)
+HTMLTableRowElement::ParseAttribute(int32_t aNamespaceID,
+                                    nsIAtom* aAttribute,
+                                    const nsAString& aValue,
+                                    nsAttrValue& aResult)
 {
   /*
    * ignore these attributes, stored simply as strings
    *
    * ch
    */
 
   if (aNamespaceID == kNameSpaceID_None) {
@@ -384,17 +334,17 @@ void MapAttributesIntoRule(const nsMappe
     }
   }
 
   nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
-nsHTMLTableRowElement::IsAttributeMapped(const nsIAtom* aAttribute) const
+HTMLTableRowElement::IsAttributeMapped(const nsIAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
     { &nsGkAtoms::align },
     { &nsGkAtoms::valign }, 
     { &nsGkAtoms::height },
     { nullptr }
   };
 
@@ -403,12 +353,15 @@ nsHTMLTableRowElement::IsAttributeMapped
     sCommonAttributeMap,
     sBackgroundAttributeMap,
   };
 
   return FindAttributeDependence(aAttribute, map);
 }
 
 nsMapRuleToAttributesFunc
-nsHTMLTableRowElement::GetAttributeMappingFunction() const
+HTMLTableRowElement::GetAttributeMappingFunction() const
 {
   return &MapAttributesIntoRule;
 }
+
+} // namespace dom
+} // namespace mozilla
copy from content/html/content/src/nsHTMLTableRowElement.cpp
copy to content/html/content/src/HTMLTableRowElement.h
--- a/content/html/content/src/nsHTMLTableRowElement.cpp
+++ b/content/html/content/src/HTMLTableRowElement.h
@@ -1,39 +1,29 @@
 /* -*- 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"
+#ifndef mozilla_dom_HTMLTableRowElement_h
+#define mozilla_dom_HTMLTableRowElement_h
 
-#include "nsIDOMHTMLTableRowElement.h"
-#include "nsIDOMHTMLTableElement.h"
-#include "nsIDOMHTMLTableSectionElem.h"
-#include "nsIDOMHTMLTableCellElement.h"
-#include "nsIDOMEventTarget.h"
-#include "nsError.h"
-#include "nsMappedAttributes.h"
 #include "nsGenericHTMLElement.h"
-#include "nsAttrValueInlines.h"
-#include "nsContentList.h"
-#include "nsGkAtoms.h"
-#include "nsStyleConsts.h"
-#include "nsHTMLParts.h"
-#include "nsRuleData.h"
-#include "nsContentUtils.h"
+#include "nsIDOMHTMLTableRowElement.h"
+
+class nsIDOMHTMLTableElement;
+class nsIDOMHTMLTableSectionElement;
 
-using namespace mozilla;
-using namespace mozilla::dom;
+namespace mozilla {
+namespace dom {
 
-class nsHTMLTableRowElement : public nsGenericHTMLElement,
-                              public nsIDOMHTMLTableRowElement
+class HTMLTableRowElement : public nsGenericHTMLElement,
+                            public nsIDOMHTMLTableRowElement
 {
 public:
-  nsHTMLTableRowElement(already_AddRefed<nsINodeInfo> aNodeInfo);
+  HTMLTableRowElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
 
   // nsIDOMElement
@@ -53,362 +43,21 @@ public:
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLTableRowElement,
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(HTMLTableRowElement,
                                                      nsGenericHTMLElement)
 
 protected:
   already_AddRefed<nsIDOMHTMLTableSectionElement> GetSection() const;
   already_AddRefed<nsIDOMHTMLTableElement> GetTable() const;
   nsRefPtr<nsContentList> mCells;
 };
 
-
-NS_IMPL_NS_NEW_HTML_ELEMENT(TableRow)
-
-
-nsHTMLTableRowElement::nsHTMLTableRowElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsGenericHTMLElement(aNodeInfo)
-{
-}
-
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLTableRowElement)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLTableRowElement,
-                                                  nsGenericHTMLElement)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCells)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
-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)
-  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLTableRowElement,
-                                               nsGenericHTMLElement)
-NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTableRowElement)
-
-
-NS_IMPL_ELEMENT_CLONE(nsHTMLTableRowElement)
-
-
-// protected method
-already_AddRefed<nsIDOMHTMLTableSectionElement>
-nsHTMLTableRowElement::GetSection() const
-{
-  nsCOMPtr<nsIDOMHTMLTableSectionElement> section =
-    do_QueryInterface(GetParent());
-  return section.forget();
-}
-
-// protected method
-already_AddRefed<nsIDOMHTMLTableElement>
-nsHTMLTableRowElement::GetTable() const
-{
-  nsIContent* parent = GetParent();
-  if (!parent) {
-    return nullptr;
-  }
-
-  // We may not be in a section
-  nsCOMPtr<nsIDOMHTMLTableElement> table = do_QueryInterface(parent);
-  if (table) {
-    return table.forget();
-  }
-
-  parent = parent->GetParent();
-  if (!parent) {
-    return nullptr;
-  }
-  table = do_QueryInterface(parent);
-  return table.forget();
-}
-
-NS_IMETHODIMP
-nsHTMLTableRowElement::GetRowIndex(int32_t* aValue)
-{
-  *aValue = -1;
-  nsCOMPtr<nsIDOMHTMLTableElement> table = GetTable();
-  if (!table) {
-    return NS_OK;
-  }
-
-  nsCOMPtr<nsIDOMHTMLCollection> rows;
-  table->GetRows(getter_AddRefs(rows));
-
-  nsCOMPtr<nsIHTMLCollection> coll = do_QueryInterface(rows);
-  uint32_t numRows = coll->Length();
-
-  for (uint32_t i = 0; i < numRows; i++) {
-    if (coll->GetElementAt(i) == this) {
-      *aValue = i;
-      break;
-    }
-  }
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsHTMLTableRowElement::GetSectionRowIndex(int32_t* aValue)
-{
-  *aValue = -1;
-  nsCOMPtr<nsIDOMHTMLTableSectionElement> section = GetSection();
-  if (!section) {
-    return NS_OK;
-  }
-
-  nsCOMPtr<nsIDOMHTMLCollection> rows;
-  section->GetRows(getter_AddRefs(rows));
-
-  nsCOMPtr<nsIHTMLCollection> coll = do_QueryInterface(rows);
-  uint32_t numRows = coll->Length();
-  for (uint32_t i = 0; i < numRows; i++) {
-    if (coll->GetElementAt(i) == this) {
-      *aValue = i;
-      break;
-    }
-  }
-
-  return NS_OK;
-}
-
-static bool
-IsCell(nsIContent *aContent, int32_t aNamespaceID,
-       nsIAtom* aAtom, void *aData)
-{
-  nsIAtom* tag = aContent->Tag();
-
-  return ((tag == nsGkAtoms::td || tag == nsGkAtoms::th) &&
-          aContent->IsHTML());
-}
-
-NS_IMETHODIMP
-nsHTMLTableRowElement::GetCells(nsIDOMHTMLCollection** aValue)
-{
-  if (!mCells) {
-    mCells = new nsContentList(this,
-                               IsCell,
-                               nullptr, // destroy func
-                               nullptr, // closure data
-                               false,
-                               nullptr,
-                               kNameSpaceID_XHTML,
-                               false);
-  }
-
-  NS_ADDREF(*aValue = mCells);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsHTMLTableRowElement::InsertCell(int32_t aIndex, nsIDOMHTMLElement** aValue)
-{
-  *aValue = nullptr;
-
-  if (aIndex < -1) {
-    return NS_ERROR_DOM_INDEX_SIZE_ERR;
-  }
-
-  // Make sure mCells is initialized.
-  nsCOMPtr<nsIDOMHTMLCollection> cells;
-  nsresult rv = GetCells(getter_AddRefs(cells));
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-
-  NS_ASSERTION(mCells, "How did that happen?");
+} // namespace dom
+} // namespace mozilla
 
-  nsCOMPtr<nsIDOMNode> nextSibling;
-  // -1 means append, so should use null nextSibling
-  if (aIndex != -1) {
-    cells->Item(aIndex, getter_AddRefs(nextSibling));
-    // Check whether we're inserting past end of list.  We want to avoid doing
-    // this unless we really have to, since this has to walk all our kids.  If
-    // we have a nextSibling, we're clearly not past end of list.
-    if (!nextSibling) {
-      uint32_t cellCount;
-      cells->GetLength(&cellCount);
-      if (aIndex > int32_t(cellCount)) {
-        return NS_ERROR_DOM_INDEX_SIZE_ERR;
-      }
-    }
-  }
-
-  // create the cell
-  nsCOMPtr<nsINodeInfo> nodeInfo;
-  nsContentUtils::NameChanged(mNodeInfo, nsGkAtoms::td,
-                              getter_AddRefs(nodeInfo));
-
-  nsCOMPtr<nsIContent> cellContent = NS_NewHTMLTableCellElement(nodeInfo.forget());
-  if (!cellContent) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
-  nsCOMPtr<nsIDOMNode> cellNode(do_QueryInterface(cellContent));
-  NS_ASSERTION(cellNode, "Should implement nsIDOMNode!");
-
-  nsCOMPtr<nsIDOMNode> retChild;
-  InsertBefore(cellNode, nextSibling, getter_AddRefs(retChild));
-
-  if (retChild) {
-    CallQueryInterface(retChild, aValue);
-  }
-
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP
-nsHTMLTableRowElement::DeleteCell(int32_t aValue)
-{
-  if (aValue < -1) {
-    return NS_ERROR_DOM_INDEX_SIZE_ERR;
-  }
-
-  nsCOMPtr<nsIDOMHTMLCollection> cells;
-  GetCells(getter_AddRefs(cells));
-
-  nsresult rv;
-  uint32_t refIndex;
-  if (aValue == -1) {
-    rv = cells->GetLength(&refIndex);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    if (refIndex == 0) {
-      return NS_OK;
-    }
-
-    --refIndex;
-  }
-  else {
-    refIndex = (uint32_t)aValue;
-  }
-
-  nsCOMPtr<nsIDOMNode> cell;
-  rv = cells->Item(refIndex, getter_AddRefs(cell));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!cell) {
-    return NS_ERROR_DOM_INDEX_SIZE_ERR;
-  }
-
-  nsCOMPtr<nsIDOMNode> retChild;
-  return RemoveChild(cell, getter_AddRefs(retChild));
-}
-
-NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, Align, align)
-NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, BgColor, bgcolor)
-NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, Ch, _char)
-NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, ChOff, charoff)
-NS_IMPL_STRING_ATTR(nsHTMLTableRowElement, VAlign, valign)
-
-
-bool
-nsHTMLTableRowElement::ParseAttribute(int32_t aNamespaceID,
-                                      nsIAtom* aAttribute,
-                                      const nsAString& aValue,
-                                      nsAttrValue& aResult)
-{
-  /*
-   * ignore these attributes, stored simply as strings
-   *
-   * ch
-   */
-
-  if (aNamespaceID == kNameSpaceID_None) {
-    if (aAttribute == nsGkAtoms::charoff) {
-      return aResult.ParseIntWithBounds(aValue, 0);
-    }
-    if (aAttribute == nsGkAtoms::height) {
-      return aResult.ParseSpecialIntValue(aValue);
-    }
-    if (aAttribute == nsGkAtoms::width) {
-      return aResult.ParseSpecialIntValue(aValue);
-    }
-    if (aAttribute == nsGkAtoms::align) {
-      return ParseTableCellHAlignValue(aValue, aResult);
-    }
-    if (aAttribute == nsGkAtoms::bgcolor) {
-      return aResult.ParseColor(aValue);
-    }
-    if (aAttribute == nsGkAtoms::valign) {
-      return ParseTableVAlignValue(aValue, aResult);
-    }
-  }
-
-  return nsGenericHTMLElement::ParseBackgroundAttribute(aNamespaceID,
-                                                        aAttribute, aValue,
-                                                        aResult) ||
-         nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
-                                              aResult);
-}
-
-static 
-void MapAttributesIntoRule(const nsMappedAttributes* aAttributes, nsRuleData* aData)
-{
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Position)) {
-    // height: value
-    nsCSSValue* height = aData->ValueForHeight();
-    if (height->GetUnit() == eCSSUnit_Null) {
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::height);
-      if (value && value->Type() == nsAttrValue::eInteger)
-        height->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
-      else if (value && value->Type() == nsAttrValue::ePercent)
-        height->SetPercentValue(value->GetPercentValue());
-    }
-  }
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Text)) {
-    nsCSSValue* textAlign = aData->ValueForTextAlign();
-    if (textAlign->GetUnit() == eCSSUnit_Null) {
-      // align: enum
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
-      if (value && value->Type() == nsAttrValue::eEnum)
-        textAlign->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
-    }
-  }
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(TextReset)) {
-    nsCSSValue* verticalAlign = aData->ValueForVerticalAlign();
-    if (verticalAlign->GetUnit() == eCSSUnit_Null) {
-      // valign: enum
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::valign);
-      if (value && value->Type() == nsAttrValue::eEnum)
-        verticalAlign->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
-    }
-  }
-
-  nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
-  nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
-}
-
-NS_IMETHODIMP_(bool)
-nsHTMLTableRowElement::IsAttributeMapped(const nsIAtom* aAttribute) const
-{
-  static const MappedAttributeEntry attributes[] = {
-    { &nsGkAtoms::align },
-    { &nsGkAtoms::valign }, 
-    { &nsGkAtoms::height },
-    { nullptr }
-  };
-
-  static const MappedAttributeEntry* const map[] = {
-    attributes,
-    sCommonAttributeMap,
-    sBackgroundAttributeMap,
-  };
-
-  return FindAttributeDependence(aAttribute, map);
-}
-
-nsMapRuleToAttributesFunc
-nsHTMLTableRowElement::GetAttributeMappingFunction() const
-{
-  return &MapAttributesIntoRule;
-}
+#endif /* mozilla_dom_HTMLTableRowElement_h */
rename from content/html/content/src/nsHTMLTableSectionElement.cpp
rename to content/html/content/src/HTMLTableSectionElement.cpp
--- a/content/html/content/src/nsHTMLTableSectionElement.cpp
+++ b/content/html/content/src/HTMLTableSectionElement.cpp
@@ -1,131 +1,85 @@
 /* -*- 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 "nsIDOMHTMLTableSectionElem.h"
-#include "nsIDOMEventTarget.h"
+#include "mozilla/dom/HTMLTableSectionElement.h"
 #include "nsMappedAttributes.h"
-#include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsGkAtoms.h"
 #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;
+NS_IMPL_NS_NEW_HTML_ELEMENT(TableSection)
+DOMCI_NODE_DATA(HTMLTableSectionElement, mozilla::dom::HTMLTableSectionElement)
+
+namespace mozilla {
+namespace dom {
 
 // you will see the phrases "rowgroup" and "section" used interchangably
 
-class nsHTMLTableSectionElement : public nsGenericHTMLElement,
-                                  public nsIDOMHTMLTableSectionElement
-{
-public:
-  nsHTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo);
-
-  // nsISupports
-  NS_DECL_ISUPPORTS_INHERITED
-
-  // nsIDOMNode
-  NS_FORWARD_NSIDOMNODE_TO_NSINODE
-
-  // nsIDOMElement
-  NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
-
-  // nsIDOMHTMLElement
-  NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
-
-  // nsIDOMHTMLTableSectionElement
-  NS_DECL_NSIDOMHTMLTABLESECTIONELEMENT
-
-  virtual bool ParseAttribute(int32_t aNamespaceID,
-                              nsIAtom* aAttribute,
-                              const nsAString& aValue,
-                              nsAttrValue& aResult);
-  virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
-  NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
-
-  virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
-
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLTableSectionElement,
-                                                     nsGenericHTMLElement)
-
-  virtual nsXPCClassInfo* GetClassInfo();
-
-  virtual nsIDOMNode* AsDOMNode() { return this; }
-protected:
-  nsRefPtr<nsContentList> mRows;
-};
-
-
-NS_IMPL_NS_NEW_HTML_ELEMENT(TableSection)
-
-
-nsHTMLTableSectionElement::nsHTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
+HTMLTableSectionElement::HTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
   : nsGenericHTMLElement(aNodeInfo)
 {
 }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLTableSectionElement)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLTableSectionElement,
+NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLTableSectionElement)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLTableSectionElement,
                                                   nsGenericHTMLElement)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRows)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-NS_IMPL_ADDREF_INHERITED(nsHTMLTableSectionElement, Element)
-NS_IMPL_RELEASE_INHERITED(nsHTMLTableSectionElement, Element)
-
-
-DOMCI_NODE_DATA(HTMLTableSectionElement, nsHTMLTableSectionElement)
+NS_IMPL_ADDREF_INHERITED(HTMLTableSectionElement, Element)
+NS_IMPL_RELEASE_INHERITED(HTMLTableSectionElement, Element)
 
-// QueryInterface implementation for nsHTMLTableSectionElement
-NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLTableSectionElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLTableSectionElement,
+// QueryInterface implementation for HTMLTableSectionElement
+NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLTableSectionElement)
+  NS_HTML_CONTENT_INTERFACE_TABLE1(HTMLTableSectionElement,
                                    nsIDOMHTMLTableSectionElement)
-  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLTableSectionElement,
+  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLTableSectionElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTableSectionElement)
 
 
-NS_IMPL_ELEMENT_CLONE(nsHTMLTableSectionElement)
+NS_IMPL_ELEMENT_CLONE(HTMLTableSectionElement)
 
 
-NS_IMPL_STRING_ATTR(nsHTMLTableSectionElement, Align, align)
-NS_IMPL_STRING_ATTR(nsHTMLTableSectionElement, VAlign, valign)
-NS_IMPL_STRING_ATTR(nsHTMLTableSectionElement, Ch, _char)
-NS_IMPL_STRING_ATTR(nsHTMLTableSectionElement, ChOff, charoff)
+NS_IMPL_STRING_ATTR(HTMLTableSectionElement, Align, align)
+NS_IMPL_STRING_ATTR(HTMLTableSectionElement, VAlign, valign)
+NS_IMPL_STRING_ATTR(HTMLTableSectionElement, Ch, _char)
+NS_IMPL_STRING_ATTR(HTMLTableSectionElement, ChOff, charoff)
 
 
 NS_IMETHODIMP
-nsHTMLTableSectionElement::GetRows(nsIDOMHTMLCollection** aValue)
+HTMLTableSectionElement::GetRows(nsIDOMHTMLCollection** aValue)
 {
   if (!mRows) {
     mRows = new nsContentList(this,
                               mNodeInfo->NamespaceID(),
                               nsGkAtoms::tr,
                               nsGkAtoms::tr,
                               false);
   }
 
   NS_ADDREF(*aValue = mRows);
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
-nsHTMLTableSectionElement::InsertRow(int32_t aIndex,
-                                     nsIDOMHTMLElement** aValue)
+HTMLTableSectionElement::InsertRow(int32_t aIndex,
+                                   nsIDOMHTMLElement** aValue)
 {
   *aValue = nullptr;
 
   if (aIndex < -1) {
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
   }
 
   nsCOMPtr<nsIDOMHTMLCollection> rows;
@@ -170,17 +124,17 @@ nsHTMLTableSectionElement::InsertRow(int
   if (retChild) {
     CallQueryInterface(retChild, aValue);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsHTMLTableSectionElement::DeleteRow(int32_t aValue)
+HTMLTableSectionElement::DeleteRow(int32_t aValue)
 {
   if (aValue < -1) {
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
   }
 
   nsCOMPtr<nsIDOMHTMLCollection> rows;
   GetRows(getter_AddRefs(rows));
 
@@ -208,20 +162,20 @@ nsHTMLTableSectionElement::DeleteRow(int
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
   }
 
   nsCOMPtr<nsIDOMNode> retChild;
   return RemoveChild(row, getter_AddRefs(retChild));
 }
 
 bool
-nsHTMLTableSectionElement::ParseAttribute(int32_t aNamespaceID,
-                                          nsIAtom* aAttribute,
-                                          const nsAString& aValue,
-                                          nsAttrValue& aResult)
+HTMLTableSectionElement::ParseAttribute(int32_t aNamespaceID,
+                                        nsIAtom* aAttribute,
+                                        const nsAString& aValue,
+                                        nsAttrValue& aResult)
 {
   if (aNamespaceID == kNameSpaceID_None) {
     /* ignore these attributes, stored simply as strings
        ch
     */
     if (aAttribute == nsGkAtoms::charoff) {
       return aResult.ParseIntWithBounds(aValue, 0);
     }
@@ -277,17 +231,17 @@ void MapAttributesIntoRule(const nsMappe
     }
   }
 
   nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
 NS_IMETHODIMP_(bool)
-nsHTMLTableSectionElement::IsAttributeMapped(const nsIAtom* aAttribute) const
+HTMLTableSectionElement::IsAttributeMapped(const nsIAtom* aAttribute) const
 {
   static const MappedAttributeEntry attributes[] = {
     { &nsGkAtoms::align }, 
     { &nsGkAtoms::valign },
     { &nsGkAtoms::height },
     { nullptr }
   };
 
@@ -297,12 +251,15 @@ nsHTMLTableSectionElement::IsAttributeMa
     sBackgroundAttributeMap,
   };
 
   return FindAttributeDependence(aAttribute, map);
 }
 
 
 nsMapRuleToAttributesFunc
-nsHTMLTableSectionElement::GetAttributeMappingFunction() const
+HTMLTableSectionElement::GetAttributeMappingFunction() const
 {
   return &MapAttributesIntoRule;
 }
+
+} // namespace dom
+} // namespace mozilla
copy from content/html/content/src/nsHTMLTableSectionElement.cpp
copy to content/html/content/src/HTMLTableSectionElement.h
--- a/content/html/content/src/nsHTMLTableSectionElement.cpp
+++ b/content/html/content/src/HTMLTableSectionElement.h
@@ -1,38 +1,26 @@
 /* -*- 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"
+#ifndef mozilla_dom_HTMLTableSectionElement_h
+#define mozilla_dom_HTMLTableSectionElement_h
 
-#include "nsIDOMHTMLTableSectionElem.h"
-#include "nsIDOMEventTarget.h"
-#include "nsMappedAttributes.h"
 #include "nsGenericHTMLElement.h"
-#include "nsAttrValueInlines.h"
-#include "nsGkAtoms.h"
-#include "nsHTMLParts.h"
-#include "nsStyleConsts.h"
-#include "nsContentList.h"
-#include "nsRuleData.h"
-#include "nsError.h"
-#include "nsContentUtils.h"
+#include "nsIDOMHTMLTableSectionElem.h"
 
-using namespace mozilla;
-using namespace mozilla::dom;
+namespace mozilla {
+namespace dom {
 
-// you will see the phrases "rowgroup" and "section" used interchangably
-
-class nsHTMLTableSectionElement : public nsGenericHTMLElement,
-                                  public nsIDOMHTMLTableSectionElement
+class HTMLTableSectionElement : public nsGenericHTMLElement,
+                                public nsIDOMHTMLTableSectionElement
 {
 public:
-  nsHTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo);
+  HTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
 
   // nsIDOMElement
@@ -48,261 +36,22 @@ public:
                               nsIAtom* aAttribute,
                               const nsAString& aValue,
                               nsAttrValue& aResult);
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
   NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLTableSectionElement,
+  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(HTMLTableSectionElement,
                                                      nsGenericHTMLElement)
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 protected:
   nsRefPtr<nsContentList> mRows;
 };
 
-
-NS_IMPL_NS_NEW_HTML_ELEMENT(TableSection)
-
-
-nsHTMLTableSectionElement::nsHTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsGenericHTMLElement(aNodeInfo)
-{
-}
-
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsHTMLTableSectionElement)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLTableSectionElement,
-                                                  nsGenericHTMLElement)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRows)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
-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)
-  NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLTableSectionElement,
-                                               nsGenericHTMLElement)
-NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTableSectionElement)
-
-
-NS_IMPL_ELEMENT_CLONE(nsHTMLTableSectionElement)
-
-
-NS_IMPL_STRING_ATTR(nsHTMLTableSectionElement, Align, align)
-NS_IMPL_STRING_ATTR(nsHTMLTableSectionElement, VAlign, valign)
-NS_IMPL_STRING_ATTR(nsHTMLTableSectionElement, Ch, _char)
-NS_IMPL_STRING_ATTR(nsHTMLTableSectionElement, ChOff, charoff)
-
-
-NS_IMETHODIMP
-nsHTMLTableSectionElement::GetRows(nsIDOMHTMLCollection** aValue)
-{
-  if (!mRows) {
-    mRows = new nsContentList(this,
-                              mNodeInfo->NamespaceID(),
-                              nsGkAtoms::tr,
-                              nsGkAtoms::tr,
-                              false);
-  }
-
-  NS_ADDREF(*aValue = mRows);
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP
-nsHTMLTableSectionElement::InsertRow(int32_t aIndex,
-                                     nsIDOMHTMLElement** aValue)
-{
-  *aValue = nullptr;
-
-  if (aIndex < -1) {
-    return NS_ERROR_DOM_INDEX_SIZE_ERR;
-  }
-
-  nsCOMPtr<nsIDOMHTMLCollection> rows;
-  GetRows(getter_AddRefs(rows));
-
-  uint32_t rowCount;
-  rows->GetLength(&rowCount);
-
-  if (aIndex > (int32_t)rowCount) {
-    return NS_ERROR_DOM_INDEX_SIZE_ERR;
-  }
-
-  bool doInsert = (aIndex < int32_t(rowCount)) && (aIndex != -1);
-
-  // create the row
-  nsCOMPtr<nsINodeInfo> nodeInfo;
-  nsContentUtils::NameChanged(mNodeInfo, nsGkAtoms::tr,
-                              getter_AddRefs(nodeInfo));
-
-  nsCOMPtr<nsIContent> rowContent = NS_NewHTMLTableRowElement(nodeInfo.forget());
-  if (!rowContent) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
-  nsCOMPtr<nsIDOMNode> rowNode(do_QueryInterface(rowContent));
-  NS_ASSERTION(rowNode, "Should implement nsIDOMNode!");
-
-  nsCOMPtr<nsIDOMNode> retChild;
-
-  nsresult rv;
-  if (doInsert) {
-    nsCOMPtr<nsIDOMNode> refRow;
-    rows->Item(aIndex, getter_AddRefs(refRow));
-
-    rv = InsertBefore(rowNode, refRow, getter_AddRefs(retChild));
-    NS_ENSURE_SUCCESS(rv, rv);
-  } else {
-    rv = AppendChild(rowNode, getter_AddRefs(retChild));
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
-  if (retChild) {
-    CallQueryInterface(retChild, aValue);
-  }
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsHTMLTableSectionElement::DeleteRow(int32_t aValue)
-{
-  if (aValue < -1) {
-    return NS_ERROR_DOM_INDEX_SIZE_ERR;
-  }
-
-  nsCOMPtr<nsIDOMHTMLCollection> rows;
-  GetRows(getter_AddRefs(rows));
+} // namespace dom
+} // namespace mozilla
 
-  nsresult rv;
-  uint32_t refIndex;
-  if (aValue == -1) {
-    rv = rows->GetLength(&refIndex);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    if (refIndex == 0) {
-      return NS_OK;
-    }
-
-    --refIndex;
-  }
-  else {
-    refIndex = (uint32_t)aValue;
-  }
-
-  nsCOMPtr<nsIDOMNode> row;
-  rv = rows->Item(refIndex, getter_AddRefs(row));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!row) {
-    return NS_ERROR_DOM_INDEX_SIZE_ERR;
-  }
-
-  nsCOMPtr<nsIDOMNode> retChild;
-  return RemoveChild(row, getter_AddRefs(retChild));
-}
-
-bool
-nsHTMLTableSectionElement::ParseAttribute(int32_t aNamespaceID,
-                                          nsIAtom* aAttribute,
-                                          const nsAString& aValue,
-                                          nsAttrValue& aResult)
-{
-  if (aNamespaceID == kNameSpaceID_None) {
-    /* ignore these attributes, stored simply as strings
-       ch
-    */
-    if (aAttribute == nsGkAtoms::charoff) {
-      return aResult.ParseIntWithBounds(aValue, 0);
-    }
-    if (aAttribute == nsGkAtoms::height) {
-      return aResult.ParseSpecialIntValue(aValue);
-    }
-    if (aAttribute == nsGkAtoms::align) {
-      return ParseTableCellHAlignValue(aValue, aResult);
-    }
-    if (aAttribute == nsGkAtoms::bgcolor) {
-      return aResult.ParseColor(aValue);
-    }
-    if (aAttribute == nsGkAtoms::valign) {
-      return ParseTableVAlignValue(aValue, aResult);
-    }
-  }
-
-  return nsGenericHTMLElement::ParseBackgroundAttribute(aNamespaceID,
-                                                        aAttribute, aValue,
-                                                        aResult) ||
-         nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
-                                              aResult);
-}
-
-static 
-void MapAttributesIntoRule(const nsMappedAttributes* aAttributes, nsRuleData* aData)
-{
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Position)) {
-    // height: value
-    nsCSSValue* height = aData->ValueForHeight();
-    if (height->GetUnit() == eCSSUnit_Null) {
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::height);
-      if (value && value->Type() == nsAttrValue::eInteger)
-        height->SetFloatValue((float)value->GetIntegerValue(), eCSSUnit_Pixel);
-    }
-  }
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Text)) {
-    nsCSSValue* textAlign = aData->ValueForTextAlign();
-    if (textAlign->GetUnit() == eCSSUnit_Null) {
-      // align: enum
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
-      if (value && value->Type() == nsAttrValue::eEnum)
-        textAlign->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
-    }
-  }
-  if (aData->mSIDs & NS_STYLE_INHERIT_BIT(TextReset)) {
-    nsCSSValue* verticalAlign = aData->ValueForVerticalAlign();
-    if (verticalAlign->GetUnit() == eCSSUnit_Null) {
-      // valign: enum
-      const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::valign);
-      if (value && value->Type() == nsAttrValue::eEnum)
-        verticalAlign->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
-    }
-  }
-
-  nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
-  nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
-}
-
-NS_IMETHODIMP_(bool)
-nsHTMLTableSectionElement::IsAttributeMapped(const nsIAtom* aAttribute) const
-{
-  static const MappedAttributeEntry attributes[] = {
-    { &nsGkAtoms::align }, 
-    { &nsGkAtoms::valign },
-    { &nsGkAtoms::height },
-    { nullptr }
-  };
-
-  static const MappedAttributeEntry* const map[] = {
-    attributes,
-    sCommonAttributeMap,
-    sBackgroundAttributeMap,
-  };
-
-  return FindAttributeDependence(aAttribute, map);
-}
-
-
-nsMapRuleToAttributesFunc
-nsHTMLTableSectionElement::GetAttributeMappingFunction() const
-{
-  return &MapAttributesIntoRule;
-}
+#endif /* mozilla_dom_HTMLTableSectionElement_h */
--- a/content/html/content/src/Makefile.in
+++ b/content/html/content/src/Makefile.in
@@ -40,16 +40,22 @@ EXPORTS_mozilla/dom = \
 		HTMLImageElement.h \
 		HTMLLabelElement.h \
 		HTMLLIElement.h \
 		HTMLParagraphElement.h \
 		HTMLPreElement.h \
 		HTMLScriptElement.h \
 		HTMLSharedListElement.h \
 		HTMLSpanElement.h \
+		HTMLTableCaptionElement.h \
+		HTMLTableCellElement.h \
+		HTMLTableColElement.h \
+		HTMLTableElement.h \
+		HTMLTableRowElement.h \
+		HTMLTableSectionElement.h \
 		HTMLTitleElement.h \
 		HTMLUnknownElement.h \
 		UndoManager.h \
 		$(NULL)
 
 CPPSRCS		= \
 		HTMLPropertiesCollection.cpp \
 		nsClientRect.cpp \
@@ -96,22 +102,22 @@ CPPSRCS		= \
 		HTMLPreElement.cpp \
 		nsHTMLProgressElement.cpp \
 		HTMLScriptElement.cpp \
 		nsHTMLSelectElement.cpp \
 		nsHTMLSharedElement.cpp \
 		HTMLSpanElement.cpp \
 		HTMLSharedListElement.cpp \
 		nsHTMLStyleElement.cpp \
-		nsHTMLTableElement.cpp \
-		nsHTMLTableCaptionElement.cpp \
-		nsHTMLTableCellElement.cpp \
-		nsHTMLTableColElement.cpp \
-		nsHTMLTableRowElement.cpp \
-		nsHTMLTableSectionElement.cpp \
+		HTMLTableElement.cpp \
+		HTMLTableCaptionElement.cpp \
+		HTMLTableCellElement.cpp \
+		HTMLTableColElement.cpp \
+		HTMLTableRowElement.cpp \
+		HTMLTableSectionElement.cpp \
 		nsHTMLTextAreaElement.cpp \
 		HTMLTitleElement.cpp \
 		HTMLUnknownElement.cpp \
 		nsDOMValidityState.cpp \
 		nsIConstraintValidation.cpp \
 		nsRadioVisitor.cpp \
 		nsDOMStringMap.cpp \
 		UndoManager.cpp \