Bug 1622008 Part 3 - Remove nsPresContext* and PresShell* from the argument list of some continuing-frame-creation methods. r=dholbert

Both PresShell() and PresContext() are cached in nsIFrame. This
simplifies the setup for the callers to
nsCSSFrameConstructor::CreateContinuingFrame().

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ting-Yu Lin 2020-03-12 21:50:23 +00:00
Родитель fede1a91ef
Коммит afe9123179
16 изменённых файлов: 56 добавлений и 84 удалений

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

@ -611,8 +611,7 @@ static bool IsBidiLeaf(nsIFrame* aFrame) {
*/ */
static void SplitInlineAncestors(nsContainerFrame* aParent, static void SplitInlineAncestors(nsContainerFrame* aParent,
nsLineList::iterator aLine, nsIFrame* aFrame) { nsLineList::iterator aLine, nsIFrame* aFrame) {
nsPresContext* presContext = aParent->PresContext(); PresShell* presShell = aParent->PresShell();
PresShell* presShell = presContext->PresShell();
nsIFrame* frame = aFrame; nsIFrame* frame = aFrame;
nsContainerFrame* parent = aParent; nsContainerFrame* parent = aParent;
nsContainerFrame* newParent; nsContainerFrame* newParent;
@ -627,7 +626,7 @@ static void SplitInlineAncestors(nsContainerFrame* aParent,
if (!frame || frame->GetNextSibling()) { if (!frame || frame->GetNextSibling()) {
newParent = static_cast<nsContainerFrame*>( newParent = static_cast<nsContainerFrame*>(
presShell->FrameConstructor()->CreateContinuingFrame( presShell->FrameConstructor()->CreateContinuingFrame(
presContext, parent, grandparent, false)); parent, grandparent, false));
nsFrameList tail = parent->StealFramesAfter(frame); nsFrameList tail = parent->StealFramesAfter(frame);
@ -740,13 +739,13 @@ static void CreateContinuation(nsIFrame* aFrame,
// of the text that the first letter frame was made out of. // of the text that the first letter frame was made out of.
if (parent->IsLetterFrame() && parent->IsFloating()) { if (parent->IsLetterFrame() && parent->IsFloating()) {
nsFirstLetterFrame* letterFrame = do_QueryFrame(parent); nsFirstLetterFrame* letterFrame = do_QueryFrame(parent);
letterFrame->CreateContinuationForFloatingParent(presContext, aFrame, letterFrame->CreateContinuationForFloatingParent(aFrame, aNewFrame,
aNewFrame, aIsFluid); aIsFluid);
return; return;
} }
*aNewFrame = presShell->FrameConstructor()->CreateContinuingFrame( *aNewFrame = presShell->FrameConstructor()->CreateContinuingFrame(
presContext, aFrame, parent, aIsFluid); aFrame, parent, aIsFluid);
// The list name kNoReflowPrincipalList would indicate we don't want reflow // The list name kNoReflowPrincipalList would indicate we don't want reflow
// XXXbz this needs higher-level framelist love // XXXbz this needs higher-level framelist love

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

@ -7832,8 +7832,7 @@ void nsCSSFrameConstructor::GetAlternateTextFor(Element* aElement, nsAtom* aTag,
} }
nsIFrame* nsCSSFrameConstructor::CreateContinuingOuterTableFrame( nsIFrame* nsCSSFrameConstructor::CreateContinuingOuterTableFrame(
PresShell* aPresShell, nsPresContext* aPresContext, nsIFrame* aFrame, nsIFrame* aFrame, nsContainerFrame* aParentFrame, nsIContent* aContent,
nsContainerFrame* aParentFrame, nsIContent* aContent,
ComputedStyle* aComputedStyle) { ComputedStyle* aComputedStyle) {
nsTableWrapperFrame* newFrame = nsTableWrapperFrame* newFrame =
NS_NewTableWrapperFrame(mPresShell, aComputedStyle); NS_NewTableWrapperFrame(mPresShell, aComputedStyle);
@ -7847,7 +7846,7 @@ nsIFrame* nsCSSFrameConstructor::CreateContinuingOuterTableFrame(
nsIFrame* childFrame = aFrame->PrincipalChildList().FirstChild(); nsIFrame* childFrame = aFrame->PrincipalChildList().FirstChild();
if (childFrame) { if (childFrame) {
nsIFrame* continuingTableFrame = nsIFrame* continuingTableFrame =
CreateContinuingFrame(aPresContext, childFrame, newFrame); CreateContinuingFrame(childFrame, newFrame);
newChildFrames.AppendFrame(nullptr, continuingTableFrame); newChildFrames.AppendFrame(nullptr, continuingTableFrame);
NS_ASSERTION(!childFrame->GetNextSibling(), NS_ASSERTION(!childFrame->GetNextSibling(),
@ -7861,8 +7860,8 @@ nsIFrame* nsCSSFrameConstructor::CreateContinuingOuterTableFrame(
} }
nsIFrame* nsCSSFrameConstructor::CreateContinuingTableFrame( nsIFrame* nsCSSFrameConstructor::CreateContinuingTableFrame(
PresShell* aPresShell, nsIFrame* aFrame, nsContainerFrame* aParentFrame, nsIFrame* aFrame, nsContainerFrame* aParentFrame, nsIContent* aContent,
nsIContent* aContent, ComputedStyle* aComputedStyle) { ComputedStyle* aComputedStyle) {
nsTableFrame* newFrame = NS_NewTableFrame(mPresShell, aComputedStyle); nsTableFrame* newFrame = NS_NewTableFrame(mPresShell, aComputedStyle);
newFrame->Init(aContent, aParentFrame, aFrame); newFrame->Init(aContent, aParentFrame, aFrame);
@ -7920,8 +7919,7 @@ nsIFrame* nsCSSFrameConstructor::CreateContinuingTableFrame(
} }
nsIFrame* nsCSSFrameConstructor::CreateContinuingFrame( nsIFrame* nsCSSFrameConstructor::CreateContinuingFrame(
nsPresContext* aPresContext, nsIFrame* aFrame, nsIFrame* aFrame, nsContainerFrame* aParentFrame, bool aIsFluid) {
nsContainerFrame* aParentFrame, bool aIsFluid) {
ComputedStyle* computedStyle = aFrame->Style(); ComputedStyle* computedStyle = aFrame->Style();
nsIFrame* newFrame = nullptr; nsIFrame* newFrame = nullptr;
nsIFrame* nextContinuation = aFrame->GetNextContinuation(); nsIFrame* nextContinuation = aFrame->GetNextContinuation();
@ -7961,13 +7959,11 @@ nsIFrame* nsCSSFrameConstructor::CreateContinuingFrame(
newFrame = newFrame =
ConstructPageFrame(mPresShell, aParentFrame, aFrame, canvasFrame); ConstructPageFrame(mPresShell, aParentFrame, aFrame, canvasFrame);
} else if (LayoutFrameType::TableWrapper == frameType) { } else if (LayoutFrameType::TableWrapper == frameType) {
newFrame = CreateContinuingOuterTableFrame( newFrame = CreateContinuingOuterTableFrame(aFrame, aParentFrame, content,
mPresShell, aPresContext, aFrame, aParentFrame, content, computedStyle); computedStyle);
} else if (LayoutFrameType::Table == frameType) { } else if (LayoutFrameType::Table == frameType) {
newFrame = CreateContinuingTableFrame(mPresShell, aFrame, aParentFrame, newFrame = CreateContinuingTableFrame(aFrame, aParentFrame, content,
content, computedStyle); computedStyle);
} else if (LayoutFrameType::TableRowGroup == frameType) { } else if (LayoutFrameType::TableRowGroup == frameType) {
newFrame = NS_NewTableRowGroupFrame(mPresShell, computedStyle); newFrame = NS_NewTableRowGroupFrame(mPresShell, computedStyle);
newFrame->Init(content, aParentFrame, aFrame); newFrame->Init(content, aParentFrame, aFrame);
@ -7989,7 +7985,7 @@ nsIFrame* nsCSSFrameConstructor::CreateContinuingFrame(
// See if it's a table cell frame // See if it's a table cell frame
if (cellFrame->IsTableCellFrame()) { if (cellFrame->IsTableCellFrame()) {
nsIFrame* continuingCellFrame = nsIFrame* continuingCellFrame =
CreateContinuingFrame(aPresContext, cellFrame, rowFrame); CreateContinuingFrame(cellFrame, rowFrame);
newChildList.AppendFrame(nullptr, continuingCellFrame); newChildList.AppendFrame(nullptr, continuingCellFrame);
} }
cellFrame = cellFrame->GetNextSibling(); cellFrame = cellFrame->GetNextSibling();
@ -8014,8 +8010,8 @@ nsIFrame* nsCSSFrameConstructor::CreateContinuingFrame(
// Create a continuing area frame // Create a continuing area frame
nsIFrame* blockFrame = aFrame->PrincipalChildList().FirstChild(); nsIFrame* blockFrame = aFrame->PrincipalChildList().FirstChild();
nsIFrame* continuingBlockFrame = CreateContinuingFrame( nsIFrame* continuingBlockFrame =
aPresContext, blockFrame, static_cast<nsContainerFrame*>(cellFrame)); CreateContinuingFrame(blockFrame, cellFrame);
SetInitialSingleChild(cellFrame, continuingBlockFrame); SetInitialSingleChild(cellFrame, continuingBlockFrame);
newFrame = cellFrame; newFrame = cellFrame;
@ -9940,8 +9936,7 @@ nsFirstLetterFrame* nsCSSFrameConstructor::CreateFloatingLetterFrame(
nsIFrame* nextTextFrame = nullptr; nsIFrame* nextTextFrame = nullptr;
if (NeedFirstLetterContinuation(aTextContent)) { if (NeedFirstLetterContinuation(aTextContent)) {
// Create continuation // Create continuation
nextTextFrame = nextTextFrame = CreateContinuingFrame(aTextFrame, aParentFrame);
CreateContinuingFrame(aState.mPresContext, aTextFrame, aParentFrame);
RefPtr<ComputedStyle> newSC = RefPtr<ComputedStyle> newSC =
styleSet->ResolveStyleForText(aTextContent, aParentComputedStyle); styleSet->ResolveStyleForText(aTextContent, aParentComputedStyle);
nextTextFrame->SetComputedStyle(newSC); nextTextFrame->SetComputedStyle(newSC);
@ -10638,8 +10633,7 @@ void nsCSSFrameConstructor::FinishBuildingColumns(
finalList.AppendFrame(aColumnSetWrapper, f); finalList.AppendFrame(aColumnSetWrapper, f);
} else { } else {
auto* continuingColumnSet = static_cast<nsContainerFrame*>( auto* continuingColumnSet = static_cast<nsContainerFrame*>(
CreateContinuingFrame(mPresShell->GetPresContext(), prevColumnSet, CreateContinuingFrame(prevColumnSet, aColumnSetWrapper, false));
aColumnSetWrapper, false));
MOZ_ASSERT(continuingColumnSet->HasColumnSpanSiblings(), MOZ_ASSERT(continuingColumnSet->HasColumnSpanSiblings(),
"The bit should propagate to the next continuation!"); "The bit should propagate to the next continuation!");
@ -10722,8 +10716,7 @@ nsFrameList nsCSSFrameConstructor::CreateColumnSpanSiblings(
// Grab the consecutive non-column-span kids, and reparent them into a new // Grab the consecutive non-column-span kids, and reparent them into a new
// continuation of the last non-column-span wrapper frame. // continuation of the last non-column-span wrapper frame.
auto* nonColumnSpanWrapper = static_cast<nsContainerFrame*>( auto* nonColumnSpanWrapper = static_cast<nsContainerFrame*>(
CreateContinuingFrame(mPresShell->GetPresContext(), CreateContinuingFrame(lastNonColumnSpanWrapper, parentFrame, false));
lastNonColumnSpanWrapper, parentFrame, false));
nonColumnSpanWrapper->AddStateBits(NS_FRAME_HAS_MULTI_COLUMN_ANCESTOR | nonColumnSpanWrapper->AddStateBits(NS_FRAME_HAS_MULTI_COLUMN_ANCESTOR |
NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN); NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
MOZ_ASSERT(nonColumnSpanWrapper->HasColumnSpanSiblings(), MOZ_ASSERT(nonColumnSpanWrapper->HasColumnSpanSiblings(),

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

@ -315,7 +315,7 @@ class nsCSSFrameConstructor final : public nsFrameManager {
bool DestroyFramesFor(Element* aElement); bool DestroyFramesFor(Element* aElement);
// Request to create a continuing frame. This method never returns null. // Request to create a continuing frame. This method never returns null.
nsIFrame* CreateContinuingFrame(nsPresContext* aPresContext, nsIFrame* aFrame, nsIFrame* CreateContinuingFrame(nsIFrame* aFrame,
nsContainerFrame* aParentFrame, nsContainerFrame* aParentFrame,
bool aIsFluid = true); bool aIsFluid = true);
@ -1672,14 +1672,12 @@ class nsCSSFrameConstructor final : public nsFrameManager {
// not null). // not null).
bool MaybeRecreateContainerForFrameRemoval(nsIFrame* aFrame); bool MaybeRecreateContainerForFrameRemoval(nsIFrame* aFrame);
nsIFrame* CreateContinuingOuterTableFrame(PresShell* aPresShell, nsIFrame* CreateContinuingOuterTableFrame(nsIFrame* aFrame,
nsPresContext* aPresContext,
nsIFrame* aFrame,
nsContainerFrame* aParentFrame, nsContainerFrame* aParentFrame,
nsIContent* aContent, nsIContent* aContent,
ComputedStyle* aComputedStyle); ComputedStyle* aComputedStyle);
nsIFrame* CreateContinuingTableFrame(PresShell* aPresShell, nsIFrame* aFrame, nsIFrame* CreateContinuingTableFrame(nsIFrame* aFrame,
nsContainerFrame* aParentFrame, nsContainerFrame* aParentFrame,
nsIContent* aContent, nsIContent* aContent,
ComputedStyle* aComputedStyle); ComputedStyle* aComputedStyle);

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

@ -894,9 +894,8 @@ void nsFieldSetFrame::EnsureChildContinuation(nsIFrame* aChild,
} else { } else {
nsFrameList nifs; nsFrameList nifs;
if (!nif) { if (!nif) {
auto* pc = PresContext(); auto* fc = PresShell()->FrameConstructor();
auto* fc = pc->PresShell()->FrameConstructor(); nif = fc->CreateContinuingFrame(aChild, this);
nif = fc->CreateContinuingFrame(pc, aChild, this);
if (aStatus.IsOverflowIncomplete()) { if (aStatus.IsOverflowIncomplete()) {
nif->AddStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER); nif->AddStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER);
} }

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

@ -221,8 +221,7 @@ void nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
if (!nextFrame) { if (!nextFrame) {
nextFrame = aPresContext->PresShell() nextFrame = aPresContext->PresShell()
->FrameConstructor() ->FrameConstructor()
->CreateContinuingFrame(aPresContext, kidFrame, ->CreateContinuingFrame(kidFrame, aDelegatingFrame);
aDelegatingFrame);
} }
// Add it as an overflow container. // Add it as an overflow container.
// XXXfr This is a hack to fix some of our printing dataloss. // XXXfr This is a hack to fix some of our printing dataloss.

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

@ -4595,9 +4595,8 @@ bool nsBlockFrame::CreateContinuationFor(BlockReflowInput& aState,
nsIFrame* newFrame = nullptr; nsIFrame* newFrame = nullptr;
if (!aFrame->GetNextInFlow()) { if (!aFrame->GetNextInFlow()) {
newFrame = aState.mPresContext->PresShell() newFrame =
->FrameConstructor() PresShell()->FrameConstructor()->CreateContinuingFrame(aFrame, this);
->CreateContinuingFrame(aState.mPresContext, aFrame, this);
mFrames.InsertFrame(nullptr, aFrame, newFrame); mFrames.InsertFrame(nullptr, aFrame, newFrame);
@ -4629,9 +4628,8 @@ void nsBlockFrame::SplitFloat(BlockReflowInput& aState, nsIFrame* aFloat,
nextInFlow->RemoveStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER); nextInFlow->RemoveStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER);
} }
} else { } else {
nextInFlow = aState.mPresContext->PresShell() nextInFlow =
->FrameConstructor() PresShell()->FrameConstructor()->CreateContinuingFrame(aFloat, this);
->CreateContinuingFrame(aState.mPresContext, aFloat, this);
} }
if (aFloatStatus.IsOverflowIncomplete()) { if (aFloatStatus.IsOverflowIncomplete()) {
nextInFlow->AddStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER); nextInFlow->AddStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER);

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

@ -763,7 +763,7 @@ void nsCanvasFrame::Reflow(nsPresContext* aPresContext,
if (!nextFrame) { if (!nextFrame) {
nextFrame = aPresContext->PresShell() nextFrame = aPresContext->PresShell()
->FrameConstructor() ->FrameConstructor()
->CreateContinuingFrame(aPresContext, kidFrame, this); ->CreateContinuingFrame(kidFrame, this);
SetOverflowFrames(nsFrameList(nextFrame, nextFrame)); SetOverflowFrames(nsFrameList(nextFrame, nextFrame));
// Root overflow containers will be normal children of // Root overflow containers will be normal children of
// the canvas frame, but that's ok because there // the canvas frame, but that's ok because there

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

@ -1182,9 +1182,8 @@ void nsContainerFrame::ReflowOverflowContainerChildren(
if (!nif) { if (!nif) {
NS_ASSERTION(frameStatus.NextInFlowNeedsReflow(), NS_ASSERTION(frameStatus.NextInFlowNeedsReflow(),
"Someone forgot a NextInFlowNeedsReflow flag"); "Someone forgot a NextInFlowNeedsReflow flag");
nif = aPresContext->PresShell() nif = PresShell()->FrameConstructor()->CreateContinuingFrame(frame,
->FrameConstructor() this);
->CreateContinuingFrame(aPresContext, frame, this);
} else if (!(nif->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER)) { } else if (!(nif->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER)) {
// used to be a normal next-in-flow; steal it from the child list // used to be a normal next-in-flow; steal it from the child list
nsresult rv = nif->GetParent()->StealFrame(nif); nsresult rv = nif->GetParent()->StealFrame(nif);
@ -1336,13 +1335,12 @@ nsIFrame* nsContainerFrame::CreateNextInFlow(nsIFrame* aFrame) {
"you should have called nsBlockFrame::CreateContinuationFor instead"); "you should have called nsBlockFrame::CreateContinuationFor instead");
MOZ_ASSERT(mFrames.ContainsFrame(aFrame), "expected an in-flow child frame"); MOZ_ASSERT(mFrames.ContainsFrame(aFrame), "expected an in-flow child frame");
nsPresContext* pc = PresContext();
nsIFrame* nextInFlow = aFrame->GetNextInFlow(); nsIFrame* nextInFlow = aFrame->GetNextInFlow();
if (nullptr == nextInFlow) { if (nullptr == nextInFlow) {
// Create a continuation frame for the child frame and insert it // Create a continuation frame for the child frame and insert it
// into our child list. // into our child list.
nextInFlow = pc->PresShell()->FrameConstructor()->CreateContinuingFrame( nextInFlow =
pc, aFrame, this); PresShell()->FrameConstructor()->CreateContinuingFrame(aFrame, this);
mFrames.InsertFrame(nullptr, aFrame, nextInFlow); mFrames.InsertFrame(nullptr, aFrame, nextInFlow);
NS_FRAME_LOG(NS_FRAME_TRACE_NEW_FRAMES, NS_FRAME_LOG(NS_FRAME_TRACE_NEW_FRAMES,

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

@ -267,8 +267,7 @@ void nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
// created for us) we need to put the continuation with the rest of the // created for us) we need to put the continuation with the rest of the
// text that the first letter frame was made out of. // text that the first letter frame was made out of.
nsIFrame* continuation; nsIFrame* continuation;
CreateContinuationForFloatingParent(aPresContext, kid, &continuation, CreateContinuationForFloatingParent(kid, &continuation, true);
true);
} }
} }
} }
@ -283,20 +282,19 @@ bool nsFirstLetterFrame::CanContinueTextRun() const {
} }
void nsFirstLetterFrame::CreateContinuationForFloatingParent( void nsFirstLetterFrame::CreateContinuationForFloatingParent(
nsPresContext* aPresContext, nsIFrame* aChild, nsIFrame** aContinuation, nsIFrame* aChild, nsIFrame** aContinuation, bool aIsFluid) {
bool aIsFluid) {
NS_ASSERTION(IsFloating(), NS_ASSERTION(IsFloating(),
"can only call this on floating first letter frames"); "can only call this on floating first letter frames");
MOZ_ASSERT(aContinuation, "bad args"); MOZ_ASSERT(aContinuation, "bad args");
*aContinuation = nullptr; *aContinuation = nullptr;
mozilla::PresShell* presShell = aPresContext->PresShell(); mozilla::PresShell* presShell = PresShell();
nsPlaceholderFrame* placeholderFrame = GetPlaceholderFrame(); nsPlaceholderFrame* placeholderFrame = GetPlaceholderFrame();
nsContainerFrame* parent = placeholderFrame->GetParent(); nsContainerFrame* parent = placeholderFrame->GetParent();
nsIFrame* continuation = presShell->FrameConstructor()->CreateContinuingFrame( nsIFrame* continuation = presShell->FrameConstructor()->CreateContinuingFrame(
aPresContext, aChild, parent, aIsFluid); aChild, parent, aIsFluid);
// The continuation will have gotten the first letter style from its // The continuation will have gotten the first letter style from its
// prev continuation, so we need to repair the ComputedStyle so it // prev continuation, so we need to repair the ComputedStyle so it

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

@ -74,8 +74,7 @@ class nsFirstLetterFrame final : public nsContainerFrame {
// place it in the correct place. aContinuation is an outparam for the // place it in the correct place. aContinuation is an outparam for the
// continuation that is created. aIsFluid determines if the continuation is // continuation that is created. aIsFluid determines if the continuation is
// fluid or not. // fluid or not.
void CreateContinuationForFloatingParent(nsPresContext* aPresContext, void CreateContinuationForFloatingParent(nsIFrame* aChild,
nsIFrame* aChild,
nsIFrame** aContinuation, nsIFrame** aContinuation,
bool aIsFluid); bool aIsFluid);

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

@ -6912,8 +6912,7 @@ nscoord nsGridContainerFrame::ReflowRowsInFragmentainer(
nsFrameList pushedList; nsFrameList pushedList;
nsFrameList incompleteList; nsFrameList incompleteList;
nsFrameList overflowIncompleteList; nsFrameList overflowIncompleteList;
auto* pc = PresContext(); auto* fc = PresShell()->FrameConstructor();
auto* fc = pc->PresShell()->FrameConstructor();
for (nsIFrame* child = GetChildList(kPrincipalList).FirstChild(); child;) { for (nsIFrame* child = GetChildList(kPrincipalList).FirstChild(); child;) {
MOZ_ASSERT((pushedItems.Contains(child) ? 1 : 0) + MOZ_ASSERT((pushedItems.Contains(child) ? 1 : 0) +
(incompleteItems.Contains(child) ? 1 : 0) + (incompleteItems.Contains(child) ? 1 : 0) +
@ -6929,7 +6928,7 @@ nscoord nsGridContainerFrame::ReflowRowsInFragmentainer(
} else if (incompleteItems.Contains(child)) { } else if (incompleteItems.Contains(child)) {
nsIFrame* childNIF = child->GetNextInFlow(); nsIFrame* childNIF = child->GetNextInFlow();
if (!childNIF) { if (!childNIF) {
childNIF = fc->CreateContinuingFrame(pc, child, this); childNIF = fc->CreateContinuingFrame(child, this);
incompleteList.AppendFrame(nullptr, childNIF); incompleteList.AppendFrame(nullptr, childNIF);
} else { } else {
auto parent = auto parent =
@ -6962,7 +6961,7 @@ nscoord nsGridContainerFrame::ReflowRowsInFragmentainer(
} else if (overflowIncompleteItems.Contains(child)) { } else if (overflowIncompleteItems.Contains(child)) {
nsIFrame* childNIF = child->GetNextInFlow(); nsIFrame* childNIF = child->GetNextInFlow();
if (!childNIF) { if (!childNIF) {
childNIF = fc->CreateContinuingFrame(pc, child, this); childNIF = fc->CreateContinuingFrame(child, this);
childNIF->AddStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER); childNIF->AddStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER);
overflowIncompleteList.AppendFrame(nullptr, childNIF); overflowIncompleteList.AppendFrame(nullptr, childNIF);
} else { } else {

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

@ -276,8 +276,8 @@ void nsPageSequenceFrame::Reflow(nsPresContext* aPresContext,
// The page isn't complete and it doesn't have a next-in-flow, so // The page isn't complete and it doesn't have a next-in-flow, so
// create a continuing page. // create a continuing page.
nsIFrame* continuingPage = nsIFrame* continuingPage =
aPresContext->PresShell()->FrameConstructor()->CreateContinuingFrame( PresShell()->FrameConstructor()->CreateContinuingFrame(kidFrame,
aPresContext, kidFrame, this); this);
// Add it to our child list // Add it to our child list
mFrames.InsertFrame(nullptr, kidFrame, continuingPage); mFrames.InsertFrame(nullptr, kidFrame, continuingPage);

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

@ -8814,10 +8814,9 @@ void nsTextFrame::SetLength(int32_t aLength, nsLineLayout* aLineLayout,
// We also skip this optimization if we were called during bidi // We also skip this optimization if we were called during bidi
// resolution, so as not to create a new frame which doesn't appear in // resolution, so as not to create a new frame which doesn't appear in
// the bidi resolver's list of frames // the bidi resolver's list of frames
nsPresContext* presContext = PresContext();
nsIFrame* newFrame = nsIFrame* newFrame =
presContext->PresShell()->FrameConstructor()->CreateContinuingFrame( PresShell()->FrameConstructor()->CreateContinuingFrame(this,
presContext, this, GetParent()); GetParent());
nsTextFrame* next = static_cast<nsTextFrame*>(newFrame); nsTextFrame* next = static_cast<nsTextFrame*>(newFrame);
nsFrameList temp(next, next); nsFrameList temp(next, next);
GetParent()->InsertFrames(kNoReflowPrincipalList, this, GetParent()->InsertFrames(kNoReflowPrincipalList, this,

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

@ -3069,9 +3069,8 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
// The child doesn't have a next-in-flow so create a continuing // The child doesn't have a next-in-flow so create a continuing
// frame. This hooks the child into the flow // frame. This hooks the child into the flow
kidNextInFlow = kidNextInFlow =
presContext->PresShell() PresShell()->FrameConstructor()->CreateContinuingFrame(kidFrame,
->FrameConstructor() this);
->CreateContinuingFrame(presContext, kidFrame, this);
// Insert the kid's new next-in-flow into our sibling list... // Insert the kid's new next-in-flow into our sibling list...
mFrames.InsertFrame(nullptr, kidFrame, kidNextInFlow); mFrames.InsertFrame(nullptr, kidFrame, kidNextInFlow);

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

@ -941,8 +941,7 @@ void nsTableRowGroupFrame::SlideChild(TableRowGroupReflowInput& aReflowInput,
// Create a continuing frame, add it to the child list, and then push it // Create a continuing frame, add it to the child list, and then push it
// and the frames that follow // and the frames that follow
void nsTableRowGroupFrame::CreateContinuingRowFrame(nsPresContext& aPresContext, void nsTableRowGroupFrame::CreateContinuingRowFrame(nsIFrame& aRowFrame,
nsIFrame& aRowFrame,
nsIFrame** aContRowFrame) { nsIFrame** aContRowFrame) {
// XXX what is the row index? // XXX what is the row index?
if (!aContRowFrame) { if (!aContRowFrame) {
@ -951,8 +950,7 @@ void nsTableRowGroupFrame::CreateContinuingRowFrame(nsPresContext& aPresContext,
} }
// create the continuing frame which will create continuing cell frames // create the continuing frame which will create continuing cell frames
*aContRowFrame = *aContRowFrame =
aPresContext.PresShell()->FrameConstructor()->CreateContinuingFrame( PresShell()->FrameConstructor()->CreateContinuingFrame(&aRowFrame, this);
&aPresContext, &aRowFrame, this);
// Add the continuing row frame to the child list // Add the continuing row frame to the child list
mFrames.InsertFrame(nullptr, &aRowFrame, *aContRowFrame); mFrames.InsertFrame(nullptr, &aRowFrame, *aContRowFrame);
@ -1030,17 +1028,15 @@ void nsTableRowGroupFrame::SplitSpanningCells(
} }
} else { } else {
if (!aContRow) { if (!aContRow) {
CreateContinuingRowFrame(aPresContext, aLastRow, CreateContinuingRowFrame(aLastRow, (nsIFrame**)&aContRow);
(nsIFrame**)&aContRow);
} }
if (aContRow) { if (aContRow) {
if (row != &aLastRow) { if (row != &aLastRow) {
// aContRow needs a continuation for cell, since cell spanned into // aContRow needs a continuation for cell, since cell spanned into
// aLastRow but does not originate there // aLastRow but does not originate there
nsTableCellFrame* contCell = static_cast<nsTableCellFrame*>( nsTableCellFrame* contCell = static_cast<nsTableCellFrame*>(
aPresContext.PresShell() PresShell()->FrameConstructor()->CreateContinuingFrame(
->FrameConstructor() cell, &aLastRow));
->CreateContinuingFrame(&aPresContext, cell, &aLastRow));
uint32_t colIndex = cell->ColIndex(); uint32_t colIndex = cell->ColIndex();
aContRow->InsertCellFrame(contCell, colIndex); aContRow->InsertCellFrame(contCell, colIndex);
} }
@ -1185,8 +1181,7 @@ nsresult nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
rowMetrics.Height() <= rowReflowInput.AvailableHeight(), rowMetrics.Height() <= rowReflowInput.AvailableHeight(),
"data loss - incomplete row needed more height than available, " "data loss - incomplete row needed more height than available, "
"on top of page"); "on top of page");
CreateContinuingRowFrame(*aPresContext, *rowFrame, CreateContinuingRowFrame(*rowFrame, (nsIFrame**)&contRow);
(nsIFrame**)&contRow);
if (contRow) { if (contRow) {
aDesiredSize.Height() += rowMetrics.Height(); aDesiredSize.Height() += rowMetrics.Height();
if (prevRowFrame) aDesiredSize.Height() += cellSpacingB; if (prevRowFrame) aDesiredSize.Height() += cellSpacingB;

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

@ -384,8 +384,7 @@ class nsTableRowGroupFrame final : public nsContainerFrame,
nsTableRowFrame*& aFirstTruncatedRow, nsTableRowFrame*& aFirstTruncatedRow,
nscoord& aDesiredHeight); nscoord& aDesiredHeight);
void CreateContinuingRowFrame(nsPresContext& aPresContext, void CreateContinuingRowFrame(nsIFrame& aRowFrame, nsIFrame** aContRowFrame);
nsIFrame& aRowFrame, nsIFrame** aContRowFrame);
bool IsSimpleRowFrame(nsTableFrame* aTableFrame, nsTableRowFrame* aRowFrame); bool IsSimpleRowFrame(nsTableFrame* aTableFrame, nsTableRowFrame* aRowFrame);