Bug 893117: Remove xpidl for nsIDOMHTMLTableElement r=peterv
☠☠ backed out by d6c1f540425c ☠ ☠
authorDavid Zbarsky <dzbarsky@gmail.com>
Thu, 18 Jul 2013 17:43:35 -0700
changeset 139194 6515e55d4fb95a0e3c6585b0a7992fcbbb5856c1
parent 139193 8dfdebcc8ce6736939d2bf135090c3b1703128f8
child 139195 05ae078ca073fdd9b443bdc70ec0c59005e4930d
push id1890
push userryanvm@gmail.com
push dateFri, 19 Jul 2013 17:44:21 +0000
treeherderfx-team@20848adc9980 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs893117
milestone25.0a1
Bug 893117: Remove xpidl for nsIDOMHTMLTableElement r=peterv
content/html/content/src/HTMLTableElement.cpp
content/html/content/src/HTMLTableElement.h
dom/interfaces/html/nsIDOMHTMLTableElement.idl
--- a/content/html/content/src/HTMLTableElement.cpp
+++ b/content/html/content/src/HTMLTableElement.cpp
@@ -339,246 +339,26 @@ NS_ELEMENT_INTERFACE_MAP_END
 
 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_IMETHODIMP
-HTMLTableElement::SetAlign(const nsAString& aAlign)
-{
-  ErrorResult rv;
-  SetAlign(aAlign, rv);
-  return rv.ErrorCode();
-}
-
-NS_IMETHODIMP
-HTMLTableElement::GetAlign(nsAString& aAlign)
-{
-  nsString align;
-  GetAlign(align);
-  aAlign = align;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLTableElement::SetBgColor(const nsAString& aBgColor)
-{
-  ErrorResult rv;
-  SetBgColor(aBgColor, rv);
-  return rv.ErrorCode();
-}
-
-NS_IMETHODIMP
-HTMLTableElement::GetBgColor(nsAString& aBgColor)
-{
-  nsString bgColor;
-  GetBgColor(bgColor);
-  aBgColor = bgColor;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLTableElement::SetBorder(const nsAString& aBorder)
-{
-  ErrorResult rv;
-  SetBorder(aBorder, rv);
-  return rv.ErrorCode();
-}
-
-NS_IMETHODIMP
-HTMLTableElement::GetBorder(nsAString& aBorder)
-{
-  nsString border;
-  GetBorder(border);
-  aBorder = border;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLTableElement::SetCellPadding(const nsAString& aCellPadding)
-{
-  ErrorResult rv;
-  SetCellPadding(aCellPadding, rv);
-  return rv.ErrorCode();
-}
-
-NS_IMETHODIMP
-HTMLTableElement::GetCellPadding(nsAString& aCellPadding)
-{
-  nsString cellPadding;
-  GetCellPadding(cellPadding);
-  aCellPadding = cellPadding;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLTableElement::SetCellSpacing(const nsAString& aCellSpacing)
-{
-  ErrorResult rv;
-  SetCellSpacing(aCellSpacing, rv);
-  return rv.ErrorCode();
-}
-
-NS_IMETHODIMP
-HTMLTableElement::GetCellSpacing(nsAString& aCellSpacing)
-{
-  nsString cellSpacing;
-  GetCellSpacing(cellSpacing);
-  aCellSpacing = cellSpacing;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLTableElement::SetFrame(const nsAString& aFrame)
-{
-  ErrorResult rv;
-  SetFrame(aFrame, rv);
-  return rv.ErrorCode();
-}
-
-NS_IMETHODIMP
-HTMLTableElement::GetFrame(nsAString& aFrame)
-{
-  nsString frame;
-  GetFrame(frame);
-  aFrame = frame;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLTableElement::SetRules(const nsAString& aRules)
-{
-  ErrorResult rv;
-  SetRules(aRules, rv);
-  return rv.ErrorCode();
-}
-
-NS_IMETHODIMP
-HTMLTableElement::GetRules(nsAString& aRules)
-{
-  nsString rules;
-  GetRules(rules);
-  aRules = rules;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLTableElement::SetSummary(const nsAString& aSummary)
-{
-  ErrorResult rv;
-  SetSummary(aSummary, rv);
-  return rv.ErrorCode();
-}
-
-NS_IMETHODIMP
-HTMLTableElement::GetSummary(nsAString& aSummary)
-{
-  nsString summary;
-  GetSummary(summary);
-  aSummary = summary;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLTableElement::SetWidth(const nsAString& aWidth)
-{
-  ErrorResult rv;
-  SetWidth(aWidth, rv);
-  return rv.ErrorCode();
-}
-
-NS_IMETHODIMP
-HTMLTableElement::GetWidth(nsAString& aWidth)
-{
-  nsString width;
-  GetWidth(width);
-  aWidth = width;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLTableElement::GetCaption(nsIDOMHTMLTableCaptionElement** aValue)
-{
-  nsCOMPtr<nsIDOMHTMLTableCaptionElement> caption = GetCaption();
-  caption.forget(aValue);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLTableElement::SetCaption(nsIDOMHTMLTableCaptionElement* aValue)
-{
-  HTMLTableCaptionElement* caption =
-    static_cast<HTMLTableCaptionElement*>(aValue);
-  SetCaption(caption);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLTableElement::GetTHead(nsIDOMHTMLTableSectionElement** aValue)
-{
-  NS_IF_ADDREF(*aValue = GetTHead());
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-HTMLTableElement::SetTHead(nsIDOMHTMLTableSectionElement* aValue)
-{
-  HTMLTableSectionElement* section =
-    static_cast<HTMLTableSectionElement*>(aValue);
-  ErrorResult 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(section, rv);
-  return rv.ErrorCode();
-}
-
-NS_IMETHODIMP
-HTMLTableElement::GetRows(nsIDOMHTMLCollection** aValue)
-{
-  NS_ADDREF(*aValue = Rows());
-  return NS_OK;
-}
-
 nsIHTMLCollection*
 HTMLTableElement::Rows()
 {
   if (!mRows) {
     mRows = new TableRowsCollection(this);
   }
 
   return mRows;
 }
 
-NS_IMETHODIMP
-HTMLTableElement::GetTBodies(nsIDOMHTMLCollection** aValue)
-{
-  NS_ADDREF(*aValue = TBodies());
-  return NS_OK;
-}
-
 nsIHTMLCollection*
 HTMLTableElement::TBodies()
 {
   if (!mTBodies) {
     // Not using NS_GetContentList because this should not be cached
     mTBodies = new nsContentList(this,
                                  kNameSpaceID_XHTML,
                                  nsGkAtoms::tbody,
@@ -605,34 +385,25 @@ HTMLTableElement::CreateTHead()
     }
 
     ErrorResult rv;
     nsINode::InsertBefore(*head, nsINode::GetFirstChild(), rv);
   }
   return head.forget();
 }
 
-NS_IMETHODIMP
-HTMLTableElement::CreateTHead(nsIDOMHTMLElement** aValue)
-{
-  nsRefPtr<nsGenericHTMLElement> thead = CreateTHead();
-  return thead ? CallQueryInterface(thead, aValue) : NS_OK;
-}
-
-NS_IMETHODIMP
+void
 HTMLTableElement::DeleteTHead()
 {
   HTMLTableSectionElement* tHead = GetTHead();
   if (tHead) {
     mozilla::ErrorResult rv;
     nsINode::RemoveChild(*tHead, rv);
     MOZ_ASSERT(!rv.Failed());
   }
-
-  return NS_OK;
 }
 
 already_AddRefed<nsGenericHTMLElement>
 HTMLTableElement::CreateTFoot()
 {
   nsRefPtr<nsGenericHTMLElement> foot = GetTFoot();
   if (!foot) {
     // create a new foot rowgroup
@@ -645,34 +416,25 @@ HTMLTableElement::CreateTFoot()
       return nullptr;
     }
     AppendChildTo(foot, true);
   }
 
   return foot.forget();
 }
 
-NS_IMETHODIMP
-HTMLTableElement::CreateTFoot(nsIDOMHTMLElement** aValue)
-{
-  nsRefPtr<nsGenericHTMLElement> tfoot = CreateTFoot();
-  return tfoot ? CallQueryInterface(tfoot, aValue) : NS_OK;
-}
-
-NS_IMETHODIMP
+void
 HTMLTableElement::DeleteTFoot()
 {
   HTMLTableSectionElement* tFoot = GetTFoot();
   if (tFoot) {
     mozilla::ErrorResult rv;
     nsINode::RemoveChild(*tFoot, rv);
     MOZ_ASSERT(!rv.Failed());
   }
-
-  return NS_OK;
 }
 
 already_AddRefed<nsGenericHTMLElement>
 HTMLTableElement::CreateCaption()
 {
   nsRefPtr<nsGenericHTMLElement> caption = GetCaption();
   if (!caption) {
     // Create a new caption.
@@ -685,34 +447,25 @@ HTMLTableElement::CreateCaption()
       return nullptr;
     }
 
     AppendChildTo(caption, true);
   }
   return caption.forget();
 }
 
-NS_IMETHODIMP
-HTMLTableElement::CreateCaption(nsIDOMHTMLElement** aValue)
-{
-  nsRefPtr<nsGenericHTMLElement> caption = CreateCaption();
-  return caption ? CallQueryInterface(caption, aValue) : NS_OK;
-}
-
-NS_IMETHODIMP
+void
 HTMLTableElement::DeleteCaption()
 {
   HTMLTableCaptionElement* caption = GetCaption();
   if (caption) {
     mozilla::ErrorResult rv;
     nsINode::RemoveChild(*caption, rv);
     MOZ_ASSERT(!rv.Failed());
   }
-
-  return NS_OK;
 }
 
 already_AddRefed<nsGenericHTMLElement>
 HTMLTableElement::CreateTBody()
 {
   nsCOMPtr<nsINodeInfo> nodeInfo =
     OwnerDoc()->NodeInfoManager()->GetNodeInfo(nsGkAtoms::tbody, nullptr,
                                                kNameSpaceID_XHTML,
@@ -738,17 +491,17 @@ HTMLTableElement::CreateTBody()
 
   return newBody.forget();
 }
 
 already_AddRefed<nsGenericHTMLElement>
 HTMLTableElement::InsertRow(int32_t aIndex, ErrorResult& aError)
 {
   /* get the ref row at aIndex
-     if there is one, 
+     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
   */
   if (aIndex < -1) {
     aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
@@ -843,24 +596,16 @@ HTMLTableElement::InsertRow(int32_t aInd
         rowGroup->InsertBefore(*newRow, rows->Item(0), aError);
       }
     }
   }
 
   return newRow.forget();
 }
 
-NS_IMETHODIMP
-HTMLTableElement::InsertRow(int32_t aIndex, nsIDOMHTMLElement** aValue)
-{
-  ErrorResult rv;
-  nsRefPtr<nsGenericHTMLElement> newRow = InsertRow(aIndex, rv);
-  return rv.Failed() ? rv.ErrorCode() : CallQueryInterface(newRow, aValue);
-}
-
 void
 HTMLTableElement::DeleteRow(int32_t aIndex, ErrorResult& aError)
 {
   if (aIndex < -1) {
     aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
     return;
   }
 
@@ -881,24 +626,16 @@ HTMLTableElement::DeleteRow(int32_t aInd
   if (!row) {
     aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
     return;
   }
 
   row->RemoveFromParent();
 }
 
-NS_IMETHODIMP
-HTMLTableElement::DeleteRow(int32_t aValue)
-{
-  ErrorResult rv;
-  DeleteRow(aValue, rv);
-  return rv.ErrorCode();
-}
-
 static const nsAttrValue::EnumTable kFrameTable[] = {
   { "void",   NS_STYLE_TABLE_FRAME_NONE },
   { "above",  NS_STYLE_TABLE_FRAME_ABOVE },
   { "below",  NS_STYLE_TABLE_FRAME_BELOW },
   { "hsides", NS_STYLE_TABLE_FRAME_HSIDES },
   { "lhs",    NS_STYLE_TABLE_FRAME_LEFT },
   { "rhs",    NS_STYLE_TABLE_FRAME_RIGHT },
   { "vsides", NS_STYLE_TABLE_FRAME_VSIDES },
--- a/content/html/content/src/HTMLTableElement.h
+++ b/content/html/content/src/HTMLTableElement.h
@@ -34,33 +34,35 @@ public:
   NS_FORWARD_NSIDOMNODE_TO_NSINODE
 
   // nsIDOMElement
   NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
 
   // nsIDOMHTMLElement
   NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
 
-  // nsIDOMHTMLTableElement
-  NS_DECL_NSIDOMHTMLTABLEELEMENT
-
   HTMLTableCaptionElement* GetCaption() const
   {
     return static_cast<HTMLTableCaptionElement*>(GetChild(nsGkAtoms::caption));
   }
   void SetCaption(HTMLTableCaptionElement* aCaption)
   {
     DeleteCaption();
     if (aCaption) {
       mozilla::ErrorResult rv;
       nsINode::AppendChild(*aCaption, rv);
     }
   }
+
+  void DeleteTFoot();
+
   already_AddRefed<nsGenericHTMLElement> CreateCaption();
 
+  void DeleteCaption();
+
   HTMLTableSectionElement* GetTHead() const
   {
     return static_cast<HTMLTableSectionElement*>(GetChild(nsGkAtoms::thead));
   }
   void SetTHead(HTMLTableSectionElement* aTHead, ErrorResult& aError)
   {
     if (aTHead && !aTHead->IsHTML(nsGkAtoms::thead)) {
       aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
@@ -69,16 +71,18 @@ public:
 
     DeleteTHead();
     if (aTHead) {
       nsINode::InsertBefore(*aTHead, nsINode::GetFirstChild(), aError);
     }
   }
   already_AddRefed<nsGenericHTMLElement> CreateTHead();
 
+  void DeleteTHead();
+
   HTMLTableSectionElement* GetTFoot() const
   {
     return static_cast<HTMLTableSectionElement*>(GetChild(nsGkAtoms::tfoot));
   }
   void SetTFoot(HTMLTableSectionElement* aTFoot, ErrorResult& aError)
   {
     if (aTFoot && !aTFoot->IsHTML(nsGkAtoms::tfoot)) {
       aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
--- a/dom/interfaces/html/nsIDOMHTMLTableElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTableElement.idl
@@ -14,44 +14,9 @@
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
 [scriptable, uuid(1a7bf1f1-5d6c-4200-9ceb-455874322315)]
 interface nsIDOMHTMLTableElement : nsIDOMHTMLElement
 {
-  // Modified in DOM Level 2:
-           attribute nsIDOMHTMLTableCaptionElement caption;
-                                             // raises(DOMException) on setting
-
-  // Modified in DOM Level 2:
-           attribute nsIDOMHTMLTableSectionElement tHead;
-                                             // raises(DOMException) on setting
-
-  // Modified in DOM Level 2:
-           attribute nsIDOMHTMLTableSectionElement tFoot;
-                                             // raises(DOMException) on setting
-
-  readonly attribute nsIDOMHTMLCollection          rows;
-  readonly attribute nsIDOMHTMLCollection          tBodies;
-           attribute DOMString                     align;
-           attribute DOMString                     bgColor;
-           attribute DOMString                     border;
-           attribute DOMString                     cellPadding;
-           attribute DOMString                     cellSpacing;
-           attribute DOMString                     frame;
-           attribute DOMString                     rules;
-           attribute DOMString                     summary;
-           attribute DOMString                     width;
-  nsIDOMHTMLElement         createTHead();
-  void                      deleteTHead();
-  nsIDOMHTMLElement         createTFoot();
-  void                      deleteTFoot();
-  nsIDOMHTMLElement         createCaption();
-  void                      deleteCaption();
-  // Modified in DOM Level 2:
-  nsIDOMHTMLElement         insertRow(in long index)
-                                             raises(DOMException);
-  // Modified in DOM Level 2:
-  void                      deleteRow(in long index)
-                                             raises(DOMException);
 };