Bug 1466727 part 6. Stop using nsITreeColumn in layout. r=mossop
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 05 Jun 2018 23:01:37 -0400
changeset 478288 4f9c0f55aa88ab4ed421394203557e5e8396d380
parent 478287 3cc696a399ed28c3e00f04fdedbe601016e20764
child 478289 830e780325e49a0b9c90449e50b943bad39a09f4
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 6. Stop using nsITreeColumn in layout. r=mossop
layout/base/PresShell.cpp
layout/xul/nsXULTooltipListener.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
layout/xul/tree/nsTreeBodyFrame.h
layout/xul/tree/nsTreeColumns.cpp
layout/xul/tree/nsTreeColumns.h
security/manager/ssl/nsCertTree.cpp
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -8364,23 +8364,20 @@ PresShell::GetCurrentItemAndPositionForE
                           (currentIndex - firstVisibleRow + 1) * rowHeight);
           istree = true;
 
           RefPtr<nsTreeColumns> cols;
           treeBox->GetColumns(getter_AddRefs(cols));
           if (cols) {
             nsTreeColumn* col = cols->GetFirstColumn();
             if (col) {
-              RefPtr<Element> colElement;
-              col->GetElement(getter_AddRefs(colElement));
-              if (colElement) {
-                nsIFrame* frame = colElement->GetPrimaryFrame();
-                if (frame) {
-                  extraTreeY += frame->GetSize().height;
-                }
+              RefPtr<Element> colElement = col->Element();
+              nsIFrame* frame = colElement->GetPrimaryFrame();
+              if (frame) {
+                extraTreeY += frame->GetSize().height;
               }
             }
           }
         }
         else {
           multiSelect->GetCurrentItem(getter_AddRefs(item));
         }
       }
--- a/layout/xul/nsXULTooltipListener.cpp
+++ b/layout/xul/nsXULTooltipListener.cpp
@@ -26,16 +26,17 @@
 #include "nsTreeColumns.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/Event.h" // for Event
 #include "mozilla/dom/BoxObject.h"
 #include "mozilla/dom/MouseEvent.h"
+#include "mozilla/dom/TreeColumnBinding.h"
 #include "mozilla/TextEvents.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsXULTooltipListener* nsXULTooltipListener::sInstance = nullptr;
 
 //////////////////////////////////////////////////////////////////////////
@@ -363,20 +364,20 @@ nsXULTooltipListener::CheckTreeBodyMove(
 
     obx->GetCellAt(x, y, &row, getter_AddRefs(col), obj);
 
     // determine if we are going to need a titletip
     // XXX check the disabletitletips attribute on the tree content
     mNeedTitletip = false;
     int16_t colType = -1;
     if (col) {
-      col->GetType(&colType);
+      colType = col->Type();
     }
     if (row >= 0 && obj.EqualsLiteral("text") &&
-        colType != nsITreeColumn::TYPE_PASSWORD) {
+        colType != TreeColumnBinding::TYPE_PASSWORD) {
       obx->IsCellCropped(row, col, &mNeedTitletip);
     }
 
     nsCOMPtr<nsIContent> currentTooltip = do_QueryReferent(mCurrentTooltip);
     if (currentTooltip && (row != mLastTreeRow || col != mLastTreeCol)) {
       HideTooltip();
     }
 
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -57,16 +57,17 @@
 #include "nsLayoutUtils.h"
 #include "nsIScrollableFrame.h"
 #include "nsDisplayList.h"
 #include "mozilla/dom/CustomEvent.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/ToJSValue.h"
 #include "mozilla/dom/TreeBoxObject.h"
+#include "mozilla/dom/TreeColumnBinding.h"
 #include "nsIScriptableRegion.h"
 #include <algorithm>
 #include "ScrollbarActivity.h"
 
 #ifdef ACCESSIBILITY
 #include "nsAccessibilityService.h"
 #include "nsIWritablePropertyBag2.h"
 #endif
@@ -629,32 +630,31 @@ nsTreeBodyFrame::Invalidate()
     return NS_OK;
 
   InvalidateFrame();
 
   return NS_OK;
 }
 
 nsresult
-nsTreeBodyFrame::InvalidateColumn(nsITreeColumn* aCol)
+nsTreeBodyFrame::InvalidateColumn(nsTreeColumn* aCol)
 {
   if (mUpdateBatchNest)
     return NS_OK;
 
-  RefPtr<nsTreeColumn> col = GetColumnImpl(aCol);
-  if (!col)
+  if (!aCol)
     return NS_ERROR_INVALID_ARG;
 
 #ifdef ACCESSIBILITY
   if (nsIPresShell::IsAccessibilityActive())
     FireInvalidateEvent(-1, -1, aCol, aCol);
 #endif
 
   nsRect columnRect;
-  nsresult rv = col->GetRect(this, mInnerBox.y, mInnerBox.height, &columnRect);
+  nsresult rv = aCol->GetRect(this, mInnerBox.y, mInnerBox.height, &columnRect);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // When false then column is out of view
   if (OffsetForHorzScroll(columnRect, true))
       InvalidateFrameWithRect(columnRect);
 
   return NS_OK;
 }
@@ -676,37 +676,36 @@ nsTreeBodyFrame::InvalidateRow(int32_t a
 
   nsRect rowRect(mInnerBox.x, mInnerBox.y+mRowHeight*aIndex, mInnerBox.width, mRowHeight);
   InvalidateFrameWithRect(rowRect);
 
   return NS_OK;
 }
 
 nsresult
-nsTreeBodyFrame::InvalidateCell(int32_t aIndex, nsITreeColumn* aCol)
+nsTreeBodyFrame::InvalidateCell(int32_t aIndex, nsTreeColumn* aCol)
 {
   if (mUpdateBatchNest)
     return NS_OK;
 
 #ifdef ACCESSIBILITY
   if (nsIPresShell::IsAccessibilityActive())
     FireInvalidateEvent(aIndex, aIndex, aCol, aCol);
 #endif
 
   aIndex -= mTopRowIndex;
   if (aIndex < 0 || aIndex > mPageLength)
     return NS_OK;
 
-  RefPtr<nsTreeColumn> col = GetColumnImpl(aCol);
-  if (!col)
+  if (!aCol)
     return NS_ERROR_INVALID_ARG;
 
   nsRect cellRect;
-  nsresult rv = col->GetRect(this, mInnerBox.y+mRowHeight*aIndex, mRowHeight,
-                             &cellRect);
+  nsresult rv = aCol->GetRect(this, mInnerBox.y+mRowHeight*aIndex, mRowHeight,
+                              &cellRect);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (OffsetForHorzScroll(cellRect, true))
     InvalidateFrameWithRect(cellRect);
 
   return NS_OK;
 }
 
@@ -739,27 +738,26 @@ nsTreeBodyFrame::InvalidateRange(int32_t
 
   nsRect rangeRect(mInnerBox.x, mInnerBox.y+mRowHeight*(aStart-mTopRowIndex), mInnerBox.width, mRowHeight*(aEnd-aStart+1));
   InvalidateFrameWithRect(rangeRect);
 
   return NS_OK;
 }
 
 nsresult
-nsTreeBodyFrame::InvalidateColumnRange(int32_t aStart, int32_t aEnd, nsITreeColumn* aCol)
+nsTreeBodyFrame::InvalidateColumnRange(int32_t aStart, int32_t aEnd, nsTreeColumn* aCol)
 {
   if (mUpdateBatchNest)
     return NS_OK;
 
-  RefPtr<nsTreeColumn> col = GetColumnImpl(aCol);
-  if (!col)
+  if (!aCol)
     return NS_ERROR_INVALID_ARG;
 
   if (aStart == aEnd)
-    return InvalidateCell(aStart, col);
+    return InvalidateCell(aStart, aCol);
 
   int32_t last = LastVisibleRow();
   if (aStart > aEnd || aEnd < mTopRowIndex || aStart > last)
     return NS_OK;
 
   if (aStart < mTopRowIndex)
     aStart = mTopRowIndex;
 
@@ -770,20 +768,20 @@ nsTreeBodyFrame::InvalidateColumnRange(i
   if (nsIPresShell::IsAccessibilityActive()) {
     int32_t end =
       mRowCount > 0 ? ((mRowCount <= aEnd) ? mRowCount - 1 : aEnd) : 0;
     FireInvalidateEvent(aStart, end, aCol, aCol);
   }
 #endif
 
   nsRect rangeRect;
-  nsresult rv = col->GetRect(this,
-                             mInnerBox.y+mRowHeight*(aStart-mTopRowIndex),
-                             mRowHeight*(aEnd-aStart+1),
-                             &rangeRect);
+  nsresult rv = aCol->GetRect(this,
+                              mInnerBox.y+mRowHeight*(aStart-mTopRowIndex),
+                              mRowHeight*(aEnd-aStart+1),
+                              &rangeRect);
   NS_ENSURE_SUCCESS(rv, rv);
 
   InvalidateFrameWithRect(rangeRect);
 
   return NS_OK;
 }
 
 static void
@@ -1092,17 +1090,17 @@ nsTreeBodyFrame::GetCellAt(int32_t aX, i
 // cell rect fits inside the adjusted row rect.  It also can have border/padding
 // as well as margins.  The vertical direction isn't that important, but you need
 // to get the horizontal direction right.
 //
 // (3) GetImageSize() does not include margins (but it does include border/padding).
 // You need to make sure to add in the image's margins as well.
 //
 nsresult
-nsTreeBodyFrame::GetCoordsForCellItem(int32_t aRow, nsITreeColumn* aCol, const nsACString& aElement,
+nsTreeBodyFrame::GetCoordsForCellItem(int32_t aRow, nsTreeColumn* aCol, const nsACString& aElement,
                                       int32_t *aX, int32_t *aY, int32_t *aWidth, int32_t *aHeight)
 {
   *aX = 0;
   *aY = 0;
   *aWidth = 0;
   *aHeight = 0;
 
   bool isRTL = StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL;
@@ -1758,29 +1756,28 @@ nsTreeBodyFrame::GetCellWidth(int32_t aR
   nscoord width = nsLayoutUtils::AppUnitWidthOfStringBidi(cellText, this, *fm,
                                                           *aRenderingContext);
   nscoord totalTextWidth = width + bp.left + bp.right;
   aDesiredSize += totalTextWidth;
   return NS_OK;
 }
 
 nsresult
-nsTreeBodyFrame::IsCellCropped(int32_t aRow, nsITreeColumn* aCol, bool *_retval)
+nsTreeBodyFrame::IsCellCropped(int32_t aRow, nsTreeColumn* aCol, bool *_retval)
 {
   nscoord currentSize, desiredSize;
   nsresult rv;
 
-  RefPtr<nsTreeColumn> col = GetColumnImpl(aCol);
-  if (!col)
+  if (!aCol)
     return NS_ERROR_INVALID_ARG;
 
   RefPtr<gfxContext> rc =
     PresShell()->CreateReferenceRenderingContext();
 
-  rv = GetCellWidth(aRow, col, rc, desiredSize, currentSize);
+  rv = GetCellWidth(aRow, aCol, rc, desiredSize, currentSize);
   NS_ENSURE_SUCCESS(rv, rv);
 
   *_retval = desiredSize > currentSize;
 
   return NS_OK;
 }
 
 void
@@ -2015,17 +2012,17 @@ nsTreeBodyFrame::PrefillPropertyArray(in
   }
 
   if (aCol) {
     mScratchArray.AppendElement(aCol->GetAtom());
 
     if (aCol->IsPrimary())
       mScratchArray.AppendElement(nsGkAtoms::primary);
 
-    if (aCol->GetType() == nsITreeColumn::TYPE_CHECKBOX) {
+    if (aCol->GetType() == TreeColumnBinding::TYPE_CHECKBOX) {
       mScratchArray.AppendElement(nsGkAtoms::checkbox);
 
       if (aRowIndex != -1) {
         nsAutoString value;
         mView->GetCellValue(aRowIndex, aCol, value);
         if (value.EqualsLiteral("true"))
           mScratchArray.AppendElement(nsGkAtoms::checked);
       }
@@ -3386,22 +3383,22 @@ nsTreeBodyFrame::PaintCell(int32_t      
   // Now paint our element, but only if we aren't a cycler column.
   // XXX until we have the ability to load images, allow the view to
   // insert text into cycler columns...
   if (!aColumn->IsCycler()) {
     nsRect elementRect(currX, cellRect.y, remainingWidth, cellRect.height);
     nsRect dirtyRect;
     if (dirtyRect.IntersectRect(aDirtyRect, elementRect)) {
       switch (aColumn->GetType()) {
-        case nsITreeColumn::TYPE_TEXT:
-        case nsITreeColumn::TYPE_PASSWORD:
+        case TreeColumnBinding::TYPE_TEXT:
+        case TreeColumnBinding::TYPE_PASSWORD:
           result &= PaintText(aRowIndex, aColumn, elementRect, aPresContext,
                               aRenderingContext, aDirtyRect, currX);
           break;
-        case nsITreeColumn::TYPE_CHECKBOX:
+        case TreeColumnBinding::TYPE_CHECKBOX:
           result &= PaintCheckbox(aRowIndex, aColumn, elementRect, aPresContext,
                                   aRenderingContext, aDirtyRect);
           break;
       }
     }
   }
 
   aCurrX = currX;
@@ -3704,17 +3701,17 @@ nsTreeBodyFrame::PaintText(int32_t      
   MOZ_ASSERT(aColumn && aColumn->GetFrame(), "invalid column passed");
 
   bool isRTL = StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL;
 
   // Now obtain the text for our cell.
   nsAutoString text;
   mView->GetCellText(aRowIndex, aColumn, text);
 
-  if (aColumn->Type() == nsITreeColumn::TYPE_PASSWORD) {
+  if (aColumn->Type() == TreeColumnBinding::TYPE_PASSWORD) {
     TextEditRules::FillBufWithPWChars(&text, text.Length());
   }
 
   // We're going to paint this text so we need to ensure bidi is enabled if
   // necessary
   CheckTextForBidi(text);
 
   ImgDrawResult result = ImgDrawResult::SUCCESS;
@@ -4060,33 +4057,32 @@ nsresult nsTreeBodyFrame::EnsureRowIsVis
     int32_t distance = aRow - (mTopRowIndex+mPageLength)+1;
     ScrollToRowInternal(aParts, mTopRowIndex+distance);
   }
 
   return NS_OK;
 }
 
 nsresult
-nsTreeBodyFrame::EnsureCellIsVisible(int32_t aRow, nsITreeColumn* aCol)
+nsTreeBodyFrame::EnsureCellIsVisible(int32_t aRow, nsTreeColumn* aCol)
 {
-  RefPtr<nsTreeColumn> col = GetColumnImpl(aCol);
-  if (!col)
+  if (!aCol)
     return NS_ERROR_INVALID_ARG;
 
   ScrollParts parts = GetScrollParts();
 
   nscoord result = -1;
   nsresult rv;
 
   nscoord columnPos;
-  rv = col->GetXInTwips(this, &columnPos);
+  rv = aCol->GetXInTwips(this, &columnPos);
   if(NS_FAILED(rv)) return rv;
 
   nscoord columnWidth;
-  rv = col->GetWidthInTwips(this, &columnWidth);
+  rv = aCol->GetWidthInTwips(this, &columnWidth);
   if(NS_FAILED(rv)) return rv;
 
   // If the start of the column is before the
   // start of the horizontal view, then scroll
   if (columnPos < mHorzPosition)
     result = columnPos;
   // If the end of the column is past the end of
   // the horizontal view, then scroll
@@ -4100,48 +4096,47 @@ nsTreeBodyFrame::EnsureCellIsVisible(int
 
   rv = EnsureRowIsVisibleInternal(parts, aRow);
   NS_ENSURE_SUCCESS(rv, rv);
   UpdateScrollbars(parts);
   return rv;
 }
 
 nsresult
-nsTreeBodyFrame::ScrollToCell(int32_t aRow, nsITreeColumn* aCol)
+nsTreeBodyFrame::ScrollToCell(int32_t aRow, nsTreeColumn* aCol)
 {
   ScrollParts parts = GetScrollParts();
   nsresult rv = ScrollToRowInternal(parts, aRow);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = ScrollToColumnInternal(parts, aCol);
   NS_ENSURE_SUCCESS(rv, rv);
 
   UpdateScrollbars(parts);
   return rv;
 }
 
 nsresult
-nsTreeBodyFrame::ScrollToColumn(nsITreeColumn* aCol)
+nsTreeBodyFrame::ScrollToColumn(nsTreeColumn* aCol)
 {
   ScrollParts parts = GetScrollParts();
   nsresult rv = ScrollToColumnInternal(parts, aCol);
   NS_ENSURE_SUCCESS(rv, rv);
   UpdateScrollbars(parts);
   return rv;
 }
 
 nsresult nsTreeBodyFrame::ScrollToColumnInternal(const ScrollParts& aParts,
-                                                 nsITreeColumn* aCol)
+                                                 nsTreeColumn* aCol)
 {
-  RefPtr<nsTreeColumn> col = GetColumnImpl(aCol);
-  if (!col)
+  if (!aCol)
     return NS_ERROR_INVALID_ARG;
 
   nscoord x;
-  nsresult rv = col->GetXInTwips(this, &x);
+  nsresult rv = aCol->GetXInTwips(this, &x);
   if (NS_FAILED(rv))
     return rv;
 
   return ScrollHorzInternal(aParts, x);
 }
 
 nsresult
 nsTreeBodyFrame::ScrollToHorizontalPosition(int32_t aHorizontalPosition)
@@ -4708,18 +4703,18 @@ nsTreeBodyFrame::FireRowCountChangedEven
 
   RefPtr<AsyncEventDispatcher> asyncDispatcher =
     new AsyncEventDispatcher(content, event);
   asyncDispatcher->PostDOMEvent();
 }
 
 void
 nsTreeBodyFrame::FireInvalidateEvent(int32_t aStartRowIdx, int32_t aEndRowIdx,
-                                     nsITreeColumn *aStartCol,
-                                     nsITreeColumn *aEndCol)
+                                     nsTreeColumn *aStartCol,
+                                     nsTreeColumn *aEndCol)
 {
   nsCOMPtr<nsIContent> content(GetBaseElement());
   if (!content)
     return;
 
   nsCOMPtr<nsIDocument> doc = content->OwnerDoc();
 
   RefPtr<Event> event = doc->CreateEvent(NS_LITERAL_STRING("customevent"),
@@ -4743,30 +4738,23 @@ nsTreeBodyFrame::FireInvalidateEvent(int
 
     // Set 'endrow' data - the end index of invalidated rows.
     propBag->SetPropertyAsInt32(NS_LITERAL_STRING("endrow"),
                                 aEndRowIdx);
   }
 
   if (aStartCol && aEndCol) {
     // Set 'startcolumn' data - the start index of invalidated rows.
-    int32_t startColIdx = 0;
-    nsresult rv = aStartCol->GetIndex(&startColIdx);
-    if (NS_FAILED(rv))
-      return;
+    int32_t startColIdx = aStartCol->GetIndex();
 
     propBag->SetPropertyAsInt32(NS_LITERAL_STRING("startcolumn"),
                                 startColIdx);
 
     // Set 'endcolumn' data - the start index of invalidated rows.
-    int32_t endColIdx = 0;
-    rv = aEndCol->GetIndex(&endColIdx);
-    if (NS_FAILED(rv))
-      return;
-
+    int32_t endColIdx = aEndCol->GetIndex();
     propBag->SetPropertyAsInt32(NS_LITERAL_STRING("endcolumn"),
                                 endColIdx);
   }
 
   InitCustomEvent(treeEvent, NS_LITERAL_STRING("TreeInvalidated"),
                   propBag);
 
   event->SetTrusted(true);
--- a/layout/xul/tree/nsTreeBodyFrame.h
+++ b/layout/xul/tree/nsTreeBodyFrame.h
@@ -86,38 +86,38 @@ public:
   int32_t RowHeight() const;
   int32_t RowWidth();
   int32_t GetHorizontalPosition() const;
   nsresult GetSelectionRegion(nsIScriptableRegion **aRegion);
   int32_t FirstVisibleRow() const { return mTopRowIndex; }
   int32_t LastVisibleRow() const { return mTopRowIndex + mPageLength; }
   int32_t PageLength() const { return mPageLength; }
   nsresult EnsureRowIsVisible(int32_t aRow);
-  nsresult EnsureCellIsVisible(int32_t aRow, nsITreeColumn *aCol);
+  nsresult EnsureCellIsVisible(int32_t aRow, nsTreeColumn *aCol);
   nsresult ScrollToRow(int32_t aRow);
   nsresult ScrollByLines(int32_t aNumLines);
   nsresult ScrollByPages(int32_t aNumPages);
-  nsresult ScrollToCell(int32_t aRow, nsITreeColumn *aCol);
-  nsresult ScrollToColumn(nsITreeColumn *aCol);
+  nsresult ScrollToCell(int32_t aRow, nsTreeColumn *aCol);
+  nsresult ScrollToColumn(nsTreeColumn *aCol);
   nsresult ScrollToHorizontalPosition(int32_t aValue);
   nsresult Invalidate();
-  nsresult InvalidateColumn(nsITreeColumn *aCol);
+  nsresult InvalidateColumn(nsTreeColumn *aCol);
   nsresult InvalidateRow(int32_t aRow);
-  nsresult InvalidateCell(int32_t aRow, nsITreeColumn *aCol);
+  nsresult InvalidateCell(int32_t aRow, nsTreeColumn *aCol);
   nsresult InvalidateRange(int32_t aStart, int32_t aEnd);
   nsresult InvalidateColumnRange(int32_t aStart, int32_t aEnd,
-                                 nsITreeColumn *aCol);
+                                 nsTreeColumn *aCol);
   nsresult GetRowAt(int32_t aX, int32_t aY, int32_t *aValue);
   nsresult GetCellAt(int32_t aX, int32_t aY, int32_t *aRow,
                      nsTreeColumn **aCol, nsACString &aChildElt);
-  nsresult GetCoordsForCellItem(int32_t aRow, nsITreeColumn *aCol,
+  nsresult GetCoordsForCellItem(int32_t aRow, nsTreeColumn *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 IsCellCropped(int32_t aRow, nsTreeColumn *aCol, bool *aResult);
   nsresult RowCountChanged(int32_t aIndex, int32_t aCount);
   nsresult BeginUpdateBatch();
   nsresult EndUpdateBatch();
   nsresult ClearStyleAndImageCaches();
   nsresult RemoveImageCacheEntry(int32_t aRowIndex, nsTreeColumn* aCol);
 
   void CancelImageRequests();
 
@@ -380,17 +380,17 @@ protected:
 
   // Use to auto-fill some of the common properties without the view having to do it.
   // Examples include container, open, selected, and focus.
   void PrefillPropertyArray(int32_t aRowIndex, nsTreeColumn* aCol);
 
   // Our internal scroll method, used by all the public scroll methods.
   nsresult ScrollInternal(const ScrollParts& aParts, int32_t aRow);
   nsresult ScrollToRowInternal(const ScrollParts& aParts, int32_t aRow);
-  nsresult ScrollToColumnInternal(const ScrollParts& aParts, nsITreeColumn* aCol);
+  nsresult ScrollToColumnInternal(const ScrollParts& aParts, nsTreeColumn* aCol);
   nsresult ScrollHorzInternal(const ScrollParts& aParts, int32_t aPosition);
   nsresult EnsureRowIsVisibleInternal(const ScrollParts& aParts, int32_t aRow);
 
   // Convert client pixels into appunits in our coordinate space.
   nsPoint AdjustClientCoordsToBoxCoordSpace(int32_t aX, int32_t aY);
 
   // Cache the box object
   void EnsureBoxObject();
@@ -425,25 +425,16 @@ protected:
 
   void InvalidateDropFeedback(int32_t aRow, int16_t aOrientation) {
     InvalidateRow(aRow);
     if (aOrientation != nsITreeView::DROP_ON)
       InvalidateRow(aRow + aOrientation);
   }
 
 public:
-  static
-  already_AddRefed<nsTreeColumn> GetColumnImpl(nsITreeColumn* aUnknownCol) {
-    if (!aUnknownCol)
-      return nullptr;
-
-    nsCOMPtr<nsTreeColumn> col = do_QueryInterface(aUnknownCol);
-    return col.forget();
-  }
-
   /**
    * Remove an nsITreeImageListener from being tracked by this frame. Only tree
    * image listeners that are created by this frame are tracked.
    *
    * @param aListener A pointer to an nsTreeImageListener to no longer
    *        track.
    */
   void RemoveTreeImageListener(nsTreeImageListener* aListener);
@@ -510,17 +501,17 @@ protected:
    * @param aEndRow    the end index of invalidated rows, -1 means that columns
    *                   have been invalidated only
    * @param aStartCol  the start invalidated column, nullptr means that only rows
    *                   have been invalidated
    * @param aEndCol    the end invalidated column, nullptr means that rows have
    *                   been invalidated only
    */
   void FireInvalidateEvent(int32_t aStartRow, int32_t aEndRow,
-                           nsITreeColumn *aStartCol, nsITreeColumn *aEndCol);
+                           nsTreeColumn *aStartCol, nsTreeColumn *aEndCol);
 #endif
 
 protected: // Data Members
 
   class Slots {
     public:
       Slots() {
       }
--- a/layout/xul/tree/nsTreeColumns.cpp
+++ b/layout/xul/tree/nsTreeColumns.cpp
@@ -301,26 +301,26 @@ nsTreeColumn::Invalidate()
     !mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::selectable,
                            nsGkAtoms::_false, eCaseMatters);
 
   mOverflow =
     mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::overflow,
                           nsGkAtoms::_true, eCaseMatters);
 
   // Figure out our column type. Default type is text.
-  mType = nsITreeColumn::TYPE_TEXT;
+  mType = TreeColumnBinding::TYPE_TEXT;
   static Element::AttrValuesArray typestrings[] =
     {&nsGkAtoms::checkbox, &nsGkAtoms::password,
      nullptr};
   switch (mContent->FindAttrValueIn(kNameSpaceID_None,
                                     nsGkAtoms::type,
                                     typestrings,
                                     eCaseMatters)) {
-    case 0: mType = nsITreeColumn::TYPE_CHECKBOX; break;
-    case 1: mType = nsITreeColumn::TYPE_PASSWORD; break;
+    case 0: mType = TreeColumnBinding::TYPE_CHECKBOX; break;
+    case 1: mType = TreeColumnBinding::TYPE_PASSWORD; break;
   }
 
   // Fetch the crop style.
   mCropStyle = 0;
   static Element::AttrValuesArray cropstrings[] =
     {&nsGkAtoms::center, &nsGkAtoms::left, &nsGkAtoms::start, nullptr};
   switch (mContent->FindAttrValueIn(kNameSpaceID_None,
                                     nsGkAtoms::crop, cropstrings,
@@ -468,17 +468,17 @@ nsTreeColumns::GetKeyColumn()
     // Skip hidden columns.
     if (currCol->mContent->AttrValueIs(kNameSpaceID_None,
                                        nsGkAtoms::hidden,
                                        nsGkAtoms::_true,
                                        eCaseMatters))
       continue;
 
     // Skip non-text column
-    if (currCol->GetType() != nsITreeColumn::TYPE_TEXT)
+    if (currCol->GetType() != TreeColumnBinding::TYPE_TEXT)
       continue;
 
     if (!first)
       first = currCol;
 
     if (nsContentUtils::HasNonEmptyAttr(currCol->mContent, kNameSpaceID_None,
                                         nsGkAtoms::sortDirection)) {
       // Use sorted column as the key.
--- a/layout/xul/tree/nsTreeColumns.h
+++ b/layout/xul/tree/nsTreeColumns.h
@@ -45,22 +45,16 @@ class TreeBoxObject;
 class nsTreeColumn final : public nsITreeColumn
                          , public nsWrapperCache
 {
 public:
   nsTreeColumn(nsTreeColumns* aColumns, mozilla::dom::Element* aElement);
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_TREECOLUMN_IMPL_CID)
 
-  static already_AddRefed<nsTreeColumn> From(nsITreeColumn* aColumn)
-  {
-    RefPtr<nsTreeColumn> col = do_QueryObject(aColumn);
-    return col.forget();
-  }
-
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsTreeColumn)
   NS_DECL_NSITREECOLUMN
 
   // WebIDL
   nsIContent* GetParentObject() const;
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
--- a/security/manager/ssl/nsCertTree.cpp
+++ b/security/manager/ssl/nsCertTree.cpp
@@ -1009,18 +1009,17 @@ nsCertTree::GetCellText(int32_t row, nsT
                         nsAString& _retval)
 {
   if (!mTreeArray)
     return NS_ERROR_NOT_INITIALIZED;
 
   nsresult rv = NS_OK;
   _retval.Truncate();
 
-  const char16_t* colID;
-  col->GetIdConst(&colID);
+  const nsAString& colID = col->GetId();
 
   treeArrayEl *el = GetThreadDescAtIndex(row);
   if (el) {
     if (NS_LITERAL_STRING("certcol").Equals(colID))
       _retval.Assign(el->orgName);
     else
       _retval.Truncate();
     return NS_OK;
@@ -1031,18 +1030,17 @@ nsCertTree::GetCellText(int32_t row, nsT
   if (!certdi)
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIX509Cert> cert = certdi->mCert;
   if (!cert && certdi->mAddonInfo) {
     cert = certdi->mAddonInfo->mCert;
   }
 
-  int32_t colIndex;
-  col->GetIndex(&colIndex);
+  int32_t colIndex = col->Index();
   uint32_t arrayIndex=absoluteCertOffset+colIndex*(mNumRows-mNumOrgs);
   uint32_t arrayLength=0;
   if (mCellText) {
     mCellText->GetLength(&arrayLength);
   }
   if (arrayIndex < arrayLength) {
     nsCOMPtr<nsISupportsString> myString(do_QueryElementAt(mCellText, arrayIndex));
     if (myString) {