Fix for bug 824907 (Convert HTML table elements to WebIDL) - convert HTMLTableCellElement to WebIDL. r=bz.
authorPeter Van der Beken <peterv@propagandism.org>
Sat, 29 Dec 2012 15:07:56 +0100
changeset 127604 42f91a4781c1acf8d1f24a10c2d412c6197e6cd6
parent 127603 a4ef9c24dd5b55d29789cebe3a7126fb52b8cfb6
child 127605 abd3e75c995cbe2c96a6f181b9563f430abc93d0
push id297
push userlsblakk@mozilla.com
push dateTue, 26 Mar 2013 17:28:00 +0000
treeherdermozilla-release@64d7b45c34e6 [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 HTMLTableCellElement to WebIDL. 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/test/reflect.js
dom/bindings/Bindings.conf
dom/interfaces/html/nsIDOMHTMLTableSectionElement.idl
dom/webidl/HTMLTableCellElement.webidl
dom/webidl/WebIDL.mk
js/xpconnect/src/dom_quickstubs.qsconf
--- a/content/html/content/src/HTMLTableCellElement.cpp
+++ b/content/html/content/src/HTMLTableCellElement.cpp
@@ -2,59 +2,61 @@
 /* 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 "nsIDOMHTMLCollection.h"
+#include "mozilla/dom/HTMLTableRowElement.h"
 #include "nsMappedAttributes.h"
 #include "nsAttrValueInlines.h"
-#include "nsGkAtoms.h"
-#include "nsStyleConsts.h"
-#include "nsPresContext.h"
 #include "nsRuleData.h"
 #include "nsRuleWalker.h"
 #include "celldata.h"
+#include "mozilla/dom/HTMLTableCellElementBinding.h"
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(TableCell)
 DOMCI_NODE_DATA(HTMLTableCellElement, mozilla::dom::HTMLTableCellElement)
 
 namespace mozilla {
 namespace dom {
 
 HTMLTableCellElement::~HTMLTableCellElement()
 {
 }
 
+JSObject*
+HTMLTableCellElement::WrapNode(JSContext *aCx, JSObject *aScope,
+                               bool *aTriedToWrap)
+{
+  return HTMLTableCellElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
+}
+
 NS_IMPL_ADDREF_INHERITED(HTMLTableCellElement, Element)
 NS_IMPL_RELEASE_INHERITED(HTMLTableCellElement, Element)
 
 // QueryInterface implementation for HTMLTableCellElement
 NS_INTERFACE_TABLE_HEAD(HTMLTableCellElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(HTMLTableCellElement,
                                    nsIDOMHTMLTableCellElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLTableCellElement,
                                                nsGenericHTMLElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLTableCellElement)
 
 
 NS_IMPL_ELEMENT_CLONE(HTMLTableCellElement)
 
 
 // protected method
-already_AddRefed<nsIDOMHTMLTableRowElement>
+HTMLTableRowElement*
 HTMLTableCellElement::GetRow() const
 {
-  nsCOMPtr<nsIDOMHTMLTableRowElement> row = do_QueryInterface(GetParent());
-  return row.forget();
+  return HTMLTableRowElement::FromContentOrNull(GetParent());
 }
 
 // protected method
 HTMLTableElement*
 HTMLTableCellElement::GetTable() const
 {
   nsIContent *parent = GetParent();
   if (!parent) {
@@ -76,103 +78,313 @@ HTMLTableCellElement::GetTable() const
   nsIContent* result = section->GetParent();
   if (result && result->IsHTML(nsGkAtoms::table)) {
     return static_cast<HTMLTableElement*>(result);
   }
 
   return nullptr;
 }
 
-NS_IMETHODIMP
-HTMLTableCellElement::GetCellIndex(int32_t* aCellIndex)
+int32_t
+HTMLTableCellElement::CellIndex() const
 {
-  *aCellIndex = -1;
-
-  nsCOMPtr<nsIDOMHTMLTableRowElement> row = GetRow();
+  HTMLTableRowElement* row = GetRow();
   if (!row) {
-    return NS_OK;
+    return -1;
   }
 
   nsCOMPtr<nsIDOMHTMLCollection> cells;
 
   row->GetCells(getter_AddRefs(cells));
 
   if (!cells) {
-    return NS_OK;
+    return -1;
   }
 
   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;
+    if (node.get() == static_cast<const nsIDOMNode *>(this)) {
+      return i;
     }
   }
 
+  return -1;
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::GetCellIndex(int32_t* aCellIndex)
+{
+  *aCellIndex = CellIndex();
   return NS_OK;
 }
 
-
 NS_IMETHODIMP
 HTMLTableCellElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
 {
   nsresult rv = nsGenericHTMLElement::WalkContentStyleRules(aRuleWalker);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (HTMLTableElement* table = GetTable()) {
     nsMappedAttributes* tableInheritedAttributes =
       table->GetAttributesMappedForCell();
     if (tableInheritedAttributes) {
       aRuleWalker->Forward(tableInheritedAttributes);
     }
   }
   return NS_OK;
 }
 
+NS_IMETHODIMP
+HTMLTableCellElement::SetAbbr(const nsAString& aAbbr)
+{
+  ErrorResult rv;
+  SetAbbr(aAbbr, rv);
+  return rv.ErrorCode();
+}
 
-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
+HTMLTableCellElement::GetAbbr(nsAString& aAbbr)
+{
+  nsString abbr;
+  GetAbbr(abbr);
+  aAbbr = abbr;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::SetAxis(const nsAString& aAxis)
+{
+  ErrorResult rv;
+  SetAxis(aAxis, rv);
+  return rv.ErrorCode();
+}
 
+NS_IMETHODIMP
+HTMLTableCellElement::GetAxis(nsAString& aAxis)
+{
+  nsString axis;
+  GetAxis(axis);
+  aAxis = axis;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::SetAlign(const nsAString& aAlign)
+{
+  ErrorResult rv;
+  SetAlign(aAlign, rv);
+  return rv.ErrorCode();
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::GetAlign(nsAString& aAlign)
+{
+  nsString align;
+  GetAlign(align);
+  aAlign = align;
+  return NS_OK;
+}
 
 NS_IMETHODIMP
-HTMLTableCellElement::GetAlign(nsAString& aValue)
+HTMLTableCellElement::SetVAlign(const nsAString& aVAlign)
+{
+  ErrorResult rv;
+  SetVAlign(aVAlign, rv);
+  return rv.ErrorCode();
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::GetVAlign(nsAString& aVAlign)
+{
+  nsString vAlign;
+  GetVAlign(vAlign);
+  aVAlign = vAlign;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::SetCh(const nsAString& aCh)
+{
+  ErrorResult rv;
+  SetCh(aCh, rv);
+  return rv.ErrorCode();
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::GetCh(nsAString& aCh)
 {
-  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);
-    }
-  }
+  nsString ch;
+  GetCh(ch);
+  aCh = ch;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::SetChOff(const nsAString& aChOff)
+{
+  ErrorResult rv;
+  SetChOff(aChOff, rv);
+  return rv.ErrorCode();
+}
 
+NS_IMETHODIMP
+HTMLTableCellElement::GetChOff(nsAString& aChOff)
+{
+  nsString chOff;
+  GetChOff(chOff);
+  aChOff = chOff;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::SetBgColor(const nsAString& aBgColor)
+{
+  ErrorResult rv;
+  SetBgColor(aBgColor, rv);
+  return rv.ErrorCode();
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::GetBgColor(nsAString& aBgColor)
+{
+  nsString bgColor;
+  GetBgColor(bgColor);
+  aBgColor = bgColor;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-HTMLTableCellElement::SetAlign(const nsAString& aValue)
+HTMLTableCellElement::SetHeight(const nsAString& aHeight)
+{
+  ErrorResult rv;
+  SetHeight(aHeight, rv);
+  return rv.ErrorCode();
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::GetHeight(nsAString& aHeight)
+{
+  nsString height;
+  GetHeight(height);
+  aHeight = height;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::SetWidth(const nsAString& aWidth)
+{
+  ErrorResult rv;
+  SetWidth(aWidth, rv);
+  return rv.ErrorCode();
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::GetWidth(nsAString& aWidth)
 {
-  return SetAttr(kNameSpaceID_None, nsGkAtoms::align, aValue, true);
+  nsString width;
+  GetWidth(width);
+  aWidth = width;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::SetNoWrap(bool aNoWrap)
+{
+  ErrorResult rv;
+  SetNoWrap(aNoWrap, rv);
+  return rv.ErrorCode();
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::GetNoWrap(bool* aNoWrap)
+{
+  *aNoWrap = NoWrap();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::SetScope(const nsAString& aScope)
+{
+  ErrorResult rv;
+  SetScope(aScope, rv);
+  return rv.ErrorCode();
 }
 
+NS_IMETHODIMP
+HTMLTableCellElement::GetScope(nsAString& aScope)
+{
+  nsString scope;
+  GetScope(scope);
+  aScope = scope;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::SetHeaders(const nsAString& aHeaders)
+{
+  ErrorResult rv;
+  SetHeaders(aHeaders, rv);
+  return rv.ErrorCode();
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::GetHeaders(nsAString& aHeaders)
+{
+  nsString headers;
+  GetHeaders(headers);
+  aHeaders = headers;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::SetColSpan(int32_t aColSpan)
+{
+  ErrorResult rv;
+  SetColSpan(aColSpan, rv);
+  return rv.ErrorCode();
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::GetColSpan(int32_t* aColSpan)
+{
+  *aColSpan = ColSpan();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::SetRowSpan(int32_t aRowSpan)
+{
+  ErrorResult rv;
+  SetRowSpan(aRowSpan, rv);
+  return rv.ErrorCode();
+}
+
+NS_IMETHODIMP
+HTMLTableCellElement::GetRowSpan(int32_t* aRowSpan)
+{
+  *aRowSpan = RowSpan();
+  return NS_OK;
+}
+
+void
+HTMLTableCellElement::GetAlign(nsString& aValue)
+{
+  if (!GetAttr(kNameSpaceID_None, nsGkAtoms::align, aValue)) {
+    // There's no align attribute, ask the row for the alignment.
+    HTMLTableRowElement* row = GetRow();
+    if (row) {
+      row->GetAlign(aValue);
+    }
+  }
+}
 
 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 }
 };
--- a/content/html/content/src/HTMLTableCellElement.h
+++ b/content/html/content/src/HTMLTableCellElement.h
@@ -17,16 +17,17 @@ class HTMLTableElement;
 
 class HTMLTableCellElement : public nsGenericHTMLElement,
                              public nsIDOMHTMLTableCellElement
 {
 public:
   HTMLTableCellElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : nsGenericHTMLElement(aNodeInfo)
   {
+    SetIsDOMBinding();
   }
   virtual ~HTMLTableCellElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
@@ -35,31 +36,147 @@ public:
   NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
 
   // nsIDOMHTMLTableCellElement
   NS_DECL_NSIDOMHTMLTABLECELLELEMENT
 
+  uint32_t ColSpan() const
+  {
+    return GetIntAttr(nsGkAtoms::colspan, 1);
+  }
+  void SetColSpan(uint32_t aColSpan, ErrorResult& aError)
+  {
+    SetHTMLIntAttr(nsGkAtoms::colspan, aColSpan, aError);
+  }
+  uint32_t RowSpan() const
+  {
+    return GetIntAttr(nsGkAtoms::rowspan, 1);
+  }
+  void SetRowSpan(uint32_t aRowSpan, ErrorResult& aError)
+  {
+    SetHTMLIntAttr(nsGkAtoms::rowspan, aRowSpan, aError);
+  }
+  //already_AddRefed<nsDOMSettableTokenList> Headers() const;
+  void GetHeaders(nsString& aHeaders)
+  {
+    GetHTMLAttr(nsGkAtoms::headers, aHeaders);
+  }
+  void SetHeaders(const nsAString& aHeaders, ErrorResult& aError)
+  {
+    SetHTMLAttr(nsGkAtoms::headers, aHeaders, aError);
+  }
+  int32_t CellIndex() const;
+
+  void GetAbbr(nsString& aAbbr)
+  {
+    GetHTMLAttr(nsGkAtoms::abbr, aAbbr);
+  }
+  void SetAbbr(const nsAString& aAbbr, ErrorResult& aError)
+  {
+    SetHTMLAttr(nsGkAtoms::abbr, aAbbr, aError);
+  }
+  void GetScope(nsString& aScope)
+  {
+    GetHTMLAttr(nsGkAtoms::scope, aScope);
+  }
+  void SetScope(const nsAString& aScope, ErrorResult& aError)
+  {
+    SetHTMLAttr(nsGkAtoms::scope, aScope, aError);
+  }
+  void GetAlign(nsString& aAlign);
+  void SetAlign(const nsAString& aAlign, ErrorResult& aError)
+  {
+    SetHTMLAttr(nsGkAtoms::align, aAlign, aError);
+  }
+  void GetAxis(nsString& aAxis)
+  {
+    GetHTMLAttr(nsGkAtoms::axis, aAxis);
+  }
+  void SetAxis(const nsAString& aAxis, ErrorResult& aError)
+  {
+    SetHTMLAttr(nsGkAtoms::axis, aAxis, aError);
+  }
+  void GetHeight(nsString& aHeight)
+  {
+    GetHTMLAttr(nsGkAtoms::height, aHeight);
+  }
+  void SetHeight(const nsAString& aHeight, ErrorResult& aError)
+  {
+    SetHTMLAttr(nsGkAtoms::height, aHeight, aError);
+  }
+  void GetWidth(nsString& aWidth)
+  {
+    GetHTMLAttr(nsGkAtoms::width, aWidth);
+  }
+  void SetWidth(const nsAString& aWidth, ErrorResult& aError)
+  {
+    SetHTMLAttr(nsGkAtoms::width, aWidth, 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);
+  }
+  bool NoWrap()
+  {
+    return GetBoolAttr(nsGkAtoms::nowrap);
+  }
+  void SetNoWrap(bool aNoWrap, ErrorResult& aError)
+  {
+    SetHTMLBoolAttr(nsGkAtoms::nowrap, aNoWrap, aError);
+  }
+  void GetVAlign(nsString& aVAlign)
+  {
+    GetHTMLAttr(nsGkAtoms::valign, aVAlign);
+  }
+  void SetVAlign(const nsAString& aVAlign, ErrorResult& aError)
+  {
+    SetHTMLAttr(nsGkAtoms::valign, aVAlign, aError);
+  }
+  void GetBgColor(nsString& aBgColor)
+  {
+    GetHTMLAttr(nsGkAtoms::bgcolor, aBgColor);
+  }
+  void SetBgColor(const nsAString& aBgColor, ErrorResult& aError)
+  {
+    SetHTMLAttr(nsGkAtoms::bgcolor, aBgColor, aError);
+  }
+
   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();
 
   virtual nsIDOMNode* AsDOMNode() { return this; }
 protected:
+  virtual JSObject* WrapNode(JSContext *aCx, JSObject *aScope,
+                             bool *aTriedToWrap) MOZ_OVERRIDE;
+
   HTMLTableElement* GetTable() const;
 
-  already_AddRefed<nsIDOMHTMLTableRowElement> GetRow() const;
+  HTMLTableRowElement* GetRow() const;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif /* mozilla_dom_HTMLTableCellElement_h */
--- a/content/html/content/src/HTMLTableRowElement.h
+++ b/content/html/content/src/HTMLTableRowElement.h
@@ -15,16 +15,18 @@ namespace mozilla {
 namespace dom {
 
 class HTMLTableRowElement : public nsGenericHTMLElement,
                             public nsIDOMHTMLTableRowElement
 {
 public:
   HTMLTableRowElement(already_AddRefed<nsINodeInfo> aNodeInfo);
 
+  NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLTableRowElement, nsGkAtoms::tr)
+
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
 
   // nsIDOMElement
   NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
--- a/content/html/content/test/reflect.js
+++ b/content/html/content/test/reflect.js
@@ -59,19 +59,17 @@ 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" ],
-    td: [ "align", "vAlign", "ch" ],
     textarea: [ "name", "placeholder" ],
-    th: [ "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/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -417,16 +417,20 @@ DOMInterfaces = {
     'headerFile': 'HTMLPropertiesCollection.h',
     'resultNotAddRefed': [ 'item', 'namedItem', 'names' ]
 },
 
 'HTMLScriptElement': {
   'hasInstanceInterface': 'nsIDOMHTMLScriptElement',
 },
 
+'HTMLTableCellElement': {
+    'hasInstanceInterface': 'nsIDOMHTMLTableCellElement'
+},
+
 'HTMLTableElement': {
     'hasInstanceInterface': 'nsIDOMHTMLTableElement',
     'resultNotAddRefed': [
         'caption', 'tHead', 'tFoot', 'tBodies', 'rows'
     ]
 },
 
 'HTMLTableSectionElement': {
new file mode 100644
--- /dev/null
+++ b/dom/webidl/HTMLTableCellElement.webidl
@@ -0,0 +1,53 @@
+/* -*- 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 HTMLTableCellElement : HTMLElement {
+           [SetterThrows]
+           attribute unsigned long colSpan;
+           [SetterThrows]
+           attribute unsigned long rowSpan;
+  //[PutForwards=value] readonly attribute DOMSettableTokenList headers;
+           [SetterThrows]
+           attribute DOMString headers;
+  readonly attribute long cellIndex;
+
+  // Mozilla-specific extensions
+           [SetterThrows]
+           attribute DOMString abbr;
+           [SetterThrows]
+           attribute DOMString scope;
+/*
+};
+
+partial interface HTMLTableCellElement {
+*/
+           [SetterThrows]
+           attribute DOMString align;
+           [SetterThrows]
+           attribute DOMString axis;
+           [SetterThrows]
+           attribute DOMString height;
+           [SetterThrows]
+           attribute DOMString width;
+
+           [SetterThrows]
+           attribute DOMString ch;
+           [SetterThrows]
+           attribute DOMString chOff;
+           [SetterThrows]
+           attribute boolean noWrap;
+           [SetterThrows]
+           attribute DOMString vAlign;
+
+  [TreatNullAs=EmptyString, SetterThrows] attribute DOMString bgColor;
+};
--- a/dom/webidl/WebIDL.mk
+++ b/dom/webidl/WebIDL.mk
@@ -69,16 +69,17 @@ webidl_files = \
   HTMLOListElement.webidl \
   HTMLOptionsCollection.webidl \
   HTMLParagraphElement.webidl \
   HTMLPreElement.webidl \
   HTMLPropertiesCollection.webidl \
   HTMLScriptElement.webidl \
   HTMLSpanElement.webidl \
   HTMLTableCaptionElement.webidl \
+  HTMLTableCellElement.webidl \
   HTMLTableElement.webidl \
   HTMLTableSectionElement.webidl \
   HTMLTitleElement.webidl \
   HTMLUListElement.webidl \
   ImageData.webidl \
   Location.webidl \
   MutationObserver.webidl \
   Node.webidl \
--- a/js/xpconnect/src/dom_quickstubs.qsconf
+++ b/js/xpconnect/src/dom_quickstubs.qsconf
@@ -175,24 +175,16 @@ members = [
     'nsIDOMHTMLSelectElement.length',
     'nsIDOMHTMLSelectElement.remove',
     'nsIDOMHTMLSelectElement.selectedIndex',
     'nsIDOMHTMLSelectElement.item',
     'nsIDOMHTMLSelectElement.type',
     'nsIDOMHTMLSelectElement.options',
     'nsIDOMHTMLSelectElement.size',
     'nsIDOMHTMLStyleElement.disabled',
-    'nsIDOMHTMLTableCellElement.colSpan',
-    'nsIDOMHTMLTableCellElement.headers',
-    'nsIDOMHTMLTableCellElement.cellIndex',
-    'nsIDOMHTMLTableCellElement.rowSpan',
-    'nsIDOMHTMLTableCellElement.abbr',
-    'nsIDOMHTMLTableCellElement.scope',
-    'nsIDOMHTMLTableCellElement.noWrap',
-    'nsIDOMHTMLTableCellElement.width',
     'nsIDOMHTMLTableColElement.span',
     'nsIDOMHTMLTableColElement.width',
     'nsIDOMHTMLTableRowElement.sectionRowIndex',
     'nsIDOMHTMLTableRowElement.rowIndex',
     'nsIDOMHTMLTableRowElement.cells',
     'nsIDOMHTMLTableRowElement.deleteCell',
     'nsIDOMHTMLTableRowElement.insertCell',
     'nsIDOMHTMLTextAreaElement.rows',