Bug 1571249 - Remove the IsTableCell() function. r=TYLin

It was made pointless by the previous patch.

This replaces callers that had a frame type for another reason with the
frame type check that IsTableCell did, and callers that needed to call
Type() with an IsTableCellFrame call.

Differential Revision: https://phabricator.services.mozilla.com/D40561

--HG--
extra : moz-landing-system : lando
This commit is contained in:
L. David Baron 2019-08-08 19:48:12 +00:00
Родитель 5afb94be01
Коммит 85d61d1a95
6 изменённых файлов: 16 добавлений и 19 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -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;

Просмотреть файл

@ -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.

Просмотреть файл

@ -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,

Просмотреть файл

@ -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,

Просмотреть файл

@ -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<nsTableCellFrame&>(*childFrame),
GetRowIndex());
@ -229,7 +229,7 @@ void nsTableRowFrame::InsertFrames(ChildListID aListID, nsIFrame* aPrevFrame,
nsTArray<nsTableCellFrame*> 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<nsTableCellFrame*>(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,