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