diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 96579c5bf902..05257594b7c6 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -8119,7 +8119,7 @@ nsIFrame* nsCSSFrameConstructor::CreateContinuingFrame( nsIFrame* cellFrame = aFrame->PrincipalChildList().FirstChild(); while (cellFrame) { // See if it's a table cell frame - if (IsTableCell(cellFrame->Type())) { + if (cellFrame->IsTableCellFrame()) { nsIFrame* continuingCellFrame = CreateContinuingFrame(aPresContext, cellFrame, rowFrame); newChildList.AppendFrame(nullptr, continuingCellFrame); @@ -8130,7 +8130,7 @@ nsIFrame* nsCSSFrameConstructor::CreateContinuingFrame( rowFrame->SetInitialChildList(kPrincipalList, newChildList); newFrame = rowFrame; - } else if (IsTableCell(frameType)) { + } else if (LayoutFrameType::TableCell == frameType) { // Warning: If you change this and add a wrapper frame around table cell // frames, make sure Bug 368554 doesn't regress! // See IsInAutoWidthTableCellForQuirk() in nsImageFrame.cpp. diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp index 304d5bdba5a3..4bf19cfa9094 100644 --- a/layout/generic/ReflowInput.cpp +++ b/layout/generic/ReflowInput.cpp @@ -630,7 +630,7 @@ void ReflowInput::InitResizeFlags(nsPresContext* aPresContext, // value it's relative to has changed. SetBResize(true); mFlags.mIsBResizeForPercentages = true; - } else if (IsTableCell(aFrameType) && + } else if (aFrameType == LayoutFrameType::TableCell && (mFlags.mSpecialBSizeReflow || (mFrame->FirstInFlow()->GetStateBits() & NS_TABLE_CELL_HAD_SPECIAL_REFLOW)) && @@ -688,7 +688,7 @@ void ReflowInput::InitResizeFlags(nsPresContext* aPresContext, // the special bsize reflow, since in that case it will already be // set correctly above if we need it set. if (!IsBResize() && mCBReflowInput && - (IsTableCell(mCBReflowInput->mFrame->Type()) || + (mCBReflowInput->mFrame->IsTableCellFrame() || mCBReflowInput->mFlags.mHeightDependsOnAncestorCell) && !mCBReflowInput->mFlags.mSpecialBSizeReflow && dependsOnCBBSize) { SetBResize(true); @@ -2241,7 +2241,7 @@ void ReflowInput::InitConstraints( // passed in. // XXX It seems like this could lead to bugs with min-height and friends if (cbri->mParentReflowInput) { - if (IsTableCell(cbri->mFrame->Type())) { + if (cbri->mFrame->IsTableCellFrame()) { // use the cell's computed block size cbSize.BSize(wm) = cbri->ComputedSize(wm).BSize(wm); } @@ -2276,7 +2276,7 @@ void ReflowInput::InitConstraints( // in quirks mode, get the cb height using the special quirk method if (!wm.IsVertical() && eCompatibility_NavQuirks == aPresContext->CompatibilityMode()) { - if (!IsTableCell(cbri->mFrame->Type())) { + if (!cbri->mFrame->IsTableCellFrame()) { cbSize.BSize(wm) = CalcQuirkContainingBlockHeight(cbri); if (cbSize.BSize(wm) == NS_UNCONSTRAINEDSIZE) { isAutoBSize = true; diff --git a/layout/mathml/nsMathMLmtableFrame.cpp b/layout/mathml/nsMathMLmtableFrame.cpp index 5e29041d2b29..7dacf118da98 100644 --- a/layout/mathml/nsMathMLmtableFrame.cpp +++ b/layout/mathml/nsMathMLmtableFrame.cpp @@ -566,7 +566,7 @@ static void MapAllAttributesIntoCSS(nsMathMLmtableFrame* aTableFrame) { for (nsIFrame* cellFrame : rowFrame->PrincipalChildList()) { DEBUG_VERIFY_THAT_FRAME_IS(cellFrame, TableCell); - if (IsTableCell(cellFrame->Type())) { + if (cellFrame->IsTableCellFrame()) { // Map cell rowalign. ParseFrameAttribute(cellFrame, nsGkAtoms::rowalign_, false); // Map row columnalign. diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 11ed629022fa..e9f364713957 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -245,7 +245,7 @@ void nsTableFrame::RegisterPositionedTablePart(nsIFrame* aFrame) { // the potential to break sites that apply 'position: relative' to those // parts, expecting nothing to happen. We warn at the console to make tracking // down the issue easy. - if (!IsTableCell(aFrame->Type())) { + if (!aFrame->IsTableCellFrame()) { nsIContent* content = aFrame->GetContent(); nsPresContext* presContext = aFrame->PresContext(); if (content && !presContext->HasWarnedAboutPositionedTableParts()) { @@ -1583,8 +1583,9 @@ bool nsTableFrame::AncestorsHaveStyleBSize( for (const ReflowInput* rs = &aParentReflowInput; rs && rs->mFrame; rs = rs->mParentReflowInput) { LayoutFrameType frameType = rs->mFrame->Type(); - if (IsTableCell(frameType) || (LayoutFrameType::TableRow == frameType) || - (LayoutFrameType::TableRowGroup == frameType)) { + if (LayoutFrameType::TableCell == frameType || + LayoutFrameType::TableRow == frameType || + LayoutFrameType::TableRowGroup == frameType) { const auto& bsize = rs->mStylePosition->BSize(wm); // calc() with both lengths and percentages treated like 'auto' on // internal table elements @@ -1603,7 +1604,7 @@ bool nsTableFrame::AncestorsHaveStyleBSize( // call RequestSpecialBSizeReflow void nsTableFrame::CheckRequestSpecialBSizeReflow( const ReflowInput& aReflowInput) { - NS_ASSERTION(IsTableCell(aReflowInput.mFrame->Type()) || + NS_ASSERTION(aReflowInput.mFrame->IsTableCellFrame() || aReflowInput.mFrame->IsTableRowFrame() || aReflowInput.mFrame->IsTableRowGroupFrame() || aReflowInput.mFrame->IsTableFrame(), @@ -1632,7 +1633,7 @@ void nsTableFrame::RequestSpecialBSizeReflow(const ReflowInput& aReflowInput) { for (const ReflowInput* rs = &aReflowInput; rs && rs->mFrame; rs = rs->mParentReflowInput) { LayoutFrameType frameType = rs->mFrame->Type(); - NS_ASSERTION(IsTableCell(frameType) || + NS_ASSERTION(LayoutFrameType::TableCell == frameType || LayoutFrameType::TableRow == frameType || LayoutFrameType::TableRowGroup == frameType || LayoutFrameType::Table == frameType, diff --git a/layout/tables/nsTableFrame.h b/layout/tables/nsTableFrame.h index 485efb438f98..e87aaa5ae652 100644 --- a/layout/tables/nsTableFrame.h +++ b/layout/tables/nsTableFrame.h @@ -36,10 +36,6 @@ class StackingContextHelper; struct BCPropertyData; -static inline bool IsTableCell(mozilla::LayoutFrameType frameType) { - return frameType == mozilla::LayoutFrameType::TableCell; -} - class nsDisplayTableItem : public nsPaintedDisplayItem { public: nsDisplayTableItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp index ff4882f23ca1..aeb6c419b909 100644 --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -193,7 +193,7 @@ void nsTableRowFrame::AppendFrames(ChildListID aListID, nsTableFrame* tableFrame = GetTableFrame(); for (nsFrameList::Enumerator e(newCells); !e.AtEnd(); e.Next()) { nsIFrame* childFrame = e.get(); - NS_ASSERTION(IsTableCell(childFrame->Type()), + NS_ASSERTION(childFrame->IsTableCellFrame(), "Not a table cell frame/pseudo frame construction failure"); tableFrame->AppendCell(static_cast(*childFrame), GetRowIndex()); @@ -229,7 +229,7 @@ void nsTableRowFrame::InsertFrames(ChildListID aListID, nsIFrame* aPrevFrame, nsTArray cellChildren; for (nsFrameList::Enumerator e(newCells); !e.AtEnd(); e.Next()) { nsIFrame* childFrame = e.get(); - NS_ASSERTION(IsTableCell(childFrame->Type()), + NS_ASSERTION(childFrame->IsTableCellFrame(), "Not a table cell frame/pseudo frame construction failure"); cellChildren.AppendElement(static_cast(childFrame)); } @@ -412,7 +412,7 @@ nscoord nsTableRowFrame::GetRowBaseline(WritingMode aWM) { nscoord ascent = 0; nsSize containerSize = GetSize(); for (nsIFrame* childFrame : mFrames) { - if (IsTableCell(childFrame->Type())) { + if (childFrame->IsTableCellFrame()) { nsIFrame* firstKid = childFrame->PrincipalChildList().FirstChild(); ascent = std::max( ascent,