Bug 1466727 part 2. Remove use of nsITreeColumn in xpidl interfaces. r=mossop
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 05 Jun 2018 23:01:36 -0400
changeset 478284 96c6c5a075a4d065b5117f23ed4bc1fa5c70a683
parent 478283 824b74c6269d69430a89301af2a638da0d0cd69c
child 478285 55feb670e0704c0447eb9cdd2c1ce917b2949806
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1466727
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1466727 part 2. Remove use of nsITreeColumn in xpidl interfaces. r=mossop There is one actual behavior change here, in the webidl version of TreeBoxObject::GetCellAt. I believe this change fixes a leak of the nsTreeColumn, but could use careful review. I tried to avoid changes not needed to get this compiling. There will be a lot more cleanup in the next few changesets.
accessible/base/nsCoreUtils.cpp
accessible/base/nsCoreUtils.h
accessible/windows/msaa/XULTreeGridAccessibleWrap.h
accessible/xul/XULTreeAccessible.cpp
accessible/xul/XULTreeAccessible.h
accessible/xul/XULTreeGridAccessible.cpp
accessible/xul/XULTreeGridAccessible.h
layout/xul/nsXULTooltipListener.cpp
layout/xul/nsXULTooltipListener.h
layout/xul/tree/TreeBoxObject.cpp
layout/xul/tree/TreeBoxObject.h
layout/xul/tree/nsITreeBoxObject.idl
layout/xul/tree/nsITreeColumns.idl
layout/xul/tree/nsITreeSelection.idl
layout/xul/tree/nsITreeView.idl
layout/xul/tree/nsTreeBodyFrame.cpp
layout/xul/tree/nsTreeBodyFrame.h
layout/xul/tree/nsTreeColumns.cpp
layout/xul/tree/nsTreeColumns.h
layout/xul/tree/nsTreeContentView.cpp
layout/xul/tree/nsTreeImageListener.cpp
layout/xul/tree/nsTreeImageListener.h
layout/xul/tree/nsTreeSelection.cpp
layout/xul/tree/nsTreeSelection.h
security/manager/pki/nsASN1Tree.cpp
security/manager/ssl/nsCertTree.cpp
--- a/accessible/base/nsCoreUtils.cpp
+++ b/accessible/base/nsCoreUtils.cpp
@@ -65,17 +65,17 @@ nsCoreUtils::HasClickListener(nsIContent
   return listenerManager &&
     (listenerManager->HasListenersFor(nsGkAtoms::onclick) ||
      listenerManager->HasListenersFor(nsGkAtoms::onmousedown) ||
      listenerManager->HasListenersFor(nsGkAtoms::onmouseup));
 }
 
 void
 nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
-                                int32_t aRowIndex, nsITreeColumn *aColumn,
+                                int32_t aRowIndex, nsTreeColumn *aColumn,
                                 const nsAString& aPseudoElt)
 {
   RefPtr<dom::Element> tcElm;
   aTreeBoxObj->GetTreeBody(getter_AddRefs(tcElm));
   if (!tcElm)
     return;
 
   nsIDocument *document = tcElm->GetUncomposedDoc();
@@ -514,17 +514,17 @@ nsCoreUtils::GetTreeBoxObject(nsIContent
         return treeBox.forget();
     }
     currentContent = currentContent->GetFlattenedTreeParent();
   }
 
   return nullptr;
 }
 
-already_AddRefed<nsITreeColumn>
+already_AddRefed<nsTreeColumn>
 nsCoreUtils::GetFirstSensibleColumn(nsITreeBoxObject *aTree)
 {
   RefPtr<nsTreeColumns> cols;
   aTree->GetColumns(getter_AddRefs(cols));
   if (!cols)
     return nullptr;
 
   RefPtr<nsTreeColumn> column = cols->GetFirstColumn();
@@ -551,58 +551,54 @@ nsCoreUtils::GetSensibleColumnCount(nsIT
       count++;
 
     column = column->GetNext();
   }
 
   return count;
 }
 
-already_AddRefed<nsITreeColumn>
+already_AddRefed<nsTreeColumn>
 nsCoreUtils::GetSensibleColumnAt(nsITreeBoxObject *aTree, uint32_t aIndex)
 {
   uint32_t idx = aIndex;
 
-  nsCOMPtr<nsITreeColumn> column = GetFirstSensibleColumn(aTree);
+  nsCOMPtr<nsTreeColumn> column = GetFirstSensibleColumn(aTree);
   while (column) {
     if (idx == 0)
       return column.forget();
 
     idx--;
     column = GetNextSensibleColumn(column);
   }
 
   return nullptr;
 }
 
-already_AddRefed<nsITreeColumn>
+already_AddRefed<nsTreeColumn>
 nsCoreUtils::GetNextSensibleColumn(nsITreeColumn *aColumn)
 {
-  nsCOMPtr<nsITreeColumn> nextColumn;
+  RefPtr<nsTreeColumn> nextColumn;
   aColumn->GetNext(getter_AddRefs(nextColumn));
 
   while (nextColumn && IsColumnHidden(nextColumn)) {
-    nsCOMPtr<nsITreeColumn> tempColumn;
-    nextColumn->GetNext(getter_AddRefs(tempColumn));
-    nextColumn.swap(tempColumn);
+    nextColumn = nextColumn->GetNext();
   }
 
   return nextColumn.forget();
 }
 
-already_AddRefed<nsITreeColumn>
+already_AddRefed<nsTreeColumn>
 nsCoreUtils::GetPreviousSensibleColumn(nsITreeColumn *aColumn)
 {
-  nsCOMPtr<nsITreeColumn> prevColumn;
+  RefPtr<nsTreeColumn> prevColumn;
   aColumn->GetPrevious(getter_AddRefs(prevColumn));
 
   while (prevColumn && IsColumnHidden(prevColumn)) {
-    nsCOMPtr<nsITreeColumn> tempColumn;
-    prevColumn->GetPrevious(getter_AddRefs(tempColumn));
-    prevColumn.swap(tempColumn);
+    prevColumn = prevColumn->GetPrevious();
   }
 
   return prevColumn.forget();
 }
 
 bool
 nsCoreUtils::IsColumnHidden(nsITreeColumn *aColumn)
 {
--- a/accessible/base/nsCoreUtils.h
+++ b/accessible/base/nsCoreUtils.h
@@ -12,16 +12,17 @@
 #include "nsIContent.h"
 #include "nsIDocument.h" // for GetShell()
 #include "nsIPresShell.h"
 
 #include "nsPoint.h"
 #include "nsTArray.h"
 
 class nsRange;
+class nsTreeColumn;
 class nsIBoxObject;
 class nsIFrame;
 class nsIDocShell;
 class nsITreeColumn;
 class nsITreeBoxObject;
 class nsIWidget;
 
 /**
@@ -46,17 +47,17 @@ public:
    *
    * @param  aTreeBoxObj  [in] tree box object
    * @param  aRowIndex    [in] row index
    * @param  aColumn      [in] column object
    * @param  aPseudoElm   [in] pseudo elemenet inside the cell, see
    *                       nsITreeBoxObject for available values
    */
   static void DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
-                                 int32_t aRowIndex, nsITreeColumn *aColumn,
+                                 int32_t aRowIndex, nsTreeColumn *aColumn,
                                  const nsAString& aPseudoElt = EmptyString());
 
   /**
    * Send mouse event to the given element.
    *
    * @param aMessage     [in] an event message (see EventForwards.h)
    * @param aX           [in] x coordinate in dev pixels
    * @param aY           [in] y coordinate in dev pixels
@@ -244,40 +245,40 @@ public:
    * Return tree box object from any levels DOMNode under the XUL tree.
    */
   static already_AddRefed<nsITreeBoxObject>
     GetTreeBoxObject(nsIContent* aContent);
 
   /**
    * Return first sensible column for the given tree box object.
    */
-  static already_AddRefed<nsITreeColumn>
+  static already_AddRefed<nsTreeColumn>
     GetFirstSensibleColumn(nsITreeBoxObject *aTree);
 
   /**
    * Return sensible columns count for the given tree box object.
    */
   static uint32_t GetSensibleColumnCount(nsITreeBoxObject *aTree);
 
   /**
    * Return sensible column at the given index for the given tree box object.
    */
-  static already_AddRefed<nsITreeColumn>
+  static already_AddRefed<nsTreeColumn>
     GetSensibleColumnAt(nsITreeBoxObject *aTree, uint32_t aIndex);
 
   /**
    * Return next sensible column for the given column.
    */
-  static already_AddRefed<nsITreeColumn>
+  static already_AddRefed<nsTreeColumn>
     GetNextSensibleColumn(nsITreeColumn *aColumn);
 
   /**
    * Return previous sensible column for the given column.
    */
-  static already_AddRefed<nsITreeColumn>
+  static already_AddRefed<nsTreeColumn>
     GetPreviousSensibleColumn(nsITreeColumn *aColumn);
 
   /**
    * Return true if the given column is hidden (i.e. not sensible).
    */
   static bool IsColumnHidden(nsITreeColumn *aColumn);
 
   /**
--- a/accessible/windows/msaa/XULTreeGridAccessibleWrap.h
+++ b/accessible/windows/msaa/XULTreeGridAccessibleWrap.h
@@ -47,17 +47,17 @@ class XULTreeGridCellAccessibleWrap : pu
   ~XULTreeGridCellAccessibleWrap() {}
 
 public:
   XULTreeGridCellAccessibleWrap(nsIContent* aContent,
                                 DocAccessible* aDoc,
                                 XULTreeGridRowAccessible* aRowAcc,
                                 nsITreeBoxObject* aTree,
                                 nsITreeView* aTreeView,
-                                int32_t aRow, nsITreeColumn* aColumn) :
+                                int32_t aRow, nsTreeColumn* aColumn) :
     XULTreeGridCellAccessible(aContent, aDoc, aRowAcc, aTree, aTreeView, aRow,
                               aColumn), ia2AccessibleTableCell(this) {}
 
   // IUnknown
   DECL_IUNKNOWN_INHERITED
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
--- a/accessible/xul/XULTreeAccessible.cpp
+++ b/accessible/xul/XULTreeAccessible.cpp
@@ -189,17 +189,17 @@ XULTreeAccessible::ChildAtPoint(int32_t 
   NS_ENSURE_TRUE(rootFrame, nullptr);
 
   CSSIntRect rootRect = rootFrame->GetScreenRect();
 
   int32_t clientX = presContext->DevPixelsToIntCSSPixels(aX) - rootRect.X();
   int32_t clientY = presContext->DevPixelsToIntCSSPixels(aY) - rootRect.Y();
 
   int32_t row = -1;
-  nsCOMPtr<nsITreeColumn> column;
+  RefPtr<nsTreeColumn> column;
   nsAutoString childEltUnused;
   mTree->GetCellAt(clientX, clientY, &row, getter_AddRefs(column),
                    childEltUnused);
 
   // If we failed to find tree cell for the given point then it might be
   // tree columns.
   if (row == -1 || !column)
     return AccessibleWrap::ChildAtPoint(aX, aY, aWhichChild);
@@ -719,17 +719,17 @@ XULTreeItemAccessibleBase::BoundsInCSSPi
   // Get x coordinate and width from treechildren element, get y coordinate and
   // height from tree cell.
 
   nsCOMPtr<nsIBoxObject> boxObj = nsCoreUtils::GetTreeBodyBoxObject(mTree);
   if (!boxObj) {
     return nsIntRect();
   }
 
-  nsCOMPtr<nsITreeColumn> column = nsCoreUtils::GetFirstSensibleColumn(mTree);
+  RefPtr<nsTreeColumn> column = nsCoreUtils::GetFirstSensibleColumn(mTree);
 
   int32_t x = 0, y = 0, width = 0, height = 0;
   nsresult rv = mTree->GetCoordsForCellItem(mRow, column, EmptyString(),
                                             &x, &y, &width, &height);
   if (NS_FAILED(rv)) {
     return nsIntRect();
   }
 
@@ -1034,17 +1034,17 @@ XULTreeItemAccessibleBase::IsExpandable(
       }
     }
   }
 
   return false;
 }
 
 void
-XULTreeItemAccessibleBase::GetCellName(nsITreeColumn* aColumn, nsAString& aName) const
+XULTreeItemAccessibleBase::GetCellName(nsTreeColumn* aColumn, nsAString& aName) const
 {
 
   mTreeView->GetCellText(mRow, aColumn, aName);
 
   // If there is still no name try the cell value:
   // This is for graphical cells. We need tree/table view implementors to
   // implement FooView::GetCellValue to return a meaningful string for cases
   // where there is something shown in the cell (non-text) such as a star icon;
--- a/accessible/xul/XULTreeAccessible.h
+++ b/accessible/xul/XULTreeAccessible.h
@@ -6,17 +6,17 @@
 #ifndef mozilla_a11y_XULTreeAccessible_h__
 #define mozilla_a11y_XULTreeAccessible_h__
 
 #include "nsITreeBoxObject.h"
 #include "nsITreeView.h"
 #include "XULListboxAccessible.h"
 
 class nsTreeBodyFrame;
-class nsITreeColumn;
+class nsTreeColumn;
 
 namespace mozilla {
 namespace a11y {
 
 class XULTreeGridCellAccessible;
 
 /*
  * A class the represents the XUL Tree widget.
@@ -172,17 +172,17 @@ public:
    * Return row index associated with the accessible.
    */
   int32_t GetRowIndex() const { return mRow; }
 
   /**
    * Return cell accessible for the given column. If XUL tree accessible is not
    * accessible table then return null.
    */
-  virtual XULTreeGridCellAccessible* GetCellAccessible(nsITreeColumn* aColumn) const
+  virtual XULTreeGridCellAccessible* GetCellAccessible(nsTreeColumn* aColumn) const
     { return nullptr; }
 
   /**
    * Proccess row invalidation. Used to fires name change events.
    */
   virtual void RowInvalidated(int32_t aStartColIdx, int32_t aEndColIdx) = 0;
 
 protected:
@@ -201,17 +201,17 @@ protected:
   /**
    * Return true if the tree item accessible is expandable (contains subrows).
    */
   bool IsExpandable() const;
 
   /**
    * Return name for cell at the given column.
    */
-  void GetCellName(nsITreeColumn* aColumn, nsAString& aName) const;
+  void GetCellName(nsTreeColumn* aColumn, nsAString& aName) const;
 
   nsCOMPtr<nsITreeBoxObject> mTree;
   nsITreeView* mTreeView;
   int32_t mRow;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(XULTreeItemAccessibleBase,
                               XULTREEITEMBASEACCESSIBLE_IMPL_CID)
@@ -239,17 +239,17 @@ public:
 
   // XULTreeItemAccessibleBase
   virtual void RowInvalidated(int32_t aStartColIdx, int32_t aEndColIdx) override;
 
 protected:
   virtual ~XULTreeItemAccessible();
 
   // XULTreeItemAccessible
-  nsCOMPtr<nsITreeColumn> mColumn;
+  RefPtr<nsTreeColumn> mColumn;
   nsString mCachedName;
 };
 
 
 /**
  * Accessible class for columns element of XUL tree.
  */
 class XULTreeColumAccessible : public XULColumAccessible
--- a/accessible/xul/XULTreeGridAccessible.cpp
+++ b/accessible/xul/XULTreeGridAccessible.cpp
@@ -121,17 +121,17 @@ XULTreeGridAccessible::SelectedRowIndice
 
 Accessible*
 XULTreeGridAccessible::CellAt(uint32_t aRowIndex, uint32_t aColumnIndex)
 {
   Accessible* row = GetTreeItemAccessible(aRowIndex);
   if (!row)
     return nullptr;
 
-  nsCOMPtr<nsITreeColumn> column =
+  RefPtr<nsTreeColumn> column =
     nsCoreUtils::GetSensibleColumnAt(mTree, aColumnIndex);
   if (!column)
     return nullptr;
 
   RefPtr<XULTreeItemAccessibleBase> rowAcc = do_QueryObject(row);
   if (!rowAcc)
     return nullptr;
 
@@ -293,17 +293,17 @@ XULTreeGridRowAccessible::NativeRole() c
 }
 
 ENameValueFlag
 XULTreeGridRowAccessible::Name(nsString& aName) const
 {
   aName.Truncate();
 
   // XXX: the row name sholdn't be a concatenation of cell names (bug 664384).
-  nsCOMPtr<nsITreeColumn> column = nsCoreUtils::GetFirstSensibleColumn(mTree);
+  RefPtr<nsTreeColumn> column = nsCoreUtils::GetFirstSensibleColumn(mTree);
   while (column) {
     if (!aName.IsEmpty())
       aName.Append(' ');
 
     nsAutoString cellName;
     GetCellName(column, cellName);
     aName.Append(cellName);
 
@@ -328,17 +328,17 @@ XULTreeGridRowAccessible::ChildAtPoint(i
   NS_ENSURE_TRUE(rootFrame, nullptr);
 
   CSSIntRect rootRect = rootFrame->GetScreenRect();
 
   int32_t clientX = presContext->DevPixelsToIntCSSPixels(aX) - rootRect.X();
   int32_t clientY = presContext->DevPixelsToIntCSSPixels(aY) - rootRect.Y();
 
   int32_t row = -1;
-  nsCOMPtr<nsITreeColumn> column;
+  RefPtr<nsTreeColumn> column;
   nsAutoString childEltUnused;
   mTree->GetCellAt(clientX, clientY, &row, getter_AddRefs(column),
                    childEltUnused);
 
   // Return if we failed to find tree cell in the row for the given point.
   if (row != mRow || !column)
     return nullptr;
 
@@ -346,17 +346,17 @@ XULTreeGridRowAccessible::ChildAtPoint(i
 }
 
 Accessible*
 XULTreeGridRowAccessible::GetChildAt(uint32_t aIndex) const
 {
   if (IsDefunct())
     return nullptr;
 
-  nsCOMPtr<nsITreeColumn> column =
+  RefPtr<nsTreeColumn> column =
     nsCoreUtils::GetSensibleColumnAt(mTree, aIndex);
   if (!column)
     return nullptr;
 
   return GetCellAccessible(column);
 }
 
 uint32_t
@@ -364,17 +364,17 @@ XULTreeGridRowAccessible::ChildCount() c
 {
   return nsCoreUtils::GetSensibleColumnCount(mTree);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTreeGridRowAccessible: XULTreeItemAccessibleBase implementation
 
 XULTreeGridCellAccessible*
-XULTreeGridRowAccessible::GetCellAccessible(nsITreeColumn* aColumn) const
+XULTreeGridRowAccessible::GetCellAccessible(nsTreeColumn* aColumn) const
 {
   MOZ_ASSERT(aColumn, "No tree column!");
 
   void* key = static_cast<void*>(aColumn);
   XULTreeGridCellAccessible* cachedCell = mAccessibleCache.GetWeak(key);
   if (cachedCell)
     return cachedCell;
 
@@ -415,17 +415,17 @@ XULTreeGridRowAccessible::RowInvalidated
 ////////////////////////////////////////////////////////////////////////////////
 // XULTreeGridCellAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 XULTreeGridCellAccessible::
   XULTreeGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc,
                             XULTreeGridRowAccessible* aRowAcc,
                             nsITreeBoxObject* aTree, nsITreeView* aTreeView,
-                            int32_t aRow, nsITreeColumn* aColumn) :
+                            int32_t aRow, nsTreeColumn* aColumn) :
   LeafAccessible(aContent, aDoc), mTree(aTree),
   mTreeView(aTreeView), mRow(aRow), mColumn(aColumn)
 {
   mParent = aRowAcc;
   mStateFlags |= eSharedNode;
   mGenericTypes |= eTableCell;
 
   NS_ASSERTION(mTreeView, "mTreeView is null");
@@ -611,17 +611,17 @@ XULTreeGridCellAccessible::Table() const
 
   return nullptr;
 }
 
 uint32_t
 XULTreeGridCellAccessible::ColIdx() const
 {
   uint32_t colIdx = 0;
-  nsCOMPtr<nsITreeColumn> column = mColumn;
+  RefPtr<nsTreeColumn> column = mColumn;
   while ((column = nsCoreUtils::GetPreviousSensibleColumn(column)))
     colIdx++;
 
   return colIdx;
 }
 
 uint32_t
 XULTreeGridCellAccessible::RowIdx() const
@@ -777,17 +777,17 @@ XULTreeGridCellAccessible::CellInvalidat
 
 Accessible*
 XULTreeGridCellAccessible::GetSiblingAtOffset(int32_t aOffset,
                                               nsresult* aError) const
 {
   if (aError)
     *aError =  NS_OK; // fail peacefully
 
-  nsCOMPtr<nsITreeColumn> columnAtOffset(mColumn), column;
+  RefPtr<nsTreeColumn> columnAtOffset(mColumn), column;
   if (aOffset < 0) {
     for (int32_t index = aOffset; index < 0 && columnAtOffset; index++) {
       column = nsCoreUtils::GetPreviousSensibleColumn(columnAtOffset);
       column.swap(columnAtOffset);
     }
   } else {
     for (int32_t index = aOffset; index > 0 && columnAtOffset; index--) {
       column = nsCoreUtils::GetNextSensibleColumn(columnAtOffset);
--- a/accessible/xul/XULTreeGridAccessible.h
+++ b/accessible/xul/XULTreeGridAccessible.h
@@ -85,17 +85,17 @@ public:
   virtual ENameValueFlag Name(nsString& aName) const override;
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild) override;
 
   virtual Accessible* GetChildAt(uint32_t aIndex) const override;
   virtual uint32_t ChildCount() const override;
 
   // XULTreeItemAccessibleBase
-  XULTreeGridCellAccessible* GetCellAccessible(nsITreeColumn* aColumn)
+  XULTreeGridCellAccessible* GetCellAccessible(nsTreeColumn* aColumn)
     const final;
   virtual void RowInvalidated(int32_t aStartColIdx, int32_t aEndColIdx) override;
 
 protected:
   virtual ~XULTreeGridRowAccessible();
 
   // XULTreeItemAccessibleBase
   mutable nsRefPtrHashtable<nsPtrHashKey<const void>, XULTreeGridCellAccessible>
@@ -111,17 +111,17 @@ protected:
 class XULTreeGridCellAccessible : public LeafAccessible,
                                   public TableCellAccessible
 {
 public:
 
   XULTreeGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc,
                             XULTreeGridRowAccessible* aRowAcc,
                             nsITreeBoxObject* aTree, nsITreeView* aTreeView,
-                            int32_t aRow, nsITreeColumn* aColumn);
+                            int32_t aRow, nsTreeColumn* aColumn);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeGridCellAccessible,
                                            LeafAccessible)
 
   // Accessible
   virtual void Shutdown() override;
@@ -174,17 +174,17 @@ protected:
   bool IsEditable() const;
 
   enum { eAction_Click = 0 };
 
   nsCOMPtr<nsITreeBoxObject> mTree;
   nsITreeView* mTreeView;
 
   int32_t mRow;
-  nsCOMPtr<nsITreeColumn> mColumn;
+  RefPtr<nsTreeColumn> mColumn;
 
   nsString mCachedTextEquiv;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/layout/xul/nsXULTooltipListener.cpp
+++ b/layout/xul/nsXULTooltipListener.cpp
@@ -346,17 +346,17 @@ nsXULTooltipListener::CheckTreeBodyMove(
 
   nsCOMPtr<nsITreeBoxObject> obx;
   GetSourceTreeBoxObject(getter_AddRefs(obx));
   if (bx && obx) {
     int32_t x = aMouseEvent->ScreenX(CallerType::System);
     int32_t y = aMouseEvent->ScreenY(CallerType::System);
 
     int32_t row;
-    nsCOMPtr<nsITreeColumn> col;
+    RefPtr<nsTreeColumn> col;
     nsAutoString obj;
 
     // subtract off the documentElement's boxObject
     int32_t boxX, boxY;
     bx->GetScreenX(&boxX);
     bx->GetScreenY(&boxY);
     x -= boxX;
     y -= boxY;
@@ -451,33 +451,33 @@ nsXULTooltipListener::ShowTooltip()
 }
 
 #ifdef MOZ_XUL
 // XXX: "This stuff inside DEBUG_crap could be used to make tree tooltips work
 //       in the future."
 #ifdef DEBUG_crap
 static void
 GetTreeCellCoords(nsITreeBoxObject* aTreeBox, nsIContent* aSourceNode,
-                  int32_t aRow, nsITreeColumn* aCol, int32_t* aX, int32_t* aY)
+                  int32_t aRow, nsTreeColumn* aCol, int32_t* aX, int32_t* aY)
 {
   int32_t junk;
   aTreeBox->GetCoordsForCellItem(aRow, aCol, EmptyCString(), aX, aY, &junk, &junk);
   RefPtr<nsXULElement> xulEl = nsXULElement::FromNode(aSourceNode);
   nsCOMPtr<nsIBoxObject> bx = xulEl->GetBoxObject(IgnoreErrors());
   int32_t myX, myY;
   bx->GetX(&myX);
   bx->GetY(&myY);
   *aX += myX;
   *aY += myY;
 }
 #endif
 
 static void
 SetTitletipLabel(nsITreeBoxObject* aTreeBox, Element* aTooltip,
-                 int32_t aRow, nsITreeColumn* aCol)
+                 int32_t aRow, nsTreeColumn* aCol)
 {
   nsCOMPtr<nsITreeView> view;
   aTreeBox->GetView(getter_AddRefs(view));
   if (view) {
     nsAutoString label;
 #ifdef DEBUG
     nsresult rv =
 #endif
--- a/layout/xul/nsXULTooltipListener.h
+++ b/layout/xul/nsXULTooltipListener.h
@@ -13,17 +13,17 @@
 #include "nsString.h"
 #ifdef MOZ_XUL
 #include "nsITreeBoxObject.h"
 #endif
 #include "nsWeakPtr.h"
 #include "mozilla/Attributes.h"
 
 class nsIContent;
-class nsITreeColumn;
+class nsTreeColumn;
 
 namespace mozilla {
 namespace dom {
 class Event;
 class MouseEvent;
 } // namespace dom
 } // namespace mozilla
 
@@ -94,13 +94,13 @@ protected:
   // the next time the mouse enters the node (bug #395668).
   bool mTooltipShownOnce;
 
 #ifdef MOZ_XUL
   // special members for handling trees
   bool mIsSourceTree;
   bool mNeedTitletip;
   int32_t mLastTreeRow;
-  nsCOMPtr<nsITreeColumn> mLastTreeCol;
+  RefPtr<nsTreeColumn> mLastTreeCol;
 #endif
 };
 
 #endif // nsXULTooltipListener
--- a/layout/xul/tree/TreeBoxObject.cpp
+++ b/layout/xul/tree/TreeBoxObject.cpp
@@ -348,17 +348,17 @@ TreeBoxObject::EnsureRowIsVisible(int32_
 {
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   if (body)
     return body->EnsureRowIsVisible(aRow);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TreeBoxObject::EnsureCellIsVisible(int32_t aRow, nsITreeColumn* aCol)
+TreeBoxObject::EnsureCellIsVisible(int32_t aRow, nsTreeColumn* aCol)
 {
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   if (body)
     return body->EnsureCellIsVisible(aRow, aCol);
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -384,26 +384,26 @@ TreeBoxObject::ScrollByPages(int32_t aNu
 {
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   if (body)
     return body->ScrollByPages(aNumPages);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TreeBoxObject::ScrollToCell(int32_t aRow, nsITreeColumn* aCol)
+TreeBoxObject::ScrollToCell(int32_t aRow, nsTreeColumn* aCol)
 {
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   if (body)
     return body->ScrollToCell(aRow, aCol);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TreeBoxObject::ScrollToColumn(nsITreeColumn* aCol)
+TreeBoxObject::ScrollToColumn(nsTreeColumn* aCol)
 {
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   if (body)
     return body->ScrollToColumn(aCol);
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -419,17 +419,17 @@ NS_IMETHODIMP TreeBoxObject::Invalidate(
 {
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   if (body)
     return body->Invalidate();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TreeBoxObject::InvalidateColumn(nsITreeColumn* aCol)
+TreeBoxObject::InvalidateColumn(nsTreeColumn* aCol)
 {
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   if (body)
     return body->InvalidateColumn(aCol);
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -437,17 +437,17 @@ TreeBoxObject::InvalidateRow(int32_t aIn
 {
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   if (body)
     return body->InvalidateRow(aIndex);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TreeBoxObject::InvalidateCell(int32_t aRow, nsITreeColumn* aCol)
+TreeBoxObject::InvalidateCell(int32_t aRow, nsTreeColumn* aCol)
 {
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   if (body)
     return body->InvalidateCell(aRow, aCol);
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -455,17 +455,17 @@ TreeBoxObject::InvalidateRange(int32_t a
 {
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   if (body)
     return body->InvalidateRange(aStart, aEnd);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TreeBoxObject::InvalidateColumnRange(int32_t aStart, int32_t aEnd, nsITreeColumn* aCol)
+TreeBoxObject::InvalidateColumnRange(int32_t aStart, int32_t aEnd, nsTreeColumn* aCol)
 {
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   if (body)
     return body->InvalidateColumnRange(aStart, aEnd, aCol);
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -483,50 +483,49 @@ TreeBoxObject::GetRowAt(int32_t x, int32
 {
   int32_t row;
   GetRowAt(x, y, &row);
   return row;
 }
 
 NS_IMETHODIMP
 TreeBoxObject::GetCellAt(int32_t aX, int32_t aY, int32_t *aRow,
-                         nsITreeColumn** aCol, nsAString& aChildElt)
+                         nsTreeColumn** aCol, nsAString& aChildElt)
 {
   *aRow = 0;
   *aCol = nullptr;
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   if (body) {
     nsAutoCString element;
     nsresult retval = body->GetCellAt(aX, aY, aRow, aCol, element);
     CopyUTF8toUTF16(element, aChildElt);
     return retval;
   }
   return NS_OK;
 }
 
 void
 TreeBoxObject::GetCellAt(int32_t x, int32_t y, TreeCellInfo& aRetVal, ErrorResult& aRv)
 {
-  nsCOMPtr<nsITreeColumn> col;
-  GetCellAt(x, y, &aRetVal.mRow, getter_AddRefs(col), aRetVal.mChildElt);
-  aRetVal.mCol = col.forget().downcast<nsTreeColumn>();
+  GetCellAt(x, y, &aRetVal.mRow, getter_AddRefs(aRetVal.mCol),
+            aRetVal.mChildElt);
 }
 
 void
 TreeBoxObject::GetCellAt(JSContext* cx,
                          int32_t x, int32_t y,
                          JS::Handle<JSObject*> rowOut,
                          JS::Handle<JSObject*> colOut,
                          JS::Handle<JSObject*> childEltOut,
                          ErrorResult& aRv)
 {
   int32_t row;
-  nsITreeColumn* col;
+  RefPtr<nsTreeColumn> col;
   nsAutoString childElt;
-  GetCellAt(x, y, &row, &col, childElt);
+  GetCellAt(x, y, &row, getter_AddRefs(col), childElt);
 
   JS::Rooted<JS::Value> v(cx);
 
   if (!ToJSValue(cx, row, &v) ||
       !JS_SetProperty(cx, rowOut, "value", v)) {
     aRv.Throw(NS_ERROR_XPC_CANT_SET_OUT_VAL);
     return;
   }
@@ -538,17 +537,17 @@ TreeBoxObject::GetCellAt(JSContext* cx,
   if (!ToJSValue(cx, childElt, &v) ||
       !JS_SetProperty(cx, childEltOut, "value", v)) {
     aRv.Throw(NS_ERROR_XPC_CANT_SET_OUT_VAL);
     return;
   }
 }
 
 NS_IMETHODIMP
-TreeBoxObject::GetCoordsForCellItem(int32_t aRow, nsITreeColumn* aCol, const nsAString& aElement,
+TreeBoxObject::GetCoordsForCellItem(int32_t aRow, nsTreeColumn* aCol, const nsAString& aElement,
                                       int32_t *aX, int32_t *aY, int32_t *aWidth, int32_t *aHeight)
 {
   *aX = *aY = *aWidth = *aHeight = 0;
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   NS_ConvertUTF16toUTF8 element(aElement);
   if (body)
     return body->GetCoordsForCellItem(aRow, aCol, element, aX, aY, aWidth, aHeight);
   return NS_OK;
@@ -594,27 +593,27 @@ TreeBoxObject::GetCoordsForCellItem(JSCo
   v.setInt32(h);
   if (!JS_SetProperty(cx, heightOut, "value", v)) {
     aRv.Throw(NS_ERROR_XPC_CANT_SET_OUT_VAL);
     return;
   }
 }
 
 NS_IMETHODIMP
-TreeBoxObject::IsCellCropped(int32_t aRow, nsITreeColumn* aCol, bool *aIsCropped)
+TreeBoxObject::IsCellCropped(int32_t aRow, nsTreeColumn* aCol, bool *aIsCropped)
 {
   *aIsCropped = false;
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   if (body)
     return body->IsCellCropped(aRow, aCol, aIsCropped);
   return NS_OK;
 }
 
 bool
-TreeBoxObject::IsCellCropped(int32_t row, nsITreeColumn* col, ErrorResult& aRv)
+TreeBoxObject::IsCellCropped(int32_t row, nsTreeColumn* col, ErrorResult& aRv)
 {
   bool ret;
   aRv = IsCellCropped(row, col, &ret);
   return ret;
 }
 
 NS_IMETHODIMP
 TreeBoxObject::RowCountChanged(int32_t aIndex, int32_t aDelta)
@@ -648,29 +647,29 @@ TreeBoxObject::ClearStyleAndImageCaches(
 {
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   if (body)
     return body->ClearStyleAndImageCaches();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TreeBoxObject::RemoveImageCacheEntry(int32_t aRowIndex, nsITreeColumn* aCol)
+TreeBoxObject::RemoveImageCacheEntry(int32_t aRowIndex, nsTreeColumn* aCol)
 {
   NS_ENSURE_ARG(aCol);
   NS_ENSURE_TRUE(aRowIndex >= 0, NS_ERROR_INVALID_ARG);
   nsTreeBodyFrame* body = GetTreeBodyFrame();
   if (body) {
     return body->RemoveImageCacheEntry(aRowIndex, aCol);
   }
   return NS_OK;
 }
 
 void
-TreeBoxObject::RemoveImageCacheEntry(int32_t row, nsITreeColumn& col, ErrorResult& aRv)
+TreeBoxObject::RemoveImageCacheEntry(int32_t row, nsTreeColumn& col, ErrorResult& aRv)
 {
   aRv = RemoveImageCacheEntry(row, &col);
 }
 
 void
 TreeBoxObject::ClearCachedValues()
 {
   mTreeBody = nullptr;
--- a/layout/xul/tree/TreeBoxObject.h
+++ b/layout/xul/tree/TreeBoxObject.h
@@ -71,19 +71,19 @@ public:
 
   void GetCellAt(int32_t x, int32_t y, TreeCellInfo& aRetVal, ErrorResult& aRv);
 
   already_AddRefed<DOMRect> GetCoordsForCellItem(int32_t row,
                                                  nsTreeColumn& col,
                                                  const nsAString& element,
                                                  ErrorResult& aRv);
 
-  bool IsCellCropped(int32_t row, nsITreeColumn* col, ErrorResult& aRv);
+  bool IsCellCropped(int32_t row, nsTreeColumn* col, ErrorResult& aRv);
 
-  void RemoveImageCacheEntry(int32_t row, nsITreeColumn& col, ErrorResult& aRv);
+  void RemoveImageCacheEntry(int32_t row, nsTreeColumn& col, ErrorResult& aRv);
 
   // Deprecated APIs from old IDL
   void GetCellAt(JSContext* cx,
                  int32_t x, int32_t y,
                  JS::Handle<JSObject*> rowOut,
                  JS::Handle<JSObject*> colOut,
                  JS::Handle<JSObject*> childEltOut,
                  ErrorResult& aRv);
@@ -100,28 +100,28 @@ public:
 
   // Same signature (except for nsresult return type) as the XPIDL impls
   // void Invalidate();
   // void BeginUpdateBatch();
   // void EndUpdateBatch();
   // void ClearStyleAndImageCaches();
   // void SetFocused(bool arg);
   // void EnsureRowIsVisible(int32_t index);
-  // void EnsureCellIsVisible(int32_t row, nsITreeColumn* col);
+  // void EnsureCellIsVisible(int32_t row, nsTreeColumn* col);
   // void ScrollToRow(int32_t index);
   // void ScrollByLines(int32_t numLines);
   // void ScrollByPages(int32_t numPages);
-  // void ScrollToCell(int32_t row, nsITreeColumn* col);
-  // void ScrollToColumn(nsITreeColumn* col);
+  // void ScrollToCell(int32_t row, nsTreeColumn* col);
+  // void ScrollToColumn(nsTreeColumn* col);
   // void ScrollToHorizontalPosition(int32_t horizontalPosition);
-  // void InvalidateColumn(nsITreeColumn* col);
+  // void InvalidateColumn(nsTreeColumn* col);
   // void InvalidateRow(int32_t index);
-  // void InvalidateCell(int32_t row, nsITreeColumn* col);
+  // void InvalidateCell(int32_t row, nsTreeColumn* col);
   // void InvalidateRange(int32_t startIndex, int32_t endIndex);
-  // void InvalidateColumnRange(int32_t startIndex, int32_t endIndex, nsITreeColumn* col);
+  // void InvalidateColumnRange(int32_t startIndex, int32_t endIndex, nsTreeColumn* col);
   // void RowCountChanged(int32_t index, int32_t count);
 
 protected:
   nsTreeBodyFrame* mTreeBody;
   nsCOMPtr<nsITreeView> mView;
 
 private:
   ~TreeBoxObject();
--- a/layout/xul/tree/nsITreeBoxObject.idl
+++ b/layout/xul/tree/nsITreeBoxObject.idl
@@ -2,20 +2,20 @@
 /* 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 "nsISupports.idl"
 
 interface nsITreeView;
 interface nsITreeSelection;
-interface nsITreeColumn;
 interface nsIScriptableRegion;
 
 webidl Element;
+webidl TreeColumn;
 webidl TreeColumns;
 
 /**
  * This interface cannot become builtinclass until bug 1438525 is fixed.
  */
 [scriptable, uuid(f3da0c5e-51f5-45f0-b2cd-6be3ab6847ae)]
 interface nsITreeBoxObject : nsISupports
 {
@@ -79,17 +79,17 @@ interface nsITreeBoxObject : nsISupports
   /**
    * Ensures that a row at a given index is visible.
    */
   void ensureRowIsVisible(in long index);
 
   /**
    * Ensures that a given cell in the tree is visible.
    */
-  void ensureCellIsVisible(in long row, in nsITreeColumn col);
+  void ensureCellIsVisible(in long row, in TreeColumn col);
 
   /**
    * Scrolls such that the row at index is at the top of the visible view.
    */
   void scrollToRow(in long index);
 
   /**
    * Scroll the tree up or down by numLines lines. Positive
@@ -105,39 +105,39 @@ interface nsITreeBoxObject : nsISupports
    * off the end of the tree.
    */
   void scrollByPages(in long numPages);
   
   /**
    * Scrolls such that a given cell is visible (if possible) 
    * at the top left corner of the visible view. 
    */
-  void scrollToCell(in long row, in nsITreeColumn col);
+  void scrollToCell(in long row, in TreeColumn col);
 
   /**
    * Scrolls horizontally so that the specified column is 
    * at the left of the view (if possible).
    */
-  void scrollToColumn(in nsITreeColumn col);
+  void scrollToColumn(in TreeColumn col);
 
   /**
    * Scroll to a specific horizontal pixel position.
    */
   void scrollToHorizontalPosition(in long horizontalPosition);
 
   /**
    * Invalidation methods for fine-grained painting control.
    */
   void invalidate();
-  void invalidateColumn(in nsITreeColumn col);
+  void invalidateColumn(in TreeColumn col);
   void invalidateRow(in long index);
-  void invalidateCell(in long row, in nsITreeColumn col);
+  void invalidateCell(in long row, in TreeColumn col);
   void invalidateRange(in long startIndex, in long endIndex);
   void invalidateColumnRange(in long startIndex, in long endIndex,
-                             in nsITreeColumn col);
+                             in TreeColumn col);
 
   /**
    * A hit test that can tell you what row the mouse is over.
    * returns -1 for invalid mouse coordinates.
    *
    * The coordinate system is the client coordinate system for the
    * document this boxObject lives in, and the units are CSS pixels.
    */
@@ -147,28 +147,28 @@ interface nsITreeBoxObject : nsISupports
    * A hit test that can tell you what cell the mouse is over.  Row is the row index
    * hit,  returns -1 for invalid mouse coordinates.  ColID is the column hit.
    * ChildElt is the pseudoelement hit: this can have values of
    * "cell", "twisty", "image", and "text".
    *
    * The coordinate system is the client coordinate system for the
    * document this boxObject lives in, and the units are CSS pixels.
    */
-  void getCellAt(in long x, in long y, out long row, out nsITreeColumn col, out AString childElt);
+  void getCellAt(in long x, in long y, out long row, out TreeColumn col, out AString childElt);
 
   /** 
    * Find the coordinates of an element within a specific cell. 
    */
-  void getCoordsForCellItem(in long row, in nsITreeColumn col, in AString element,
+  void getCoordsForCellItem(in long row, in TreeColumn col, in AString element,
                             out long x, out long y, out long width, out long height);
 
   /** 
    * Determine if the text of a cell is being cropped or not.
    */
-  boolean isCellCropped(in long row, in nsITreeColumn col);
+  boolean isCellCropped(in long row, in TreeColumn col);
 
   /**
    * The view is responsible for calling these notification methods when
    * rows are added or removed.  Index is the position at which the new
    * rows were added or at which rows were removed.  For
    * non-contiguous additions/removals, this method should be called multiple times.
    */
   void rowCountChanged(in long index, in long count);
@@ -192,10 +192,10 @@ interface nsITreeBoxObject : nsISupports
   void clearStyleAndImageCaches();
 
   /**
    * Remove an image source from the image cache to allow its invalidation.
    *
    * @note This only affects images supplied by the view, not the ones supplied
    *       through the styling context, like twisties or checkboxes.
    */
-  void removeImageCacheEntry(in long row, in nsITreeColumn col);
+  void removeImageCacheEntry(in long row, in TreeColumn col);
 };
--- a/layout/xul/tree/nsITreeColumns.idl
+++ b/layout/xul/tree/nsITreeColumns.idl
@@ -1,15 +1,16 @@
 /* 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 "nsISupports.idl"
 
 webidl Element;
+webidl TreeColumn;
 webidl TreeColumns;
 
 [scriptable, builtinclass, uuid(ae835ecf-6b32-4660-9b43-8a270df56e02)]
 interface nsITreeColumn : nsISupports
 {
   readonly attribute Element element;
 
   readonly attribute TreeColumns columns;
@@ -27,13 +28,13 @@ interface nsITreeColumn : nsISupports
   readonly attribute boolean editable;
   readonly attribute boolean selectable;
 
   const short TYPE_TEXT                = 1;
   const short TYPE_CHECKBOX            = 2;
   const short TYPE_PASSWORD            = 3;
   readonly attribute short type;
 
-  nsITreeColumn getNext();
-  nsITreeColumn getPrevious();
+  TreeColumn getNext();
+  TreeColumn getPrevious();
 
   void invalidate();
 };
--- a/layout/xul/tree/nsITreeSelection.idl
+++ b/layout/xul/tree/nsITreeSelection.idl
@@ -1,15 +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/. */
 
 interface nsITreeBoxObject;
-interface nsITreeColumn;
+
+webidl TreeColumn;
 
 #include "nsISupports.idl"
 
 [scriptable, uuid(ab6fe746-300b-4ab4-abb9-1c0e3977874c)]
 interface nsITreeSelection : nsISupports
 {
   /**
    * The tree widget for this selection.
@@ -104,17 +105,17 @@ interface nsITreeSelection : nsISupports
    * The current item (the one that gets a focus rect in addition to being
    * selected).
    */
   attribute long currentIndex;
 
   /**
    * The current column.
    */
-  attribute nsITreeColumn currentColumn;
+  attribute TreeColumn currentColumn;
 
   /**
    * The selection "pivot".  This is the first item the user selected as
    * part of a ranged select.
    */
   readonly attribute long shiftSelectPivot;
 };
 
--- a/layout/xul/tree/nsITreeView.idl
+++ b/layout/xul/tree/nsITreeView.idl
@@ -2,19 +2,19 @@
 /* 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 "nsISupports.idl"
 
 interface nsITreeBoxObject;
 interface nsITreeSelection;
-interface nsITreeColumn;
 
 webidl DataTransfer;
+webidl TreeColumn;
 
 [scriptable, uuid(091116f0-0bdc-4b32-b9c8-c8d5a37cb088)]
 interface nsITreeView : nsISupports
 {
   /**
    * The total number of rows in the tree (including the offscreen rows).
    */
   readonly attribute long rowCount;
@@ -35,23 +35,23 @@ interface nsITreeView : nsISupports
 
   /**
    * A whitespace delimited list of properties for a given cell.  Each
    * property, x, that the view gives back will cause the pseudoclasses
    *  ::-moz-tree-cell(x), ::-moz-tree-row(x), ::-moz-tree-twisty(x),
    *  ::-moz-tree-image(x), ::-moz-tree-cell-text(x). to be matched on the
    *  cell.
    */
-  AString getCellProperties(in long row, in nsITreeColumn col);
+  AString getCellProperties(in long row, in TreeColumn col);
   
   /**
    * Called to get properties to paint a column background.  For shading the sort
    * column, etc.
    */
-  AString getColumnProperties(in nsITreeColumn col);
+  AString getColumnProperties(in TreeColumn col);
 
   /**
    * Methods that can be used to test whether or not a twisty should be drawn,
    * and if so, whether an open or closed twisty should be used.
    */
   boolean isContainer(in long index);
   boolean isContainerOpen(in long index);
   boolean isContainerEmpty(in long index);
@@ -108,89 +108,89 @@ interface nsITreeView : nsISupports
    */
   long getLevel(in long index);
 
   /**
    * The image path for a given cell. For defining an icon for a cell.
    * If the empty string is returned, the :moz-tree-image pseudoelement
    * will be used.
    */
-  AString getImageSrc(in long row, in nsITreeColumn col);
+  AString getImageSrc(in long row, in TreeColumn col);
 
   /**
    * The value for a given cell. This method is only called for columns
    * of type other than |text|.
    */
-  AString getCellValue(in long row, in nsITreeColumn col);
+  AString getCellValue(in long row, in TreeColumn col);
 
   /**
    * The text for a given cell.  If a column consists only of an image, then
    * the empty string is returned.  
    */
-  AString getCellText(in long row, in nsITreeColumn col);
+  AString getCellText(in long row, in TreeColumn col);
 
   /**
    * Called during initialization to link the view to the front end box object.
    */
   void setTree(in nsITreeBoxObject tree);
   
   /**
    * Called on the view when an item is opened or closed.
    */
   void toggleOpenState(in long index);
 
   /**
    * Called on the view when a header is clicked.
    */
-  void cycleHeader(in nsITreeColumn col);
+  void cycleHeader(in TreeColumn col);
 
   /**
    * Should be called from a XUL onselect handler whenever the selection changes.
    */
   void selectionChanged();
 
   /**
    * Called on the view when a cell in a non-selectable cycling column (e.g., unread/flag/etc.) is clicked.
    */
-  void cycleCell(in long row, in nsITreeColumn col);
+  void cycleCell(in long row, in TreeColumn col);
   
   /**
    * isEditable is called to ask the view if the cell contents are editable.
    * A value of true will result in the tree popping up a text field when 
    * the user tries to inline edit the cell.
    */
-  boolean isEditable(in long row, in nsITreeColumn col);
+  boolean isEditable(in long row, in TreeColumn col);
 
   /**
    * isSelectable is called to ask the view if the cell is selectable.
    * This method is only called if the selection style is |cell| or |text|.
    * XXXvarga shouldn't this be called isCellSelectable?
    */
-  boolean isSelectable(in long row, in nsITreeColumn col);
+  boolean isSelectable(in long row, in TreeColumn col);
 
   /**
    * setCellValue is called when the value of the cell has been set by the user.
    * This method is only called for columns of type other than |text|.
    */
-  void setCellValue(in long row, in nsITreeColumn col, in AString value);
+  void setCellValue(in long row, in TreeColumn col, in AString value);
 
   /**
    * setCellText is called when the contents of the cell have been edited by the user.
    */   
-  void setCellText(in long row, in nsITreeColumn col, in AString value);
+  void setCellText(in long row, in TreeColumn col, in AString value);
 
   /**
    * A command API that can be used to invoke commands on the selection.  The tree
    * will automatically invoke this method when certain keys are pressed.  For example,
    * when the DEL key is pressed, performAction will be called with the "delete" string.
    */
   void performAction(in wstring action);
 
   /**
    * A command API that can be used to invoke commands on a specific row.
    */
   void performActionOnRow(in wstring action, in long row);
 
   /**
    * A command API that can be used to invoke commands on a specific cell.
    */
-  void performActionOnCell(in wstring action, in long row, in nsITreeColumn col);
+  void performActionOnCell(in wstring action, in long row, in TreeColumn col);
 };
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -1036,18 +1036,18 @@ nsTreeBodyFrame::GetRowAt(int32_t aX, in
   }
 
   *_retval = GetRowAt(point.x, point.y);
 
   return NS_OK;
 }
 
 nsresult
-nsTreeBodyFrame::GetCellAt(int32_t aX, int32_t aY, int32_t* aRow, nsITreeColumn** aCol,
-                           nsACString& aChildElt)
+nsTreeBodyFrame::GetCellAt(int32_t aX, int32_t aY, int32_t* aRow,
+                           nsTreeColumn** aCol, nsACString& aChildElt)
 {
   if (!mView)
     return NS_OK;
 
   nsPoint point = AdjustClientCoordsToBoxCoordSpace(aX, aY);
 
   // Check if the coordinates are above our visible space.
   if (point.y < 0) {
@@ -1959,17 +1959,17 @@ nsTreeBodyFrame::PrefillPropertyArray(in
       // current
       int32_t currentIndex;
       selection->GetCurrentIndex(&currentIndex);
       if (aRowIndex == currentIndex)
         mScratchArray.AppendElement(nsGkAtoms::current);
 
       // active
       if (aCol) {
-        nsCOMPtr<nsITreeColumn> currentColumn;
+        RefPtr<nsTreeColumn> currentColumn;
         selection->GetCurrentColumn(getter_AddRefs(currentColumn));
         if (aCol == currentColumn)
           mScratchArray.AppendElement(nsGkAtoms::active);
       }
     }
 
     // container or leaf
     bool isContainer = false;
@@ -4368,17 +4368,17 @@ nsTreeBodyFrame::ClearStyleAndImageCache
 {
   mStyleCache.Clear();
   CancelImageRequests();
   mImageCache.Clear();
   return NS_OK;
 }
 
 nsresult
-nsTreeBodyFrame::RemoveImageCacheEntry(int32_t aRowIndex, nsITreeColumn* aCol)
+nsTreeBodyFrame::RemoveImageCacheEntry(int32_t aRowIndex, nsTreeColumn* aCol)
 {
   nsAutoString imageSrc;
   if (NS_SUCCEEDED(mView->GetImageSrc(aRowIndex, aCol, imageSrc))) {
     nsTreeImageCacheEntry entry;
     if (mImageCache.Get(imageSrc, &entry)) {
       nsLayoutUtils::DeregisterImageRequest(PresContext(), entry.request,
                                             nullptr);
       entry.request->CancelAndForgetObserver(NS_BINDING_ABORTED);
--- a/layout/xul/tree/nsTreeBodyFrame.h
+++ b/layout/xul/tree/nsTreeBodyFrame.h
@@ -102,27 +102,27 @@ public:
   nsresult InvalidateColumn(nsITreeColumn *aCol);
   nsresult InvalidateRow(int32_t aRow);
   nsresult InvalidateCell(int32_t aRow, nsITreeColumn *aCol);
   nsresult InvalidateRange(int32_t aStart, int32_t aEnd);
   nsresult InvalidateColumnRange(int32_t aStart, int32_t aEnd,
                                  nsITreeColumn *aCol);
   nsresult GetRowAt(int32_t aX, int32_t aY, int32_t *aValue);
   nsresult GetCellAt(int32_t aX, int32_t aY, int32_t *aRow,
-                     nsITreeColumn **aCol, nsACString &aChildElt);
+                     nsTreeColumn **aCol, nsACString &aChildElt);
   nsresult GetCoordsForCellItem(int32_t aRow, nsITreeColumn *aCol,
                                 const nsACString &aElt,
                                 int32_t *aX, int32_t *aY,
                                 int32_t *aWidth, int32_t *aHeight);
   nsresult IsCellCropped(int32_t aRow, nsITreeColumn *aCol, bool *aResult);
   nsresult RowCountChanged(int32_t aIndex, int32_t aCount);
   nsresult BeginUpdateBatch();
   nsresult EndUpdateBatch();
   nsresult ClearStyleAndImageCaches();
-  nsresult RemoveImageCacheEntry(int32_t aRowIndex, nsITreeColumn* aCol);
+  nsresult RemoveImageCacheEntry(int32_t aRowIndex, nsTreeColumn* aCol);
 
   void CancelImageRequests();
 
   void ManageReflowCallback(const nsRect& aRect, nscoord aHorzWidth);
 
   virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
   virtual void SetXULBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
                             bool aRemoveOverflowArea = false) override;
--- a/layout/xul/tree/nsTreeColumns.cpp
+++ b/layout/xul/tree/nsTreeColumns.cpp
@@ -235,24 +235,24 @@ nsTreeColumn::GetSelectable(bool* aSelec
 NS_IMETHODIMP
 nsTreeColumn::GetType(int16_t* aType)
 {
   *aType = GetType();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsTreeColumn::GetNext(nsITreeColumn** _retval)
+nsTreeColumn::GetNext(nsTreeColumn** _retval)
 {
   NS_IF_ADDREF(*_retval = GetNext());
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsTreeColumn::GetPrevious(nsITreeColumn** _retval)
+nsTreeColumn::GetPrevious(nsTreeColumn** _retval)
 {
   NS_IF_ADDREF(*_retval = GetPrevious());
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTreeColumn::Invalidate()
 {
--- a/layout/xul/tree/nsTreeColumns.h
+++ b/layout/xul/tree/nsTreeColumns.h
@@ -102,19 +102,18 @@ protected:
   nsresult GetRect(nsTreeBodyFrame* aBodyFrame, nscoord aY, nscoord aHeight,
                    nsRect* aResult);
 
   nsresult GetXInTwips(nsTreeBodyFrame* aBodyFrame, nscoord* aResult);
   nsresult GetWidthInTwips(nsTreeBodyFrame* aBodyFrame, nscoord* aResult);
 
   void SetColumns(nsTreeColumns* aColumns) { mColumns = aColumns; }
 
+public:
   const nsAString& GetId() { return mId; }
-
-public:
   nsAtom* GetAtom() { return mAtom; }
   int32_t GetIndex() { return mIndex; }
 
 protected:
   bool IsPrimary() { return mIsPrimary; }
   bool IsCycler() { return mIsCycler; }
   bool IsEditable() { return mIsEditable; }
   bool IsSelectable() { return mIsSelectable; }
--- a/layout/xul/tree/nsTreeContentView.cpp
+++ b/layout/xul/tree/nsTreeContentView.cpp
@@ -228,45 +228,43 @@ nsTreeContentView::GetCellProperties(int
     Element* cell = GetCell(realRow, aColumn);
     if (cell) {
       cell->GetAttr(kNameSpaceID_None, nsGkAtoms::properties, aProperties);
     }
   }
 }
 
 NS_IMETHODIMP
-nsTreeContentView::GetCellProperties(int32_t aRow, nsITreeColumn* aCol,
+nsTreeContentView::GetCellProperties(int32_t aRow, nsTreeColumn* aCol,
                                      nsAString& aProps)
 {
-  RefPtr<nsTreeColumn> col = nsTreeColumn::From(aCol);
-  NS_ENSURE_ARG(col);
+  NS_ENSURE_ARG(aCol);
 
   ErrorResult rv;
-  GetCellProperties(aRow, *col, aProps, rv);
+  GetCellProperties(aRow, *aCol, aProps, rv);
   return rv.StealNSResult();
 }
 
 void
 nsTreeContentView::GetColumnProperties(nsTreeColumn& aColumn,
                                        nsAString& aProperties)
 {
   RefPtr<Element> element = aColumn.GetElement(IgnoreErrors());
 
   if (element) {
     element->GetAttribute(NS_LITERAL_STRING("properties"), aProperties);
   }
 }
 
 NS_IMETHODIMP
-nsTreeContentView::GetColumnProperties(nsITreeColumn* aCol, nsAString& aProps)
+nsTreeContentView::GetColumnProperties(nsTreeColumn* aCol, nsAString& aProps)
 {
-  RefPtr<nsTreeColumn> col = nsTreeColumn::From(aCol);
-  NS_ENSURE_ARG(col);
+  NS_ENSURE_ARG(aCol);
 
-  GetColumnProperties(*col, aProps);
+  GetColumnProperties(*aCol, aProps);
   return NS_OK;
 }
 
 bool
 nsTreeContentView::IsContainer(int32_t aRow, ErrorResult& aError)
 {
   if (!IsValidRowIndex(aRow)) {
     aError.Throw(NS_ERROR_INVALID_ARG);
@@ -493,23 +491,22 @@ nsTreeContentView::GetImageSrc(int32_t a
   if (realRow) {
     Element* cell = GetCell(realRow, aColumn);
     if (cell)
       cell->GetAttr(kNameSpaceID_None, nsGkAtoms::src, aSrc);
   }
 }
 
 NS_IMETHODIMP
-nsTreeContentView::GetImageSrc(int32_t aRow, nsITreeColumn* aCol, nsAString& _retval)
+nsTreeContentView::GetImageSrc(int32_t aRow, nsTreeColumn* aCol, nsAString& _retval)
 {
-  RefPtr<nsTreeColumn> col = nsTreeColumn::From(aCol);
-  NS_ENSURE_ARG(col);
+  NS_ENSURE_ARG(aCol);
 
   ErrorResult rv;
-  GetImageSrc(aRow, *col, _retval, rv);
+  GetImageSrc(aRow, *aCol, _retval, rv);
   return rv.StealNSResult();
 }
 
 void
 nsTreeContentView::GetCellValue(int32_t aRow, nsTreeColumn& aColumn,
                                 nsAString& aValue, ErrorResult& aError)
 {
   if (!IsValidRowIndex(aRow)) {
@@ -524,23 +521,22 @@ nsTreeContentView::GetCellValue(int32_t 
   if (realRow) {
     Element* cell = GetCell(realRow, aColumn);
     if (cell)
       cell->GetAttr(kNameSpaceID_None, nsGkAtoms::value, aValue);
   }
 }
 
 NS_IMETHODIMP
-nsTreeContentView::GetCellValue(int32_t aRow, nsITreeColumn* aCol, nsAString& _retval)
+nsTreeContentView::GetCellValue(int32_t aRow, nsTreeColumn* aCol, nsAString& _retval)
 {
-  RefPtr<nsTreeColumn> col = nsTreeColumn::From(aCol);
-  NS_ENSURE_ARG(col);
+  NS_ENSURE_ARG(aCol);
 
   ErrorResult rv;
-  GetCellValue(aRow, *col, _retval, rv);
+  GetCellValue(aRow, *aCol, _retval, rv);
   return rv.StealNSResult();
 }
 
 void
 nsTreeContentView::GetCellText(int32_t aRow, nsTreeColumn& aColumn,
                                nsAString& aText, ErrorResult& aError)
 {
   if (!IsValidRowIndex(aRow)) {
@@ -564,23 +560,22 @@ nsTreeContentView::GetCellText(int32_t a
       Element* cell = GetCell(realRow, aColumn);
       if (cell)
         cell->GetAttr(kNameSpaceID_None, nsGkAtoms::label, aText);
     }
   }
 }
 
 NS_IMETHODIMP
-nsTreeContentView::GetCellText(int32_t aRow, nsITreeColumn* aCol, nsAString& _retval)
+nsTreeContentView::GetCellText(int32_t aRow, nsTreeColumn* aCol, nsAString& _retval)
 {
-  RefPtr<nsTreeColumn> col = nsTreeColumn::From(aCol);
-  NS_ENSURE_ARG(col);
+  NS_ENSURE_ARG(aCol);
 
   ErrorResult rv;
-  GetCellText(aRow, *col, _retval, rv);
+  GetCellText(aRow, *aCol, _retval, rv);
   return rv.StealNSResult();
 }
 
 void
 nsTreeContentView::SetTree(TreeBoxObject* aTree, ErrorResult& aError)
 {
   aError = SetTree(aTree);
 }
@@ -687,34 +682,33 @@ nsTreeContentView::CycleHeader(nsTreeCol
 
         xs->Sort(mRoot, sort, sortdirection);
       }
     }
   }
 }
 
 NS_IMETHODIMP
-nsTreeContentView::CycleHeader(nsITreeColumn* aCol)
+nsTreeContentView::CycleHeader(nsTreeColumn* aCol)
 {
-  RefPtr<nsTreeColumn> col = nsTreeColumn::From(aCol);
-  NS_ENSURE_ARG(col);
+  NS_ENSURE_ARG(aCol);
 
   ErrorResult rv;
-  CycleHeader(*col, rv);
+  CycleHeader(*aCol, rv);
   return rv.StealNSResult();
 }
 
 NS_IMETHODIMP
 nsTreeContentView::SelectionChanged()
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsTreeContentView::CycleCell(int32_t aRow, nsITreeColumn* aCol)
+nsTreeContentView::CycleCell(int32_t aRow, nsTreeColumn* aCol)
 {
   return NS_OK;
 }
 
 bool
 nsTreeContentView::IsEditable(int32_t aRow, nsTreeColumn& aColumn,
                               ErrorResult& aError)
 {
@@ -734,23 +728,22 @@ nsTreeContentView::IsEditable(int32_t aR
       return false;
     }
   }
 
   return true;
 }
 
 NS_IMETHODIMP
-nsTreeContentView::IsEditable(int32_t aRow, nsITreeColumn* aCol, bool* _retval)
+nsTreeContentView::IsEditable(int32_t aRow, nsTreeColumn* aCol, bool* _retval)
 {
-  RefPtr<nsTreeColumn> col = nsTreeColumn::From(aCol);
-  NS_ENSURE_ARG(col);
+  NS_ENSURE_ARG(aCol);
 
   ErrorResult rv;
-  *_retval = IsEditable(aRow, *col, rv);
+  *_retval = IsEditable(aRow, *aCol, rv);
   return rv.StealNSResult();
 }
 
 bool
 nsTreeContentView::IsSelectable(int32_t aRow, nsTreeColumn& aColumn,
                                 ErrorResult& aError)
 {
   if (!IsValidRowIndex(aRow)) {
@@ -769,23 +762,22 @@ nsTreeContentView::IsSelectable(int32_t 
       return false;
     }
   }
 
   return true;
 }
 
 NS_IMETHODIMP
-nsTreeContentView::IsSelectable(int32_t aRow, nsITreeColumn* aCol, bool* _retval)
+nsTreeContentView::IsSelectable(int32_t aRow, nsTreeColumn* aCol, bool* _retval)
 {
-  RefPtr<nsTreeColumn> col = nsTreeColumn::From(aCol);
-  NS_ENSURE_ARG(col);
+  NS_ENSURE_ARG(aCol);
 
   ErrorResult rv;
-  *_retval = IsSelectable(aRow, *col, rv);
+  *_retval = IsSelectable(aRow, *aCol, rv);
   return rv.StealNSResult();
 }
 
 void
 nsTreeContentView::SetCellValue(int32_t aRow, nsTreeColumn& aColumn,
                                 const nsAString& aValue, ErrorResult& aError)
 {
   if (!IsValidRowIndex(aRow)) {
@@ -800,23 +792,22 @@ nsTreeContentView::SetCellValue(int32_t 
   if (realRow) {
     Element* cell = GetCell(realRow, aColumn);
     if (cell)
       cell->SetAttr(kNameSpaceID_None, nsGkAtoms::value, aValue, true);
   }
 }
 
 NS_IMETHODIMP
-nsTreeContentView::SetCellValue(int32_t aRow, nsITreeColumn* aCol, const nsAString& aValue)
+nsTreeContentView::SetCellValue(int32_t aRow, nsTreeColumn* aCol, const nsAString& aValue)
 {
-  RefPtr<nsTreeColumn> col = nsTreeColumn::From(aCol);
-  NS_ENSURE_ARG(col);
+  NS_ENSURE_ARG(aCol);
 
   ErrorResult rv;
-  SetCellValue(aRow, *col, aValue, rv);
+  SetCellValue(aRow, *aCol, aValue, rv);
   return rv.StealNSResult();
 }
 
 void
 nsTreeContentView::SetCellText(int32_t aRow, nsTreeColumn& aColumn,
                                const nsAString& aValue, ErrorResult& aError)
 {
   if (!IsValidRowIndex(aRow)) {
@@ -831,40 +822,39 @@ nsTreeContentView::SetCellText(int32_t a
   if (realRow) {
     Element* cell = GetCell(realRow, aColumn);
     if (cell)
       cell->SetAttr(kNameSpaceID_None, nsGkAtoms::label, aValue, true);
   }
 }
 
 NS_IMETHODIMP
-nsTreeContentView::SetCellText(int32_t aRow, nsITreeColumn* aCol, const nsAString& aValue)
+nsTreeContentView::SetCellText(int32_t aRow, nsTreeColumn* aCol, const nsAString& aValue)
 {
-  RefPtr<nsTreeColumn> col = nsTreeColumn::From(aCol);
-  NS_ENSURE_ARG(col);
+  NS_ENSURE_ARG(aCol);
 
   ErrorResult rv;
-  SetCellText(aRow, *col, aValue, rv);
+  SetCellText(aRow, *aCol, aValue, rv);
   return rv.StealNSResult();
 }
 
 NS_IMETHODIMP
 nsTreeContentView::PerformAction(const char16_t* aAction)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTreeContentView::PerformActionOnRow(const char16_t* aAction, int32_t aRow)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsTreeContentView::PerformActionOnCell(const char16_t* aAction, int32_t aRow, nsITreeColumn* aCol)
+nsTreeContentView::PerformActionOnCell(const char16_t* aAction, int32_t aRow, nsTreeColumn* aCol)
 {
   return NS_OK;
 }
 
 Element*
 nsTreeContentView::GetItemAtIndex(int32_t aIndex, ErrorResult& aError)
 {
   if (!IsValidRowIndex(aIndex)) {
--- a/layout/xul/tree/nsTreeImageListener.cpp
+++ b/layout/xul/tree/nsTreeImageListener.cpp
@@ -42,17 +42,17 @@ nsTreeImageListener::Notify(imgIRequest 
   if (aType == imgINotificationObserver::FRAME_UPDATE) {
     Invalidate();
   }
 
   return NS_OK;
 }
 
 void
-nsTreeImageListener::AddCell(int32_t aIndex, nsITreeColumn* aCol)
+nsTreeImageListener::AddCell(int32_t aIndex, nsTreeColumn* aCol)
 {
   if (!mInvalidationArea) {
     mInvalidationArea = new InvalidationArea(aCol);
     mInvalidationArea->AddRow(aIndex);
   }
   else {
     InvalidationArea* currArea;
     for (currArea = mInvalidationArea; currArea; currArea = currArea->GetNext()) {
@@ -85,17 +85,17 @@ nsTreeImageListener::Invalidate()
             tree->InvalidateCell(i, currArea->GetCol());
           }
         }
       }
     }
   }
 }
 
-nsTreeImageListener::InvalidationArea::InvalidationArea(nsITreeColumn* aCol)
+nsTreeImageListener::InvalidationArea::InvalidationArea(nsTreeColumn* aCol)
   : mCol(aCol),
     mMin(-1), // min should start out "undefined"
     mMax(0),
     mNext(nullptr)
 {
 }
 
 void
--- a/layout/xul/tree/nsTreeImageListener.h
+++ b/layout/xul/tree/nsTreeImageListener.h
@@ -7,17 +7,17 @@
 #ifndef nsTreeImageListener_h__
 #define nsTreeImageListener_h__
 
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsTreeBodyFrame.h"
 #include "mozilla/Attributes.h"
 
-class nsITreeColumn;
+class nsTreeColumn;
 
 // This class handles image load observation.
 class nsTreeImageListener final : public imgINotificationObserver
 {
 public:
   explicit nsTreeImageListener(nsTreeBodyFrame *aTreeFrame);
 
   NS_DECL_ISUPPORTS
@@ -27,41 +27,41 @@ public:
 
   friend class nsTreeBodyFrame;
 
 protected:
   ~nsTreeImageListener();
 
   void UnsuppressInvalidation() { mInvalidationSuppressed = false; }
   void Invalidate();
-  void AddCell(int32_t aIndex, nsITreeColumn* aCol);
+  void AddCell(int32_t aIndex, nsTreeColumn* aCol);
 
 private:
   nsTreeBodyFrame* mTreeFrame;
 
   // A guard that prevents us from recursive painting.
   bool mInvalidationSuppressed;
 
   class InvalidationArea {
     public:
-      explicit InvalidationArea(nsITreeColumn* aCol);
+      explicit InvalidationArea(nsTreeColumn* aCol);
       ~InvalidationArea() { delete mNext; }
 
       friend class nsTreeImageListener;
 
     protected:
       void AddRow(int32_t aIndex);
-      nsITreeColumn* GetCol() { return mCol.get(); }
+      nsTreeColumn* GetCol() { return mCol.get(); }
       int32_t GetMin() { return mMin; }
       int32_t GetMax() { return mMax; }
       InvalidationArea* GetNext() { return mNext; }
       void SetNext(InvalidationArea* aNext) { mNext = aNext; }
 
     private:
-      nsCOMPtr<nsITreeColumn> mCol;
+      RefPtr<nsTreeColumn> mCol;
       int32_t                 mMin;
       int32_t                 mMax;
       InvalidationArea*       mNext;
   };
 
   InvalidationArea* mInvalidationArea;
 };
 
--- a/layout/xul/tree/nsTreeSelection.cpp
+++ b/layout/xul/tree/nsTreeSelection.cpp
@@ -651,23 +651,23 @@ NS_IMETHODIMP nsTreeSelection::SetCurren
   RefPtr<AsyncEventDispatcher> asyncDispatcher =
     new AsyncEventDispatcher(treeElt,
                              (aIndex != -1 ? DOMMenuItemActive :
                                              DOMMenuItemInactive),
                              true, false);
   return asyncDispatcher->PostDOMEvent();
 }
 
-NS_IMETHODIMP nsTreeSelection::GetCurrentColumn(nsITreeColumn** aCurrentColumn)
+NS_IMETHODIMP nsTreeSelection::GetCurrentColumn(nsTreeColumn** aCurrentColumn)
 {
   NS_IF_ADDREF(*aCurrentColumn = mCurrentColumn);
   return NS_OK;
 }
 
-NS_IMETHODIMP nsTreeSelection::SetCurrentColumn(nsITreeColumn* aCurrentColumn)
+NS_IMETHODIMP nsTreeSelection::SetCurrentColumn(nsTreeColumn* aCurrentColumn)
 {
   if (!mTree) {
     return NS_ERROR_UNEXPECTED;
   }
   if (mCurrentColumn == aCurrentColumn) {
     return NS_OK;
   }
 
--- a/layout/xul/tree/nsTreeSelection.h
+++ b/layout/xul/tree/nsTreeSelection.h
@@ -8,17 +8,17 @@
 #define nsTreeSelection_h__
 
 #include "nsITreeSelection.h"
 #include "nsITimer.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/Attributes.h"
 
 class nsITreeBoxObject;
-class nsITreeColumn;
+class nsTreeColumn;
 struct nsTreeRange;
 
 class nsTreeSelection final : public nsINativeTreeSelection
 {
 public:
   explicit nsTreeSelection(nsITreeBoxObject* aTree);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@@ -40,17 +40,17 @@ protected:
   // Helper function to get the content node associated with mTree.
   already_AddRefed<nsIContent> GetContent();
 
   // Members
   nsCOMPtr<nsITreeBoxObject> mTree; // The tree will hold on to us through the view and let go when it dies.
 
   bool mSuppressed; // Whether or not we should be firing onselect events.
   int32_t mCurrentIndex; // The item to draw the rect around. The last one clicked, etc.
-  nsCOMPtr<nsITreeColumn> mCurrentColumn;
+  RefPtr<nsTreeColumn> mCurrentColumn;
   int32_t mShiftSelectPivot; // Used when multiple SHIFT+selects are performed to pivot on.
 
   nsTreeRange* mFirstRange; // Our list of ranges.
 
   nsCOMPtr<nsITimer> mSelectTimer;
 };
 
 nsresult
--- a/security/manager/pki/nsASN1Tree.cpp
+++ b/security/manager/pki/nsASN1Tree.cpp
@@ -187,23 +187,23 @@ nsNSSASN1Tree::SetSelection(nsITreeSelec
 
 NS_IMETHODIMP
 nsNSSASN1Tree::GetRowProperties(int32_t, nsAString&)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSASN1Tree::GetCellProperties(int32_t, nsITreeColumn*, nsAString&)
+nsNSSASN1Tree::GetCellProperties(int32_t, nsTreeColumn*, nsAString&)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSASN1Tree::GetColumnProperties(nsITreeColumn*, nsAString&)
+nsNSSASN1Tree::GetColumnProperties(nsTreeColumn*, nsAString&)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNSSASN1Tree::IsContainer(int32_t index, bool* _retval)
 {
   NS_ENSURE_ARG_MIN(index, 0);
@@ -257,29 +257,29 @@ nsNSSASN1Tree::GetLevel(int32_t index, i
   if (!n)
     return NS_ERROR_FAILURE;
 
   *_retval = nodeLevel;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSASN1Tree::GetImageSrc(int32_t, nsITreeColumn*, nsAString&)
+nsNSSASN1Tree::GetImageSrc(int32_t, nsTreeColumn*, nsAString&)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSASN1Tree::GetCellValue(int32_t, nsITreeColumn*, nsAString&)
+nsNSSASN1Tree::GetCellValue(int32_t, nsTreeColumn*, nsAString&)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSASN1Tree::GetCellText(int32_t row, nsITreeColumn*, nsAString& _retval)
+nsNSSASN1Tree::GetCellText(int32_t row, nsTreeColumn*, nsAString& _retval)
 {
   NS_ENSURE_ARG_MIN(row, 0);
 
   _retval.Truncate();
 
   myNode* n = FindNodeFromIndex(row);
   if (!n)
     return NS_ERROR_FAILURE;
@@ -329,57 +329,57 @@ nsNSSASN1Tree::ToggleOpenState(int32_t i
     rowCountChange = CountVisibleNodes(n->child);
   }
   if (mTree)
     mTree->RowCountChanged(index, rowCountChange);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSASN1Tree::CycleHeader(nsITreeColumn*)
+nsNSSASN1Tree::CycleHeader(nsTreeColumn*)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNSSASN1Tree::SelectionChanged()
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSASN1Tree::CycleCell(int32_t, nsITreeColumn*)
+nsNSSASN1Tree::CycleCell(int32_t, nsTreeColumn*)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSASN1Tree::IsEditable(int32_t, nsITreeColumn*, bool* _retval)
+nsNSSASN1Tree::IsEditable(int32_t, nsTreeColumn*, bool* _retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
   *_retval = false;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSASN1Tree::IsSelectable(int32_t, nsITreeColumn*, bool* _retval)
+nsNSSASN1Tree::IsSelectable(int32_t, nsTreeColumn*, bool* _retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
   *_retval = false;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSASN1Tree::SetCellValue(int32_t, nsITreeColumn*, const nsAString&)
+nsNSSASN1Tree::SetCellValue(int32_t, nsTreeColumn*, const nsAString&)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSASN1Tree::SetCellText(int32_t, nsITreeColumn*, const nsAString&)
+nsNSSASN1Tree::SetCellText(int32_t, nsTreeColumn*, const nsAString&)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNSSASN1Tree::PerformAction(const char16_t*)
 {
   return NS_OK;
@@ -387,17 +387,17 @@ nsNSSASN1Tree::PerformAction(const char1
 
 NS_IMETHODIMP
 nsNSSASN1Tree::PerformActionOnRow(const char16_t*, int32_t)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSASN1Tree::PerformActionOnCell(const char16_t*, int32_t, nsITreeColumn*)
+nsNSSASN1Tree::PerformActionOnCell(const char16_t*, int32_t, nsTreeColumn*)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNSSASN1Tree::CanDrop(int32_t, int32_t, mozilla::dom::DataTransfer*, bool* _retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
--- a/security/manager/ssl/nsCertTree.cpp
+++ b/security/manager/ssl/nsCertTree.cpp
@@ -876,24 +876,24 @@ nsCertTree::SetSelection(nsITreeSelectio
 
 NS_IMETHODIMP
 nsCertTree::GetRowProperties(int32_t index, nsAString& aProps)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsCertTree::GetCellProperties(int32_t row, nsITreeColumn* col,
+nsCertTree::GetCellProperties(int32_t row, nsTreeColumn* col,
                               nsAString& aProps)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsCertTree::GetColumnProperties(nsITreeColumn* col, nsAString& aProps)
+nsCertTree::GetColumnProperties(nsTreeColumn* col, nsAString& aProps)
 {
   return NS_OK;
 }
 NS_IMETHODIMP
 nsCertTree::IsContainer(int32_t index, bool *_retval)
 {
   if (!mTreeArray)
     return NS_ERROR_NOT_INITIALIZED;
@@ -984,33 +984,33 @@ nsCertTree::GetLevel(int32_t index, int3
     *_retval = 0;
   } else {
     *_retval = 1;
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsCertTree::GetImageSrc(int32_t row, nsITreeColumn* col,
+nsCertTree::GetImageSrc(int32_t row, nsTreeColumn* col,
                         nsAString& _retval)
 {
   _retval.Truncate();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsCertTree::GetCellValue(int32_t row, nsITreeColumn* col,
+nsCertTree::GetCellValue(int32_t row, nsTreeColumn* col,
                          nsAString& _retval)
 {
   _retval.Truncate();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsCertTree::GetCellText(int32_t row, nsITreeColumn* col,
+nsCertTree::GetCellText(int32_t row, nsTreeColumn* col,
                         nsAString& _retval)
 {
   if (!mTreeArray)
     return NS_ERROR_NOT_INITIALIZED;
 
   nsresult rv = NS_OK;
   _retval.Truncate();
 
@@ -1119,56 +1119,56 @@ nsCertTree::ToggleOpenState(int32_t inde
     el->open = !el->open;
     int32_t newChildren = (el->open) ? el->numChildren : -el->numChildren;
     if (mTree) mTree->RowCountChanged(index + 1, newChildren);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsCertTree::CycleHeader(nsITreeColumn* col)
+nsCertTree::CycleHeader(nsTreeColumn* col)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsCertTree::SelectionChanged()
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsCertTree::CycleCell(int32_t row, nsITreeColumn* col)
+nsCertTree::CycleCell(int32_t row, nsTreeColumn* col)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsCertTree::IsEditable(int32_t row, nsITreeColumn* col, bool *_retval)
+nsCertTree::IsEditable(int32_t row, nsTreeColumn* col, bool *_retval)
 {
   *_retval = false;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsCertTree::IsSelectable(int32_t row, nsITreeColumn* col, bool *_retval)
+nsCertTree::IsSelectable(int32_t row, nsTreeColumn* col, bool *_retval)
 {
   *_retval = false;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsCertTree::SetCellValue(int32_t row, nsITreeColumn* col,
+nsCertTree::SetCellValue(int32_t row, nsTreeColumn* col,
                          const nsAString& value)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsCertTree::SetCellText(int32_t row, nsITreeColumn* col,
+nsCertTree::SetCellText(int32_t row, nsTreeColumn* col,
                         const nsAString& value)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsCertTree::PerformAction(const char16_t *action)
 {
@@ -1178,17 +1178,17 @@ nsCertTree::PerformAction(const char16_t
 NS_IMETHODIMP
 nsCertTree::PerformActionOnRow(const char16_t *action, int32_t row)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsCertTree::PerformActionOnCell(const char16_t *action, int32_t row,
-                                nsITreeColumn* col)
+                                nsTreeColumn* col)
 {
   return NS_OK;
 }
 
 #ifdef DEBUG_CERT_TREE
 void
 nsCertTree::dumpMap()
 {