mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 967287 part 1: Remove unnecessary nsPresContext* argument from functions defined in nsContainerFrame.h. r=mats
This commit is contained in:
parent
503d34b795
commit
50a0c7d717
@ -435,7 +435,7 @@ SplitInlineAncestors(nsIFrame* aParent,
|
||||
|
||||
// Reparent views as necessary
|
||||
nsresult rv;
|
||||
rv = nsContainerFrame::ReparentFrameViewList(presContext, tail, parent, newParent);
|
||||
rv = nsContainerFrame::ReparentFrameViewList(tail, parent, newParent);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -1387,8 +1387,7 @@ MoveChildrenTo(nsPresContext* aPresContext,
|
||||
|
||||
if (aNewParent->HasView() || aOldParent->HasView() || !sameGrandParent) {
|
||||
// Move the frames into the new view
|
||||
nsContainerFrame::ReparentFrameViewList(aPresContext, aFrameList,
|
||||
aOldParent, aNewParent);
|
||||
nsContainerFrame::ReparentFrameViewList(aFrameList, aOldParent, aNewParent);
|
||||
}
|
||||
|
||||
for (nsFrameList::Enumerator e(aFrameList); !e.AtEnd(); e.Next()) {
|
||||
|
@ -102,7 +102,7 @@ nsAbsoluteContainingBlock::RemoveFrame(nsIFrame* aDelegatingFrame,
|
||||
nsIFrame* nif = aOldFrame->GetNextInFlow();
|
||||
if (nif) {
|
||||
static_cast<nsContainerFrame*>(nif->GetParent())
|
||||
->DeleteNextInFlowChild(aOldFrame->PresContext(), nif, false);
|
||||
->DeleteNextInFlowChild(nif, false);
|
||||
}
|
||||
|
||||
mAbsoluteFrames.DestroyFrame(aOldFrame);
|
||||
@ -124,7 +124,7 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
|
||||
bool reflowAll = aReflowState.ShouldReflowAllKids();
|
||||
|
||||
nsIFrame* kidFrame;
|
||||
nsOverflowContinuationTracker tracker(aPresContext, aDelegatingFrame, true);
|
||||
nsOverflowContinuationTracker tracker(aDelegatingFrame, true);
|
||||
for (kidFrame = mAbsoluteFrames.FirstChild(); kidFrame; kidFrame = kidFrame->GetNextSibling()) {
|
||||
bool kidNeedsReflow = reflowAll || NS_SUBTREE_DIRTY(kidFrame) ||
|
||||
FrameDependsOnContainer(kidFrame, aCBWidthChanged, aCBHeightChanged);
|
||||
@ -155,7 +155,7 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
|
||||
if (nextFrame) {
|
||||
nsOverflowContinuationTracker::AutoFinish fini(&tracker, kidFrame);
|
||||
static_cast<nsContainerFrame*>(nextFrame->GetParent())
|
||||
->DeleteNextInFlowChild(aPresContext, nextFrame, true);
|
||||
->DeleteNextInFlowChild(nextFrame, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -532,8 +532,7 @@ ReparentFrame(nsIFrame* aFrame, nsIFrame* aOldParent, nsIFrame* aNewParent)
|
||||
|
||||
// When pushing and pulling frames we need to check for whether any
|
||||
// views need to be reparented
|
||||
nsContainerFrame::ReparentFrameView(aFrame->PresContext(), aFrame,
|
||||
aOldParent, aNewParent);
|
||||
nsContainerFrame::ReparentFrameView(aFrame, aOldParent, aNewParent);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1044,7 +1043,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
// Now that we're done cleaning up our overflow container lists, we can
|
||||
// give |state| its nsOverflowContinuationTracker.
|
||||
nsOverflowContinuationTracker tracker(aPresContext, this, false);
|
||||
nsOverflowContinuationTracker tracker(this, false);
|
||||
state.mOverflowTracker = &tracker;
|
||||
|
||||
// Drain & handle pushed floats
|
||||
@ -3185,7 +3184,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
|
||||
nsOverflowContinuationTracker::AutoFinish fini(aState.mOverflowTracker, frame);
|
||||
nsContainerFrame* parent =
|
||||
static_cast<nsContainerFrame*>(nextFrame->GetParent());
|
||||
rv = parent->StealFrame(aState.mPresContext, nextFrame);
|
||||
rv = parent->StealFrame(nextFrame);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (parent != this)
|
||||
ReparentFrame(nextFrame, parent, this);
|
||||
@ -3252,7 +3251,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
|
||||
// to dig it out of the child lists.
|
||||
nsContainerFrame* parent = static_cast<nsContainerFrame*>
|
||||
(nextFrame->GetParent());
|
||||
rv = parent->StealFrame(aState.mPresContext, nextFrame);
|
||||
rv = parent->StealFrame(nextFrame);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
else if (madeContinuation) {
|
||||
@ -3864,7 +3863,7 @@ nsBlockFrame::SplitFloat(nsBlockReflowState& aState,
|
||||
if (nextInFlow) {
|
||||
nsContainerFrame *oldParent =
|
||||
static_cast<nsContainerFrame*>(nextInFlow->GetParent());
|
||||
DebugOnly<nsresult> rv = oldParent->StealFrame(aState.mPresContext, nextInFlow);
|
||||
DebugOnly<nsresult> rv = oldParent->StealFrame(nextInFlow);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "StealFrame failed");
|
||||
if (oldParent != this) {
|
||||
ReparentFrame(nextInFlow, oldParent, this);
|
||||
@ -4563,7 +4562,7 @@ nsBlockFrame::GetOverflowOutOfFlows() const
|
||||
return nullptr;
|
||||
}
|
||||
nsFrameList* result =
|
||||
GetPropTableFrames(PresContext(), OverflowOutOfFlowsProperty());
|
||||
GetPropTableFrames(OverflowOutOfFlowsProperty());
|
||||
NS_ASSERTION(result, "value should always be non-empty when state set");
|
||||
return result;
|
||||
}
|
||||
@ -4580,22 +4579,19 @@ nsBlockFrame::SetOverflowOutOfFlows(const nsFrameList& aList,
|
||||
if (!(GetStateBits() & NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS)) {
|
||||
return;
|
||||
}
|
||||
nsPresContext* pc = PresContext();
|
||||
nsFrameList* list = RemovePropTableFrames(pc, OverflowOutOfFlowsProperty());
|
||||
nsFrameList* list = RemovePropTableFrames(OverflowOutOfFlowsProperty());
|
||||
NS_ASSERTION(aPropValue == list, "prop value mismatch");
|
||||
list->Clear();
|
||||
list->Delete(pc->PresShell());
|
||||
list->Delete(PresContext()->PresShell());
|
||||
RemoveStateBits(NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS);
|
||||
}
|
||||
else if (GetStateBits() & NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS) {
|
||||
NS_ASSERTION(aPropValue == GetPropTableFrames(PresContext(),
|
||||
OverflowOutOfFlowsProperty()),
|
||||
NS_ASSERTION(aPropValue == GetPropTableFrames(OverflowOutOfFlowsProperty()),
|
||||
"prop value mismatch");
|
||||
*aPropValue = aList;
|
||||
}
|
||||
else {
|
||||
nsPresContext* pc = PresContext();
|
||||
SetPropTableFrames(pc, new (pc->PresShell()) nsFrameList(aList),
|
||||
SetPropTableFrames(new (PresContext()->PresShell()) nsFrameList(aList),
|
||||
OverflowOutOfFlowsProperty());
|
||||
AddStateBits(NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS);
|
||||
}
|
||||
@ -5085,7 +5081,7 @@ nsBlockFrame::DoRemoveOutOfFlowFrame(nsIFrame* aFrame)
|
||||
nsIFrame* nif = aFrame->GetNextInFlow();
|
||||
if (nif) {
|
||||
static_cast<nsContainerFrame*>(nif->GetParent())
|
||||
->DeleteNextInFlowChild(aFrame->PresContext(), nif, false);
|
||||
->DeleteNextInFlowChild(nif, false);
|
||||
}
|
||||
// Now remove aFrame from its child list and Destroy it.
|
||||
block->RemoveFloatFromFloatCache(aFrame);
|
||||
@ -5345,7 +5341,6 @@ nsBlockFrame::DoRemoveFrame(nsIFrame* aDeletedFrame, uint32_t aFlags)
|
||||
// Clear our line cursor, since our lines may change.
|
||||
ClearLineCursor();
|
||||
|
||||
nsPresContext* presContext = PresContext();
|
||||
if (aDeletedFrame->GetStateBits() &
|
||||
(NS_FRAME_OUT_OF_FLOW | NS_FRAME_IS_OVERFLOW_CONTAINER)) {
|
||||
if (!aDeletedFrame->GetPrevInFlow()) {
|
||||
@ -5354,7 +5349,7 @@ nsBlockFrame::DoRemoveFrame(nsIFrame* aDeletedFrame, uint32_t aFlags)
|
||||
DoRemoveOutOfFlowFrame(aDeletedFrame);
|
||||
}
|
||||
else {
|
||||
nsContainerFrame::DeleteNextInFlowChild(presContext, aDeletedFrame,
|
||||
nsContainerFrame::DeleteNextInFlowChild(aDeletedFrame,
|
||||
(aFlags & FRAMES_ARE_EMPTY) != 0);
|
||||
}
|
||||
return NS_OK;
|
||||
@ -5464,7 +5459,7 @@ nsBlockFrame::DoRemoveFrame(nsIFrame* aDeletedFrame, uint32_t aFlags)
|
||||
if (deletedNextContinuation &&
|
||||
deletedNextContinuation->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER) {
|
||||
static_cast<nsContainerFrame*>(deletedNextContinuation->GetParent())
|
||||
->DeleteNextInFlowChild(presContext, deletedNextContinuation, false);
|
||||
->DeleteNextInFlowChild(deletedNextContinuation, false);
|
||||
deletedNextContinuation = nullptr;
|
||||
}
|
||||
|
||||
@ -5628,8 +5623,7 @@ FindLineFor(nsIFrame* aChild,
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsBlockFrame::StealFrame(nsPresContext* aPresContext,
|
||||
nsIFrame* aChild,
|
||||
nsBlockFrame::StealFrame(nsIFrame* aChild,
|
||||
bool aForceNormal)
|
||||
{
|
||||
MOZ_ASSERT(aChild->GetParent() == this);
|
||||
@ -5642,7 +5636,7 @@ nsBlockFrame::StealFrame(nsPresContext* aPresContext,
|
||||
|
||||
if ((aChild->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER)
|
||||
&& !aForceNormal) {
|
||||
return nsContainerFrame::StealFrame(aPresContext, aChild);
|
||||
return nsContainerFrame::StealFrame(aChild);
|
||||
}
|
||||
|
||||
MOZ_ASSERT(!(aChild->GetStateBits() & NS_FRAME_OUT_OF_FLOW));
|
||||
@ -5690,16 +5684,14 @@ nsBlockFrame::RemoveFrameFromLine(nsIFrame* aChild, nsLineList::iterator aLine,
|
||||
}
|
||||
|
||||
void
|
||||
nsBlockFrame::DeleteNextInFlowChild(nsPresContext* aPresContext,
|
||||
nsIFrame* aNextInFlow,
|
||||
nsBlockFrame::DeleteNextInFlowChild(nsIFrame* aNextInFlow,
|
||||
bool aDeletingEmptyFrames)
|
||||
{
|
||||
NS_PRECONDITION(aNextInFlow->GetPrevInFlow(), "bad next-in-flow");
|
||||
|
||||
if (aNextInFlow->GetStateBits() &
|
||||
(NS_FRAME_OUT_OF_FLOW | NS_FRAME_IS_OVERFLOW_CONTAINER)) {
|
||||
nsContainerFrame::DeleteNextInFlowChild(aPresContext,
|
||||
aNextInFlow, aDeletingEmptyFrames);
|
||||
nsContainerFrame::DeleteNextInFlowChild(aNextInFlow, aDeletingEmptyFrames);
|
||||
}
|
||||
else {
|
||||
#ifdef DEBUG
|
||||
|
@ -276,12 +276,10 @@ public:
|
||||
*/
|
||||
virtual bool DrainSelfOverflowList() MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult StealFrame(nsPresContext* aPresContext,
|
||||
nsIFrame* aChild,
|
||||
virtual nsresult StealFrame(nsIFrame* aChild,
|
||||
bool aForceNormal = false) MOZ_OVERRIDE;
|
||||
|
||||
virtual void DeleteNextInFlowChild(nsPresContext* aPresContext,
|
||||
nsIFrame* aNextInFlow,
|
||||
virtual void DeleteNextInFlowChild(nsIFrame* aNextInFlow,
|
||||
bool aDeletingEmptyFrames) MOZ_OVERRIDE;
|
||||
|
||||
/**
|
||||
|
@ -296,7 +296,7 @@ nsBlockReflowContext::ReflowBlock(const nsRect& aSpace,
|
||||
// which detaches the placeholder from the float.
|
||||
nsOverflowContinuationTracker::AutoFinish fini(aState.mOverflowTracker, mFrame);
|
||||
static_cast<nsContainerFrame*>(kidNextInFlow->GetParent())
|
||||
->DeleteNextInFlowChild(mPresContext, kidNextInFlow, true);
|
||||
->DeleteNextInFlowChild(kidNextInFlow, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -483,7 +483,7 @@ nsBlockReflowState::AddFloat(nsLineLayout* aLineLayout,
|
||||
// nsBlockFrame::DrainPushedFloats.
|
||||
nsBlockFrame *floatParent =
|
||||
static_cast<nsBlockFrame*>(aFloat->GetParent());
|
||||
floatParent->StealFrame(mPresContext, aFloat);
|
||||
floatParent->StealFrame(aFloat);
|
||||
|
||||
aFloat->RemoveStateBits(NS_FRAME_IS_PUSHED_FLOAT);
|
||||
|
||||
@ -898,7 +898,7 @@ nsBlockReflowState::PushFloatPastBreak(nsIFrame *aFloat)
|
||||
|
||||
// Put the float on the pushed floats list, even though it
|
||||
// isn't actually a continuation.
|
||||
DebugOnly<nsresult> rv = mBlock->StealFrame(mPresContext, aFloat);
|
||||
DebugOnly<nsresult> rv = mBlock->StealFrame(aFloat);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "StealFrame should succeed");
|
||||
AppendPushedFloat(aFloat);
|
||||
|
||||
|
@ -471,8 +471,7 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
||||
if (overflow) {
|
||||
NS_ASSERTION(overflow->OnlyChild(),
|
||||
"must have doc root as canvas frame's only child");
|
||||
nsContainerFrame::ReparentFrameViewList(aPresContext, *overflow,
|
||||
prevCanvasFrame, this);
|
||||
nsContainerFrame::ReparentFrameViewList(*overflow, prevCanvasFrame, this);
|
||||
// Prepend overflow to the our child list. There may already be
|
||||
// children placeholders for fixed-pos elements, which don't get
|
||||
// reflowed but must not be lost until the canvas frame is destroyed.
|
||||
@ -531,7 +530,7 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
|
||||
if (!nextFrame) {
|
||||
nextFrame = aPresContext->PresShell()->FrameConstructor()->
|
||||
CreateContinuingFrame(aPresContext, kidFrame, this);
|
||||
SetOverflowFrames(aPresContext, nsFrameList(nextFrame, nextFrame));
|
||||
SetOverflowFrames(nsFrameList(nextFrame, nextFrame));
|
||||
// Root overflow containers will be normal children of
|
||||
// the canvas frame, but that's ok because there
|
||||
// aren't any other frames we need to isolate them from
|
||||
|
@ -84,17 +84,16 @@ public:
|
||||
*/
|
||||
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
||||
|
||||
virtual nsresult StealFrame(nsPresContext* aPresContext,
|
||||
nsIFrame* aChild,
|
||||
virtual nsresult StealFrame(nsIFrame* aChild,
|
||||
bool aForceNormal) MOZ_OVERRIDE
|
||||
{
|
||||
NS_ASSERTION(!aForceNormal, "No-one should be passing this in here");
|
||||
|
||||
// nsCanvasFrame keeps overflow container continuations of its child
|
||||
// frame in main child list
|
||||
nsresult rv = nsContainerFrame::StealFrame(aPresContext, aChild, true);
|
||||
nsresult rv = nsContainerFrame::StealFrame(aChild, true);
|
||||
if (NS_FAILED(rv)) {
|
||||
rv = nsContainerFrame::StealFrame(aPresContext, aChild);
|
||||
rv = nsContainerFrame::StealFrame(aChild);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
@ -629,7 +629,7 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
||||
"We have to create a continuation, but the block doesn't want us to reflow it?");
|
||||
|
||||
// We need to create a continuing column
|
||||
nsresult rv = CreateNextInFlow(PresContext(), child, kidNextInFlow);
|
||||
nsresult rv = CreateNextInFlow(child, kidNextInFlow);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_NOTREACHED("Couldn't create continuation");
|
||||
@ -670,7 +670,7 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
||||
// next-in-flow will eventually pick them up.
|
||||
const nsFrameList& continuationColumns = mFrames.RemoveFramesAfter(child);
|
||||
if (continuationColumns.NotEmpty()) {
|
||||
SetOverflowFrames(PresContext(), continuationColumns);
|
||||
SetOverflowFrames(continuationColumns);
|
||||
}
|
||||
child = nullptr;
|
||||
break;
|
||||
@ -775,8 +775,7 @@ nsColumnSetFrame::DrainOverflowColumns()
|
||||
if (prev) {
|
||||
AutoFrameListPtr overflows(presContext, prev->StealOverflowFrames());
|
||||
if (overflows) {
|
||||
nsContainerFrame::ReparentFrameViewList(presContext, *overflows,
|
||||
prev, this);
|
||||
nsContainerFrame::ReparentFrameViewList(*overflows, prev, this);
|
||||
|
||||
mFrames.InsertFrames(this, nullptr, *overflows);
|
||||
}
|
||||
|
@ -49,11 +49,10 @@ public:
|
||||
return frame->GetContentInsertionFrame();
|
||||
}
|
||||
|
||||
virtual nsresult StealFrame(nsPresContext* aPresContext,
|
||||
nsIFrame* aChild,
|
||||
virtual nsresult StealFrame(nsIFrame* aChild,
|
||||
bool aForceNormal) MOZ_OVERRIDE
|
||||
{ // nsColumnSetFrame keeps overflow containers in main child list
|
||||
return nsContainerFrame::StealFrame(aPresContext, aChild, true);
|
||||
return nsContainerFrame::StealFrame(aChild, true);
|
||||
}
|
||||
|
||||
virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
|
||||
|
@ -176,7 +176,7 @@ nsContainerFrame::RemoveFrame(ChildListID aListID,
|
||||
generateReflowCommand = false;
|
||||
}
|
||||
#endif
|
||||
nsPresContext* pc = PresContext();
|
||||
nsIPresShell* shell = PresContext()->PresShell();
|
||||
nsContainerFrame* lastParent = nullptr;
|
||||
while (aOldFrame) {
|
||||
//XXXfr probably should use StealFrame here. I'm not sure if we need to
|
||||
@ -186,13 +186,12 @@ nsContainerFrame::RemoveFrame(ChildListID aListID,
|
||||
nsIFrame* oldFrameNextContinuation = aOldFrame->GetNextContinuation();
|
||||
nsContainerFrame* parent =
|
||||
static_cast<nsContainerFrame*>(aOldFrame->GetParent());
|
||||
parent->StealFrame(pc, aOldFrame, true);
|
||||
parent->StealFrame(aOldFrame, true);
|
||||
aOldFrame->Destroy();
|
||||
aOldFrame = oldFrameNextContinuation;
|
||||
if (parent != lastParent && generateReflowCommand) {
|
||||
pc->PresShell()->
|
||||
FrameNeedsReflow(parent, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
shell->FrameNeedsReflow(parent, nsIPresShell::eTreeChange,
|
||||
NS_FRAME_HAS_DIRTY_CHILDREN);
|
||||
lastParent = parent;
|
||||
}
|
||||
}
|
||||
@ -277,13 +276,12 @@ nsContainerFrame::GetChildList(ChildListID aListID) const
|
||||
return list ? *list : nsFrameList::EmptyList();
|
||||
}
|
||||
case kOverflowContainersList: {
|
||||
nsFrameList* list =
|
||||
GetPropTableFrames(PresContext(), OverflowContainersProperty());
|
||||
nsFrameList* list = GetPropTableFrames(OverflowContainersProperty());
|
||||
return list ? *list : nsFrameList::EmptyList();
|
||||
}
|
||||
case kExcessOverflowContainersList: {
|
||||
nsFrameList* list =
|
||||
GetPropTableFrames(PresContext(), ExcessOverflowContainersProperty());
|
||||
GetPropTableFrames(ExcessOverflowContainersProperty());
|
||||
return list ? *list : nsFrameList::EmptyList();
|
||||
}
|
||||
default:
|
||||
@ -506,8 +504,7 @@ nsContainerFrame::PositionFrameView(nsIFrame* aKidFrame)
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsContainerFrame::ReparentFrameView(nsPresContext* aPresContext,
|
||||
nsIFrame* aChildFrame,
|
||||
nsContainerFrame::ReparentFrameView(nsIFrame* aChildFrame,
|
||||
nsIFrame* aOldParentFrame,
|
||||
nsIFrame* aNewParentFrame)
|
||||
{
|
||||
@ -565,8 +562,7 @@ nsContainerFrame::ReparentFrameView(nsPresContext* aPresContext,
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsContainerFrame::ReparentFrameViewList(nsPresContext* aPresContext,
|
||||
const nsFrameList& aChildFrameList,
|
||||
nsContainerFrame::ReparentFrameViewList(const nsFrameList& aChildFrameList,
|
||||
nsIFrame* aOldParentFrame,
|
||||
nsIFrame* aNewParentFrame)
|
||||
{
|
||||
@ -973,7 +969,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||
// parent is not this because we are executing pullup code)
|
||||
nsOverflowContinuationTracker::AutoFinish fini(aTracker, aKidFrame);
|
||||
static_cast<nsContainerFrame*>(kidNextInFlow->GetParent())
|
||||
->DeleteNextInFlowChild(aPresContext, kidNextInFlow, true);
|
||||
->DeleteNextInFlowChild(kidNextInFlow, true);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@ -1080,13 +1076,11 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
nsFrameList* overflowContainers =
|
||||
GetPropTableFrames(aPresContext,
|
||||
OverflowContainersProperty());
|
||||
GetPropTableFrames(OverflowContainersProperty());
|
||||
|
||||
NS_ASSERTION(!(overflowContainers && GetPrevInFlow()
|
||||
&& static_cast<nsContainerFrame*>(GetPrevInFlow())
|
||||
->GetPropTableFrames(aPresContext,
|
||||
ExcessOverflowContainersProperty())),
|
||||
->GetPropTableFrames(ExcessOverflowContainersProperty())),
|
||||
"conflicting overflow containers lists");
|
||||
|
||||
if (!overflowContainers) {
|
||||
@ -1094,15 +1088,12 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
||||
nsContainerFrame* prev = (nsContainerFrame*) GetPrevInFlow();
|
||||
if (prev) {
|
||||
nsFrameList* excessFrames =
|
||||
prev->RemovePropTableFrames(aPresContext,
|
||||
ExcessOverflowContainersProperty());
|
||||
prev->RemovePropTableFrames(ExcessOverflowContainersProperty());
|
||||
if (excessFrames) {
|
||||
excessFrames->ApplySetParent(this);
|
||||
nsContainerFrame::ReparentFrameViewList(aPresContext, *excessFrames,
|
||||
prev, this);
|
||||
nsContainerFrame::ReparentFrameViewList(*excessFrames, prev, this);
|
||||
overflowContainers = excessFrames;
|
||||
SetPropTableFrames(aPresContext, overflowContainers,
|
||||
OverflowContainersProperty());
|
||||
SetPropTableFrames(overflowContainers, OverflowContainersProperty());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1110,22 +1101,21 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
||||
// Our own excess overflow containers from a previous reflow can still be
|
||||
// present if our next-in-flow hasn't been reflown yet.
|
||||
nsFrameList* selfExcessOCFrames =
|
||||
RemovePropTableFrames(aPresContext, ExcessOverflowContainersProperty());
|
||||
RemovePropTableFrames(ExcessOverflowContainersProperty());
|
||||
if (selfExcessOCFrames) {
|
||||
if (overflowContainers) {
|
||||
overflowContainers->AppendFrames(nullptr, *selfExcessOCFrames);
|
||||
selfExcessOCFrames->Delete(aPresContext->PresShell());
|
||||
} else {
|
||||
overflowContainers = selfExcessOCFrames;
|
||||
SetPropTableFrames(aPresContext, overflowContainers,
|
||||
OverflowContainersProperty());
|
||||
SetPropTableFrames(overflowContainers, OverflowContainersProperty());
|
||||
}
|
||||
}
|
||||
if (!overflowContainers) {
|
||||
return NS_OK; // nothing to reflow
|
||||
}
|
||||
|
||||
nsOverflowContinuationTracker tracker(aPresContext, this, false, false);
|
||||
nsOverflowContinuationTracker tracker(this, false, false);
|
||||
bool shouldReflowAllKids = aReflowState.ShouldReflowAllKids();
|
||||
|
||||
for (nsIFrame* frame = overflowContainers->FirstChild(); frame;
|
||||
@ -1186,7 +1176,7 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
||||
else if (!(nif->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER)) {
|
||||
// used to be a normal next-in-flow; steal it from the child list
|
||||
rv = static_cast<nsContainerFrame*>(nif->GetParent())
|
||||
->StealFrame(aPresContext, nif);
|
||||
->StealFrame(nif);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
@ -1213,8 +1203,7 @@ nsContainerFrame::DisplayOverflowContainers(nsDisplayListBuilder* aBuilder,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists)
|
||||
{
|
||||
nsFrameList* overflowconts =
|
||||
GetPropTableFrames(PresContext(), OverflowContainersProperty());
|
||||
nsFrameList* overflowconts = GetPropTableFrames(OverflowContainersProperty());
|
||||
if (overflowconts) {
|
||||
for (nsIFrame* frame = overflowconts->FirstChild(); frame;
|
||||
frame = frame->GetNextSibling()) {
|
||||
@ -1240,15 +1229,14 @@ TryRemoveFrame(nsIFrame* aFrame, FramePropertyTable* aPropTable,
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsContainerFrame::StealFrame(nsPresContext* aPresContext,
|
||||
nsIFrame* aChild,
|
||||
nsContainerFrame::StealFrame(nsIFrame* aChild,
|
||||
bool aForceNormal)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
if (!mFrames.ContainsFrame(aChild)) {
|
||||
nsFrameList* list = GetOverflowFrames();
|
||||
if (!list || !list->ContainsFrame(aChild)) {
|
||||
FramePropertyTable* propTable = aPresContext->PropertyTable();
|
||||
FramePropertyTable* propTable = PresContext()->PropertyTable();
|
||||
list = static_cast<nsFrameList*>(
|
||||
propTable->Get(this, OverflowContainersProperty()));
|
||||
if (!list || !list->ContainsFrame(aChild)) {
|
||||
@ -1264,7 +1252,7 @@ nsContainerFrame::StealFrame(nsPresContext* aPresContext,
|
||||
bool removed;
|
||||
if ((aChild->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER)
|
||||
&& !aForceNormal) {
|
||||
FramePropertyTable* propTable = aPresContext->PropertyTable();
|
||||
FramePropertyTable* propTable = PresContext()->PropertyTable();
|
||||
// Try removing from the overflow container list.
|
||||
removed = ::TryRemoveFrame(this, propTable, OverflowContainersProperty(),
|
||||
aChild);
|
||||
@ -1283,7 +1271,7 @@ nsContainerFrame::StealFrame(nsPresContext* aPresContext,
|
||||
if (frameList) {
|
||||
removed = frameList->ContinueRemoveFrame(aChild);
|
||||
if (frameList->IsEmpty()) {
|
||||
DestroyOverflowList(aPresContext);
|
||||
DestroyOverflowList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1336,22 +1324,22 @@ nsContainerFrame::StealFramesAfter(nsIFrame* aChild)
|
||||
* created; otherwise nullptr is returned in aNextInFlowResult.
|
||||
*/
|
||||
nsresult
|
||||
nsContainerFrame::CreateNextInFlow(nsPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsContainerFrame::CreateNextInFlow(nsIFrame* aFrame,
|
||||
nsIFrame*& aNextInFlowResult)
|
||||
{
|
||||
NS_PRECONDITION(GetType() != nsGkAtoms::blockFrame,
|
||||
"you should have called nsBlockFrame::CreateContinuationFor instead");
|
||||
NS_PRECONDITION(mFrames.ContainsFrame(aFrame), "expected an in-flow child frame");
|
||||
|
||||
nsPresContext* pc = PresContext();
|
||||
aNextInFlowResult = nullptr;
|
||||
|
||||
nsIFrame* nextInFlow = aFrame->GetNextInFlow();
|
||||
if (nullptr == nextInFlow) {
|
||||
// Create a continuation frame for the child frame and insert it
|
||||
// into our child list.
|
||||
nextInFlow = aPresContext->PresShell()->FrameConstructor()->
|
||||
CreateContinuingFrame(aPresContext, aFrame, this);
|
||||
nextInFlow = pc->PresShell()->FrameConstructor()->
|
||||
CreateContinuingFrame(pc, aFrame, this);
|
||||
mFrames.InsertFrame(nullptr, aFrame, nextInFlow);
|
||||
|
||||
NS_FRAME_LOG(NS_FRAME_TRACE_NEW_FRAMES,
|
||||
@ -1368,8 +1356,7 @@ nsContainerFrame::CreateNextInFlow(nsPresContext* aPresContext,
|
||||
* pointers
|
||||
*/
|
||||
void
|
||||
nsContainerFrame::DeleteNextInFlowChild(nsPresContext* aPresContext,
|
||||
nsIFrame* aNextInFlow,
|
||||
nsContainerFrame::DeleteNextInFlowChild(nsIFrame* aNextInFlow,
|
||||
bool aDeletingEmptyFrames)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
@ -1390,12 +1377,12 @@ nsContainerFrame::DeleteNextInFlowChild(nsPresContext* aPresContext,
|
||||
for (int32_t i = frames.Length() - 1; i >= 0; --i) {
|
||||
nsIFrame* delFrame = frames.ElementAt(i);
|
||||
static_cast<nsContainerFrame*>(delFrame->GetParent())
|
||||
->DeleteNextInFlowChild(aPresContext, delFrame, aDeletingEmptyFrames);
|
||||
->DeleteNextInFlowChild(delFrame, aDeletingEmptyFrames);
|
||||
}
|
||||
}
|
||||
|
||||
// Take the next-in-flow out of the parent's child list
|
||||
DebugOnly<nsresult> rv = StealFrame(aPresContext, aNextInFlow);
|
||||
DebugOnly<nsresult> rv = StealFrame(aNextInFlow);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "StealFrame failure");
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -1415,44 +1402,42 @@ nsContainerFrame::DeleteNextInFlowChild(nsPresContext* aPresContext,
|
||||
* Set the frames on the overflow list
|
||||
*/
|
||||
void
|
||||
nsContainerFrame::SetOverflowFrames(nsPresContext* aPresContext,
|
||||
const nsFrameList& aOverflowFrames)
|
||||
nsContainerFrame::SetOverflowFrames(const nsFrameList& aOverflowFrames)
|
||||
{
|
||||
NS_PRECONDITION(aOverflowFrames.NotEmpty(), "Shouldn't be called");
|
||||
nsFrameList* newList = new (aPresContext->PresShell()) nsFrameList(aOverflowFrames);
|
||||
|
||||
aPresContext->PropertyTable()->Set(this, OverflowProperty(), newList);
|
||||
nsPresContext* pc = PresContext();
|
||||
nsFrameList* newList = new (pc->PresShell()) nsFrameList(aOverflowFrames);
|
||||
|
||||
pc->PropertyTable()->Set(this, OverflowProperty(), newList);
|
||||
}
|
||||
|
||||
nsFrameList*
|
||||
nsContainerFrame::GetPropTableFrames(nsPresContext* aPresContext,
|
||||
const FramePropertyDescriptor* aProperty) const
|
||||
nsContainerFrame::GetPropTableFrames(const FramePropertyDescriptor* aProperty) const
|
||||
{
|
||||
FramePropertyTable* propTable = aPresContext->PropertyTable();
|
||||
FramePropertyTable* propTable = PresContext()->PropertyTable();
|
||||
return static_cast<nsFrameList*>(propTable->Get(this, aProperty));
|
||||
}
|
||||
|
||||
nsFrameList*
|
||||
nsContainerFrame::RemovePropTableFrames(nsPresContext* aPresContext,
|
||||
const FramePropertyDescriptor* aProperty)
|
||||
nsContainerFrame::RemovePropTableFrames(const FramePropertyDescriptor* aProperty)
|
||||
{
|
||||
FramePropertyTable* propTable = aPresContext->PropertyTable();
|
||||
FramePropertyTable* propTable = PresContext()->PropertyTable();
|
||||
return static_cast<nsFrameList*>(propTable->Remove(this, aProperty));
|
||||
}
|
||||
|
||||
void
|
||||
nsContainerFrame::SetPropTableFrames(nsPresContext* aPresContext,
|
||||
nsFrameList* aFrameList,
|
||||
nsContainerFrame::SetPropTableFrames(nsFrameList* aFrameList,
|
||||
const FramePropertyDescriptor* aProperty)
|
||||
{
|
||||
NS_PRECONDITION(aPresContext && aProperty && aFrameList, "null ptr");
|
||||
NS_PRECONDITION(aProperty && aFrameList, "null ptr");
|
||||
NS_PRECONDITION(
|
||||
(aProperty != nsContainerFrame::OverflowContainersProperty() &&
|
||||
aProperty != nsContainerFrame::ExcessOverflowContainersProperty()) ||
|
||||
IsFrameOfType(nsIFrame::eCanContainOverflowContainers),
|
||||
"this type of frame can't have overflow containers");
|
||||
MOZ_ASSERT(!GetPropTableFrames(aPresContext, aProperty));
|
||||
aPresContext->PropertyTable()->Set(this, aProperty, aFrameList);
|
||||
MOZ_ASSERT(!GetPropTableFrames(aProperty));
|
||||
PresContext()->PropertyTable()->Set(this, aProperty, aFrameList);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1470,8 +1455,7 @@ nsContainerFrame::SetPropTableFrames(nsPresContext* aPresContext
|
||||
* an error to push a parent's first child frame
|
||||
*/
|
||||
void
|
||||
nsContainerFrame::PushChildren(nsPresContext* aPresContext,
|
||||
nsIFrame* aFromChild,
|
||||
nsContainerFrame::PushChildren(nsIFrame* aFromChild,
|
||||
nsIFrame* aPrevSibling)
|
||||
{
|
||||
NS_PRECONDITION(aFromChild, "null pointer");
|
||||
@ -1490,13 +1474,13 @@ nsContainerFrame::PushChildren(nsPresContext* aPresContext,
|
||||
// When pushing and pulling frames we need to check for whether any
|
||||
// views need to be reparented.
|
||||
for (nsIFrame* f = aFromChild; f; f = f->GetNextSibling()) {
|
||||
nsContainerFrame::ReparentFrameView(aPresContext, f, this, nextInFlow);
|
||||
nsContainerFrame::ReparentFrameView(f, this, nextInFlow);
|
||||
}
|
||||
nextInFlow->mFrames.InsertFrames(nextInFlow, nullptr, tail);
|
||||
}
|
||||
else {
|
||||
// Add the frames to our overflow list
|
||||
SetOverflowFrames(aPresContext, tail);
|
||||
SetOverflowFrames(tail);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1509,14 +1493,14 @@ nsContainerFrame::PushChildren(nsPresContext* aPresContext,
|
||||
* @return true if any frames were moved and false otherwise
|
||||
*/
|
||||
bool
|
||||
nsContainerFrame::MoveOverflowToChildList(nsPresContext* aPresContext)
|
||||
nsContainerFrame::MoveOverflowToChildList()
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
// Check for an overflow list with our prev-in-flow
|
||||
nsContainerFrame* prevInFlow = (nsContainerFrame*)GetPrevInFlow();
|
||||
if (nullptr != prevInFlow) {
|
||||
AutoFrameListPtr prevOverflowFrames(aPresContext,
|
||||
AutoFrameListPtr prevOverflowFrames(PresContext(),
|
||||
prevInFlow->StealOverflowFrames());
|
||||
if (prevOverflowFrames) {
|
||||
// Tables are special; they can have repeated header/footer
|
||||
@ -1525,8 +1509,7 @@ nsContainerFrame::MoveOverflowToChildList(nsPresContext* aPresContext)
|
||||
"bad overflow list");
|
||||
// When pushing and pulling frames we need to check for whether any
|
||||
// views need to be reparented.
|
||||
nsContainerFrame::ReparentFrameViewList(aPresContext,
|
||||
*prevOverflowFrames,
|
||||
nsContainerFrame::ReparentFrameViewList(*prevOverflowFrames,
|
||||
prevInFlow, this);
|
||||
mFrames.AppendFrames(this, *prevOverflowFrames);
|
||||
result = true;
|
||||
@ -1549,8 +1532,7 @@ nsContainerFrame::DrainSelfOverflowList()
|
||||
return false;
|
||||
}
|
||||
|
||||
nsOverflowContinuationTracker::nsOverflowContinuationTracker(nsPresContext* aPresContext,
|
||||
nsContainerFrame* aFrame,
|
||||
nsOverflowContinuationTracker::nsOverflowContinuationTracker(nsContainerFrame* aFrame,
|
||||
bool aWalkOOFFrames,
|
||||
bool aSkipOverflowContainerChildren)
|
||||
: mOverflowContList(nullptr),
|
||||
@ -1569,11 +1551,10 @@ nsOverflowContinuationTracker::SetupOverflowContList()
|
||||
{
|
||||
NS_PRECONDITION(mParent, "null frame pointer");
|
||||
NS_PRECONDITION(!mOverflowContList, "already have list");
|
||||
nsPresContext* pc = mParent->PresContext();
|
||||
nsContainerFrame* nif =
|
||||
static_cast<nsContainerFrame*>(mParent->GetNextInFlow());
|
||||
if (nif) {
|
||||
mOverflowContList = nif->GetPropTableFrames(pc,
|
||||
mOverflowContList = nif->GetPropTableFrames(
|
||||
nsContainerFrame::OverflowContainersProperty());
|
||||
if (mOverflowContList) {
|
||||
mParent = nif;
|
||||
@ -1581,7 +1562,7 @@ nsOverflowContinuationTracker::SetupOverflowContList()
|
||||
}
|
||||
}
|
||||
if (!mOverflowContList) {
|
||||
mOverflowContList = mParent->GetPropTableFrames(pc,
|
||||
mOverflowContList = mParent->GetPropTableFrames(
|
||||
nsContainerFrame::ExcessOverflowContainersProperty());
|
||||
if (mOverflowContList) {
|
||||
SetUpListWalker();
|
||||
@ -1685,7 +1666,7 @@ nsOverflowContinuationTracker::Insert(nsIFrame* aOverflowCont,
|
||||
mOverflowContList->ContainsFrame(aOverflowCont)),
|
||||
"overflow containers out of order");
|
||||
rv = static_cast<nsContainerFrame*>(aOverflowCont->GetParent())
|
||||
->StealFrame(presContext, aOverflowCont);
|
||||
->StealFrame(aOverflowCont);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
else {
|
||||
@ -1693,12 +1674,12 @@ nsOverflowContinuationTracker::Insert(nsIFrame* aOverflowCont,
|
||||
}
|
||||
if (!mOverflowContList) {
|
||||
mOverflowContList = new (presContext->PresShell()) nsFrameList();
|
||||
mParent->SetPropTableFrames(presContext, mOverflowContList,
|
||||
mParent->SetPropTableFrames(mOverflowContList,
|
||||
nsContainerFrame::ExcessOverflowContainersProperty());
|
||||
SetUpListWalker();
|
||||
}
|
||||
if (aOverflowCont->GetParent() != mParent) {
|
||||
nsContainerFrame::ReparentFrameView(presContext, aOverflowCont,
|
||||
nsContainerFrame::ReparentFrameView(aOverflowCont,
|
||||
aOverflowCont->GetParent(),
|
||||
mParent);
|
||||
reparented = true;
|
||||
@ -1751,7 +1732,7 @@ nsOverflowContinuationTracker::Insert(nsIFrame* aOverflowCont,
|
||||
(reparented && f->GetParent() != mParent))) {
|
||||
if (!(f->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER)) {
|
||||
nsContainerFrame* parent = static_cast<nsContainerFrame*>(f->GetParent());
|
||||
rv = parent->StealFrame(presContext, f);
|
||||
rv = parent->StealFrame(f);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
Insert(f, aReflowStatus);
|
||||
|
@ -94,8 +94,7 @@ public:
|
||||
* exists aNextInFlowResult is set to nullptr.
|
||||
* @return NS_OK if a next-in-flow already exists or is successfully created.
|
||||
*/
|
||||
nsresult CreateNextInFlow(nsPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
nsresult CreateNextInFlow(nsIFrame* aFrame,
|
||||
nsIFrame*& aNextInFlowResult);
|
||||
|
||||
/**
|
||||
@ -104,8 +103,7 @@ public:
|
||||
* content was complete before aNextInFlow, so aNextInFlow and its
|
||||
* next-in-flows no longer map any real content.
|
||||
*/
|
||||
virtual void DeleteNextInFlowChild(nsPresContext* aPresContext,
|
||||
nsIFrame* aNextInFlow,
|
||||
virtual void DeleteNextInFlowChild(nsIFrame* aNextInFlow,
|
||||
bool aDeletingEmptyFrames);
|
||||
|
||||
/**
|
||||
@ -118,13 +116,11 @@ public:
|
||||
// Positions the frame's view based on the frame's origin
|
||||
static void PositionFrameView(nsIFrame* aKidFrame);
|
||||
|
||||
static nsresult ReparentFrameView(nsPresContext* aPresContext,
|
||||
nsIFrame* aChildFrame,
|
||||
static nsresult ReparentFrameView(nsIFrame* aChildFrame,
|
||||
nsIFrame* aOldParentFrame,
|
||||
nsIFrame* aNewParentFrame);
|
||||
|
||||
static nsresult ReparentFrameViewList(nsPresContext* aPresContext,
|
||||
const nsFrameList& aChildFrameList,
|
||||
static nsresult ReparentFrameViewList(const nsFrameList& aChildFrameList,
|
||||
nsIFrame* aOldParentFrame,
|
||||
nsIFrame* aNewParentFrame);
|
||||
|
||||
@ -322,8 +318,7 @@ public:
|
||||
* If aForceNormal is true, only checks the primary and overflow lists
|
||||
* even when the NS_FRAME_IS_OVERFLOW_CONTAINER flag is set.
|
||||
*/
|
||||
virtual nsresult StealFrame(nsPresContext* aPresContext,
|
||||
nsIFrame* aChild,
|
||||
virtual nsresult StealFrame(nsIFrame* aChild,
|
||||
bool aForceNormal = false);
|
||||
|
||||
/**
|
||||
@ -448,13 +443,12 @@ protected:
|
||||
/**
|
||||
* Set the overflow list. aOverflowFrames must not be an empty list.
|
||||
*/
|
||||
void SetOverflowFrames(nsPresContext* aPresContext,
|
||||
const nsFrameList& aOverflowFrames);
|
||||
void SetOverflowFrames(const nsFrameList& aOverflowFrames);
|
||||
|
||||
/**
|
||||
* Destroy the overflow list, which must be empty.
|
||||
*/
|
||||
inline void DestroyOverflowList(nsPresContext* aPresContext);
|
||||
inline void DestroyOverflowList();
|
||||
|
||||
/**
|
||||
* Moves any frames on both the prev-in-flow's overflow list and the
|
||||
@ -465,7 +459,7 @@ protected:
|
||||
*
|
||||
* @return true if any frames were moved and false otherwise
|
||||
*/
|
||||
bool MoveOverflowToChildList(nsPresContext* aPresContext);
|
||||
bool MoveOverflowToChildList();
|
||||
|
||||
/**
|
||||
* Push aFromChild and its next siblings to the next-in-flow. Change
|
||||
@ -481,8 +475,7 @@ protected:
|
||||
* @param aPrevSibling aFromChild's previous sibling. Must not be null.
|
||||
* It's an error to push a parent's first child frame
|
||||
*/
|
||||
void PushChildren(nsPresContext* aPresContext,
|
||||
nsIFrame* aFromChild,
|
||||
void PushChildren(nsIFrame* aFromChild,
|
||||
nsIFrame* aPrevSibling);
|
||||
|
||||
// ==========================================================================
|
||||
@ -495,22 +488,19 @@ protected:
|
||||
* Get the PresContext-stored nsFrameList named aPropID for this frame.
|
||||
* May return null.
|
||||
*/
|
||||
nsFrameList* GetPropTableFrames(nsPresContext* aPresContext,
|
||||
const FramePropertyDescriptor* aProperty) const;
|
||||
nsFrameList* GetPropTableFrames(const FramePropertyDescriptor* aProperty) const;
|
||||
|
||||
/**
|
||||
* Remove and return the PresContext-stored nsFrameList named aPropID for
|
||||
* this frame. May return null.
|
||||
*/
|
||||
nsFrameList* RemovePropTableFrames(nsPresContext* aPresContext,
|
||||
const FramePropertyDescriptor* aProperty);
|
||||
nsFrameList* RemovePropTableFrames(const FramePropertyDescriptor* aProperty);
|
||||
|
||||
/**
|
||||
* Set the PresContext-stored nsFrameList named aPropID for this frame
|
||||
* to the given aFrameList, which must not be null.
|
||||
*/
|
||||
void SetPropTableFrames(nsPresContext* aPresContext,
|
||||
nsFrameList* aFrameList,
|
||||
void SetPropTableFrames(nsFrameList* aFrameList,
|
||||
const FramePropertyDescriptor* aProperty);
|
||||
|
||||
/**
|
||||
@ -582,8 +572,7 @@ public:
|
||||
* by calling ReflowOverflowContainerChildren.) aWalkOOFFrames is ignored
|
||||
* if aSkipOverflowContainerChildren is false.
|
||||
*/
|
||||
nsOverflowContinuationTracker(nsPresContext* aPresContext,
|
||||
nsContainerFrame* aFrame,
|
||||
nsOverflowContinuationTracker(nsContainerFrame* aFrame,
|
||||
bool aWalkOOFFrames,
|
||||
bool aSkipOverflowContainerChildren = true);
|
||||
/**
|
||||
@ -714,11 +703,11 @@ nsContainerFrame::StealOverflowFrames()
|
||||
}
|
||||
|
||||
inline void
|
||||
nsContainerFrame::DestroyOverflowList(nsPresContext* aPresContext)
|
||||
nsContainerFrame::DestroyOverflowList()
|
||||
{
|
||||
nsFrameList* list = RemovePropTableFrames(aPresContext, OverflowProperty());
|
||||
nsFrameList* list = RemovePropTableFrames(OverflowProperty());
|
||||
MOZ_ASSERT(list && list->IsEmpty());
|
||||
list->Delete(aPresContext->PresShell());
|
||||
list->Delete(PresContext()->PresShell());
|
||||
}
|
||||
|
||||
#endif /* nsContainerFrame_h___ */
|
||||
|
@ -256,7 +256,7 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
|
||||
if (kidNextInFlow) {
|
||||
// Remove all of the childs next-in-flows
|
||||
static_cast<nsContainerFrame*>(kidNextInFlow->GetParent())
|
||||
->DeleteNextInFlowChild(aPresContext, kidNextInFlow, true);
|
||||
->DeleteNextInFlowChild(kidNextInFlow, true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -264,7 +264,7 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
|
||||
// have one.
|
||||
if (!IsFloating()) {
|
||||
nsIFrame* nextInFlow;
|
||||
rv = CreateNextInFlow(aPresContext, kid, nextInFlow);
|
||||
rv = CreateNextInFlow(kid, nextInFlow);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
@ -272,7 +272,7 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
|
||||
// And then push it to our overflow list
|
||||
const nsFrameList& overflow = mFrames.RemoveFramesAfter(kid);
|
||||
if (overflow.NotEmpty()) {
|
||||
SetOverflowFrames(aPresContext, overflow);
|
||||
SetOverflowFrames(overflow);
|
||||
}
|
||||
} else if (!kid->GetNextInFlow()) {
|
||||
// For floating first letter frames (if a continuation wasn't already
|
||||
@ -353,8 +353,8 @@ nsFirstLetterFrame::DrainOverflowFrames(nsPresContext* aPresContext)
|
||||
|
||||
// When pushing and pulling frames we need to check for whether any
|
||||
// views need to be reparented.
|
||||
nsContainerFrame::ReparentFrameViewList(aPresContext, *overflowFrames,
|
||||
prevInFlow, this);
|
||||
nsContainerFrame::ReparentFrameViewList(*overflowFrames, prevInFlow,
|
||||
this);
|
||||
mFrames.InsertFrames(this, nullptr, *overflowFrames);
|
||||
}
|
||||
}
|
||||
|
@ -316,9 +316,8 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext,
|
||||
if (prevOverflowFrames) {
|
||||
// When pushing and pulling frames we need to check for whether any
|
||||
// views need to be reparented.
|
||||
nsContainerFrame::ReparentFrameViewList(aPresContext,
|
||||
*prevOverflowFrames,
|
||||
prevInFlow, this);
|
||||
nsContainerFrame::ReparentFrameViewList(*prevOverflowFrames, prevInFlow,
|
||||
this);
|
||||
|
||||
// Check if we should do the lazilySetParentPointer optimization.
|
||||
// Only do it in simple cases where we're being reflowed for the
|
||||
@ -468,9 +467,8 @@ nsInlineFrame::PullOverflowsFromPrevInFlow()
|
||||
prevInFlow->StealOverflowFrames());
|
||||
if (prevOverflowFrames) {
|
||||
// Assume that our prev-in-flow has the same line container that we do.
|
||||
nsContainerFrame::ReparentFrameViewList(presContext,
|
||||
*prevOverflowFrames,
|
||||
prevInFlow, this);
|
||||
nsContainerFrame::ReparentFrameViewList(*prevOverflowFrames, prevInFlow,
|
||||
this);
|
||||
mFrames.InsertFrames(this, nullptr, *prevOverflowFrames);
|
||||
}
|
||||
}
|
||||
@ -750,7 +748,7 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext,
|
||||
// Create a next-in-flow if needed.
|
||||
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
|
||||
nsIFrame* newFrame;
|
||||
rv = CreateNextInFlow(aPresContext, aFrame, newFrame);
|
||||
rv = CreateNextInFlow(aFrame, newFrame);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
@ -804,7 +802,7 @@ nsInlineFrame::PullOneFrame(nsPresContext* aPresContext,
|
||||
frame = overflowFrames->RemoveFirstChild();
|
||||
if (overflowFrames->IsEmpty()) {
|
||||
// We're stealing the only frame - delete the overflow list.
|
||||
nextInFlow->DestroyOverflowList(aPresContext);
|
||||
nextInFlow->DestroyOverflowList();
|
||||
} else {
|
||||
// We leave the remaining frames on the overflow list (rather than
|
||||
// putting them on nextInFlow's principal list) so we don't have to
|
||||
@ -834,7 +832,7 @@ nsInlineFrame::PullOneFrame(nsPresContext* aPresContext,
|
||||
if (irs.mLineLayout) {
|
||||
irs.mLineLayout->SetDirtyNextLine();
|
||||
}
|
||||
nsContainerFrame::ReparentFrameView(aPresContext, frame, nextInFlow, this);
|
||||
nsContainerFrame::ReparentFrameView(frame, nextInFlow, this);
|
||||
break;
|
||||
}
|
||||
nextInFlow = static_cast<nsInlineFrame*>(nextInFlow->GetNextInFlow());
|
||||
@ -862,7 +860,7 @@ nsInlineFrame::PushFrames(nsPresContext* aPresContext,
|
||||
|
||||
// Add the frames to our overflow list (let our next in flow drain
|
||||
// our overflow list when it is ready)
|
||||
SetOverflowFrames(aPresContext, mFrames.RemoveFramesAfter(aPrevSibling));
|
||||
SetOverflowFrames(mFrames.RemoveFramesAfter(aPrevSibling));
|
||||
if (aState.mLineLayout) {
|
||||
aState.mLineLayout->SetDirtyNextLine();
|
||||
}
|
||||
|
@ -970,7 +970,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
||||
// parent is not this because we are executing pullup code)
|
||||
nsContainerFrame* parent = static_cast<nsContainerFrame*>
|
||||
(kidNextInFlow->GetParent());
|
||||
parent->DeleteNextInFlowChild(mPresContext, kidNextInFlow, true);
|
||||
parent->DeleteNextInFlowChild(kidNextInFlow, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1705,7 +1705,7 @@ NS_METHOD nsTableFrame::Reflow(nsPresContext* aPresContext,
|
||||
aDesiredSize.Width() = aReflowState.AvailableWidth();
|
||||
|
||||
// Check for an overflow list, and append any row group frames being pushed
|
||||
MoveOverflowToChildList(aPresContext);
|
||||
MoveOverflowToChildList();
|
||||
|
||||
bool haveDesiredHeight = false;
|
||||
SetHaveReflowedColGroups(false);
|
||||
@ -1949,13 +1949,13 @@ nsTableFrame::PushChildren(const RowGroupArray& aRowGroups,
|
||||
}
|
||||
// When pushing and pulling frames we need to check for whether any
|
||||
// views need to be reparented.
|
||||
ReparentFrameViewList(PresContext(), frames, this, nextInFlow);
|
||||
ReparentFrameViewList(frames, this, nextInFlow);
|
||||
nextInFlow->mFrames.InsertFrames(nextInFlow, prevSibling,
|
||||
frames);
|
||||
}
|
||||
else {
|
||||
// Add the frames to our overflow list.
|
||||
SetOverflowFrames(PresContext(), frames);
|
||||
SetOverflowFrames(frames);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -897,7 +897,7 @@ NS_METHOD nsTableOuterFrame::Reflow(nsPresContext* aPresContext,
|
||||
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||
// Set up our kids. They're already present, on an overflow list,
|
||||
// or there are none so we'll create them now
|
||||
MoveOverflowToChildList(aPresContext);
|
||||
MoveOverflowToChildList();
|
||||
}
|
||||
|
||||
// Use longs to get more-aligned space.
|
||||
|
@ -881,7 +881,7 @@ nsTableRowGroupFrame::CreateContinuingRowFrame(nsPresContext& aPresContext,
|
||||
mFrames.InsertFrame(nullptr, &aRowFrame, *aContRowFrame);
|
||||
|
||||
// Push the continuing row frame and the frames that follow
|
||||
PushChildren(&aPresContext, *aContRowFrame, &aRowFrame);
|
||||
PushChildren(*aContRowFrame, &aRowFrame);
|
||||
}
|
||||
|
||||
// Reflow the cells with rowspan > 1 which originate between aFirstRow
|
||||
@ -1243,7 +1243,7 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
|
||||
if (NS_FRAME_IS_NOT_COMPLETE(aStatus) && !contRow) {
|
||||
nsTableRowFrame* nextRow = lastRowThisPage->GetNextRow();
|
||||
if (nextRow) {
|
||||
PushChildren(aPresContext, nextRow, lastRowThisPage);
|
||||
PushChildren(nextRow, lastRowThisPage);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1254,7 +1254,7 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
|
||||
// see if there is a page break after the row
|
||||
nsTableRowFrame* nextRow = rowFrame->GetNextRow();
|
||||
if (nextRow && nsTableFrame::PageBreakAfter(rowFrame, nextRow)) {
|
||||
PushChildren(aPresContext, nextRow, rowFrame);
|
||||
PushChildren(nextRow, rowFrame);
|
||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
break;
|
||||
}
|
||||
@ -1297,7 +1297,7 @@ nsTableRowGroupFrame::Reflow(nsPresContext* aPresContext,
|
||||
}
|
||||
|
||||
// Check for an overflow list
|
||||
MoveOverflowToChildList(aPresContext);
|
||||
MoveOverflowToChildList();
|
||||
|
||||
// Reflow the existing frames.
|
||||
bool splitDueToPageBreak = false;
|
||||
|
Loading…
Reference in New Issue
Block a user