Bug 1277131 : Part 1 - rename nsTableOuterFrame to nsTableWrapperFrame. draft
authorAstley Chen <aschen@mozilla.com>
Thu, 16 Jun 2016 13:14:08 +0100
changeset 378396 ce0cdbf5025d5252b5a0107b5fc57e8bc17df100
parent 378390 b9f4f38063951cd5a8b249911aea61869f40fd1f
child 378397 4b90290cd5766046dba069a36989e8408bec316d
push id21006
push useraschen@mozilla.com
push dateThu, 16 Jun 2016 12:17:57 +0000
bugs1277131
milestone50.0a1
Bug 1277131 : Part 1 - rename nsTableOuterFrame to nsTableWrapperFrame. MozReview-Commit-ID: KrSHLbmovTM
accessible/html/HTMLTableAccessible.cpp
editor/libeditor/nsHTMLEditor.h
editor/libeditor/nsTableEditor.cpp
layout/base/GeometryUtils.cpp
layout/base/RestyleManager.cpp
layout/base/RestyleManager.h
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsCSSFrameConstructor.h
layout/base/nsLayoutUtils.h
layout/doc/frame_reflow_debug.html
layout/doc/table_reflow_slides.html
layout/generic/nsFrame.cpp
layout/generic/nsFrameIdList.h
layout/generic/nsHTMLParts.h
layout/generic/nsHTMLReflowState.cpp
layout/generic/nsSelection.cpp
layout/mathml/nsMathMLmtableFrame.cpp
layout/mathml/nsMathMLmtableFrame.h
layout/style/nsComputedDOMStyle.cpp
layout/tables/moz.build
layout/tables/nsTableCellFrame.cpp
layout/tables/nsTableFrame.cpp
layout/tables/nsTableFrame.h
layout/tables/nsTableOuterFrame.cpp
layout/tables/nsTableOuterFrame.h
layout/tables/nsTableWrapperFrame.cpp
layout/tables/nsTableWrapperFrame.h
--- a/accessible/html/HTMLTableAccessible.cpp
+++ b/accessible/html/HTMLTableAccessible.cpp
@@ -29,17 +29,17 @@
 #include "nsIPresShell.h"
 #include "nsITableCellLayout.h"
 #include "nsFrameSelection.h"
 #include "nsError.h"
 #include "nsArrayUtils.h"
 #include "nsComponentManagerUtils.h"
 #include "nsNameSpaceManager.h"
 #include "nsTableCellFrame.h"
-#include "nsTableOuterFrame.h"
+#include "nsTableWrapperFrame.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLTableCellAccessible
 ////////////////////////////////////////////////////////////////////////////////
@@ -490,31 +490,31 @@ HTMLTableAccessible::Summary(nsString& a
 
   if (table)
     table->GetSummary(aSummary);
 }
 
 uint32_t
 HTMLTableAccessible::ColCount()
 {
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   return tableFrame ? tableFrame->GetColCount() : 0;
 }
 
 uint32_t
 HTMLTableAccessible::RowCount()
 {
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   return tableFrame ? tableFrame->GetRowCount() : 0;
 }
 
 uint32_t
 HTMLTableAccessible::SelectedCellCount()
 {
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (!tableFrame)
     return 0;
 
   uint32_t count = 0, rowCount = RowCount(), colCount = ColCount();
   for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++) {
     for (uint32_t colIdx = 0; colIdx < colCount; colIdx++) {
       nsTableCellFrame* cellFrame = tableFrame->GetCellFrameAt(rowIdx, colIdx);
       if (!cellFrame || !cellFrame->IsSelected())
@@ -554,17 +554,17 @@ HTMLTableAccessible::SelectedRowCount()
       count++;
 
   return count;
 }
 
 void
 HTMLTableAccessible::SelectedCells(nsTArray<Accessible*>* aCells)
 {
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (!tableFrame)
     return;
 
   uint32_t rowCount = RowCount(), colCount = ColCount();
   for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++) {
     for (uint32_t colIdx = 0; colIdx < colCount; colIdx++) {
       nsTableCellFrame* cellFrame = tableFrame->GetCellFrameAt(rowIdx, colIdx);
       if (!cellFrame || !cellFrame->IsSelected())
@@ -581,17 +581,17 @@ HTMLTableAccessible::SelectedCells(nsTAr
         aCells->AppendElement(cell);
     }
   }
 }
 
 void
 HTMLTableAccessible::SelectedCellIndices(nsTArray<uint32_t>* aCells)
 {
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (!tableFrame)
     return;
 
   uint32_t rowCount = RowCount(), colCount = ColCount();
   for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++) {
     for (uint32_t colIdx = 0; colIdx < colCount; colIdx++) {
       nsTableCellFrame* cellFrame = tableFrame->GetCellFrameAt(rowIdx, colIdx);
       if (!cellFrame || !cellFrame->IsSelected())
@@ -623,85 +623,85 @@ HTMLTableAccessible::SelectedRowIndices(
   for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++)
     if (IsRowSelected(rowIdx))
       aRows->AppendElement(rowIdx);
 }
 
 Accessible*
 HTMLTableAccessible::CellAt(uint32_t aRowIdx, uint32_t aColIdx)
 {
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (!tableFrame)
     return nullptr;
 
   nsIContent* cellContent = tableFrame->GetCellAt(aRowIdx, aColIdx);
   Accessible* cell = mDoc->GetAccessible(cellContent);
 
   // XXX bug 576838: crazy tables (like table6 in tables/test_table2.html) may
   // return itself as a cell what makes Orca hang.
   return cell == this ? nullptr : cell;
 }
 
 int32_t
 HTMLTableAccessible::CellIndexAt(uint32_t aRowIdx, uint32_t aColIdx)
 {
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (!tableFrame)
     return -1;
 
   return tableFrame->GetIndexByRowAndColumn(aRowIdx, aColIdx);
 }
 
 int32_t
 HTMLTableAccessible::ColIndexAt(uint32_t aCellIdx)
 {
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (!tableFrame)
     return -1;
 
   int32_t rowIdx = -1, colIdx = -1;
   tableFrame->GetRowAndColumnByIndex(aCellIdx, &rowIdx, &colIdx);
   return colIdx;
 }
 
 int32_t
 HTMLTableAccessible::RowIndexAt(uint32_t aCellIdx)
 {
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (!tableFrame)
     return -1;
 
   int32_t rowIdx = -1, colIdx = -1;
   tableFrame->GetRowAndColumnByIndex(aCellIdx, &rowIdx, &colIdx);
   return rowIdx;
 }
 
 void
 HTMLTableAccessible::RowAndColIndicesAt(uint32_t aCellIdx, int32_t* aRowIdx,
                                         int32_t* aColIdx)
 {
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (tableFrame)
     tableFrame->GetRowAndColumnByIndex(aCellIdx, aRowIdx, aColIdx);
 }
 
 uint32_t
 HTMLTableAccessible::ColExtentAt(uint32_t aRowIdx, uint32_t aColIdx)
 {
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (!tableFrame)
     return 0;
 
   return tableFrame->GetEffectiveColSpanAt(aRowIdx, aColIdx);
 }
 
 uint32_t
 HTMLTableAccessible::RowExtentAt(uint32_t aRowIdx, uint32_t aColIdx)
 {
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (!tableFrame)
     return 0;
 
   return tableFrame->GetEffectiveRowSpanAt(aRowIdx, aColIdx);
 }
 
 bool
 HTMLTableAccessible::IsColSelected(uint32_t aColIdx)
@@ -731,17 +731,17 @@ HTMLTableAccessible::IsRowSelected(uint3
   }
 
   return isSelected;
 }
 
 bool
 HTMLTableAccessible::IsCellSelected(uint32_t aRowIdx, uint32_t aColIdx)
 {
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (!tableFrame)
     return false;
 
   nsTableCellFrame* cellFrame = tableFrame->GetCellFrameAt(aRowIdx, aColIdx);
   return cellFrame ? cellFrame->IsSelected() : false;
 }
 
 void
@@ -786,17 +786,17 @@ HTMLTableAccessible::UnselectCol(uint32_
                                    false);
 }
 
 nsresult
 HTMLTableAccessible::AddRowOrColumnToSelection(int32_t aIndex, uint32_t aTarget)
 {
   bool doSelectRow = (aTarget == nsISelectionPrivate::TABLESELECTION_ROW);
 
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (!tableFrame)
     return NS_OK;
 
   uint32_t count = 0;
   if (doSelectRow)
     count = ColCount();
   else
     count = RowCount();
@@ -818,17 +818,17 @@ HTMLTableAccessible::AddRowOrColumnToSel
   return NS_OK;
 }
 
 nsresult
 HTMLTableAccessible::RemoveRowsOrColumnsFromSelection(int32_t aIndex,
                                                       uint32_t aTarget,
                                                       bool aIsOuter)
 {
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (!tableFrame)
     return NS_OK;
 
   nsIPresShell* presShell(mDoc->PresShell());
   RefPtr<nsFrameSelection> tableSelection =
     const_cast<nsFrameSelection*>(presShell->ConstFrameSelection());
 
   bool doUnselectRow = (aTarget == nsISelectionPrivate::TABLESELECTION_ROW);
@@ -1042,17 +1042,17 @@ HTMLTableAccessible::IsProbablyLayoutTab
   // Check for many columns
   if (colCount >= 5) {
     RETURN_LAYOUT_ANSWER(false, ">=5 columns");
   }
 
   // Now we know there are 2-4 columns and 2 or more rows
   // Check to see if there are visible borders on the cells
   // XXX currently, we just check the first cell -- do we really need to do more?
-  nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame());
   if (!tableFrame)
     RETURN_LAYOUT_ANSWER(false, "table with no frame!");
 
   nsIFrame* cellFrame = tableFrame->GetCellFrameAt(0, 0);
   if (!cellFrame)
     RETURN_LAYOUT_ANSWER(false, "table's first cell has no frame!");
 
   nsMargin border;
--- a/editor/libeditor/nsHTMLEditor.h
+++ b/editor/libeditor/nsHTMLEditor.h
@@ -43,17 +43,17 @@
 
 class nsDocumentFragment;
 class nsIDOMKeyEvent;
 class nsITransferable;
 class nsIClipboard;
 class TypeInState;
 class nsIContentFilter;
 class nsILinkHandler;
-class nsTableOuterFrame;
+class nsTableWrapperFrame;
 class nsIDOMRange;
 class nsRange;
 struct PropItem;
 
 namespace mozilla {
 template<class T> class OwningNonNull;
 namespace dom {
 class DocumentFragment;
@@ -449,18 +449,18 @@ protected:
 
   // Move all contents from aCellToMerge into aTargetCell (append at end)
   NS_IMETHOD MergeCells(nsCOMPtr<nsIDOMElement> aTargetCell, nsCOMPtr<nsIDOMElement> aCellToMerge, bool aDeleteCellToMerge);
 
   nsresult DeleteTable2(nsIDOMElement* aTable, Selection* aSelection);
   NS_IMETHOD SetColSpan(nsIDOMElement *aCell, int32_t aColSpan);
   NS_IMETHOD SetRowSpan(nsIDOMElement *aCell, int32_t aRowSpan);
 
-  // Helper used to get nsTableOuterFrame for a table.
-  nsTableOuterFrame* GetTableFrame(nsIDOMElement* aTable);
+  // Helper used to get nsTableWrapperFrame for a table.
+  nsTableWrapperFrame* GetTableFrame(nsIDOMElement* aTable);
   // Needed to do appropriate deleting when last cell or row is about to be deleted
   // This doesn't count cells that don't start in the given row (are spanning from row above)
   int32_t  GetNumberOfCellsInRow(nsIDOMElement* aTable, int32_t rowIndex);
   // Test if all cells in row or column at given index are selected
   bool AllCellsInRowSelected(nsIDOMElement *aTable, int32_t aRowIndex, int32_t aNumberOfColumns);
   bool AllCellsInColumnSelected(nsIDOMElement *aTable, int32_t aColIndex, int32_t aNumberOfRows);
 
   bool IsEmptyCell(Element* aCell);
--- a/editor/libeditor/nsTableEditor.cpp
+++ b/editor/libeditor/nsTableEditor.cpp
@@ -31,17 +31,17 @@
 #include "nsITableCellLayout.h" // For efficient access to table cell
 #include "nsITableEditor.h"
 #include "nsLiteralString.h"
 #include "nsQueryFrame.h"
 #include "nsRange.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsTableCellFrame.h"
-#include "nsTableOuterFrame.h"
+#include "nsTableWrapperFrame.h"
 #include "nscore.h"
 #include <algorithm>
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 /***************************************************************************
  * stack based helper class for restoring selection after table edit
@@ -2573,17 +2573,17 @@ nsHTMLEditor::GetCellIndexes(nsIDOMEleme
   nsIFrame *layoutObject = nodeAsContent->GetPrimaryFrame();
   NS_ENSURE_TRUE(layoutObject, NS_ERROR_FAILURE);
 
   nsITableCellLayout *cellLayoutObject = do_QueryFrame(layoutObject);
   NS_ENSURE_TRUE(cellLayoutObject, NS_ERROR_FAILURE);
   return cellLayoutObject->GetCellIndexes(*aRowIndex, *aColIndex);
 }
 
-nsTableOuterFrame*
+nsTableWrapperFrame*
 nsHTMLEditor::GetTableFrame(nsIDOMElement* aTable)
 {
   NS_ENSURE_TRUE(aTable, nullptr);
 
   nsCOMPtr<nsIContent> nodeAsContent( do_QueryInterface(aTable) );
   NS_ENSURE_TRUE(nodeAsContent, nullptr);
   return do_QueryFrame(nodeAsContent->GetPrimaryFrame());
 }
@@ -2632,17 +2632,17 @@ nsHTMLEditor::GetTableSize(nsIDOMElement
   *aRowCount = 0;
   *aColCount = 0;
   nsCOMPtr<nsIDOMElement> table;
   // Get the selected talbe or the table enclosing the selection anchor
   res = GetElementOrParentByTagName(NS_LITERAL_STRING("table"), aTable, getter_AddRefs(table));
   NS_ENSURE_SUCCESS(res, res);
   NS_ENSURE_TRUE(table, NS_ERROR_FAILURE);
 
-  nsTableOuterFrame* tableFrame = GetTableFrame(table.get());
+  nsTableWrapperFrame* tableFrame = GetTableFrame(table.get());
   NS_ENSURE_TRUE(tableFrame, NS_ERROR_FAILURE);
 
   *aRowCount = tableFrame->GetRowCount();
   *aColCount = tableFrame->GetColCount();
 
   return NS_OK;
 }
 
@@ -2681,17 +2681,17 @@ nsHTMLEditor::GetCellDataAt(nsIDOMElemen
     res = GetElementOrParentByTagName(NS_LITERAL_STRING("table"), nullptr, getter_AddRefs(table));
     NS_ENSURE_SUCCESS(res, res);
     if (table)
       aTable = table;
     else
       return NS_ERROR_FAILURE;
   }
 
-  nsTableOuterFrame* tableFrame = GetTableFrame(aTable);
+  nsTableWrapperFrame* tableFrame = GetTableFrame(aTable);
   NS_ENSURE_TRUE(tableFrame, NS_ERROR_FAILURE);
 
   nsTableCellFrame* cellFrame =
     tableFrame->GetCellFrameAt(aRowIndex, aColIndex);
   if (!cellFrame)
     return NS_ERROR_FAILURE;
 
   *aIsSelected = cellFrame->IsSelected();
@@ -2719,17 +2719,17 @@ nsHTMLEditor::GetCellAt(nsIDOMElement* a
     // Get the selected table or the table enclosing the selection anchor
     nsCOMPtr<nsIDOMElement> table;
     nsresult res = GetElementOrParentByTagName(NS_LITERAL_STRING("table"), nullptr, getter_AddRefs(table));
     NS_ENSURE_SUCCESS(res, res);
     NS_ENSURE_TRUE(table, NS_ERROR_FAILURE);
     aTable = table;
   }
 
-  nsTableOuterFrame* tableFrame = GetTableFrame(aTable);
+  nsTableWrapperFrame* tableFrame = GetTableFrame(aTable);
   if (!tableFrame) {
     *aCell = nullptr;
     return NS_EDITOR_ELEMENT_NOT_FOUND;
   }
 
   nsCOMPtr<nsIDOMElement> domCell =
     do_QueryInterface(tableFrame->GetCellAt(aRowIndex, aColIndex));
   domCell.forget(aCell);
@@ -2737,17 +2737,17 @@ nsHTMLEditor::GetCellAt(nsIDOMElement* a
   return NS_OK;
 }
 
 // When all you want are the rowspan and colspan (not exposed in nsITableEditor)
 NS_IMETHODIMP
 nsHTMLEditor::GetCellSpansAt(nsIDOMElement* aTable, int32_t aRowIndex, int32_t aColIndex,
                              int32_t& aActualRowSpan, int32_t& aActualColSpan)
 {
-  nsTableOuterFrame* tableFrame = GetTableFrame(aTable);
+  nsTableWrapperFrame* tableFrame = GetTableFrame(aTable);
   if (!tableFrame)
     return NS_ERROR_FAILURE;
 
   aActualRowSpan = tableFrame->GetEffectiveRowSpanAt(aRowIndex, aColIndex);
   aActualColSpan = tableFrame->GetEffectiveColSpanAt(aRowIndex, aColIndex);
 
   return NS_OK;
 }
--- a/layout/base/GeometryUtils.cpp
+++ b/layout/base/GeometryUtils.cpp
@@ -182,17 +182,17 @@ public:
     }
   }
 
   virtual void AddBox(nsIFrame* aFrame) override
   {
     nsIFrame* f = aFrame;
     if (mBoxType == CSSBoxType::Margin &&
         f->GetType() == nsGkAtoms::tableFrame) {
-      // Margin boxes for table frames should be taken from the outer table
+      // Margin boxes for table frames should be taken from the table wrapper
       // frame, since that has the margin.
       f = f->GetParent();
     }
     nsRect box = GetBoxRectForFrame(&f, mBoxType);
     nsPoint appUnits[4] =
       { box.TopLeft(), box.TopRight(), box.BottomRight(), box.BottomLeft() };
     CSSPoint points[4];
     for (uint32_t i = 0; i < 4; ++i) {
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -394,18 +394,19 @@ ApplyRenderingChangeToTree(nsPresContext
   gInApplyRenderingChangeToTree = false;
 #endif
 }
 
 bool
 RestyleManager::RecomputePosition(nsIFrame* aFrame)
 {
   // Don't process position changes on table frames, since we already handle
-  // the dynamic position change on the outer table frame, and the reflow-based
-  // fallback code path also ignores positions on inner table frames.
+  // the dynamic position change on the table wrapper frame, and the
+  // reflow-based fallback code path also ignores positions on inner table
+  // frames.
   if (aFrame->GetType() == nsGkAtoms::tableFrame) {
     return true;
   }
 
   const nsStyleDisplay* display = aFrame->StyleDisplay();
   // Changes to the offsets of a non-positioned element can safely be ignored.
   if (display->mPosition == NS_STYLE_POSITION_STATIC) {
     return true;
--- a/layout/base/RestyleManager.h
+++ b/layout/base/RestyleManager.h
@@ -612,19 +612,19 @@ public:
   };
   ElementRestyler(const ElementRestyler& aParentRestyler,
                   nsIFrame* aFrame,
                   uint32_t aConstructorFlags);
 
   // Construct for a frame whose parent is being restyled, but whose
   // style context is the parent style context for its parent frame.
   // (This is only used for table frames, whose style contexts are used
-  // as the parent style context for their outer table frame (table
-  // wrapper frame).  We should probably try to get rid of this
-  // exception and have the inheritance go the other way.)
+  // as the parent style context for their table wrapper frame. We should
+  // probably try to get rid of this exception and have the inheritance go
+  // the other way.)
   enum ParentContextFromChildFrame { PARENT_CONTEXT_FROM_CHILD_FRAME };
   ElementRestyler(ParentContextFromChildFrame,
                   const ElementRestyler& aParentFrameRestyler,
                   nsIFrame* aFrame);
 
   // For restyling undisplayed content only (mFrame==null).
   ElementRestyler(nsPresContext* aPresContext,
                   nsIContent* aContent,
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -86,17 +86,17 @@
 #include "nsFieldSetFrame.h"
 #include "nsInlineFrame.h"
 #include "nsBlockFrame.h"
 #include "nsCanvasFrame.h"
 #include "nsFirstLetterFrame.h"
 #include "nsGfxScrollFrame.h"
 #include "nsPageFrame.h"
 #include "nsSimplePageSequenceFrame.h"
-#include "nsTableOuterFrame.h"
+#include "nsTableWrapperFrame.h"
 #include "nsIScrollableFrame.h"
 #include "nsBackdropFrame.h"
 #include "nsTransitionManager.h"
 #include "DetailsFrame.h"
 
 #ifdef MOZ_XUL
 #include "nsIRootBox.h"
 #endif
@@ -1109,17 +1109,17 @@ nsFrameConstructorState::GetGeometricPar
   // brought to you by the letter T: tables, since other roots don't
   // even call into this code.  See bug 178855.
   //
   // XXX Disabling positioning in this case is a hack.  If one was so inclined,
   // one could support this either by (1) inserting a dummy block between the
   // table and the canvas or (2) teaching the canvas how to reflow positioned
   // elements. (1) has the usual problems when multiple frames share the same
   // content (notice all the special cases in this file dealing with inner
-  // tables and outer tables which share the same content). (2) requires some
+  // tables and table wrappers which share the same content). (2) requires some
   // work and possible factoring.
   //
   // XXXbz couldn't we just force position to "static" on roots and
   // float to "none"?  That's OK per CSS 2.1, as far as I can tell.
 
   if (aContentParentFrame && aContentParentFrame->IsSVGText()) {
     return aContentParentFrame;
   }
@@ -1914,23 +1914,23 @@ nsCSSFrameConstructor::CreateGeneratedCo
 
 /****************************************************
  **  BEGIN TABLE SECTION
  ****************************************************/
 
 // The term pseudo frame is being used instead of anonymous frame, since anonymous
 // frame has been used elsewhere to refer to frames that have generated content
 
-// Return whether the given frame is a table pseudo-frame.  Note that
+// Return whether the given frame is a table pseudo-frame. Note that
 // cell-content and table-outer frames have pseudo-types, but are always
 // created, even for non-anonymous cells and tables respectively.  So for those
 // we have to examine the cell or table frame to see whether it's a pseudo
-// frame.  In particular, a lone table caption will have an outer table as its
+// frame. In particular, a lone table caption will have a table wrapper as its
 // parent, but will also trigger construction of an empty inner table, which
-// will be the one we can examine to see whether the outer was a pseudo-frame.
+// will be the one we can examine to see whether the wrapper was a pseudo-frame.
 static bool
 IsTablePseudo(nsIFrame* aFrame)
 {
   nsIAtom* pseudoType = aFrame->StyleContext()->GetPseudo();
   return pseudoType &&
     (pseudoType == nsCSSAnonBoxes::table ||
      pseudoType == nsCSSAnonBoxes::inlineTable ||
      pseudoType == nsCSSAnonBoxes::tableColGroup ||
@@ -2064,33 +2064,33 @@ nsCSSFrameConstructor::ConstructTable(ns
   NS_PRECONDITION(aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE ||
                   aDisplay->mDisplay == NS_STYLE_DISPLAY_INLINE_TABLE,
                   "Unexpected call");
 
   nsIContent* const content = aItem.mContent;
   nsStyleContext* const styleContext = aItem.mStyleContext;
   const uint32_t nameSpaceID = aItem.mNameSpaceID;
 
-  // create the pseudo SC for the outer table as a child of the inner SC
+  // create the pseudo SC for the table wrapper as a child of the inner SC
   RefPtr<nsStyleContext> outerStyleContext;
   outerStyleContext = mPresShell->StyleSet()->
     ResolveAnonymousBoxStyle(nsCSSAnonBoxes::tableOuter, styleContext);
 
-  // Create the outer table frame which holds the caption and inner table frame
+  // Create the table wrapper frame which holds the caption and inner table frame
   nsContainerFrame* newFrame;
   if (kNameSpaceID_MathML == nameSpaceID)
     newFrame = NS_NewMathMLmtableOuterFrame(mPresShell, outerStyleContext);
   else
-    newFrame = NS_NewTableOuterFrame(mPresShell, outerStyleContext);
+    newFrame = NS_NewTableWrapperFrame(mPresShell, outerStyleContext);
 
   nsContainerFrame* geometricParent =
     aState.GetGeometricParent(outerStyleContext->StyleDisplay(),
                               aParentFrame);
 
-  // Init the table outer frame
+  // Init the table wrapper frame
   InitAndRestoreFrame(aState, content, geometricParent, newFrame);
 
   // Create the inner table frame
   nsContainerFrame* innerFrame;
   if (kNameSpaceID_MathML == nameSpaceID)
     innerFrame = NS_NewMathMLmtableFrame(mPresShell, styleContext);
   else
     innerFrame = NS_NewTableFrame(mPresShell, styleContext);
@@ -2132,17 +2132,17 @@ nsCSSFrameConstructor::ConstructTable(ns
   }
 
   nsFrameItems captionItems;
   PullOutCaptionFrames(childItems, captionItems);
 
   // Set the inner table frame's initial primary list
   innerFrame->SetInitialChildList(kPrincipalList, childItems);
 
-  // Set the outer table frame's secondary childlist lists
+  // Set the table wrapper frame's secondary childlist lists
   if (captionItems.NotEmpty()) {
     newFrame->SetInitialChildList(nsIFrame::kCaptionList, captionItems);
   }
 
   return newFrame;
 }
 
 static void
@@ -2718,44 +2718,44 @@ nsCSSFrameConstructor::SetUpDocElementCo
     how the root frame hierarchy should look
 
   Galley presentation, non-XUL, with scrolling:
 
       ViewportFrame [fixed-cb]
         nsHTMLScrollFrame
           nsCanvasFrame [abs-cb]
             root element frame (nsBlockFrame, nsSVGOuterSVGFrame,
-                                nsTableOuterFrame, nsPlaceholderFrame)
+                                nsTableWrapperFrame, nsPlaceholderFrame)
 
   Galley presentation, XUL
 
       ViewportFrame [fixed-cb]
         nsRootBoxFrame
           root element frame (nsDocElementBoxFrame)
 
   Print presentation, non-XUL
 
       ViewportFrame
         nsSimplePageSequenceFrame
           nsPageFrame
             nsPageContentFrame [fixed-cb]
               nsCanvasFrame [abs-cb]
                 root element frame (nsBlockFrame, nsSVGOuterSVGFrame,
-                                    nsTableOuterFrame, nsPlaceholderFrame)
+                                    nsTableWrapperFrame, nsPlaceholderFrame)
 
   Print-preview presentation, non-XUL
 
       ViewportFrame
         nsHTMLScrollFrame
           nsSimplePageSequenceFrame
             nsPageFrame
               nsPageContentFrame [fixed-cb]
                 nsCanvasFrame [abs-cb]
                   root element frame (nsBlockFrame, nsSVGOuterSVGFrame,
-                                      nsTableOuterFrame, nsPlaceholderFrame)
+                                      nsTableWrapperFrame, nsPlaceholderFrame)
 
   Print/print preview of XUL is not supported.
   [fixed-cb]: the default containing block for fixed-pos content
   [abs-cb]: the default containing block for abs-pos content
 
   Meaning of nsCSSFrameConstructor fields:
     mRootElementFrame is "root element frame".  This is the primary frame for
       the root element.
@@ -6161,21 +6161,21 @@ nsCSSFrameConstructor::GetAbsoluteContai
     }
     // Only first continuations can be containing blocks.
     absPosCBCandidate = absPosCBCandidate->FirstContinuation();
     // Is the frame really an absolute container?
     if (!absPosCBCandidate->IsAbsoluteContainer()) {
       continue;
     }
 
-    // For tables, skip the inner frame and consider the outer table frame.
+    // For tables, skip the inner frame and consider the table wrapper frame.
     if (type == nsGkAtoms::tableFrame) {
       continue;
     }
-    // For outer table frames, we can just return absPosCBCandidate.
+    // For table wrapper frames, we can just return absPosCBCandidate.
     MOZ_ASSERT((nsContainerFrame*)do_QueryFrame(absPosCBCandidate),
                "abs.pos. containing block must be nsContainerFrame sub-class");
     return static_cast<nsContainerFrame*>(absPosCBCandidate);
   }
 
   MOZ_ASSERT(aType != FIXED_POS, "no ICB in this frame tree?");
 
   // It is possible for the search for the containing block to fail, because
@@ -7411,18 +7411,18 @@ nsCSSFrameConstructor::ContentAppended(n
     // Invalidate now instead of before the WipeContainingBlock call, just in
     // case we do wipe; in that case we don't need to do this walk at all.
     // XXXbz does that matter?  Would it make more sense to save some virtual
     // GetChildAt calls instead and do this during construction of our
     // FrameConstructionItemList?
     InvalidateCanvasIfNeeded(mPresShell, child);
   }
 
-  // if the container is a table and a caption was appended, it needs to be put
-  // in the outer table frame's additional child list.
+  // If the container is a table and a caption was appended, it needs to be put
+  // in the table wrapper frame's additional child list.
   nsFrameItems captionItems;
   if (nsGkAtoms::tableFrame == frameType) {
     // Pull out the captions.  Note that we don't want to do that as we go,
     // because processing a single caption can add a whole bunch of things to
     // the frame items due to pseudoframe processing.  So we'd have to pull
     // captions from a list anyway; might as well do that here.
     // XXXbz this is no longer true; we could pull captions directly out of the
     // FrameConstructionItemList now.
@@ -7434,17 +7434,17 @@ nsCSSFrameConstructor::ContentAppended(n
     // first-line frame. Look at them and see...
     AppendFirstLineFrames(state, containingBlock->GetContent(),
                           containingBlock, frameItems);
   }
 
   // Notify the parent frame passing it the list of new frames
   // Append the flowed frames to the principal child list; captions
   // need special treatment
-  if (captionItems.NotEmpty()) { // append the caption to the outer table
+  if (captionItems.NotEmpty()) { // append the caption to the table wrapper
     NS_ASSERTION(nsGkAtoms::tableFrame == frameType, "how did that happen?");
     nsContainerFrame* outerTable = parentFrame->GetParent();
     AppendFrames(outerTable, nsIFrame::kCaptionList, captionItems);
   }
 
   if (frameItems.NotEmpty()) { // append the in-flow kids
     AppendFramesToParent(state, parentFrame, frameItems, prevSibling);
   }
@@ -7936,17 +7936,17 @@ nsCSSFrameConstructor::ContentRangeInser
   if (WipeContainingBlock(state, containingBlock, insertion.mParentFrame, items,
                           isAppend, prevSibling)) {
     LAYOUT_PHASE_TEMP_REENTER();
     return NS_OK;
   }
   LAYOUT_PHASE_TEMP_REENTER();
 
   // If the container is a table and a caption will be appended, it needs to be
-  // put in the outer table frame's additional child list.
+  // put in the table wrapper frame's additional child list.
   // We make no attempt here to set flags to indicate whether the list
   // will be at the start or end of a block. It doesn't seem worthwhile.
   nsFrameItems frameItems, captionItems;
   ConstructFramesFromItemList(state, items, insertion.mParentFrame, frameItems);
 
   if (frameItems.NotEmpty()) {
     for (nsIContent* child = aStartChild;
          child != aEndChild;
@@ -7963,17 +7963,17 @@ nsCSSFrameConstructor::ContentRangeInser
   // If the parent of our current prevSibling is different from the frame we'll
   // actually use as the parent, then the calculated insertion point is now
   // invalid and as it is unknown where to insert correctly we append instead
   // (bug 341858).
   // This can affect our prevSibling and isAppend, but should not have any
   // effect on the WipeContainingBlock above, since this should only happen
   // when neither parent is a ib-split frame and should not affect whitespace
   // handling inside table-related frames (and in fact, can only happen when
-  // one of the parents is an outer table and one is an inner table or when the
+  // one of the parents is a table wrapper and one is an inner table or when the
   // parent is a fieldset or fieldset content frame).  So it won't affect the
   // {ib} or XUL box cases in WipeContainingBlock(), and the table pseudo
   // handling will only be affected by us maybe thinking we're not inserting
   // at the beginning, whereas we really are.  That would have made us reframe
   // unnecessarily, but that's ok.
   // XXXbz we should push our frame construction item code up higher, so we
   // know what our items are by the time we start figuring out previous
   // siblings
@@ -8017,17 +8017,17 @@ nsCSSFrameConstructor::ContentRangeInser
       // here to make no sense without anyone noticing...  If it ever stops
       // being a no-op, vet them carefully!
       InsertFirstLineFrames(state, container, containingBlock, &insertion.mParentFrame,
                             prevSibling, frameItems);
     }
   }
 
   // We might have captions; put them into the caption list of the
-  // outer table frame.
+  // table wrapper frame.
   if (captionItems.NotEmpty()) {
     NS_ASSERTION(nsGkAtoms::tableFrame == frameType ||
                  nsGkAtoms::tableOuterFrame == frameType,
                  "parent for caption is not table?");
     // We need to determine where to put the caption items; start with the
     // the parent frame that has already been determined and get the insertion
     // prevsibling of the first caption item.
     bool captionIsAppend;
@@ -8050,22 +8050,22 @@ nsCSSFrameConstructor::ContentRangeInser
                                 &captionIsAppend, &ignored,
                                 aStartChild, aEndChild);
     }
 
     nsContainerFrame* outerTable = nullptr;
     if (GetCaptionAdjustedParent(captionInsertion.mParentFrame,
                                  captionItems.FirstChild(),
                                  &outerTable)) {
-      // If the parent is not an outer table frame we will try to add frames
-      // to a named child list that the parent does not honour and the frames
-      // will get lost
+      // If the parent is not a table wrapper frame we will try to add frames
+      // to a named child list that the parent does not honor and the frames
+      // will get lost.
       NS_ASSERTION(nsGkAtoms::tableOuterFrame == outerTable->GetType(),
                    "Pseudo frame construction failure; "
-                   "a caption can be only a child of an outer table frame");
+                   "a caption can be only a child of a table wrapper frame");
 
       // If the parent of our current prevSibling is different from the frame
       // we'll actually use as the parent, then the calculated insertion
       // point is now invalid (bug 341382).
       if (captionPrevSibling &&
           captionPrevSibling->GetParent() != outerTable) {
           captionPrevSibling = nullptr;
       }
@@ -8684,34 +8684,34 @@ void nsCSSFrameConstructor::GetAlternate
 nsIFrame*
 nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell*     aPresShell,
                                                        nsPresContext*    aPresContext,
                                                        nsIFrame*         aFrame,
                                                        nsContainerFrame* aParentFrame,
                                                        nsIContent*       aContent,
                                                        nsStyleContext*   aStyleContext)
 {
-  nsTableOuterFrame* newFrame = NS_NewTableOuterFrame(aPresShell, aStyleContext);
+  nsTableWrapperFrame* newFrame = NS_NewTableWrapperFrame(aPresShell, aStyleContext);
 
   newFrame->Init(aContent, aParentFrame, aFrame);
 
   // Create a continuing inner table frame, and if there's a caption then
   // replicate the caption
   nsFrameItems  newChildFrames;
 
   nsIFrame* childFrame = aFrame->PrincipalChildList().FirstChild();
   if (childFrame) {
     nsIFrame* continuingTableFrame =
       CreateContinuingFrame(aPresContext, childFrame, newFrame);
     newChildFrames.AddChild(continuingTableFrame);
 
     NS_ASSERTION(!childFrame->GetNextSibling(),"there can be only one inner table frame");
   }
 
-  // Set the outer table's initial child list
+  // Set the table wrapper's initial child list
   newFrame->SetInitialChildList(kPrincipalList, newChildFrames);
 
   return newFrame;
 }
 
 nsIFrame*
 nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell*     aPresShell,
                                                   nsIFrame*         aFrame,
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -462,17 +462,17 @@ private:
   nsresult AppendFramesToParent(nsFrameConstructorState&       aState,
                                 nsContainerFrame*              aParentFrame,
                                 nsFrameItems&                  aFrameList,
                                 nsIFrame*                      aPrevSibling,
                                 bool                           aIsRecursiveCall = false);
 
   // BEGIN TABLE SECTION
   /**
-   * Construct an outer table frame.  This is the FrameConstructionData
+   * Construct a table wrapper frame. This is the FrameConstructionData
    * callback used for the job.
    */
   nsIFrame* ConstructTable(nsFrameConstructorState& aState,
                            FrameConstructionItem&   aItem,
                            nsContainerFrame*        aParentFrame,
                            const nsStyleDisplay*    aDisplay,
                            nsFrameItems&            aFrameItems);
 
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -341,29 +341,29 @@ public:
    */
   static nsIFrame* GetPageFrame(nsIFrame* aFrame)
   {
     return GetClosestFrameOfType(aFrame, nsGkAtoms::pageFrame);
   }
 
   /**
    * Given a frame which is the primary frame for an element,
-   * return the frame that has the non-psuedoelement style context for
+   * return the frame that has the non-pseudoelement style context for
    * the content.
    * This is aPrimaryFrame itself except for tableOuter frames.
    *
    * Given a non-null input, this will return null if and only if its
-   * argument is a table outer frame that is mid-destruction (and its
+   * argument is a table wrapper frame that is mid-destruction (and its
    * table frame has been destroyed).
    */
   static nsIFrame* GetStyleFrame(nsIFrame* aPrimaryFrame);
 
   /**
    * Given a content node,
-   * return the frame that has the non-psuedoelement style context for
+   * return the frame that has the non-pseudoelement style context for
    * the content.  May return null.
    * This is aContent->GetPrimaryFrame() except for tableOuter frames.
    */
   static nsIFrame* GetStyleFrame(const nsIContent* aContent);
 
   /**
    * Gets the real primary frame associated with the content object.
    *
@@ -372,17 +372,17 @@ public:
    * placeholder frame.
    */
   static nsIFrame* GetRealPrimaryFrameFor(const nsIContent* aContent);
 
   /**
    * IsGeneratedContentFor returns true if aFrame is the outermost
    * frame for generated content of type aPseudoElement for aContent.
    * aFrame *might not* have the aPseudoElement pseudo-style! For example
-   * it might be a table outer frame and the inner table frame might
+   * it might be a table wrapper frame and the inner table frame might
    * have the pseudo-style.
    *
    * @param aContent the content node we're looking at.  If this is
    *        null, then we just assume that aFrame has the right content
    *        pointer.
    * @param aFrame the frame we're looking at
    * @param aPseudoElement the pseudo type we're interested in
    * @return whether aFrame is the generated aPseudoElement frame for aContent
@@ -1128,17 +1128,17 @@ public:
   class BoxCallback {
   public:
     BoxCallback() : mIncludeCaptionBoxForTable(true) {}
     virtual void AddBox(nsIFrame* aFrame) = 0;
     bool mIncludeCaptionBoxForTable;
   };
   /**
    * Collect all CSS boxes associated with aFrame and its
-   * continuations, "drilling down" through outer table frames and
+   * continuations, "drilling down" through table wrapper frames and
    * some anonymous blocks since they're not real CSS boxes.
    * If aFrame is null, no boxes are returned.
    * SVG frames return a single box, themselves.
    */
   static void GetAllInFlowBoxes(nsIFrame* aFrame, BoxCallback* aCallback);
 
   /**
    * Find the first frame descendant of aFrame (including aFrame) which is
@@ -1176,17 +1176,17 @@ public:
     // With neither bit set (default), use the border box.
     RECTS_USE_CONTENT_BOX = 0x02,
     RECTS_USE_PADDING_BOX = 0x04,
     RECTS_USE_MARGIN_BOX = 0x06, // both bits set
     RECTS_WHICH_BOX_MASK = 0x06 // bitmask for these two bits
   };
   /**
    * Collect all CSS boxes (content, padding, border, or margin) associated
-   * with aFrame and its continuations, "drilling down" through outer table
+   * with aFrame and its continuations, "drilling down" through table wrapper
    * frames and some anonymous blocks since they're not real CSS boxes.
    * The boxes are positioned relative to aRelativeTo (taking scrolling
    * into account) and passed to the callback in frame-tree order.
    * If aFrame is null, no boxes are returned.
    * For SVG frames, returns one rectangle, the bounding box.
    * If aFlags includes RECTS_ACCOUNT_FOR_TRANSFORMS, then when converting
    * the boxes into aRelativeTo coordinates, transforms (including CSS
    * and SVG transforms) are taken into account.
--- a/layout/doc/frame_reflow_debug.html
+++ b/layout/doc/frame_reflow_debug.html
@@ -136,17 +136,17 @@ The first line shows the reflow of the v
 <tr><td>1</td><td>incremental reflow</td></tr>
 <tr><td>2</td><td>resize reflow</td></tr>
 <tr><td>3</td><td>style change reflow</td></tr>
 <tr><td>4</td><td>dirty reflow.</td></tr>
 </table>
 
 <p>The available width is 9180 twips. The available height is 4470 twips (<code class="log">a=9180,4470</code>). The computed width is 9180 twips. The computed height is 4470 twips (<code class="log">c=9180,4470</code>). The line count is 856 (<code  class="log">cnt=856</code>).
 <p>
-Below this is a line that reads:<p><code class="log">tblO 02D7B5F0 r=0 a=8940,UC c=0,0 cnt=870</code></p><p> Here the <code class="log">UC</code> shows that on initial reflow the available height for the outer table frame is unconstrained.
+Below this is a line that reads:<p><code class="log">tblO 02D7B5F0 r=0 a=8940,UC c=0,0 cnt=870</code></p><p> Here the <code class="log">UC</code> shows that on initial reflow the available height for the table wrapper frame is unconstrained.
 <p>
 The table cell requires its children to compute the MES. It is reported back from the block as:
 <p><code class="log">block 02D7BCF8 d=300,300 me=300</code></p>
 <p>The  block max. element size is 300 twips.
 <p> The second table reflow is started at 
 <p><code class="log">rowG 00B984A4 r=2 a=1500,UC c=1500,UC cnt=879</code></p>
 <p>where the previous information is used. 
 The block has been required to compute the max. element size only once and it reports now:
--- a/layout/doc/table_reflow_slides.html
+++ b/layout/doc/table_reflow_slides.html
@@ -370,17 +370,17 @@
 
 <div class="slide" id="s10">
   <div class="nav">
     <a href="#s9">&lt;</a>
     <a href="#s11">&gt;</a>
   </div>
   <h1>Table Reflow</h1>
   <ul>
-    <li>Outer table reflows table and caption (if present)</li>
+    <li>table wrapper reflows table and caption (if present)</li>
 	<li>Table reflows row groups in multiple passes</li> 
 	 <ul class=nested>
       <li>Pass 1 - unconstrained width, height and requests max elem width.</li>
       <li>The table figures out the column widths (balances) given the style width constraints
 	  on the table, col groups, cols, cells the preferred and max element sizes of the cells 
 	  (from the pass 1 reflow), and considers colspans</li> 
       <li>Pass 2 - cell widths are constrained by the column widths (heights are only 
 	  constrained in paginated mode).</li> 
@@ -483,31 +483,31 @@ Key:
     <a href="#s14">&gt;</a>
   </div>
   <h1>Table reflow optimizations</h1>
   <ul>
     <li>If the table is already balanced, pass 1 constrains the width (like a normal pass 2) based on the current
 	column widths. The pass 2 will get skipped if the table doesn't need to rebalance. <!--<span class="comment">please clarify when can this happen</span>--></li> 
     <li>Nested table reflowed with an unconstrained width (i.e. an ancestor is doing a pass 1 reflow)
 	will only do a pass 1 reflow on its children</li>
-    <li>Outer table caches last avail width and avoids reflowing children if resize reflow is the same as previous</li>
+    <li>table wrapper caches last avail width and avoids reflowing children if resize reflow is the same as previous</li>
     <li>Table caches max element, preferred widths in case they are requested and it isn't rebalanced</li>
     <li>Cell caches prior avail width. if this doesn't change, the row may not have to reflow the cell</li>
   </ul>
 
 </div>
 
 <div class="slide" id="s14">
   <div class="nav">
     <a href="#s13">&lt;</a>
     <a href="#s15">&gt;</a>
   </div>
   <h1>Table incremental reflow</h1>
   <ul>
-    <li>Outer table is a target when a caption is added or removed (dirty) or the table or caption margin 
+    <li>table wrapper is a target when a caption is added or removed (dirty) or the table or caption margin 
   changes (style changed).</li> 
     <li>Caption is a target when it changes stylistically (style changed).</li>
     <li>Table, row group, row, col group, col is a target when a child is added or removed (dirty) or it changes
   stylistically (style changed). <!--<span class="comment">please show how the column style change is propagated 
                into the cell reflows as the cells are reflowed by their parent rows and not cols</span>--></li>
     <li>In the dirty cases, a target posted the reflow command in AppendFrames, InsertFrames, or DeleteFrame.</li>
   </ul>
 </div>
@@ -675,17 +675,17 @@ Key:
 	        <tr><td class=title>areaFrame (html)</td></tr>
 	        <tr>
 	         <td class=box>
 			  <table class=box style="height:100%; border-bottom:hidden">
 	           <tr><td class=title>blockFrame (body)</td></tr>
 	           <tr>
 	            <td class=box>
 			     <table class=box style="height:100%; border-bottom:hidden">
-	              <tr><td class=title>nsTableOuterFrame</td></tr>
+	              <tr><td class=title>nsTableWrapperFrame</td></tr>
 	              <tr>
 	               <td class=box></td>
 	              </tr>
 	             </table>
 				</td>
 	           </tr>
 	          </table>
              </td>
@@ -708,17 +708,17 @@ Key:
 	         <td class=box>
 			  <table class=box style="height:100%; border-top:hidden">
 	           <tr>
 	            <td class=box>
 			     <table class=box style="height:100%; border-top:hidden">
 	              <tr>
 	               <td class=box></td>
 	              </tr>
-	              <tr><td class=title2>nsTableOuterFrame</td></tr>
+	              <tr><td class=title2>nsTableWrapperFrame</td></tr>
 	             </table>
 				</td>
 	           </tr>
 	           <tr><td class=title2>blockFrame (body)</td></tr>
 	          </table>
              </td>
 	        </tr>
 	        <tr><td class=title2>areaFrame (html)</td></tr>
@@ -795,23 +795,23 @@ Key:
 
 <div class="slide" id="s25">
   <div class="nav">
     <a href="#s24">&lt;</a>
     <a href="#s26">&gt;</a>
   </div>
   <h1>Table paginated reflow</h1>
   <ul>
-	<li>The block containing the outer table reflows it. If it is incomplete, the block will
+	<li>The block containing the table wrapper reflows it. If it is incomplete, the block will
 	  <ul>
-	    <li>create a continuation for the outer table (which also creates a continuation for the table).</li>
+	    <li>create a continuation for the table wrapper (which also creates a continuation for the table).</li>
 	    <li>put the continuation on a new line and place that line on its overflow lines property.</li>
 	  </ul>
 	</li>
-    <li>The outer table reflows the table and just returns the status of the table.</li>
+    <li>The table wrapper reflows the table and just returns the status of the table.</li>
     <li>The table does a pass 1 reflow and balances. If it is incomplete,</li>
 	  <ul>
 	    <li>it will become the first-in-flow</li>
 		<li>it will be the only frame among its continuations to ever balance or calc the cell map, and it only
 		does this once</li>
 	  </ul>
 	</li>
   </ul>
@@ -869,20 +869,20 @@ Key:
 	<li>The row and cells (getting the constrained height reflow) just reflow their children with a constrained height.  
     They don't need an overflow list for continued children because the continuations were created when the
     row group created the row's continutation.</li>
     <li>A cell is incomplete because its block is incomplete. The block uses the overflow lines mechanism 
     (mentioned above) for its continued children</li>
 	</li>
 	<li>There are two splitting scenarios for a table
 	  <ul>
-	    <li>An incomplete cells block causes the cell, row, row group, table, outer table to
+	    <li>An incomplete cells block causes the cell, row, row group, table, table wrapper to
 	    be incomplete</li>
 	    <li>A truncated row or a row that started too far down the page causes the row group, 
-		table, outer table to be incomplete.</li>
+		table, table wrapper to be incomplete.</li>
 	  </ul>
 	</li>
   </ul>
 </div>
 
 
 </body>
 </html>
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -24,17 +24,17 @@
 #include "nsPlaceholderFrame.h"
 #include "nsIContent.h"
 #include "nsContentUtils.h"
 #include "nsCSSPseudoElements.h"
 #include "nsIAtom.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsStyleContext.h"
-#include "nsTableOuterFrame.h"
+#include "nsTableWrapperFrame.h"
 #include "nsView.h"
 #include "nsViewManager.h"
 #include "nsIScrollableFrame.h"
 #include "nsPresContext.h"
 #include "nsStyleConsts.h"
 #include "nsIPresShell.h"
 #include "mozilla/Logging.h"
 #include "mozilla/Snprintf.h"
@@ -3062,17 +3062,17 @@ nsFrame::GetDataForTableSelection(const 
       //      for row and column selection, this is the place to do it
       break;
     }
     else
     {
       // If not a cell, check for table
       // This will happen when starting frame is the table or child of a table,
       //  such as a row (we were inbetween cells or in table border)
-      nsTableOuterFrame *tableFrame = do_QueryFrame(frame);
+      nsTableWrapperFrame *tableFrame = do_QueryFrame(frame);
       if (tableFrame)
       {
         foundTable = true;
         //TODO: How can we select row when along left table edge
         //  or select column when along top edge?
         break;
       } else {
         frame = frame->GetParent();
@@ -7263,24 +7263,24 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct*
             if (aPos->mDirection == eDirPrevious)
               thisLine--;
             else
               thisLine++;
           }
           else //if failure or success with different frame.
             doneLooping = true; //do not continue with while loop
 
-          lastFrame = aPos->mResultFrame; //set last frame 
-
-          if (NS_SUCCEEDED(result) && aPos->mResultFrame 
+          lastFrame = aPos->mResultFrame; //set last frame
+
+          if (NS_SUCCEEDED(result) && aPos->mResultFrame
             && blockFrame != aPos->mResultFrame)// make sure block element is not the same as the one we had before
           {
 /* SPECIAL CHECK FOR TABLE NAVIGATION
   tables need to navigate also and the frame that supports it is nsTableRowGroupFrame which is INSIDE
-  nsTableOuterFrame.  if we have stumbled onto an nsTableOuter we need to drill into nsTableRowGroup
+  nsTableWrapperFrame.  if we have stumbled onto an nsTableOuter we need to drill into nsTableRowGroup
   if we hit a header or footer that's ok just go into them,
 */
             bool searchTableBool = false;
             if (aPos->mResultFrame->GetType() == nsGkAtoms::tableOuterFrame ||
                 aPos->mResultFrame->GetType() == nsGkAtoms::tableCellFrame)
             {
               nsIFrame *frame = aPos->mResultFrame->PrincipalChildList().FirstChild();
               //got the table frame now
@@ -7432,18 +7432,21 @@ nsFrame::PeekOffsetCharacter(bool aForwa
     // skip to the other side and we're done.
     *aOffset = 1 - startOffset;
     return FOUND;
   }
   return CONTINUE;
 }
 
 nsIFrame::FrameSearchResult
-nsFrame::PeekOffsetWord(bool aForward, bool aWordSelectEatSpace, bool aIsKeyboardSelect,
-                        int32_t* aOffset, PeekWordState* aState)
+nsFrame::PeekOffsetWord(bool            aForward,
+                        bool            aWordSelectEatSpace,
+                        bool            aIsKeyboardSelect,
+                        int32_t*        aOffset,
+                        PeekWordState*  aState)
 {
   NS_ASSERTION (aOffset && *aOffset <= 1, "aOffset out of range");
   int32_t startOffset = *aOffset;
   // This isn't text, so truncate the context
   aState->mContext.Truncate();
   if (startOffset < 0)
     startOffset = 1;
   if (aForward == (startOffset == 0)) {
@@ -8345,19 +8348,19 @@ GetCorrectedParent(const nsIFrame* aFram
   // as the style parent.
   if (aFrame->IsTableCaption()) {
     nsIFrame* innerTable = parent->PrincipalChildList().FirstChild();
     if (!innerTable->StyleContext()->GetPseudo()) {
       return innerTable;
     }
   }
 
-  // Outer tables are always anon boxes; if we're in here for an outer
+  // Table wrappers are always anon boxes; if we're in here for an outer
   // table, that actually means its the _inner_ table that wants to
-  // know its parent.  So get the pseudo of the inner in that case.
+  // know its parent. So get the pseudo of the inner in that case.
   nsIAtom* pseudo = aFrame->StyleContext()->GetPseudo();
   if (pseudo == nsCSSAnonBoxes::tableOuter) {
     pseudo = aFrame->PrincipalChildList().FirstChild()->StyleContext()->GetPseudo();
   }
   return nsFrame::CorrectStyleParentFrame(parent, pseudo);
 }
 
 /* static */
--- a/layout/generic/nsFrameIdList.h
+++ b/layout/generic/nsFrameIdList.h
@@ -159,17 +159,17 @@ FRAME_ID(nsSVGStopFrame)
 FRAME_ID(nsSVGSwitchFrame)
 FRAME_ID(SVGTextFrame)
 FRAME_ID(nsSVGUseFrame)
 FRAME_ID(SVGViewFrame)
 FRAME_ID(nsTableCellFrame)
 FRAME_ID(nsTableColFrame)
 FRAME_ID(nsTableColGroupFrame)
 FRAME_ID(nsTableFrame)
-FRAME_ID(nsTableOuterFrame)
+FRAME_ID(nsTableWrapperFrame)
 FRAME_ID(nsTableRowFrame)
 FRAME_ID(nsTableRowGroupFrame)
 FRAME_ID(nsTextBoxFrame)
 FRAME_ID(nsTextControlFrame)
 FRAME_ID(nsTextFrame)
 FRAME_ID(nsTitleBarFrame)
 FRAME_ID(nsTreeBodyFrame)
 FRAME_ID(nsTreeColFrame)
--- a/layout/generic/nsHTMLParts.h
+++ b/layout/generic/nsHTMLParts.h
@@ -175,19 +175,19 @@ nsIFrame*
 NS_NewRangeFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
 NS_NewNumberControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 class DetailsFrame;
 DetailsFrame*
 NS_NewDetailsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 // Table frame factories
-class nsTableOuterFrame;
-nsTableOuterFrame*
-NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
+class nsTableWrapperFrame;
+nsTableWrapperFrame*
+NS_NewTableWrapperFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 class nsTableFrame;
 nsTableFrame*
 NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsTableColFrame*
 NS_NewTableColFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 class nsTableColGroupFrame;
 nsTableColGroupFrame*
 NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
--- a/layout/generic/nsHTMLReflowState.cpp
+++ b/layout/generic/nsHTMLReflowState.cpp
@@ -2552,17 +2552,17 @@ nsCSSOffsetState::InitOffsets(WritingMod
       // only part of their border.  We need to do this here before we
       // try to do anything like handling 'auto' widths,
       // 'box-sizing', or 'auto' margins.
       ComputedPhysicalPadding().SizeTo(0,0,0,0);
       SetComputedLogicalBorderPadding(
         tableFrame->GetIncludedOuterBCBorder(mWritingMode));
     }
 
-    // The margin is inherited to the outer table frame via
+    // The margin is inherited to the table wrapper frame via
     // the ::-moz-table-outer rule in ua.css.
     ComputedPhysicalMargin().SizeTo(0, 0, 0, 0);
   } else if (aFrameType == nsGkAtoms::scrollbarFrame) {
     // scrollbars may have had their width or height smashed to zero
     // by the associated scrollframe, in which case we must not report
     // any padding or border.
     nsSize size(frame->GetSize());
     if (size.width == 0 || size.height == 0) {
@@ -2642,19 +2642,19 @@ nsHTMLReflowState::CalculateBlockSideMar
   if (!isAutoStartMargin && !isAutoEndMargin) {
     // Neither margin is 'auto' so we're over constrained. Use the
     // 'direction' property of the parent to tell which margin to
     // ignore
     // First check if there is an HTML alignment that we should honor
     const nsHTMLReflowState* prs = mParentReflowState;
     if (aFrameType == nsGkAtoms::tableFrame) {
       NS_ASSERTION(prs->frame->GetType() == nsGkAtoms::tableOuterFrame,
-                   "table not inside outer table");
-      // Center the table within the outer table based on the alignment
-      // of the outer table's parent.
+                   "table not inside table wrapper");
+      // Center the table within the table wrapper based on the alignment
+      // of the table wrapper's parent.
       prs = prs->mParentReflowState;
     }
     if (prs &&
         (prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_LEFT ||
          prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_CENTER ||
          prs->mStyleText->mTextAlign == NS_STYLE_TEXT_ALIGN_MOZ_RIGHT)) {
       if (prs->mWritingMode.IsBidiLTR()) {
         isAutoStartMargin =
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -20,17 +20,17 @@
 #include "nsContentCID.h"
 #include "nsDeviceContext.h"
 #include "nsIContent.h"
 #include "nsIDOMNode.h"
 #include "nsRange.h"
 #include "nsCOMArray.h"
 #include "nsITableCellLayout.h"
 #include "nsTArray.h"
-#include "nsTableOuterFrame.h"
+#include "nsTableWrapperFrame.h"
 #include "nsTableCellFrame.h"
 #include "nsIScrollableFrame.h"
 #include "nsCCUncollectableMarker.h"
 #include "nsIContentIterator.h"
 #include "nsIDocumentEncoder.h"
 #include "nsTextFragment.h"
 #include <algorithm>
 
@@ -2798,17 +2798,17 @@ nsFrameSelection::UnselectCells(nsIConte
                                 int32_t aEndRowIndex,
                                 int32_t aEndColumnIndex,
                                 bool aRemoveOutsideOfCellRange)
 {
   int8_t index = GetIndexFromSelectionType(SelectionType::eNormal);
   if (!mDomSelections[index])
     return NS_ERROR_NULL_POINTER;
 
-  nsTableOuterFrame* tableFrame = do_QueryFrame(aTableContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(aTableContent->GetPrimaryFrame());
   if (!tableFrame)
     return NS_ERROR_FAILURE;
 
   int32_t minRowIndex = std::min(aStartRowIndex, aEndRowIndex);
   int32_t maxRowIndex = std::max(aStartRowIndex, aEndRowIndex);
   int32_t minColIndex = std::min(aStartColumnIndex, aEndColumnIndex);
   int32_t maxColIndex = std::max(aStartColumnIndex, aEndColumnIndex);
 
@@ -2878,17 +2878,17 @@ nsFrameSelection::AddCellsToSelection(ns
                                       int32_t aStartColumnIndex,
                                       int32_t aEndRowIndex,
                                       int32_t aEndColumnIndex)
 {
   int8_t index = GetIndexFromSelectionType(SelectionType::eNormal);
   if (!mDomSelections[index])
     return NS_ERROR_NULL_POINTER;
 
-  nsTableOuterFrame* tableFrame = do_QueryFrame(aTableContent->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(aTableContent->GetPrimaryFrame());
   if (!tableFrame) // Check that |table| is a table.
     return NS_ERROR_FAILURE;
 
   nsresult result = NS_OK;
   int32_t row = aStartRowIndex;
   while(true)
   {
     int32_t col = aStartColumnIndex;
@@ -2949,25 +2949,25 @@ nsFrameSelection::RestrictCellsToSelecti
 nsresult
 nsFrameSelection::SelectRowOrColumn(nsIContent *aCellContent, uint32_t aTarget)
 {
   if (!aCellContent) return NS_ERROR_NULL_POINTER;
 
   nsIContent* table = GetParentTable(aCellContent);
   if (!table) return NS_ERROR_NULL_POINTER;
 
-  // Get table and cell layout interfaces to access 
-  //   cell data based on cellmap location
+  // Get table and cell layout interfaces to access
+  // cell data based on cellmap location
   // Frames are not ref counted, so don't use an nsCOMPtr
-  nsTableOuterFrame* tableFrame = do_QueryFrame(table->GetPrimaryFrame());
+  nsTableWrapperFrame* tableFrame = do_QueryFrame(table->GetPrimaryFrame());
   if (!tableFrame) return NS_ERROR_FAILURE;
   nsITableCellLayout *cellLayout = GetCellLayout(aCellContent);
   if (!cellLayout) return NS_ERROR_FAILURE;
 
-  // Get location of target cell:      
+  // Get location of target cell:
   int32_t rowIndex, colIndex;
   nsresult result = cellLayout->GetCellIndexes(rowIndex, colIndex);
   if (NS_FAILED(result)) return result;
 
   // Be sure we start at proper beginning
   // (This allows us to select row or col given ANY cell!)
   if (aTarget == nsISelectionPrivate::TABLESELECTION_ROW)
     colIndex = 0;
--- a/layout/mathml/nsMathMLmtableFrame.cpp
+++ b/layout/mathml/nsMathMLmtableFrame.cpp
@@ -680,17 +680,17 @@ ListMathMLTree(nsIFrame* atLeast)
 }
 #endif
 
 // --------
 // implementation of nsMathMLmtableOuterFrame
 
 NS_QUERYFRAME_HEAD(nsMathMLmtableOuterFrame)
   NS_QUERYFRAME_ENTRY(nsIMathMLFrame)
-NS_QUERYFRAME_TAIL_INHERITING(nsTableOuterFrame)
+NS_QUERYFRAME_TAIL_INHERITING(nsTableWrapperFrame)
 
 nsContainerFrame*
 NS_NewMathMLmtableOuterFrame (nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsMathMLmtableOuterFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmtableOuterFrame)
@@ -817,17 +817,17 @@ void
 nsMathMLmtableOuterFrame::Reflow(nsPresContext*          aPresContext,
                                  nsHTMLReflowMetrics&     aDesiredSize,
                                  const nsHTMLReflowState& aReflowState,
                                  nsReflowStatus&          aStatus)
 {
   nsAutoString value;
   // we want to return a table that is anchored according to the align attribute
 
-  nsTableOuterFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
+  nsTableWrapperFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
   NS_ASSERTION(aDesiredSize.Height() >= 0, "illegal height for mtable");
   NS_ASSERTION(aDesiredSize.Width() >= 0, "illegal width for mtable");
 
   // see if the user has set the align attribute on the <mtable>
   int32_t rowIndex = 0;
   eAlign tableAlign = eAlign_axis;
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::align, value);
   if (!value.IsEmpty()) {
--- a/layout/mathml/nsMathMLmtableFrame.h
+++ b/layout/mathml/nsMathMLmtableFrame.h
@@ -4,54 +4,54 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsMathMLmtableFrame_h___
 #define nsMathMLmtableFrame_h___
 
 #include "mozilla/Attributes.h"
 #include "nsMathMLContainerFrame.h"
 #include "nsBlockFrame.h"
-#include "nsTableOuterFrame.h"
+#include "nsTableWrapperFrame.h"
 #include "nsTableRowFrame.h"
 #include "nsTableCellFrame.h"
 
 //
 // <mtable> -- table or matrix
 //
 
-class nsMathMLmtableOuterFrame : public nsTableOuterFrame,
+class nsMathMLmtableOuterFrame : public nsTableWrapperFrame,
                                  public nsMathMLFrame
 {
 public:
   friend nsContainerFrame* NS_NewMathMLmtableOuterFrame(nsIPresShell* aPresShell,
                                                         nsStyleContext* aContext);
 
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
-  // overloaded nsTableOuterFrame methods
+  // overloaded nsTableWrapperFrame methods
 
   virtual void
   Reflow(nsPresContext*          aPresContext,
          nsHTMLReflowMetrics&     aDesiredSize,
          const nsHTMLReflowState& aReflowState,
          nsReflowStatus&          aStatus) override;
 
   virtual nsresult
   AttributeChanged(int32_t  aNameSpaceID,
                    nsIAtom* aAttribute,
                    int32_t  aModType) override;
 
   virtual bool IsFrameOfType(uint32_t aFlags) const override
   {
-    return nsTableOuterFrame::IsFrameOfType(aFlags & ~(nsIFrame::eMathML));
+    return nsTableWrapperFrame::IsFrameOfType(aFlags & ~(nsIFrame::eMathML));
   }
 
 protected:
-  explicit nsMathMLmtableOuterFrame(nsStyleContext* aContext) : nsTableOuterFrame(aContext) {}
+  explicit nsMathMLmtableOuterFrame(nsStyleContext* aContext) : nsTableWrapperFrame(aContext) {}
   virtual ~nsMathMLmtableOuterFrame();
 
   // helper to find the row frame at a given index, positive or negative, e.g.,
   // 1..n means the first row down to the last row, -1..-n means the last row
   // up to the first row. Used for alignments that are relative to a given row
   nsIFrame*
   GetRowFrameAt(int32_t aRowIndex);
 }; // class nsMathMLmtableOuterFrame
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -672,22 +672,22 @@ nsComputedDOMStyle::UpdateCurrentStyleSo
   // mPrimaryFrame). Remove it once that's fixed.
   if (!mPseudo && mStyleType == eAll &&
       !mContent->IsHTMLElement(nsGkAtoms::area)) {
     mOuterFrame = mContent->GetPrimaryFrame();
     mInnerFrame = mOuterFrame;
     if (mOuterFrame) {
       nsIAtom* type = mOuterFrame->GetType();
       if (type == nsGkAtoms::tableOuterFrame) {
-        // If the frame is an outer table frame then we should get the style
+        // If the frame is a table wrapper frame then we should get the style
         // from the inner table frame.
         mInnerFrame = mOuterFrame->PrincipalChildList().FirstChild();
-        NS_ASSERTION(mInnerFrame, "Outer table must have an inner");
+        NS_ASSERTION(mInnerFrame, "table wrapper must have an inner");
         NS_ASSERTION(!mInnerFrame->GetNextSibling(),
-                     "Outer table frames should have just one child, "
+                     "table wrapper frames should have just one child, "
                      "the inner table");
       }
 
       SetFrameStyleContext(mInnerFrame->StyleContext());
       NS_ASSERTION(mStyleContext, "Frame without style context?");
     }
   }
 
@@ -5204,17 +5204,17 @@ nsComputedDOMStyle::GetMarginWidthFor(mo
   RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
 
   if (!mInnerFrame) {
     SetValueToCoord(val, StyleMargin()->mMargin.Get(aSide), false);
   } else {
     AssertFlushedPendingReflows();
 
     // For tables, GetUsedMargin always returns an empty margin, so we
-    // should read the margin from the outer table frame instead.
+    // should read the margin from the table wrapper frame instead.
     val->SetAppUnits(mOuterFrame->GetUsedMargin().Side(aSide));
     NS_ASSERTION(mOuterFrame == mInnerFrame ||
                  mInnerFrame->GetUsedMargin() == nsMargin(0, 0, 0, 0),
                  "Inner tables must have zero margins");
   }
 
   return val.forget();
 }
--- a/layout/tables/moz.build
+++ b/layout/tables/moz.build
@@ -16,20 +16,20 @@ EXPORTS += [
 UNIFIED_SOURCES += [
     'BasicTableLayoutStrategy.cpp',
     'FixedTableLayoutStrategy.cpp',
     'nsCellMap.cpp',
     'nsTableCellFrame.cpp',
     'nsTableColFrame.cpp',
     'nsTableColGroupFrame.cpp',
     'nsTableFrame.cpp',
-    'nsTableOuterFrame.cpp',
     'nsTablePainter.cpp',
     'nsTableRowFrame.cpp',
     'nsTableRowGroupFrame.cpp',
+    'nsTableWrapperFrame.cpp',
     'SpanningCellSorter.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '../../intl/unicharutil/util',
     '../base',
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -108,17 +108,17 @@ nsTableCellFrame::DestroyFrom(nsIFrame* 
 // nsIPercentBSizeObserver methods
 
 void
 nsTableCellFrame::NotifyPercentBSize(const nsHTMLReflowState& aReflowState)
 {
   // nsHTMLReflowState ensures the mCBReflowState of blocks inside a
   // cell is the cell frame, not the inner-cell block, and that the
   // containing block of an inner table is the containing block of its
-  // outer table.
+  // table wrapper.
   // XXXldb Given the now-stricter |NeedsToObserve|, many if not all of
   // these tests are probably unnecessary.
 
   // Maybe the cell reflow state; we sure if we're inside the |if|.
   const nsHTMLReflowState *cellRS = aReflowState.mCBReflowState;
 
   if (cellRS && cellRS->frame == this &&
       (cellRS->ComputedBSize() == NS_UNCONSTRAINEDSIZE ||
@@ -161,17 +161,17 @@ nsTableCellFrame::NeedsToObserve(const n
     return true;
   }
   rs = rs->mParentReflowState;
   if (!rs) {
     return false;
   }
 
   // We always need to let the percent bsize observer be propagated
-  // from an outer table frame to an inner table frame.
+  // from a table wrapper frame to an inner table frame.
   nsIAtom *fType = aReflowState.frame->GetType();
   if (fType == nsGkAtoms::tableFrame) {
     return true;
   }
 
   // We need the observer to be propagated to all children of the cell
   // (i.e., children of the child block) in quirks mode, but only to
   // tables in standards mode.
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -17,17 +17,17 @@
 #include "nsIContent.h"
 #include "nsCellMap.h"
 #include "nsTableCellFrame.h"
 #include "nsHTMLParts.h"
 #include "nsTableColFrame.h"
 #include "nsTableColGroupFrame.h"
 #include "nsTableRowFrame.h"
 #include "nsTableRowGroupFrame.h"
-#include "nsTableOuterFrame.h"
+#include "nsTableWrapperFrame.h"
 #include "nsTablePainter.h"
 
 #include "BasicTableLayoutStrategy.h"
 #include "FixedTableLayoutStrategy.h"
 
 #include "nsPresContext.h"
 #include "nsContentUtils.h"
 #include "nsCSSRendering.h"
@@ -119,20 +119,20 @@ struct BCPropertyData
   BCPixelSize mIStartBorderWidth;
   BCPixelSize mIStartCellBorderWidth;
   BCPixelSize mIEndCellBorderWidth;
 };
 
 nsStyleContext*
 nsTableFrame::GetParentStyleContext(nsIFrame** aProviderFrame) const
 {
-  // Since our parent, the table outer frame, returned this frame, we
+  // Since our parent, the table wrapper frame, returned this frame, we
   // must return whatever our parent would normally have returned.
 
-  NS_PRECONDITION(GetParent(), "table constructed without outer table");
+  NS_PRECONDITION(GetParent(), "table constructed without table wrapper");
   if (!mContent->GetParent() && !StyleContext()->GetPseudo()) {
     // We're the root.  We have no style context parent.
     *aProviderFrame = nullptr;
     return nullptr;
   }
 
   return GetParent()->DoGetParentStyleContext(aProviderFrame);
 }
@@ -178,17 +178,17 @@ nsTableFrame::Init(nsIContent*       aCo
     mCellMap = new nsTableCellMap(*this, borderCollapse);
     if (IsAutoLayout()) {
       mTableLayoutStrategy = new BasicTableLayoutStrategy(this);
     } else {
       mTableLayoutStrategy = new FixedTableLayoutStrategy(this);
     }
   } else {
     // Set my isize, because all frames in a table flow are the same isize and
-    // code in nsTableOuterFrame depends on this being set.
+    // code in nsTableWrapperFrame depends on this being set.
     WritingMode wm = GetWritingMode();
     SetSize(LogicalSize(wm, aPrevInFlow->ISize(wm), BSize(wm)));
   }
 }
 
 nsTableFrame::~nsTableFrame()
 {
   delete mCellMap;
@@ -2641,17 +2641,17 @@ nsTableFrame::GetUsedPadding() const
     return nsContainerFrame::GetUsedPadding();
 
   return nsMargin(0,0,0,0);
 }
 
 /* virtual */ nsMargin
 nsTableFrame::GetUsedMargin() const
 {
-  // The margin is inherited to the outer table frame via
+  // The margin is inherited to the table wrapper frame via
   // the ::-moz-table-outer rule in ua.css.
   return nsMargin(0, 0, 0, 0);
 }
 
 NS_DECLARE_FRAME_PROPERTY_DELETABLE(TableBCProperty, BCPropertyData)
 
 BCPropertyData*
 nsTableFrame::GetBCProperty(bool aCreateIfNecessary) const
@@ -6482,17 +6482,17 @@ BCPaintBorderIterator::SetDamageArea(con
       }
       rowB += rowBSize;
     }
   }
   mNextOffsetB = mInitialOffsetB;
 
   // XXX comment refers to the obsolete NS_FRAME_OUTSIDE_CHILDREN flag
   // XXX but I don't understand it, so not changing it for now
-  // outer table borders overflow the table, so the table might be
+  // table wrapper borders overflow the table, so the table might be
   // target to other areas as the NS_FRAME_OUTSIDE_CHILDREN is set
   // on the table
   if (!haveIntersect)
     return false;
   // find startColIndex, endColIndex, startColX
   haveIntersect = false;
   if (0 == mNumTableCols)
     return false;
--- a/layout/tables/nsTableFrame.h
+++ b/layout/tables/nsTableFrame.h
@@ -116,17 +116,17 @@ enum nsTableColType {
   eColContent            = 0, // there is real col content associated
   eColAnonymousCol       = 1, // the result of a span on a col
   eColAnonymousColGroup  = 2, // the result of a span on a col group
   eColAnonymousCell      = 3  // the result of a cell alone
 };
 
 /**
   * nsTableFrame maps the inner portion of a table (everything except captions.)
-  * Used as a pseudo-frame within nsTableOuterFrame, it may also be used
+  * Used as a pseudo-frame within nsTableWrapperFrame, it may also be used
   * stand-alone as the top-level frame.
   *
   * The principal child list contains row group frames. There is also an
   * additional child list, kColGroupList, which contains the col group frames.
   */
 class nsTableFrame : public nsContainerFrame
 {
   typedef mozilla::image::DrawResult DrawResult;
@@ -135,18 +135,18 @@ class nsTableFrame : public nsContainerF
 
 public:
   NS_DECL_QUERYFRAME_TARGET(nsTableFrame)
   NS_DECL_FRAMEARENA_HELPERS
 
   NS_DECLARE_FRAME_PROPERTY_DELETABLE(PositionedTablePartArray,
                                       nsTArray<nsIFrame*>)
 
-  /** nsTableOuterFrame has intimate knowledge of the inner table frame */
-  friend class nsTableOuterFrame;
+  /** nsTableWrapperFrame has intimate knowledge of the inner table frame */
+  friend class nsTableWrapperFrame;
 
   /** instantiate a new instance of nsTableRowFrame.
     * @param aPresShell the pres shell for this frame
     *
     * @return           the frame that was created
     */
   friend nsTableFrame* NS_NewTableFrame(nsIPresShell* aPresShell,
                                         nsStyleContext* aContext);
rename from layout/tables/nsTableOuterFrame.cpp
rename to layout/tables/nsTableWrapperFrame.cpp
--- a/layout/tables/nsTableOuterFrame.cpp
+++ b/layout/tables/nsTableWrapperFrame.cpp
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsTableOuterFrame.h"
+#include "nsTableWrapperFrame.h"
 
 #include "nsFrameManager.h"
 #include "nsTableFrame.h"
 #include "nsTableCellFrame.h"
 #include "nsStyleContext.h"
 #include "nsStyleConsts.h"
 #include "nsPresContext.h"
 #include "nsCSSRendering.h"
@@ -25,77 +25,77 @@
 #include <algorithm>
 
 using namespace mozilla;
 using namespace mozilla::layout;
 
 #define NO_SIDE 100
 
 /* virtual */ nscoord
-nsTableOuterFrame::GetLogicalBaseline(WritingMode aWritingMode) const
+nsTableWrapperFrame::GetLogicalBaseline(WritingMode aWritingMode) const
 {
   nsIFrame* kid = mFrames.FirstChild();
   if (!kid) {
     NS_NOTREACHED("no inner table");
     return nsContainerFrame::GetLogicalBaseline(aWritingMode);
   }
 
   return kid->GetLogicalBaseline(aWritingMode) +
          kid->BStart(aWritingMode, mRect.Size());
 }
 
-nsTableOuterFrame::nsTableOuterFrame(nsStyleContext* aContext):
-  nsContainerFrame(aContext)
+nsTableWrapperFrame::nsTableWrapperFrame(nsStyleContext* aContext)
+  : nsContainerFrame(aContext)
 {
 }
 
-nsTableOuterFrame::~nsTableOuterFrame()
+nsTableWrapperFrame::~nsTableWrapperFrame()
 {
 }
 
-NS_QUERYFRAME_HEAD(nsTableOuterFrame)
-  NS_QUERYFRAME_ENTRY(nsTableOuterFrame)
+NS_QUERYFRAME_HEAD(nsTableWrapperFrame)
+  NS_QUERYFRAME_ENTRY(nsTableWrapperFrame)
 NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
 
 #ifdef ACCESSIBILITY
 a11y::AccType
-nsTableOuterFrame::AccessibleType()
+nsTableWrapperFrame::AccessibleType()
 {
   return a11y::eHTMLTableType;
 }
 #endif
 
 void
-nsTableOuterFrame::DestroyFrom(nsIFrame* aDestructRoot)
+nsTableWrapperFrame::DestroyFrom(nsIFrame* aDestructRoot)
 {
   DestroyAbsoluteFrames(aDestructRoot);
   mCaptionFrames.DestroyFramesFrom(aDestructRoot);
   nsContainerFrame::DestroyFrom(aDestructRoot);
 }
 
 const nsFrameList&
-nsTableOuterFrame::GetChildList(ChildListID aListID) const
+nsTableWrapperFrame::GetChildList(ChildListID aListID) const
 {
   if (aListID == kCaptionList) {
     return mCaptionFrames;
   }
 
   return nsContainerFrame::GetChildList(aListID);
 }
 
 void
-nsTableOuterFrame::GetChildLists(nsTArray<ChildList>* aLists) const
+nsTableWrapperFrame::GetChildLists(nsTArray<ChildList>* aLists) const
 {
   nsContainerFrame::GetChildLists(aLists);
   mCaptionFrames.AppendIfNonempty(aLists, kCaptionList);
 }
 
-void 
-nsTableOuterFrame::SetInitialChildList(ChildListID     aListID,
-                                       nsFrameList&    aChildList)
+void
+nsTableWrapperFrame::SetInitialChildList(ChildListID     aListID,
+                                         nsFrameList&    aChildList)
 {
   if (kCaptionList == aListID) {
     // the frame constructor already checked for table-caption display type
     MOZ_ASSERT(mCaptionFrames.IsEmpty(),
                "already have child frames in CaptionList");
     mCaptionFrames.SetFrames(aChildList);
   } else {
     MOZ_ASSERT(kPrincipalList != aListID ||
@@ -103,80 +103,78 @@ nsTableOuterFrame::SetInitialChildList(C
                 aChildList.FirstChild() == aChildList.LastChild() &&
                 nsGkAtoms::tableFrame == aChildList.FirstChild()->GetType()),
                "expected a single table frame in principal child list");
     nsContainerFrame::SetInitialChildList(aListID, aChildList);
   }
 }
 
 void
-nsTableOuterFrame::AppendFrames(ChildListID     aListID,
-                                nsFrameList&    aFrameList)
+nsTableWrapperFrame::AppendFrames(ChildListID     aListID,
+                                  nsFrameList&    aFrameList)
 {
   // We only have two child frames: the inner table and a caption frame.
   // The inner frame is provided when we're initialized, and it cannot change
   MOZ_ASSERT(kCaptionList == aListID, "unexpected child list");
   MOZ_ASSERT(aFrameList.IsEmpty() ||
              aFrameList.FirstChild()->IsTableCaption(),
              "appending non-caption frame to captionList");
   mCaptionFrames.AppendFrames(this, aFrameList);
 
   // Reflow the new caption frame. It's already marked dirty, so
   // just tell the pres shell.
-  PresContext()->PresShell()->
-    FrameNeedsReflow(this, nsIPresShell::eTreeChange,
-                     NS_FRAME_HAS_DIRTY_CHILDREN);
+  PresContext()->PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
+                                               NS_FRAME_HAS_DIRTY_CHILDREN);
 }
 
 void
-nsTableOuterFrame::InsertFrames(ChildListID     aListID,
-                                nsIFrame*       aPrevFrame,
-                                nsFrameList&    aFrameList)
+nsTableWrapperFrame::InsertFrames(ChildListID     aListID,
+                                  nsIFrame*       aPrevFrame,
+                                  nsFrameList&    aFrameList)
 {
   MOZ_ASSERT(kCaptionList == aListID, "unexpected child list");
   MOZ_ASSERT(aFrameList.IsEmpty() ||
              aFrameList.FirstChild()->IsTableCaption(),
              "inserting non-caption frame into captionList");
   MOZ_ASSERT(!aPrevFrame || aPrevFrame->GetParent() == this,
              "inserting after sibling frame with different parent");
   mCaptionFrames.InsertFrames(nullptr, aPrevFrame, aFrameList);
 
   // Reflow the new caption frame. It's already marked dirty, so
   // just tell the pres shell.
-  PresContext()->PresShell()->
-    FrameNeedsReflow(this, nsIPresShell::eTreeChange,
-                     NS_FRAME_HAS_DIRTY_CHILDREN);
+  PresContext()->PresShell()->FrameNeedsReflow(this, nsIPresShell::eTreeChange,
+                                               NS_FRAME_HAS_DIRTY_CHILDREN);
 }
 
 void
-nsTableOuterFrame::RemoveFrame(ChildListID     aListID,
-                               nsIFrame*       aOldFrame)
+nsTableWrapperFrame::RemoveFrame(ChildListID  aListID,
+                                 nsIFrame*    aOldFrame)
 {
   // We only have two child frames: the inner table and one caption frame.
   // The inner frame can't be removed so this should be the caption
   NS_PRECONDITION(kCaptionList == aListID, "can't remove inner frame");
 
   if (HasSideCaption()) {
     // The old caption isize had an effect on the inner table isize, so
     // we're going to need to reflow it. Mark it dirty
     InnerTableFrame()->AddStateBits(NS_FRAME_IS_DIRTY);
   }
 
   // Remove the frame and destroy it
   mCaptionFrames.DestroyFrame(aOldFrame);
-  
+
   PresContext()->PresShell()->
     FrameNeedsReflow(this, nsIPresShell::eTreeChange,
                      NS_FRAME_HAS_DIRTY_CHILDREN); // also means child removed
 }
 
 void
-nsTableOuterFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
-                                    const nsRect&           aDirtyRect,
-                                    const nsDisplayListSet& aLists)
+nsTableWrapperFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
+                                      const nsRect&           aDirtyRect,
+                                      const nsDisplayListSet& aLists)
 {
   // No border, background or outline are painted because they all belong
   // to the inner table.
 
   // If there's no caption, take a short cut to avoid having to create
   // the special display list set and then sort it.
   if (mCaptionFrames.IsEmpty()) {
     BuildDisplayListForInnerTable(aBuilder, aDirtyRect, aLists);
@@ -184,60 +182,59 @@ nsTableOuterFrame::BuildDisplayList(nsDi
   }
 
   nsDisplayListCollection set;
   BuildDisplayListForInnerTable(aBuilder, aDirtyRect, set);
   
   nsDisplayListSet captionSet(set, set.BlockBorderBackgrounds());
   BuildDisplayListForChild(aBuilder, mCaptionFrames.FirstChild(),
                            aDirtyRect, captionSet);
-  
+
   // Now we have to sort everything by content order, since the caption
   // may be somewhere inside the table
   set.SortAllByContentOrder(GetContent());
   set.MoveTo(aLists);
 }
 
 void
-nsTableOuterFrame::BuildDisplayListForInnerTable(nsDisplayListBuilder*   aBuilder,
-                                                 const nsRect&           aDirtyRect,
-                                                 const nsDisplayListSet& aLists)
+nsTableWrapperFrame::BuildDisplayListForInnerTable(nsDisplayListBuilder*   aBuilder,
+                                                   const nsRect&           aDirtyRect,
+                                                   const nsDisplayListSet& aLists)
 {
   // Just paint the regular children, but the children's background is our
   // true background (there should only be one, the real table)
   nsIFrame* kid = mFrames.FirstChild();
   // The children should be in content order
   while (kid) {
     BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
     kid = kid->GetNextSibling();
   }
 }
 
 nsStyleContext*
-nsTableOuterFrame::GetParentStyleContext(nsIFrame** aProviderFrame) const
+nsTableWrapperFrame::GetParentStyleContext(nsIFrame** aProviderFrame) const
 {
-  // The table outer frame and the (inner) table frame split the style
+  // The table wrapper frame and the (inner) table frame split the style
   // data by giving the table frame the style context associated with
-  // the table content node and creating a style context for the outer
+  // the table content node and creating a style context for the wrapper
   // frame that is a *child* of the table frame's style context,
-  // matching the ::-moz-table-outer pseudo-element.  html.css has a
-  // rule that causes that pseudo-element (and thus the outer table)
+  // matching the ::-moz-table-outer pseudo-element. html.css has a
+  // rule that causes that pseudo-element (and thus the wrapper table)
   // to inherit *some* style properties from the table frame.  The
   // children of the table inherit directly from the inner table, and
-  // the outer table's style context is a leaf.
+  // the table wrapper's style context is a leaf.
 
   return (*aProviderFrame = InnerTableFrame())->StyleContext();
 }
 
 // INCREMENTAL REFLOW HELPER FUNCTIONS 
 
 void
-nsTableOuterFrame::InitChildReflowState(nsPresContext&    aPresContext,                     
-                                        nsHTMLReflowState& aReflowState)
-                                    
+nsTableWrapperFrame::InitChildReflowState(nsPresContext&     aPresContext,
+                                          nsHTMLReflowState& aReflowState)
 {
   nsMargin collapseBorder;
   nsMargin collapsePadding(0,0,0,0);
   nsMargin* pCollapseBorder  = nullptr;
   nsMargin* pCollapsePadding = nullptr;
   if (aReflowState.frame == InnerTableFrame() &&
       InnerTableFrame()->IsBorderCollapse()) {
     WritingMode wm = aReflowState.GetWritingMode();
@@ -247,21 +244,21 @@ nsTableOuterFrame::InitChildReflowState(
     pCollapsePadding = &collapsePadding;
   }
   aReflowState.Init(&aPresContext, nullptr, pCollapseBorder, pCollapsePadding);
 }
 
 // get the margin and padding data. nsHTMLReflowState doesn't handle the
 // case of auto margins
 void
-nsTableOuterFrame::GetChildMargin(nsPresContext*           aPresContext,
-                                  const nsHTMLReflowState& aOuterRS,
-                                  nsIFrame*                aChildFrame,
-                                  nscoord                  aAvailISize,
-                                  LogicalMargin&           aMargin)
+nsTableWrapperFrame::GetChildMargin(nsPresContext*           aPresContext,
+                                    const nsHTMLReflowState& aOuterRS,
+                                    nsIFrame*                aChildFrame,
+                                    nscoord                  aAvailISize,
+                                    LogicalMargin&           aMargin)
 {
   NS_ASSERTION(!aChildFrame->IsTableCaption(),
                "didn't expect caption frame; writing-mode may be wrong!");
 
   // construct a reflow state to compute margin and padding. Auto margins
   // will not be computed at this time.
 
   // create and init the child reflow state
@@ -290,17 +287,17 @@ GetContainingBlockSize(const nsHTMLReflo
     if (NS_UNCONSTRAINEDSIZE == size.height) {
       size.height = 0;
     }
   }
   return size;
 }
 
 /* virtual */ nscoord
-nsTableOuterFrame::GetMinISize(nsRenderingContext *aRenderingContext)
+nsTableWrapperFrame::GetMinISize(nsRenderingContext *aRenderingContext)
 {
   nscoord iSize = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
                     InnerTableFrame(), nsLayoutUtils::MIN_ISIZE);
   DISPLAY_MIN_WIDTH(this, iSize);
   if (mCaptionFrames.NotEmpty()) {
     nscoord capISize =
       nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
                                            mCaptionFrames.FirstChild(),
@@ -312,17 +309,17 @@ nsTableOuterFrame::GetMinISize(nsRenderi
         iSize = capISize;
       }
     }
   }
   return iSize;
 }
 
 /* virtual */ nscoord
-nsTableOuterFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
+nsTableWrapperFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
 {
   nscoord maxISize;
   DISPLAY_PREF_WIDTH(this, maxISize);
 
   maxISize = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
                InnerTableFrame(), nsLayoutUtils::PREF_ISIZE);
   if (mCaptionFrames.NotEmpty()) {
     uint8_t captionSide = GetCaptionSide();
@@ -393,28 +390,28 @@ ChildShrinkWrapISize(nsRenderingContext 
   if (aMarginResult) {
     *aMarginResult = offsets.ComputedLogicalMargin().IStartEnd(aWM);
   }
   return size.ISize(aWM) + marginSize.ISize(aWM) + bpSize.ISize(aWM);
 }
 
 /* virtual */
 LogicalSize
-nsTableOuterFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
-                                   WritingMode aWM,
-                                   const LogicalSize& aCBSize,
-                                   nscoord aAvailableISize,
-                                   const LogicalSize& aMargin,
-                                   const LogicalSize& aBorder,
-                                   const LogicalSize& aPadding,
-                                   bool aShrinkWrap)
+nsTableWrapperFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
+                                     WritingMode aWM,
+                                     const LogicalSize& aCBSize,
+                                     nscoord aAvailableISize,
+                                     const LogicalSize& aMargin,
+                                     const LogicalSize& aBorder,
+                                     const LogicalSize& aPadding,
+                                     bool aShrinkWrap)
 {
   nscoord kidAvailableISize = aAvailableISize - aMargin.ISize(aWM);
   NS_ASSERTION(aBorder.IsAllZero() && aPadding.IsAllZero(),
-               "Table outer frames cannot have borders or paddings");
+               "Table wrapper frames cannot have borders or paddings");
 
   // When we're shrink-wrapping, our auto size needs to wrap around the
   // actual size of the table, which (if it is specified as a percent)
   // could be something that is not reflected in our GetMinISize and
   // GetPrefISize.  See bug 349457 for an example.
 
   // Match the availableISize logic in Reflow.
   uint8_t captionSide = GetCaptionSide();
@@ -455,45 +452,46 @@ nsTableOuterFrame::ComputeAutoSize(nsRen
       inlineSize = capISize;
     }
   }
 
   return LogicalSize(aWM, inlineSize, NS_UNCONSTRAINEDSIZE);
 }
 
 uint8_t
-nsTableOuterFrame::GetCaptionSide()
+nsTableWrapperFrame::GetCaptionSide()
 {
   if (mCaptionFrames.NotEmpty()) {
     return mCaptionFrames.FirstChild()->StyleTableBorder()->mCaptionSide;
   }
   else {
     return NO_SIDE; // no caption
   }
 }
 
 uint8_t
-nsTableOuterFrame::GetCaptionVerticalAlign()
+nsTableWrapperFrame::GetCaptionVerticalAlign()
 {
   const nsStyleCoord& va =
     mCaptionFrames.FirstChild()->StyleDisplay()->mVerticalAlign;
+
   return (va.GetUnit() == eStyleUnit_Enumerated)
            ? va.GetIntValue()
            : NS_STYLE_VERTICAL_ALIGN_TOP;
 }
 
 void
-nsTableOuterFrame::SetDesiredSize(uint8_t              aCaptionSide,
-                                  const LogicalSize&   aInnerSize,
-                                  const LogicalSize&   aCaptionSize,
-                                  const LogicalMargin& aInnerMargin,
-                                  const LogicalMargin& aCaptionMargin,
-                                  nscoord&             aISize,
-                                  nscoord&             aBSize,
-                                  WritingMode          aWM)
+nsTableWrapperFrame::SetDesiredSize(uint8_t              aCaptionSide,
+                                    const LogicalSize&   aInnerSize,
+                                    const LogicalSize&   aCaptionSize,
+                                    const LogicalMargin& aInnerMargin,
+                                    const LogicalMargin& aCaptionMargin,
+                                    nscoord&             aISize,
+                                    nscoord&             aBSize,
+                                    WritingMode          aWM)
 {
   aISize = aBSize = 0;
 
   // compute the overall inline-size
   switch (aCaptionSide) {
     case NS_STYLE_CAPTION_SIDE_LEFT:
       aISize =
         std::max(aInnerMargin.LineLeft(aWM),
@@ -542,25 +540,25 @@ nsTableOuterFrame::SetDesiredSize(uint8_
       break;
   }
 
   // negative sizes can upset overflow-area code
   aISize = std::max(aISize, 0);
   aBSize = std::max(aBSize, 0);
 }
 
-nsresult 
-nsTableOuterFrame::GetCaptionOrigin(uint32_t             aCaptionSide,
-                                    const LogicalSize&   aContainBlockSize,
-                                    const LogicalSize&   aInnerSize, 
-                                    const LogicalMargin& aInnerMargin,
-                                    const LogicalSize&   aCaptionSize,
-                                    LogicalMargin&       aCaptionMargin,
-                                    LogicalPoint&        aOrigin,
-                                    WritingMode          aWM)
+nsresult
+nsTableWrapperFrame::GetCaptionOrigin(uint32_t             aCaptionSide,
+                                      const LogicalSize&   aContainBlockSize,
+                                      const LogicalSize&   aInnerSize,
+                                      const LogicalMargin& aInnerMargin,
+                                      const LogicalSize&   aCaptionSize,
+                                      LogicalMargin&       aCaptionMargin,
+                                      LogicalPoint&        aOrigin,
+                                      WritingMode          aWM)
 {
   aOrigin.I(aWM) = aOrigin.B(aWM) = 0;
   if ((NS_UNCONSTRAINEDSIZE == aInnerSize.ISize(aWM)) ||
       (NS_UNCONSTRAINEDSIZE == aInnerSize.BSize(aWM)) ||
       (NS_UNCONSTRAINEDSIZE == aCaptionSize.ISize(aWM)) ||
       (NS_UNCONSTRAINEDSIZE == aCaptionSize.BSize(aWM))) {
     return NS_OK;
   }
@@ -634,25 +632,25 @@ nsTableOuterFrame::GetCaptionOrigin(uint
       break;
     default:
       NS_NOTREACHED("Unknown caption alignment type");
       break;
   }
   return NS_OK;
 }
 
-nsresult 
-nsTableOuterFrame::GetInnerOrigin(uint32_t             aCaptionSide,
-                                  const LogicalSize&   aContainBlockSize,
-                                  const LogicalSize&   aCaptionSize, 
-                                  const LogicalMargin& aCaptionMargin,
-                                  const LogicalSize&   aInnerSize,
-                                  LogicalMargin&       aInnerMargin,
-                                  LogicalPoint&        aOrigin,
-                                  WritingMode          aWM)
+nsresult
+nsTableWrapperFrame::GetInnerOrigin(uint32_t             aCaptionSide,
+                                    const LogicalSize&   aContainBlockSize,
+                                    const LogicalSize&   aCaptionSize,
+                                    const LogicalMargin& aCaptionMargin,
+                                    const LogicalSize&   aInnerSize,
+                                    LogicalMargin&       aInnerMargin,
+                                    LogicalPoint&        aOrigin,
+                                    WritingMode          aWM)
 {
   NS_ASSERTION(NS_AUTOMARGIN != aCaptionMargin.IStart(aWM) &&
                NS_AUTOMARGIN != aCaptionMargin.IEnd(aWM),
                "The computed caption margin is auto?");
   NS_ASSERTION(NS_AUTOMARGIN != aInnerMargin.IStart(aWM) &&
                NS_AUTOMARGIN != aInnerMargin.IEnd(aWM) &&
                NS_AUTOMARGIN != aInnerMargin.BStart(aWM) &&
                NS_AUTOMARGIN != aInnerMargin.BEnd(aWM),
@@ -727,21 +725,21 @@ nsTableOuterFrame::GetInnerOrigin(uint32
     default:
       NS_NOTREACHED("Unknown caption alignment type");
       break;
   }
   return NS_OK;
 }
 
 void
-nsTableOuterFrame::OuterBeginReflowChild(nsPresContext*            aPresContext,
-                                         nsIFrame*                 aChildFrame,
-                                         const nsHTMLReflowState&  aOuterRS,
-                                         Maybe<nsHTMLReflowState>& aChildRS,
-                                         nscoord                   aAvailISize)
+nsTableWrapperFrame::OuterBeginReflowChild(nsPresContext*            aPresContext,
+                                           nsIFrame*                 aChildFrame,
+                                           const nsHTMLReflowState&  aOuterRS,
+                                           Maybe<nsHTMLReflowState>& aChildRS,
+                                           nscoord                   aAvailISize)
 {
   // work around pixel rounding errors, round down to ensure we don't exceed the avail height in
   WritingMode wm = aChildFrame->GetWritingMode();
   LogicalSize outerSize = aOuterRS.AvailableSize(wm);
   nscoord availBSize = outerSize.BSize(wm);
   if (NS_UNCONSTRAINEDSIZE != availBSize) {
     if (mCaptionFrames.FirstChild() == aChildFrame) {
       availBSize = NS_UNCONSTRAINEDSIZE;
@@ -773,72 +771,72 @@ nsTableOuterFrame::OuterBeginReflowChild
     if (captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM ||
         captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE) {
       aChildRS->mFlags.mIsTopOfPage = false;
     }
   }
 }
 
 void
-nsTableOuterFrame::OuterDoReflowChild(nsPresContext*             aPresContext,
-                                      nsIFrame*                  aChildFrame,
-                                      const nsHTMLReflowState&   aChildRS,
-                                      nsHTMLReflowMetrics&       aMetrics,
-                                      nsReflowStatus&            aStatus)
+nsTableWrapperFrame::OuterDoReflowChild(nsPresContext*             aPresContext,
+                                        nsIFrame*                  aChildFrame,
+                                        const nsHTMLReflowState&   aChildRS,
+                                        nsHTMLReflowMetrics&       aMetrics,
+                                        nsReflowStatus&            aStatus)
 {
   // Using zero as containerSize here because we want consistency between
   // the GetLogicalPosition and ReflowChild calls, to avoid unnecessarily
   // changing the frame's coordinates; but we don't yet know its final
   // position anyway so the actual value is unimportant.
   const nsSize zeroCSize;
   WritingMode wm = aChildRS.GetWritingMode();
 
   // Use the current position as a best guess for placement.
   LogicalPoint childPt = aChildFrame->GetLogicalPosition(wm, zeroCSize);
   uint32_t flags = NS_FRAME_NO_MOVE_FRAME;
 
   // We don't want to delete our next-in-flow's child if it's an inner table
-  // frame, because outer table frames always assume that their inner table
-  // frames don't go away. If an outer table frame is removed because it is
-  // a next-in-flow of an already complete outer table frame, then it will
+  // frame, because table wrapper frames always assume that their inner table
+  // frames don't go away. If a table wrapper frame is removed because it is
+  // a next-in-flow of an already complete table wrapper frame, then it will
   // take care of removing it's inner table frame.
   if (aChildFrame == InnerTableFrame()) {
     flags |= NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD;
   }
 
   ReflowChild(aChildFrame, aPresContext, aMetrics, aChildRS,
               wm, childPt, zeroCSize, flags, aStatus);
 }
 
-void 
-nsTableOuterFrame::UpdateOverflowAreas(nsHTMLReflowMetrics& aMet)
+void
+nsTableWrapperFrame::UpdateOverflowAreas(nsHTMLReflowMetrics& aMet)
 {
   aMet.SetOverflowAreasToDesiredBounds();
   ConsiderChildOverflow(aMet.mOverflowAreas, InnerTableFrame());
   if (mCaptionFrames.NotEmpty()) {
     ConsiderChildOverflow(aMet.mOverflowAreas, mCaptionFrames.FirstChild());
   }
 }
 
 void
-nsTableOuterFrame::Reflow(nsPresContext*           aPresContext,
-                          nsHTMLReflowMetrics&     aDesiredSize,
-                          const nsHTMLReflowState& aOuterRS,
-                          nsReflowStatus&          aStatus)
+nsTableWrapperFrame::Reflow(nsPresContext*           aPresContext,
+                            nsHTMLReflowMetrics&     aDesiredSize,
+                            const nsHTMLReflowState& aOuterRS,
+                            nsReflowStatus&          aStatus)
 {
   MarkInReflow();
-  DO_GLOBAL_REFLOW_COUNT("nsTableOuterFrame");
+  DO_GLOBAL_REFLOW_COUNT("nsTableWrapperFrame");
   DISPLAY_REFLOW(aPresContext, this, aOuterRS, aDesiredSize, aStatus);
 
   // Initialize out parameters
   aDesiredSize.ClearSize();
   aStatus = NS_FRAME_COMPLETE;
 
   if (!HasAnyStateBits(NS_FRAME_FIRST_REFLOW)) {
-    // Set up our kids.  They're already present, on an overflow list, 
+    // Set up our kids.  They're already present, on an overflow list,
     // or there are none so we'll create them now
     MoveOverflowToChildList();
   }
 
   Maybe<nsHTMLReflowState> captionRS;
   Maybe<nsHTMLReflowState> innerRS;
 
   nsRect origInnerRect = InnerTableFrame()->GetRect();
@@ -1008,48 +1006,48 @@ nsTableOuterFrame::Reflow(nsPresContext*
   FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aOuterRS, aStatus);
 
   // Return our desired rect
 
   NS_FRAME_SET_TRUNCATION(aStatus, aOuterRS, aDesiredSize);
 }
 
 nsIAtom*
-nsTableOuterFrame::GetType() const
+nsTableWrapperFrame::GetType() const
 {
   return nsGkAtoms::tableOuterFrame;
 }
 
 /* ----- global methods ----- */
 
 nsIContent*
-nsTableOuterFrame::GetCellAt(uint32_t aRowIdx, uint32_t aColIdx) const
+nsTableWrapperFrame::GetCellAt(uint32_t aRowIdx, uint32_t aColIdx) const
 {
   nsTableCellMap* cellMap = InnerTableFrame()->GetCellMap();
   if (!cellMap) {
     return nullptr;
   }
 
   nsTableCellFrame* cell = cellMap->GetCellInfoAt(aRowIdx, aColIdx);
   if (!cell) {
     return nullptr;
   }
 
   return cell->GetContent();
 }
 
 
-nsTableOuterFrame*
-NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
+nsTableWrapperFrame*
+NS_NewTableWrapperFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
-  return new (aPresShell) nsTableOuterFrame(aContext);
+  return new (aPresShell) nsTableWrapperFrame(aContext);
 }
 
-NS_IMPL_FRAMEARENA_HELPERS(nsTableOuterFrame)
+NS_IMPL_FRAMEARENA_HELPERS(nsTableWrapperFrame)
 
 #ifdef DEBUG_FRAME_DUMP
 nsresult
-nsTableOuterFrame::GetFrameName(nsAString& aResult) const
+nsTableWrapperFrame::GetFrameName(nsAString& aResult) const
 {
-  return MakeFrameName(NS_LITERAL_STRING("TableOuter"), aResult);
+  return MakeFrameName(NS_LITERAL_STRING("TableWrapper"), aResult);
 }
 #endif
 
rename from layout/tables/nsTableOuterFrame.h
rename to layout/tables/nsTableWrapperFrame.h
--- a/layout/tables/nsTableOuterFrame.h
+++ b/layout/tables/nsTableWrapperFrame.h
@@ -1,43 +1,43 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#ifndef nsTableOuterFrame_h__
-#define nsTableOuterFrame_h__
+#ifndef nsTableWrapperFrame_h__
+#define nsTableWrapperFrame_h__
 
 #include "mozilla/Attributes.h"
 #include "mozilla/Maybe.h"
 #include "nscore.h"
 #include "nsContainerFrame.h"
 #include "nsCellMap.h"
 #include "nsTableFrame.h"
 
 /**
  * Primary frame for a table element,
- * the nsTableOuterFrame contains 0 or one caption frame, and a nsTableFrame
+ * the nsTableWrapperFrame contains 0 or one caption frame, and a nsTableFrame
  * pseudo-frame (referred to as the "inner frame').
  */
-class nsTableOuterFrame : public nsContainerFrame
+class nsTableWrapperFrame : public nsContainerFrame
 {
 public:
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS
 
-  NS_DECL_QUERYFRAME_TARGET(nsTableOuterFrame)
+  NS_DECL_QUERYFRAME_TARGET(nsTableWrapperFrame)
 
   /** instantiate a new instance of nsTableRowFrame.
     * @param aPresShell the pres shell for this frame
     *
     * @return           the frame that was created
     */
-  friend nsTableOuterFrame* NS_NewTableOuterFrame(nsIPresShell* aPresShell,
-                                                  nsStyleContext* aContext);
-  
+  friend nsTableWrapperFrame* NS_NewTableWrapperFrame(nsIPresShell* aPresShell,
+                                                      nsStyleContext* aContext);
+
   // nsIFrame overrides - see there for a description
 
   virtual void DestroyFrom(nsIFrame* aDestructRoot) override;
 
   virtual const nsFrameList& GetChildList(ChildListID aListID) const override;
   virtual void GetChildLists(nsTArray<ChildList>* aLists) const override;
 
   virtual void SetInitialChildList(ChildListID     aListID,
@@ -177,20 +177,20 @@ public:
   {
     nsTableCellMap* map = InnerTableFrame()->GetCellMap();
     return map->GetEffectiveRowSpan(aRowIdx, aColIdx);
   }
 
 protected:
 
 
-  explicit nsTableOuterFrame(nsStyleContext* aContext);
-  virtual ~nsTableOuterFrame();
+  explicit nsTableWrapperFrame(nsStyleContext* aContext);
+  virtual ~nsTableWrapperFrame();
 
-  void InitChildReflowState(nsPresContext&    aPresContext,                     
+  void InitChildReflowState(nsPresContext&     aPresContext,
                             nsHTMLReflowState& aReflowState);
 
   // Get a NS_STYLE_CAPTION_SIDE_* value, or NO_SIDE if no caption is present.
   // (Remember that caption-side values are interpreted logically, despite
   // having "physical" names.)
   uint8_t GetCaptionSide();
 
   bool HasSideCaption() {
@@ -252,17 +252,18 @@ protected:
                       mozilla::LogicalMargin&  aMargin);
 
   virtual bool IsFrameOfType(uint32_t aFlags) const override
   {
     return nsContainerFrame::IsFrameOfType(aFlags &
                                            (~eCanContainOverflowContainers));
   }
 
-  nsTableFrame* InnerTableFrame() const {
+  nsTableFrame* InnerTableFrame() const
+  {
     return static_cast<nsTableFrame*>(mFrames.FirstChild());
   }
-  
+
 private:
   nsFrameList   mCaptionFrames;
 };
 
 #endif