Bug 916972 - Eliminate nsIFrame::GetSplittableType() completely. r=mats,dholbert
Currently, GetSplittableType() is called only in nsCSSFrameConstructor::CreateContinuingFrame(). The splittable concrete frames should inherit from nsSplittableFrame, and must explicitly create continuing frame in CreateContinuingFrame(). Thus, no need to maintain GetSplittableType(). Differential Revision: https://phabricator.services.mozilla.com/D10798
This commit is contained in:
@@ -8329,9 +8329,6 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
|
||||
LayoutFrameType frameType = aFrame->Type();
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
|
||||
NS_ASSERTION(aFrame->GetSplittableType() != NS_FRAME_NOT_SPLITTABLE,
|
||||
"why CreateContinuingFrame for a non-splittable frame?");
|
||||
|
||||
if (LayoutFrameType::Text == frameType) {
|
||||
newFrame = NS_NewContinuingTextFrame(shell, computedStyle);
|
||||
newFrame->Init(content, aParentFrame, aFrame);
|
||||
|
||||
@@ -35,10 +35,6 @@ public:
|
||||
{
|
||||
return nsFrame::PeekOffsetCharacter(aForward, aOffset, aOptions);
|
||||
}
|
||||
nsSplittableType GetSplittableType() const override
|
||||
{
|
||||
return nsFrame::GetSplittableType();
|
||||
}
|
||||
|
||||
protected:
|
||||
nsAtomicContainerFrame(ComputedStyle* aStyle, ClassID aID)
|
||||
|
||||
@@ -404,12 +404,6 @@ NS_QUERYFRAME_HEAD(nsBlockFrame)
|
||||
NS_QUERYFRAME_ENTRY(nsBlockFrame)
|
||||
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
|
||||
|
||||
nsSplittableType
|
||||
nsBlockFrame::GetSplittableType() const
|
||||
{
|
||||
return NS_FRAME_SPLITTABLE_NON_RECTANGULAR;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
void
|
||||
nsBlockFrame::List(FILE* out, const char* aPrefix, uint32_t aFlags) const
|
||||
|
||||
@@ -137,7 +137,6 @@ public:
|
||||
nscoord* aBaseline) const override;
|
||||
nscoord GetCaretBaseline() const override;
|
||||
void DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData) override;
|
||||
nsSplittableType GetSplittableType() const override;
|
||||
bool IsFloatContainingBlock() const override;
|
||||
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsDisplayListSet& aLists) override;
|
||||
|
||||
@@ -6630,12 +6630,6 @@ nsFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||
|
||||
// Flow member functions
|
||||
|
||||
nsSplittableType
|
||||
nsFrame::GetSplittableType() const
|
||||
{
|
||||
return NS_FRAME_NOT_SPLITTABLE;
|
||||
}
|
||||
|
||||
nsIFrame* nsFrame::GetPrevContinuation() const
|
||||
{
|
||||
return nullptr;
|
||||
|
||||
@@ -201,7 +201,6 @@ public:
|
||||
nsresult AttributeChanged(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute,
|
||||
int32_t aModType) override;
|
||||
nsSplittableType GetSplittableType() const override;
|
||||
nsIFrame* GetPrevContinuation() const override;
|
||||
void SetPrevContinuation(nsIFrame*) override;
|
||||
nsIFrame* GetNextContinuation() const override;
|
||||
|
||||
@@ -199,12 +199,6 @@ nsHTMLScrollFrame::RemoveFrame(ChildListID aListID,
|
||||
mHelper.ReloadChildFrames();
|
||||
}
|
||||
|
||||
nsSplittableType
|
||||
nsHTMLScrollFrame::GetSplittableType() const
|
||||
{
|
||||
return NS_FRAME_NOT_SPLITTABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
HTML scrolling implementation
|
||||
|
||||
@@ -1616,12 +1610,6 @@ nsXULScrollFrame::RemoveFrame(ChildListID aListID,
|
||||
mHelper.ReloadChildFrames();
|
||||
}
|
||||
|
||||
nsSplittableType
|
||||
nsXULScrollFrame::GetSplittableType() const
|
||||
{
|
||||
return NS_FRAME_NOT_SPLITTABLE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsXULScrollFrame::GetXULPadding(nsMargin& aMargin)
|
||||
{
|
||||
|
||||
@@ -818,7 +818,6 @@ public:
|
||||
}
|
||||
|
||||
virtual bool DoesClipChildren() override { return true; }
|
||||
virtual nsSplittableType GetSplittableType() const override;
|
||||
|
||||
nsPoint GetPositionOfChildIgnoringScrolling(const nsIFrame* aChild) override
|
||||
{ nsPoint pt = aChild->GetPosition();
|
||||
@@ -1246,7 +1245,6 @@ public:
|
||||
}
|
||||
|
||||
virtual bool DoesClipChildren() override { return true; }
|
||||
virtual nsSplittableType GetSplittableType() const override;
|
||||
|
||||
nsPoint GetPositionOfChildIgnoringScrolling(const nsIFrame* aChild) override
|
||||
{ nsPoint pt = aChild->GetPosition();
|
||||
|
||||
@@ -120,31 +120,6 @@ class Selection;
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
/**
|
||||
* Indication of how the frame can be split. This is used when doing runaround
|
||||
* of floats, and when pulling up child frames from a next-in-flow.
|
||||
*
|
||||
* The choices are splittable, not splittable at all, and splittable in
|
||||
* a non-rectangular fashion. This last type only applies to block-level
|
||||
* elements, and indicates whether splitting can be used when doing runaround.
|
||||
* If you can split across page boundaries, but you expect each continuing
|
||||
* frame to be the same width then return frSplittable and not
|
||||
* frSplittableNonRectangular.
|
||||
*
|
||||
* @see #GetSplittableType()
|
||||
*/
|
||||
typedef uint32_t nsSplittableType;
|
||||
|
||||
#define NS_FRAME_NOT_SPLITTABLE 0 // Note: not a bit!
|
||||
#define NS_FRAME_SPLITTABLE 0x1
|
||||
#define NS_FRAME_SPLITTABLE_NON_RECTANGULAR 0x3
|
||||
|
||||
#define NS_FRAME_IS_SPLITTABLE(type)\
|
||||
(0 != ((type) & NS_FRAME_SPLITTABLE))
|
||||
|
||||
#define NS_FRAME_IS_NOT_SPLITTABLE(type)\
|
||||
(0 == ((type) & NS_FRAME_SPLITTABLE))
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
#define NS_SUBTREE_DIRTY(_frame) \
|
||||
@@ -2075,11 +2050,6 @@ public:
|
||||
*/
|
||||
virtual void ContentStatesChanged(mozilla::EventStates aStates);
|
||||
|
||||
/**
|
||||
* Return how your frame can be split.
|
||||
*/
|
||||
virtual nsSplittableType GetSplittableType() const = 0;
|
||||
|
||||
/**
|
||||
* Continuation member functions
|
||||
*/
|
||||
|
||||
@@ -124,11 +124,6 @@ public:
|
||||
uint32_t aFlags = 0) const override;
|
||||
#endif
|
||||
|
||||
nsSplittableType GetSplittableType() const override
|
||||
{
|
||||
return NS_FRAME_SPLITTABLE;
|
||||
}
|
||||
|
||||
virtual LogicalSides GetLogicalSkipSides(const ReflowInput* aReflowInput = nullptr) const override;
|
||||
|
||||
nsresult GetIntrinsicImageSize(nsSize& aSize);
|
||||
|
||||
@@ -41,12 +41,6 @@ nsSplittableFrame::DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostDe
|
||||
nsFrame::DestroyFrom(aDestructRoot, aPostDestroyData);
|
||||
}
|
||||
|
||||
nsSplittableType
|
||||
nsSplittableFrame::GetSplittableType() const
|
||||
{
|
||||
return NS_FRAME_SPLITTABLE;
|
||||
}
|
||||
|
||||
nsIFrame* nsSplittableFrame::GetPrevContinuation() const
|
||||
{
|
||||
return mPrevContinuation;
|
||||
|
||||
@@ -25,8 +25,6 @@ public:
|
||||
nsContainerFrame* aParent,
|
||||
nsIFrame* aPrevInFlow) override;
|
||||
|
||||
nsSplittableType GetSplittableType() const override;
|
||||
|
||||
void DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData) override;
|
||||
|
||||
/*
|
||||
|
||||
@@ -135,11 +135,6 @@ public:
|
||||
nsTextFrame* LastInFlow() const final;
|
||||
nsTextFrame* LastContinuation() const final;
|
||||
|
||||
nsSplittableType GetSplittableType() const final
|
||||
{
|
||||
return NS_FRAME_SPLITTABLE;
|
||||
}
|
||||
|
||||
bool IsFrameOfType(uint32_t aFlags) const final
|
||||
{
|
||||
// Set the frame state bit for text frames to mark them as replaced.
|
||||
|
||||
@@ -798,12 +798,6 @@ nsSVGOuterSVGFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
}
|
||||
|
||||
nsSplittableType
|
||||
nsSVGOuterSVGFrame::GetSplittableType() const
|
||||
{
|
||||
return NS_FRAME_NOT_SPLITTABLE;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// nsISVGSVGFrame methods:
|
||||
|
||||
|
||||
@@ -80,8 +80,6 @@ public:
|
||||
aFlags & ~eSupportsContainLayoutAndPaint);
|
||||
}
|
||||
|
||||
virtual nsSplittableType GetSplittableType() const override;
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
virtual nsresult GetFrameName(nsAString& aResult) const override
|
||||
{
|
||||
|
||||
@@ -202,12 +202,6 @@ nsTableColFrame::GetFrameName(nsAString& aResult) const
|
||||
}
|
||||
#endif
|
||||
|
||||
nsSplittableType
|
||||
nsTableColFrame::GetSplittableType() const
|
||||
{
|
||||
return NS_FRAME_NOT_SPLITTABLE;
|
||||
}
|
||||
|
||||
void
|
||||
nsTableColFrame::InvalidateFrame(uint32_t aDisplayItemKey, bool aRebuildDisplayItems)
|
||||
{
|
||||
|
||||
@@ -60,8 +60,6 @@ public:
|
||||
virtual nsresult GetFrameName(nsAString& aResult) const override;
|
||||
#endif
|
||||
|
||||
virtual nsSplittableType GetSplittableType() const override;
|
||||
|
||||
nsTableColGroupFrame* GetTableColGroupFrame() const
|
||||
{
|
||||
nsIFrame* parent = GetParent();
|
||||
|
||||
Reference in New Issue
Block a user