Fix for bug 824907 (Convert HTML table elements to WebIDL) - convert HTMLTableSectionElement to WebIDL. r=bz.
authorPeter Van der Beken <peterv@propagandism.org>
Sat, 29 Dec 2012 15:07:48 +0100
changeset 117746 a4ef9c24dd5b55d29789cebe3a7126fb52b8cfb6
parent 117745 7564aeb63a36912dc58cbdad0073c4ffbacd597f
child 117747 42f91a4781c1acf8d1f24a10c2d412c6197e6cd6
push id24110
push userphilringnalda@gmail.com
push dateSat, 05 Jan 2013 23:57:49 +0000
treeherdermozilla-central@20d1a5916ef6 [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) - convert HTMLTableSectionElement to WebIDL. r=bz.
accessible/src/html/HTMLTableAccessible.cpp
browser/devtools/debugger/test/browser_dbg_propertyview-filter-05.js
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/test/reflect.js
dom/base/nsDOMClassInfo.cpp
dom/bindings/Bindings.conf
dom/interfaces/html/Makefile.in
dom/interfaces/html/nsIDOMHTMLTableSectionElem.idl
dom/interfaces/html/nsIDOMHTMLTableSectionElement.idl
dom/webidl/HTMLTableElement.webidl
dom/webidl/HTMLTableSectionElement.webidl
dom/webidl/WebIDL.mk
js/xpconnect/src/dom_quickstubs.qsconf
--- a/accessible/src/html/HTMLTableAccessible.cpp
+++ b/accessible/src/html/HTMLTableAccessible.cpp
@@ -23,17 +23,17 @@
 #include "nsIDOMRange.h"
 #include "nsISelectionPrivate.h"
 #include "nsINameSpaceManager.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMHTMLCollection.h"
 #include "nsIDOMHTMLTableCellElement.h"
 #include "nsIDOMHTMLTableElement.h"
 #include "nsIDOMHTMLTableRowElement.h"
-#include "nsIDOMHTMLTableSectionElem.h"
+#include "nsIDOMHTMLTableSectionElement.h"
 #include "nsIDocument.h"
 #include "nsIMutableArray.h"
 #include "nsIPresShell.h"
 #include "nsITableCellLayout.h"
 #include "nsFrameSelection.h"
 #include "nsError.h"
 #include "nsArrayUtils.h"
 #include "nsComponentManagerUtils.h"
--- a/browser/devtools/debugger/test/browser_dbg_propertyview-filter-05.js
+++ b/browser/devtools/debugger/test/browser_dbg_propertyview-filter-05.js
@@ -40,18 +40,18 @@ function testVariablesFiltering()
     is(innerScope.querySelectorAll(".variable:not([non-match])").length, 1,
       "There should be 1 variable displayed in the inner scope");
     is(mathScope.querySelectorAll(".variable:not([non-match])").length, 0,
       "There should be 0 variables displayed in the math scope");
     is(testScope.querySelectorAll(".variable:not([non-match])").length, 0,
       "There should be 0 variables displayed in the test scope");
     is(loadScope.querySelectorAll(".variable:not([non-match])").length, 1,
       "There should be 1 variable displayed in the load scope");
-    is(globalScope.querySelectorAll(".variable:not([non-match])").length, 4,
-      "There should be 4 variables displayed in the global scope");
+    is(globalScope.querySelectorAll(".variable:not([non-match])").length, 5,
+      "There should be 5 variables displayed in the global scope");
 
     is(innerScope.querySelectorAll(".property:not([non-match])").length, 0,
       "There should be 0 properties displayed in the inner scope");
     is(mathScope.querySelectorAll(".property:not([non-match])").length, 0,
       "There should be 0 properties displayed in the math scope");
     is(testScope.querySelectorAll(".property:not([non-match])").length, 0,
       "There should be 0 properties displayed in the test scope");
     is(loadScope.querySelectorAll(".property:not([non-match])").length, 0,
--- a/content/html/content/src/HTMLTableElement.cpp
+++ b/content/html/content/src/HTMLTableElement.cpp
@@ -1,17 +1,17 @@
 /* -*- 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/HTMLTableElement.h"
-#include "nsIDOMHTMLTableSectionElem.h"
+#include "nsIDOMHTMLTableSectionElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsRuleData.h"
 #include "nsHTMLStyleSheet.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/HTMLCollectionBinding.h"
 #include "mozilla/dom/HTMLTableElementBinding.h"
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Table)
@@ -112,44 +112,44 @@ NS_INTERFACE_MAP_END
 // rowgroup's rows will be in the nsIDOMHTMLCollection* named "rows".  Note
 // that this may be null at any time.  This macro assumes an nsresult named
 // |rv| is in scope.
 #define DO_FOR_EACH_ROWGROUP(_code)                                  \
   do {                                                               \
     if (mParent) {                                                   \
       /* THead */                                                    \
       HTMLTableSectionElement* rowGroup = mParent->GetTHead();       \
-      nsCOMPtr<nsIDOMHTMLCollection> rows;                           \
+      nsIHTMLCollection* rows;                                       \
       if (rowGroup) {                                                \
-        rowGroup->GetRows(getter_AddRefs(rows));                     \
+        rows = rowGroup->Rows();                                     \
         do { /* gives scoping */                                     \
           _code                                                      \
         } while (0);                                                 \
       }                                                              \
       /* TBodies */                                                  \
       for (nsIContent* _node = mParent->nsINode::GetFirstChild();    \
            _node; _node = _node->GetNextSibling()) {                 \
         if (_node->IsHTML(nsGkAtoms::tbody)) {                       \
           rowGroup = static_cast<HTMLTableSectionElement*>(_node);   \
-          rowGroup->GetRows(getter_AddRefs(rows));                   \
+          rows = rowGroup->Rows();                                   \
           do { /* gives scoping */                                   \
             _code                                                    \
           } while (0);                                               \
         }                                                            \
       }                                                              \
       /* orphan rows */                                              \
       rows = mOrphanRows;                                            \
       do { /* gives scoping */                                       \
         _code                                                        \
       } while (0);                                                   \
       /* TFoot */                                                    \
       rowGroup = mParent->GetTFoot();                                \
-      rows = nullptr;                                                 \
+      rows = nullptr;                                                \
       if (rowGroup) {                                                \
-        rowGroup->GetRows(getter_AddRefs(rows));                     \
+        rows = rowGroup->Rows();                                     \
         do { /* gives scoping */                                     \
           _code                                                      \
         } while (0);                                                 \
       }                                                              \
     }                                                                \
   } while (0)
 
 static uint32_t
@@ -535,34 +535,38 @@ HTMLTableElement::GetTHead(nsIDOMHTMLTab
   NS_IF_ADDREF(*aValue = GetTHead());
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLTableElement::SetTHead(nsIDOMHTMLTableSectionElement* aValue)
 {
+  HTMLTableSectionElement* section =
+    static_cast<HTMLTableSectionElement*>(aValue);
   ErrorResult rv;
-  SetTHead(aValue, rv);
+  SetTHead(section, rv);
   return rv.ErrorCode();
 }
 
 NS_IMETHODIMP
 HTMLTableElement::GetTFoot(nsIDOMHTMLTableSectionElement** aValue)
 {
   NS_IF_ADDREF(*aValue = GetTFoot());
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLTableElement::SetTFoot(nsIDOMHTMLTableSectionElement* aValue)
 {
+  HTMLTableSectionElement* section =
+    static_cast<HTMLTableSectionElement*>(aValue);
   ErrorResult rv;
-  SetTFoot(aValue, rv);
+  SetTFoot(section, rv);
   return rv.ErrorCode();
 }
 
 NS_IMETHODIMP
 HTMLTableElement::GetRows(nsIDOMHTMLCollection** aValue)
 {
   NS_ADDREF(*aValue = Rows());
   return NS_OK;
@@ -816,21 +820,18 @@ HTMLTableElement::InsertRow(int32_t aInd
       nsCOMPtr<nsINodeInfo> nodeInfo;
       nsContentUtils::NameChanged(mNodeInfo, nsGkAtoms::tr,
                                   getter_AddRefs(nodeInfo));
 
       newRow = NS_NewHTMLTableRowElement(nodeInfo.forget());
       if (newRow) {
         HTMLTableSectionElement* section =
           static_cast<HTMLTableSectionElement*>(rowGroup.get());
-        nsCOMPtr<nsIDOMHTMLCollection> rows;
-        section->GetRows(getter_AddRefs(rows));
-        rowGroup->InsertBefore(*newRow,
-                               static_cast<nsIHTMLCollection*>(rows.get())->Item(0),
-                               aError);
+        nsIHTMLCollection* rows = section->Rows();
+        rowGroup->InsertBefore(*newRow, rows->Item(0), aError);
       }
     }
   }
 
   return newRow.forget();
 }
 
 NS_IMETHODIMP
--- a/content/html/content/src/HTMLTableElement.h
+++ b/content/html/content/src/HTMLTableElement.h
@@ -53,50 +53,44 @@ public:
     }
   }
   already_AddRefed<nsGenericHTMLElement> CreateCaption();
 
   HTMLTableSectionElement* GetTHead() const
   {
     return static_cast<HTMLTableSectionElement*>(GetChild(nsGkAtoms::thead));
   }
-  void SetTHead(nsIDOMHTMLTableSectionElement* aTHead, ErrorResult& aError)
+  void SetTHead(HTMLTableSectionElement* aTHead, ErrorResult& aError)
   {
-    nsCOMPtr<nsIContent> content = do_QueryInterface(aTHead);
-    if (!content || !content->IsHTML(nsGkAtoms::thead)) {
+    if (!aTHead->IsHTML(nsGkAtoms::thead)) {
       aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
       return;
     }
-    HTMLTableSectionElement* thead =
-      static_cast<HTMLTableSectionElement*>(aTHead);
 
     DeleteTHead();
-    if (thead) {
-      nsINode::InsertBefore(*thead, nsINode::GetFirstChild(), aError);
+    if (aTHead) {
+      nsINode::InsertBefore(*aTHead, nsINode::GetFirstChild(), aError);
     }
   }
   already_AddRefed<nsGenericHTMLElement> CreateTHead();
 
   HTMLTableSectionElement* GetTFoot() const
   {
     return static_cast<HTMLTableSectionElement*>(GetChild(nsGkAtoms::tfoot));
   }
-  void SetTFoot(nsIDOMHTMLTableSectionElement* aTFoot, ErrorResult& aError)
+  void SetTFoot(HTMLTableSectionElement* aTFoot, ErrorResult& aError)
   {
-    nsCOMPtr<nsIContent> content = do_QueryInterface(aTFoot);
-    if (!content || !content->IsHTML(nsGkAtoms::tfoot)) {
+    if (!aTFoot->IsHTML(nsGkAtoms::tfoot)) {
       aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
       return;
     }
-    HTMLTableSectionElement* tfoot =
-      static_cast<HTMLTableSectionElement*>(aTFoot);
 
     DeleteTFoot();
-    if (tfoot) {
-      nsINode::AppendChild(*tfoot, aError);
+    if (aTFoot) {
+      nsINode::AppendChild(*aTFoot, aError);
     }
   }
   already_AddRefed<nsGenericHTMLElement> CreateTFoot();
 
   nsIHTMLCollection* TBodies();
   nsIHTMLCollection* Rows();
 
   already_AddRefed<nsGenericHTMLElement> InsertRow(int32_t aIndex,
--- a/content/html/content/src/HTMLTableRowElement.cpp
+++ b/content/html/content/src/HTMLTableRowElement.cpp
@@ -2,17 +2,17 @@
 /* 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/HTMLTableRowElement.h"
 #include "nsIDOMHTMLTableElement.h"
-#include "nsIDOMHTMLTableSectionElem.h"
+#include "nsIDOMHTMLTableSectionElement.h"
 #include "nsIDOMHTMLTableCellElement.h"
 #include "nsMappedAttributes.h"
 #include "nsAttrValueInlines.h"
 #include "nsContentList.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsHTMLParts.h"
 #include "nsRuleData.h"
--- a/content/html/content/src/HTMLTableSectionElement.cpp
+++ b/content/html/content/src/HTMLTableSectionElement.cpp
@@ -3,35 +3,33 @@
  * 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/HTMLTableSectionElement.h"
 #include "nsMappedAttributes.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 "mozilla/dom/BindingUtils.h"
+#include "mozilla/dom/HTMLTableSectionElementBinding.h"
 
 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
 
-HTMLTableSectionElement::HTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsGenericHTMLElement(aNodeInfo)
+JSObject*
+HTMLTableSectionElement::WrapNode(JSContext *aCx, JSObject *aScope,
+                                  bool *aTriedToWrap)
 {
+  return HTMLTableSectionElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
 }
 
 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
 
@@ -44,131 +42,190 @@ NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION
                                    nsIDOMHTMLTableSectionElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLTableSectionElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTableSectionElement)
 
 
 NS_IMPL_ELEMENT_CLONE(HTMLTableSectionElement)
 
+NS_IMETHODIMP
+HTMLTableSectionElement::SetAlign(const nsAString& aAlign)
+{
+  ErrorResult rv;
+  SetAlign(aAlign, rv);
+  return rv.ErrorCode();
+}
 
-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
+HTMLTableSectionElement::GetAlign(nsAString& aAlign)
+{
+  nsString align;
+  GetAlign(align);
+  aAlign = align;
+  return NS_OK;
+}
 
+NS_IMETHODIMP
+HTMLTableSectionElement::SetVAlign(const nsAString& aVAlign)
+{
+  ErrorResult rv;
+  SetVAlign(aVAlign, rv);
+  return rv.ErrorCode();
+}
+
+NS_IMETHODIMP
+HTMLTableSectionElement::GetVAlign(nsAString& aVAlign)
+{
+  nsString vAlign;
+  GetVAlign(vAlign);
+  aVAlign = vAlign;
+  return NS_OK;
+}
 
 NS_IMETHODIMP
-HTMLTableSectionElement::GetRows(nsIDOMHTMLCollection** aValue)
+HTMLTableSectionElement::SetCh(const nsAString& aCh)
+{
+  ErrorResult rv;
+  SetCh(aCh, rv);
+  return rv.ErrorCode();
+}
+
+NS_IMETHODIMP
+HTMLTableSectionElement::GetCh(nsAString& aCh)
+{
+  nsString ch;
+  GetCh(ch);
+  aCh = ch;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HTMLTableSectionElement::SetChOff(const nsAString& aChOff)
+{
+  ErrorResult rv;
+  SetChOff(aChOff, rv);
+  return rv.ErrorCode();
+}
+
+NS_IMETHODIMP
+HTMLTableSectionElement::GetChOff(nsAString& aChOff)
+{
+  nsString chOff;
+  GetChOff(chOff);
+  aChOff = chOff;
+  return NS_OK;
+}
+
+nsIHTMLCollection*
+HTMLTableSectionElement::Rows()
 {
   if (!mRows) {
     mRows = new nsContentList(this,
                               mNodeInfo->NamespaceID(),
                               nsGkAtoms::tr,
                               nsGkAtoms::tr,
                               false);
   }
 
-  NS_ADDREF(*aValue = mRows);
+  return mRows;
+}
+
+NS_IMETHODIMP
+HTMLTableSectionElement::GetRows(nsIDOMHTMLCollection** aValue)
+{
+  NS_ADDREF(*aValue = Rows());
   return NS_OK;
 }
 
-
-NS_IMETHODIMP
-HTMLTableSectionElement::InsertRow(int32_t aIndex,
-                                   nsIDOMHTMLElement** aValue)
+already_AddRefed<nsGenericHTMLElement>
+HTMLTableSectionElement::InsertRow(int32_t aIndex, ErrorResult& aError)
 {
-  *aValue = nullptr;
-
   if (aIndex < -1) {
-    return NS_ERROR_DOM_INDEX_SIZE_ERR;
+    aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
+    return nullptr;
   }
 
-  nsCOMPtr<nsIDOMHTMLCollection> rows;
-  GetRows(getter_AddRefs(rows));
+  nsIHTMLCollection* rows = Rows();
 
-  uint32_t rowCount;
-  rows->GetLength(&rowCount);
-
+  uint32_t rowCount = rows->Length();
   if (aIndex > (int32_t)rowCount) {
-    return NS_ERROR_DOM_INDEX_SIZE_ERR;
+    aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
+    return nullptr;
   }
 
   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());
+  nsRefPtr<nsGenericHTMLElement> rowContent =
+    NS_NewHTMLTableRowElement(nodeInfo.forget());
   if (!rowContent) {
-    return NS_ERROR_OUT_OF_MEMORY;
+    aError.Throw(NS_ERROR_OUT_OF_MEMORY);
+    return nullptr;
   }
 
-  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);
+    nsINode::InsertBefore(*rowContent, rows->Item(aIndex), aError);
   } else {
-    rv = AppendChild(rowNode, getter_AddRefs(retChild));
-    NS_ENSURE_SUCCESS(rv, rv);
+    nsINode::AppendChild(*rowContent, aError);
   }
-
-  if (retChild) {
-    CallQueryInterface(retChild, aValue);
-  }
-
-  return NS_OK;
+  return rowContent.forget();
 }
 
 NS_IMETHODIMP
-HTMLTableSectionElement::DeleteRow(int32_t aValue)
+HTMLTableSectionElement::InsertRow(int32_t aIndex,
+                                   nsIDOMHTMLElement** aValue)
+{
+  ErrorResult rv;
+  nsRefPtr<nsGenericHTMLElement> row = InsertRow(aIndex, rv);
+  return rv.Failed() ? rv.ErrorCode() : CallQueryInterface(row, aValue);
+}
+
+void
+HTMLTableSectionElement::DeleteRow(int32_t aValue, ErrorResult& aError)
 {
   if (aValue < -1) {
-    return NS_ERROR_DOM_INDEX_SIZE_ERR;
+    aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
+    return;
   }
 
-  nsCOMPtr<nsIDOMHTMLCollection> rows;
-  GetRows(getter_AddRefs(rows));
+  nsIHTMLCollection* rows = Rows();
 
-  nsresult rv;
   uint32_t refIndex;
   if (aValue == -1) {
-    rv = rows->GetLength(&refIndex);
-    NS_ENSURE_SUCCESS(rv, rv);
-
+    refIndex = rows->Length();
     if (refIndex == 0) {
-      return NS_OK;
+      return;
     }
 
     --refIndex;
   }
   else {
     refIndex = (uint32_t)aValue;
   }
 
-  nsCOMPtr<nsIDOMNode> row;
-  rv = rows->Item(refIndex, getter_AddRefs(row));
-  NS_ENSURE_SUCCESS(rv, rv);
-
+  nsINode* row = rows->Item(refIndex);
   if (!row) {
-    return NS_ERROR_DOM_INDEX_SIZE_ERR;
+    aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
+    return;
   }
 
-  nsCOMPtr<nsIDOMNode> retChild;
-  return RemoveChild(row, getter_AddRefs(retChild));
+  nsINode::RemoveChild(*row, aError);
+}
+
+NS_IMETHODIMP
+HTMLTableSectionElement::DeleteRow(int32_t aValue)
+{
+  ErrorResult rv;
+  DeleteRow(aValue, rv);
+  return rv.ErrorCode();
 }
 
 bool
 HTMLTableSectionElement::ParseAttribute(int32_t aNamespaceID,
                                         nsIAtom* aAttribute,
                                         const nsAString& aValue,
                                         nsAttrValue& aResult)
 {
--- a/content/html/content/src/HTMLTableSectionElement.h
+++ b/content/html/content/src/HTMLTableSectionElement.h
@@ -1,57 +1,101 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef mozilla_dom_HTMLTableSectionElement_h
 #define mozilla_dom_HTMLTableSectionElement_h
 
 #include "nsGenericHTMLElement.h"
-#include "nsIDOMHTMLTableSectionElem.h"
+#include "nsIDOMHTMLTableSectionElement.h"
 
 namespace mozilla {
 namespace dom {
 
 class HTMLTableSectionElement : public nsGenericHTMLElement,
                                 public nsIDOMHTMLTableSectionElement
 {
 public:
-  HTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo);
+  HTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
+    : nsGenericHTMLElement(aNodeInfo)
+  {
+    SetIsDOMBinding();
+  }
 
   // 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
 
+  nsIHTMLCollection* Rows();
+  already_AddRefed<nsGenericHTMLElement>
+    InsertRow(int32_t aIndex, ErrorResult& aError);
+  void DeleteRow(int32_t aValue, ErrorResult& aError);
+
+  void GetAlign(nsString& aAlign)
+  {
+    GetHTMLAttr(nsGkAtoms::align, aAlign);
+  }
+  void SetAlign(const nsAString& aAlign, ErrorResult& aError)
+  {
+    SetHTMLAttr(nsGkAtoms::align, aAlign, aError);
+  }
+  void GetCh(nsString& aCh)
+  {
+    GetHTMLAttr(nsGkAtoms::_char, aCh);
+  }
+  void SetCh(const nsAString& aCh, ErrorResult& aError)
+  {
+    SetHTMLAttr(nsGkAtoms::_char, aCh, aError);
+  }
+  void GetChOff(nsString& aChOff)
+  {
+    GetHTMLAttr(nsGkAtoms::charoff, aChOff);
+  }
+  void SetChOff(const nsAString& aChOff, ErrorResult& aError)
+  {
+    SetHTMLAttr(nsGkAtoms::charoff, aChOff, aError);
+  }
+  void GetVAlign(nsString& aVAlign)
+  {
+    GetHTMLAttr(nsGkAtoms::valign, aVAlign);
+  }
+  void SetVAlign(const nsAString& aVAlign, ErrorResult& aError)
+  {
+    SetHTMLAttr(nsGkAtoms::valign, aVAlign, aError);
+  }
+
   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(HTMLTableSectionElement,
                                                      nsGenericHTMLElement)
 
   virtual nsXPCClassInfo* GetClassInfo();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 protected:
+  JSObject* WrapNode(JSContext *aCx, JSObject *aScope, bool *aTriedToWrap);
+
   nsRefPtr<nsContentList> mRows;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif /* mozilla_dom_HTMLTableSectionElement_h */
--- a/content/html/content/test/reflect.js
+++ b/content/html/content/test/reflect.js
@@ -59,22 +59,19 @@ function reflectString(aParameters)
   var todoAttrs = {
     col: [ "align", "vAlign", "ch" ],
     colgroup: [ "align", "vAlign", "ch" ],
     form: [ "acceptCharset", "name", "target" ],
     img: [ "align" ],
     input: [ "accept", "alt", "formTarget", "max", "min", "name", "pattern", "placeholder", "step", "defaultValue" ],
     link: [ "crossOrigin" ],
     source: [ "media" ],
-    tbody: [ "align", "vAlign", "ch" ],
     td: [ "align", "vAlign", "ch" ],
     textarea: [ "name", "placeholder" ],
-    tfoot: [ "align", "vAlign", "ch" ],
     th: [ "align", "vAlign", "ch" ],
-    thead: [ "align", "vAlign", "ch" ],
     tr: [ "align", "vAlign", "ch" ],
   };
   if (!(element.localName in todoAttrs) || todoAttrs[element.localName].indexOf(idlAttr) == -1) {
     is(element.getAttribute(contentAttr), "null",
        "null should have been stringified to 'null'");
     is(element[idlAttr], "null", "null should have been stringified to 'null'");
     element.removeAttribute(contentAttr);
   } else {
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -251,17 +251,17 @@
 #include "nsIDOMHTMLQuoteElement.h"
 #include "nsIDOMHTMLScriptElement.h"
 #include "nsIDOMHTMLStyleElement.h"
 #include "nsIDOMHTMLTableCaptionElem.h"
 #include "nsIDOMHTMLTableCellElement.h"
 #include "nsIDOMHTMLTableColElement.h"
 #include "nsIDOMHTMLTableElement.h"
 #include "nsIDOMHTMLTableRowElement.h"
-#include "nsIDOMHTMLTableSectionElem.h"
+#include "nsIDOMHTMLTableSectionElement.h"
 #include "nsIDOMHTMLTextAreaElement.h"
 #include "nsIDOMHTMLTitleElement.h"
 #include "nsIDOMHTMLUListElement.h"
 #include "nsIDOMHTMLUnknownElement.h"
 #include "nsIDOMMediaError.h"
 #include "nsIDOMTimeRanges.h"
 #include "nsIDOMHTMLSourceElement.h"
 #include "nsIDOMHTMLVideoElement.h"
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -424,16 +424,23 @@ DOMInterfaces = {
 
 'HTMLTableElement': {
     'hasInstanceInterface': 'nsIDOMHTMLTableElement',
     'resultNotAddRefed': [
         'caption', 'tHead', 'tFoot', 'tBodies', 'rows'
     ]
 },
 
+'HTMLTableSectionElement': {
+    'hasInstanceInterface': 'nsIDOMHTMLTableSectionElement',
+    'resultNotAddRefed': [
+        'rows'
+    ]
+},
+
 'HTMLUListElement': {
     'headerFile' : 'mozilla/dom/HTMLSharedListElement.h'
 },
 
 'IID': [
 {
     'nativeType': 'nsIJSID',
     'headerFile': 'xpcjsid.h',
@@ -1112,18 +1119,16 @@ addExternalIface('ClientRect')
 addExternalIface("Counter")
 addExternalIface('CSSRule')
 addExternalIface('DOMRequest')
 addExternalIface('DOMStringList')
 addExternalIface('File')
 addExternalIface('HitRegionOptions', nativeType='nsISupports')
 addExternalIface('HTMLHeadElement', nativeType='mozilla::dom::Element')
 addExternalIface('HTMLCanvasElement', nativeType='mozilla::dom::HTMLCanvasElement')
-addExternalIface('HTMLTableSectionElement',
-                 headerFile="nsIDOMHTMLTableSectionElem.h")
 addExternalIface('imgINotificationObserver', nativeType='imgINotificationObserver')
 addExternalIface('imgIRequest', nativeType='imgIRequest', notflattened=True)
 addExternalIface('LockedFile')
 addExternalIface('MediaStream')
 addExternalIface('NamedNodeMap')
 addExternalIface('NodeIterator')
 addExternalIface('nsIStreamListener', nativeType='nsIStreamListener', notflattened=True)
 addExternalIface('nsISupports', nativeType='nsISupports')
--- a/dom/interfaces/html/Makefile.in
+++ b/dom/interfaces/html/Makefile.in
@@ -67,17 +67,17 @@ SDK_XPIDLSRCS =					\
 	nsIDOMHTMLScriptElement.idl		\
 	nsIDOMHTMLSelectElement.idl		\
 	nsIDOMHTMLStyleElement.idl		\
 	nsIDOMHTMLTableCaptionElem.idl		\
 	nsIDOMHTMLTableCellElement.idl		\
 	nsIDOMHTMLTableColElement.idl		\
 	nsIDOMHTMLTableElement.idl		\
 	nsIDOMHTMLTableRowElement.idl		\
-	nsIDOMHTMLTableSectionElem.idl		\
+	nsIDOMHTMLTableSectionElement.idl		\
 	nsIDOMHTMLTextAreaElement.idl		\
 	nsIDOMHTMLTitleElement.idl		\
 	nsIDOMHTMLUListElement.idl		\
 	nsIDOMMediaError.idl		\
 	nsIDOMTimeRanges.idl		\
 	nsIDOMHTMLByteRanges.idl		\
 	nsIDOMHTMLMediaElement.idl		\
 	nsIDOMHTMLSourceElement.idl		\
rename from dom/interfaces/html/nsIDOMHTMLTableSectionElem.idl
rename to dom/interfaces/html/nsIDOMHTMLTableSectionElement.idl
--- a/dom/webidl/HTMLTableElement.webidl
+++ b/dom/webidl/HTMLTableElement.webidl
@@ -6,18 +6,16 @@
  * The origin of this IDL file is
  * http://www.whatwg.org/specs/web-apps/current-work/
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-interface HTMLTableSectionElement;
-
 interface HTMLTableElement : HTMLElement {
            attribute HTMLTableCaptionElement? caption;
   HTMLElement createCaption();
   void deleteCaption();
            [SetterThrows]
            attribute HTMLTableSectionElement? tHead;
   HTMLElement createTHead();
   void deleteTHead();
new file mode 100644
--- /dev/null
+++ b/dom/webidl/HTMLTableSectionElement.webidl
@@ -0,0 +1,33 @@
+/* -*- Mode: IDL; 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/.
+ *
+ * The origin of this IDL file is
+ * http://www.whatwg.org/specs/web-apps/current-work/
+ *
+ * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
+ * Opera Software ASA. You are granted a license to use, reproduce
+ * and create derivative works of this document.
+ */
+
+interface HTMLTableSectionElement : HTMLElement {
+  readonly attribute HTMLCollection rows;
+  [Throws]
+  HTMLElement insertRow(optional long index = -1);
+  [Throws]
+  void deleteRow(long index);
+/*
+};
+
+partial interface HTMLTableSectionElement {
+*/
+           [SetterThrows]
+           attribute DOMString align;
+           [SetterThrows]
+           attribute DOMString ch;
+           [SetterThrows]
+           attribute DOMString chOff;
+           [SetterThrows]
+           attribute DOMString vAlign;
+};
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -70,16 +70,17 @@ webidl_files = \
   HTMLOptionsCollection.webidl \
   HTMLParagraphElement.webidl \
   HTMLPreElement.webidl \
   HTMLPropertiesCollection.webidl \
   HTMLScriptElement.webidl \
   HTMLSpanElement.webidl \
   HTMLTableCaptionElement.webidl \
   HTMLTableElement.webidl \
+  HTMLTableSectionElement.webidl \
   HTMLTitleElement.webidl \
   HTMLUListElement.webidl \
   ImageData.webidl \
   Location.webidl \
   MutationObserver.webidl \
   Node.webidl \
   NodeFilter.webidl \
   NodeList.webidl \
--- a/js/xpconnect/src/dom_quickstubs.qsconf
+++ b/js/xpconnect/src/dom_quickstubs.qsconf
@@ -190,19 +190,16 @@ members = [
     'nsIDOMHTMLTableCellElement.width',
     'nsIDOMHTMLTableColElement.span',
     'nsIDOMHTMLTableColElement.width',
     'nsIDOMHTMLTableRowElement.sectionRowIndex',
     'nsIDOMHTMLTableRowElement.rowIndex',
     'nsIDOMHTMLTableRowElement.cells',
     'nsIDOMHTMLTableRowElement.deleteCell',
     'nsIDOMHTMLTableRowElement.insertCell',
-    'nsIDOMHTMLTableSectionElement.rows',
-    'nsIDOMHTMLTableSectionElement.insertRow',
-    'nsIDOMHTMLTableSectionElement.deleteRow',
     'nsIDOMHTMLTextAreaElement.rows',
     'nsIDOMHTMLTextAreaElement.name',
     'nsIDOMHTMLTextAreaElement.form',
     'nsIDOMHTMLTextAreaElement.defaultValue',
     'nsIDOMHTMLTextAreaElement.cols',
     'nsIDOMHTMLTextAreaElement.value',
     'nsIDOMHTMLTextAreaElement.type',
     'nsIDOMHTMLTextAreaElement.select',
@@ -311,19 +308,16 @@ members = [
 
 # Most interfaces can be found by searching the includePath; to find
 # nsIDOMEvent, for example, just look for nsIDOMEvent.idl.  But IDL filenames
 # for very long interface names are slightly abbreviated, and many interfaces
 # don't have their own files, just for extra wackiness.  So qsgen.py needs
 # a little help.
 #
 irregularFilenames = {
-    # abbreviations
-    'nsIDOMHTMLTableSectionElement': 'nsIDOMHTMLTableSectionElem',
-
     # stowaways
     'nsIDOMTextMetrics': 'nsIDOMCanvasRenderingContext2D',
     'nsIDOMCanvasGradient': 'nsIDOMCanvasRenderingContext2D',
     'nsIDOMCanvasPattern': 'nsIDOMCanvasRenderingContext2D',
 
     'nsIDOMBlob': 'nsIDOMFile',
 
     'nsIIndexedDatabaseUsageCallback': 'nsIIndexedDatabaseManager',