diff --git a/accessible/html/HTMLTableAccessible.cpp b/accessible/html/HTMLTableAccessible.cpp index 1a8ccc5e81ce..b0cdc0932dbb 100644 --- a/accessible/html/HTMLTableAccessible.cpp +++ b/accessible/html/HTMLTableAccessible.cpp @@ -34,7 +34,7 @@ #include "nsComponentManagerUtils.h" #include "nsNameSpaceManager.h" #include "nsTableCellFrame.h" -#include "nsTableOuterFrame.h" +#include "nsTableWrapperFrame.h" using namespace mozilla; using namespace mozilla::dom; @@ -495,21 +495,21 @@ HTMLTableAccessible::Summary(nsString& 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; @@ -559,7 +559,7 @@ HTMLTableAccessible::SelectedRowCount() void HTMLTableAccessible::SelectedCells(nsTArray* aCells) { - nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame()); + nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame()); if (!tableFrame) return; @@ -586,7 +586,7 @@ HTMLTableAccessible::SelectedCells(nsTArray* aCells) void HTMLTableAccessible::SelectedCellIndices(nsTArray* aCells) { - nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame()); + nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame()); if (!tableFrame) return; @@ -628,7 +628,7 @@ HTMLTableAccessible::SelectedRowIndices(nsTArray* aRows) 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; @@ -643,7 +643,7 @@ HTMLTableAccessible::CellAt(uint32_t aRowIdx, uint32_t aColIdx) 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; @@ -653,7 +653,7 @@ HTMLTableAccessible::CellIndexAt(uint32_t aRowIdx, uint32_t aColIdx) int32_t HTMLTableAccessible::ColIndexAt(uint32_t aCellIdx) { - nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame()); + nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame()); if (!tableFrame) return -1; @@ -665,7 +665,7 @@ HTMLTableAccessible::ColIndexAt(uint32_t aCellIdx) int32_t HTMLTableAccessible::RowIndexAt(uint32_t aCellIdx) { - nsTableOuterFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame()); + nsTableWrapperFrame* tableFrame = do_QueryFrame(mContent->GetPrimaryFrame()); if (!tableFrame) return -1; @@ -678,7 +678,7 @@ 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); } @@ -686,7 +686,7 @@ HTMLTableAccessible::RowAndColIndicesAt(uint32_t aCellIdx, int32_t* aRowIdx, 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; @@ -696,7 +696,7 @@ HTMLTableAccessible::ColExtentAt(uint32_t aRowIdx, uint32_t 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; @@ -736,7 +736,7 @@ HTMLTableAccessible::IsRowSelected(uint32_t aRowIdx) 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; @@ -791,7 +791,7 @@ 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; @@ -823,7 +823,7 @@ 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; @@ -1047,7 +1047,7 @@ HTMLTableAccessible::IsProbablyLayoutTable() // 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!"); diff --git a/editor/libeditor/nsHTMLEditor.h b/editor/libeditor/nsHTMLEditor.h index 4cb3204cf688..670f664d12cf 100644 --- a/editor/libeditor/nsHTMLEditor.h +++ b/editor/libeditor/nsHTMLEditor.h @@ -48,7 +48,7 @@ class nsIClipboard; class TypeInState; class nsIContentFilter; class nsILinkHandler; -class nsTableOuterFrame; +class nsTableWrapperFrame; class nsIDOMRange; class nsRange; struct PropItem; @@ -454,8 +454,8 @@ protected: 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); diff --git a/editor/libeditor/nsTableEditor.cpp b/editor/libeditor/nsTableEditor.cpp index 0b1ffeb3aa97..baba26333de5 100644 --- a/editor/libeditor/nsTableEditor.cpp +++ b/editor/libeditor/nsTableEditor.cpp @@ -36,7 +36,7 @@ #include "nsString.h" #include "nsTArray.h" #include "nsTableCellFrame.h" -#include "nsTableOuterFrame.h" +#include "nsTableWrapperFrame.h" #include "nscore.h" #include @@ -2578,7 +2578,7 @@ nsHTMLEditor::GetCellIndexes(nsIDOMElement *aCell, return cellLayoutObject->GetCellIndexes(*aRowIndex, *aColIndex); } -nsTableOuterFrame* +nsTableWrapperFrame* nsHTMLEditor::GetTableFrame(nsIDOMElement* aTable) { NS_ENSURE_TRUE(aTable, nullptr); @@ -2637,7 +2637,7 @@ nsHTMLEditor::GetTableSize(nsIDOMElement *aTable, 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(); @@ -2686,7 +2686,7 @@ nsHTMLEditor::GetCellDataAt(nsIDOMElement* aTable, int32_t aRowIndex, return NS_ERROR_FAILURE; } - nsTableOuterFrame* tableFrame = GetTableFrame(aTable); + nsTableWrapperFrame* tableFrame = GetTableFrame(aTable); NS_ENSURE_TRUE(tableFrame, NS_ERROR_FAILURE); nsTableCellFrame* cellFrame = @@ -2724,7 +2724,7 @@ nsHTMLEditor::GetCellAt(nsIDOMElement* aTable, int32_t aRowIndex, int32_t aColIn aTable = table; } - nsTableOuterFrame* tableFrame = GetTableFrame(aTable); + nsTableWrapperFrame* tableFrame = GetTableFrame(aTable); if (!tableFrame) { *aCell = nullptr; return NS_EDITOR_ELEMENT_NOT_FOUND; @@ -2742,7 +2742,7 @@ 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; diff --git a/layout/base/GeometryUtils.cpp b/layout/base/GeometryUtils.cpp index fc320607cf05..8bbb8fbcd186 100644 --- a/layout/base/GeometryUtils.cpp +++ b/layout/base/GeometryUtils.cpp @@ -187,7 +187,7 @@ public: 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(); } diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index 377e234745bd..e9962d660bdd 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -399,8 +399,9 @@ 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; } diff --git a/layout/base/RestyleManager.h b/layout/base/RestyleManager.h index 23c625eb9112..58302506b97c 100644 --- a/layout/base/RestyleManager.h +++ b/layout/base/RestyleManager.h @@ -617,9 +617,9 @@ public: // 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, diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 158107d5eb88..6c548d3eb63a 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -91,7 +91,7 @@ #include "nsGfxScrollFrame.h" #include "nsPageFrame.h" #include "nsSimplePageSequenceFrame.h" -#include "nsTableOuterFrame.h" +#include "nsTableWrapperFrame.h" #include "nsIScrollableFrame.h" #include "nsBackdropFrame.h" #include "nsTransitionManager.h" @@ -1114,7 +1114,7 @@ nsFrameConstructorState::GetGeometricParent(const nsStyleDisplay* aStyleDisplay, // 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 @@ -1919,13 +1919,13 @@ nsCSSFrameConstructor::CreateGeneratedContentItem(nsFrameConstructorState& aStat // 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) { @@ -2069,23 +2069,23 @@ nsCSSFrameConstructor::ConstructTable(nsFrameConstructorState& aState, 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 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 @@ -2137,7 +2137,7 @@ nsCSSFrameConstructor::ConstructTable(nsFrameConstructorState& aState, // 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); } @@ -2723,7 +2723,7 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement) nsHTMLScrollFrame nsCanvasFrame [abs-cb] root element frame (nsBlockFrame, nsSVGOuterSVGFrame, - nsTableOuterFrame, nsPlaceholderFrame) + nsTableWrapperFrame, nsPlaceholderFrame) Galley presentation, XUL @@ -2739,7 +2739,7 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement) nsPageContentFrame [fixed-cb] nsCanvasFrame [abs-cb] root element frame (nsBlockFrame, nsSVGOuterSVGFrame, - nsTableOuterFrame, nsPlaceholderFrame) + nsTableWrapperFrame, nsPlaceholderFrame) Print-preview presentation, non-XUL @@ -2750,7 +2750,7 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement) 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 @@ -6166,11 +6166,11 @@ nsCSSFrameConstructor::GetAbsoluteContainingBlock(nsIFrame* aFrame, 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(absPosCBCandidate); @@ -7416,8 +7416,8 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer, 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, @@ -7439,7 +7439,7 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer, // 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); @@ -7941,7 +7941,7 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer, 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; @@ -7968,7 +7968,7 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer, // 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 @@ -8022,7 +8022,7 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer, } // 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, @@ -8055,12 +8055,12 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer, 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 @@ -8689,7 +8689,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresSh nsIContent* aContent, nsStyleContext* aStyleContext) { - nsTableOuterFrame* newFrame = NS_NewTableOuterFrame(aPresShell, aStyleContext); + nsTableWrapperFrame* newFrame = NS_NewTableWrapperFrame(aPresShell, aStyleContext); newFrame->Init(aContent, aParentFrame, aFrame); @@ -8706,7 +8706,7 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresSh 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; diff --git a/layout/base/nsCSSFrameConstructor.h b/layout/base/nsCSSFrameConstructor.h index 893ce8666ea3..084d6f758870 100644 --- a/layout/base/nsCSSFrameConstructor.h +++ b/layout/base/nsCSSFrameConstructor.h @@ -467,7 +467,7 @@ private: // 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, diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index 776d5e2d0c95..25febad44639 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -346,19 +346,19 @@ public: /** * 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. */ @@ -377,7 +377,7 @@ public: * 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 @@ -1133,7 +1133,7 @@ public: }; /** * 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. @@ -1181,7 +1181,7 @@ public: }; /** * 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. diff --git a/layout/doc/frame_reflow_debug.html b/layout/doc/frame_reflow_debug.html index 04fdf86d6693..7ba451eff2a5 100644 --- a/layout/doc/frame_reflow_debug.html +++ b/layout/doc/frame_reflow_debug.html @@ -141,7 +141,7 @@ The first line shows the reflow of the viewport (VP). T

The available width is 9180 twips. The available height is 4470 twips (a=9180,4470). The computed width is 9180 twips. The computed height is 4470 twips (c=9180,4470). The line count is 856 (cnt=856).

-Below this is a line that reads:

tblO 02D7B5F0 r=0 a=8940,UC c=0,0 cnt=870

Here the UC shows that on initial reflow the available height for the outer table frame is unconstrained. +Below this is a line that reads:

tblO 02D7B5F0 r=0 a=8940,UC c=0,0 cnt=870

Here the UC shows that on initial reflow the available height for the table wrapper frame is unconstrained.

The table cell requires its children to compute the MES. It is reported back from the block as:

block 02D7BCF8 d=300,300 me=300

diff --git a/layout/doc/table_reflow_slides.html b/layout/doc/table_reflow_slides.html index 2bd863613d06..a24152d18ea1 100644 --- a/layout/doc/table_reflow_slides.html +++ b/layout/doc/table_reflow_slides.html @@ -375,7 +375,7 @@

Table Reflow

    -
  • Outer table reflows table and caption (if present)
  • +
  • table wrapper reflows table and caption (if present)
  • Table reflows row groups in multiple passes
    • Pass 1 - unconstrained width, height and requests max elem width.
    • @@ -488,7 +488,7 @@ Key: column widths. The pass 2 will get skipped if the table doesn't need to rebalance.
    • 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
    • -
    • Outer table caches last avail width and avoids reflowing children if resize reflow is the same as previous
    • +
    • table wrapper caches last avail width and avoids reflowing children if resize reflow is the same as previous
    • Table caches max element, preferred widths in case they are requested and it isn't rebalanced
    • Cell caches prior avail width. if this doesn't change, the row may not have to reflow the cell
    @@ -502,7 +502,7 @@ Key:

    Table incremental reflow

      -
    • Outer table is a target when a caption is added or removed (dirty) or the table or caption margin +
    • table wrapper is a target when a caption is added or removed (dirty) or the table or caption margin changes (style changed).
    • Caption is a target when it changes stylistically (style changed).
    • Table, row group, row, col group, col is a target when a child is added or removed (dirty) or it changes @@ -680,7 +680,7 @@ Key: - + @@ -713,7 +713,7 @@ Key: - +
      nsTableOuterFrame
      nsTableWrapperFrame
      nsTableOuterFrame
      nsTableWrapperFrame
      @@ -800,13 +800,13 @@ Key:

      Table paginated reflow

        -
      • The block containing the outer table reflows it. If it is incomplete, the block will +
      • The block containing the table wrapper reflows it. If it is incomplete, the block will
          -
        • create a continuation for the outer table (which also creates a continuation for the table).
        • +
        • create a continuation for the table wrapper (which also creates a continuation for the table).
        • put the continuation on a new line and place that line on its overflow lines property.
      • -
      • The outer table reflows the table and just returns the status of the table.
      • +
      • The table wrapper reflows the table and just returns the status of the table.
      • The table does a pass 1 reflow and balances. If it is incomplete,
        • it will become the first-in-flow
        • @@ -874,10 +874,10 @@ Key:
        • There are two splitting scenarios for a table
            -
          • An incomplete cells block causes the cell, row, row group, table, outer table to +
          • An incomplete cells block causes the cell, row, row group, table, table wrapper to be incomplete
          • A truncated row or a row that started too far down the page causes the row group, - table, outer table to be incomplete.
          • + table, table wrapper to be incomplete.
        diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 8fc99c9ce513..970e8b267e08 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -29,7 +29,7 @@ #include "nsString.h" #include "nsReadableUtils.h" #include "nsStyleContext.h" -#include "nsTableOuterFrame.h" +#include "nsTableWrapperFrame.h" #include "nsView.h" #include "nsViewManager.h" #include "nsIScrollableFrame.h" @@ -3067,7 +3067,7 @@ nsFrame::GetDataForTableSelection(const nsFrameSelection* aFrameSelection, // 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; @@ -7268,14 +7268,14 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct* aPos) else //if failure or success with different frame. doneLooping = true; //do not continue with while loop - lastFrame = aPos->mResultFrame; //set last frame + lastFrame = aPos->mResultFrame; //set last frame - if (NS_SUCCEEDED(result) && aPos->mResultFrame + 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; @@ -7437,8 +7437,11 @@ nsFrame::PeekOffsetCharacter(bool aForward, int32_t* aOffset, } 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; @@ -8350,9 +8353,9 @@ GetCorrectedParent(const nsIFrame* aFrame) } } - // 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(); diff --git a/layout/generic/nsFrameIdList.h b/layout/generic/nsFrameIdList.h index 69593790ef70..6f401bf2da42 100644 --- a/layout/generic/nsFrameIdList.h +++ b/layout/generic/nsFrameIdList.h @@ -164,7 +164,7 @@ 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) diff --git a/layout/generic/nsHTMLParts.h b/layout/generic/nsHTMLParts.h index 82980d78a55a..9752bdb71e05 100644 --- a/layout/generic/nsHTMLParts.h +++ b/layout/generic/nsHTMLParts.h @@ -180,9 +180,9 @@ 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); diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index fd6f13aa42ef..05cdb8d59836 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -2557,7 +2557,7 @@ nsCSSOffsetState::InitOffsets(WritingMode aWM, 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) { @@ -2647,9 +2647,9 @@ nsHTMLReflowState::CalculateBlockSideMargins(nsIAtom* aFrameType) 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 && diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp index 2e4eebb4a3d3..513d80e16771 100644 --- a/layout/generic/nsSelection.cpp +++ b/layout/generic/nsSelection.cpp @@ -25,7 +25,7 @@ #include "nsCOMArray.h" #include "nsITableCellLayout.h" #include "nsTArray.h" -#include "nsTableOuterFrame.h" +#include "nsTableWrapperFrame.h" #include "nsTableCellFrame.h" #include "nsIScrollableFrame.h" #include "nsCCUncollectableMarker.h" @@ -2803,7 +2803,7 @@ nsFrameSelection::UnselectCells(nsIContent *aTableContent, 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; @@ -2883,7 +2883,7 @@ nsFrameSelection::AddCellsToSelection(nsIContent *aTableContent, 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; @@ -2954,15 +2954,15 @@ nsFrameSelection::SelectRowOrColumn(nsIContent *aCellContent, uint32_t aTarget) 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; diff --git a/layout/mathml/nsMathMLmtableFrame.cpp b/layout/mathml/nsMathMLmtableFrame.cpp index 951757ee0b0e..dd1fe51f31c6 100644 --- a/layout/mathml/nsMathMLmtableFrame.cpp +++ b/layout/mathml/nsMathMLmtableFrame.cpp @@ -685,7 +685,7 @@ ListMathMLTree(nsIFrame* atLeast) 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) @@ -822,7 +822,7 @@ nsMathMLmtableOuterFrame::Reflow(nsPresContext* aPresContext, 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"); diff --git a/layout/mathml/nsMathMLmtableFrame.h b/layout/mathml/nsMathMLmtableFrame.h index b0e55bbb225c..ab0ce7adfa10 100644 --- a/layout/mathml/nsMathMLmtableFrame.h +++ b/layout/mathml/nsMathMLmtableFrame.h @@ -9,7 +9,7 @@ #include "mozilla/Attributes.h" #include "nsMathMLContainerFrame.h" #include "nsBlockFrame.h" -#include "nsTableOuterFrame.h" +#include "nsTableWrapperFrame.h" #include "nsTableRowFrame.h" #include "nsTableCellFrame.h" @@ -17,7 +17,7 @@ // -- table or matrix // -class nsMathMLmtableOuterFrame : public nsTableOuterFrame, +class nsMathMLmtableOuterFrame : public nsTableWrapperFrame, public nsMathMLFrame { public: @@ -27,7 +27,7 @@ public: NS_DECL_QUERYFRAME NS_DECL_FRAMEARENA_HELPERS - // overloaded nsTableOuterFrame methods + // overloaded nsTableWrapperFrame methods virtual void Reflow(nsPresContext* aPresContext, @@ -42,11 +42,11 @@ public: 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., diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 04c16565d2c7..8207b5d6ea87 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -677,12 +677,12 @@ nsComputedDOMStyle::UpdateCurrentStyleSources(bool aNeedsLayoutFlush) 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"); } @@ -5209,7 +5209,7 @@ nsComputedDOMStyle::GetMarginWidthFor(mozilla::css::Side aSide) 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), diff --git a/layout/tables/moz.build b/layout/tables/moz.build index 082236c496b2..716cf31d2e1a 100644 --- a/layout/tables/moz.build +++ b/layout/tables/moz.build @@ -21,10 +21,10 @@ UNIFIED_SOURCES += [ 'nsTableColFrame.cpp', 'nsTableColGroupFrame.cpp', 'nsTableFrame.cpp', - 'nsTableOuterFrame.cpp', 'nsTablePainter.cpp', 'nsTableRowFrame.cpp', 'nsTableRowGroupFrame.cpp', + 'nsTableWrapperFrame.cpp', 'SpanningCellSorter.cpp', ] diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index 992351f259ea..eeb9f2bdad9f 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -113,7 +113,7 @@ 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. @@ -166,7 +166,7 @@ nsTableCellFrame::NeedsToObserve(const nsHTMLReflowState& aReflowState) } // 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; diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index bb0cac0fba2d..6d685e4119c7 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -22,7 +22,7 @@ #include "nsTableColGroupFrame.h" #include "nsTableRowFrame.h" #include "nsTableRowGroupFrame.h" -#include "nsTableOuterFrame.h" +#include "nsTableWrapperFrame.h" #include "nsTablePainter.h" #include "BasicTableLayoutStrategy.h" @@ -124,10 +124,10 @@ struct BCPropertyData 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; @@ -183,7 +183,7 @@ nsTableFrame::Init(nsIContent* aContent, } } 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))); } @@ -2646,7 +2646,7 @@ nsTableFrame::GetUsedPadding() const /* 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); } @@ -6487,7 +6487,7 @@ BCPaintBorderIterator::SetDamageArea(const nsRect& aDirtyRect) // 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) diff --git a/layout/tables/nsTableFrame.h b/layout/tables/nsTableFrame.h index 45fee6edbbed..bddb8908c40a 100644 --- a/layout/tables/nsTableFrame.h +++ b/layout/tables/nsTableFrame.h @@ -121,7 +121,7 @@ enum nsTableColType { /** * 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 @@ -140,8 +140,8 @@ public: NS_DECLARE_FRAME_PROPERTY_DELETABLE(PositionedTablePartArray, nsTArray) - /** 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 diff --git a/layout/tables/nsTableOuterFrame.cpp b/layout/tables/nsTableWrapperFrame.cpp similarity index 83% rename from layout/tables/nsTableOuterFrame.cpp rename to layout/tables/nsTableWrapperFrame.cpp index a49b921712df..5b3f64cd9bc5 100644 --- a/layout/tables/nsTableOuterFrame.cpp +++ b/layout/tables/nsTableWrapperFrame.cpp @@ -3,7 +3,7 @@ * 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" @@ -30,7 +30,7 @@ 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) { @@ -42,29 +42,29 @@ nsTableOuterFrame::GetLogicalBaseline(WritingMode aWritingMode) const 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); @@ -72,7 +72,7 @@ nsTableOuterFrame::DestroyFrom(nsIFrame* aDestructRoot) } const nsFrameList& -nsTableOuterFrame::GetChildList(ChildListID aListID) const +nsTableWrapperFrame::GetChildList(ChildListID aListID) const { if (aListID == kCaptionList) { return mCaptionFrames; @@ -82,15 +82,15 @@ nsTableOuterFrame::GetChildList(ChildListID aListID) const } void -nsTableOuterFrame::GetChildLists(nsTArray* aLists) const +nsTableWrapperFrame::GetChildLists(nsTArray* 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 @@ -108,8 +108,8 @@ nsTableOuterFrame::SetInitialChildList(ChildListID aListID, } 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 @@ -121,15 +121,14 @@ nsTableOuterFrame::AppendFrames(ChildListID aListID, // 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() || @@ -141,14 +140,13 @@ nsTableOuterFrame::InsertFrames(ChildListID aListID, // 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 @@ -162,16 +160,16 @@ nsTableOuterFrame::RemoveFrame(ChildListID aListID, // 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. @@ -189,7 +187,7 @@ nsTableOuterFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, 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()); @@ -197,9 +195,9 @@ nsTableOuterFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, } 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) @@ -212,17 +210,17 @@ nsTableOuterFrame::BuildDisplayListForInnerTable(nsDisplayListBuilder* aBuilde } 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(); } @@ -230,9 +228,8 @@ nsTableOuterFrame::GetParentStyleContext(nsIFrame** aProviderFrame) const // 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); @@ -252,11 +249,11 @@ nsTableOuterFrame::InitChildReflowState(nsPresContext& aPresContext, // 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!"); @@ -295,7 +292,7 @@ GetContainingBlockSize(const nsHTMLReflowState& aOuterRS) } /* virtual */ nscoord -nsTableOuterFrame::GetMinISize(nsRenderingContext *aRenderingContext) +nsTableWrapperFrame::GetMinISize(nsRenderingContext *aRenderingContext) { nscoord iSize = nsLayoutUtils::IntrinsicForContainer(aRenderingContext, InnerTableFrame(), nsLayoutUtils::MIN_ISIZE); @@ -317,7 +314,7 @@ nsTableOuterFrame::GetMinISize(nsRenderingContext *aRenderingContext) } /* virtual */ nscoord -nsTableOuterFrame::GetPrefISize(nsRenderingContext *aRenderingContext) +nsTableWrapperFrame::GetPrefISize(nsRenderingContext *aRenderingContext) { nscoord maxISize; DISPLAY_PREF_WIDTH(this, maxISize); @@ -398,18 +395,18 @@ ChildShrinkWrapISize(nsRenderingContext *aRenderingContext, /* 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) @@ -460,7 +457,7 @@ nsTableOuterFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext, } uint8_t -nsTableOuterFrame::GetCaptionSide() +nsTableWrapperFrame::GetCaptionSide() { if (mCaptionFrames.NotEmpty()) { return mCaptionFrames.FirstChild()->StyleTableBorder()->mCaptionSide; @@ -471,24 +468,25 @@ nsTableOuterFrame::GetCaptionSide() } 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; @@ -547,15 +545,15 @@ nsTableOuterFrame::SetDesiredSize(uint8_t aCaptionSide, 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)) || @@ -639,15 +637,15 @@ nsTableOuterFrame::GetCaptionOrigin(uint32_t aCaptionSide, 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), @@ -732,11 +730,11 @@ nsTableOuterFrame::GetInnerOrigin(uint32_t aCaptionSide, } void -nsTableOuterFrame::OuterBeginReflowChild(nsPresContext* aPresContext, - nsIFrame* aChildFrame, - const nsHTMLReflowState& aOuterRS, - Maybe& aChildRS, - nscoord aAvailISize) +nsTableWrapperFrame::OuterBeginReflowChild(nsPresContext* aPresContext, + nsIFrame* aChildFrame, + const nsHTMLReflowState& aOuterRS, + Maybe& aChildRS, + nscoord aAvailISize) { // work around pixel rounding errors, round down to ensure we don't exceed the avail height in WritingMode wm = aChildFrame->GetWritingMode(); @@ -778,11 +776,11 @@ nsTableOuterFrame::OuterBeginReflowChild(nsPresContext* aPresContext, } 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 @@ -796,9 +794,9 @@ nsTableOuterFrame::OuterDoReflowChild(nsPresContext* aPresContext, 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; @@ -808,8 +806,8 @@ nsTableOuterFrame::OuterDoReflowChild(nsPresContext* aPresContext, wm, childPt, zeroCSize, flags, aStatus); } -void -nsTableOuterFrame::UpdateOverflowAreas(nsHTMLReflowMetrics& aMet) +void +nsTableWrapperFrame::UpdateOverflowAreas(nsHTMLReflowMetrics& aMet) { aMet.SetOverflowAreasToDesiredBounds(); ConsiderChildOverflow(aMet.mOverflowAreas, InnerTableFrame()); @@ -819,13 +817,13 @@ nsTableOuterFrame::UpdateOverflowAreas(nsHTMLReflowMetrics& aMet) } 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 @@ -833,7 +831,7 @@ nsTableOuterFrame::Reflow(nsPresContext* aPresContext, 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(); } @@ -1013,7 +1011,7 @@ nsTableOuterFrame::Reflow(nsPresContext* aPresContext, } nsIAtom* -nsTableOuterFrame::GetType() const +nsTableWrapperFrame::GetType() const { return nsGkAtoms::tableOuterFrame; } @@ -1021,7 +1019,7 @@ nsTableOuterFrame::GetType() const /* ----- 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) { @@ -1037,19 +1035,19 @@ nsTableOuterFrame::GetCellAt(uint32_t aRowIdx, uint32_t aColIdx) const } -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 diff --git a/layout/tables/nsTableOuterFrame.h b/layout/tables/nsTableWrapperFrame.h similarity index 93% rename from layout/tables/nsTableOuterFrame.h rename to layout/tables/nsTableWrapperFrame.h index 3b6782225245..4781fe066d7e 100644 --- a/layout/tables/nsTableOuterFrame.h +++ b/layout/tables/nsTableWrapperFrame.h @@ -2,8 +2,8 @@ /* 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" @@ -14,25 +14,25 @@ /** * 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; @@ -182,10 +182,10 @@ public: 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. @@ -257,10 +257,11 @@ protected: (~eCanContainOverflowContainers)); } - nsTableFrame* InnerTableFrame() const { + nsTableFrame* InnerTableFrame() const + { return static_cast(mFrames.FirstChild()); } - + private: nsFrameList mCaptionFrames; };