Skip to content
Snippets Groups Projects
Commit 84688dc4 authored by Jonathan Watt's avatar Jonathan Watt
Browse files

Bug 1824852. Ensure PrintedSheetFrame calls MoveOverflowToChildList before reflow. r=dholbert

The intention is to allow PrintedSheetFrame::Reflow to access the page style
prior to reflowing its child so that it can decide whether to apply page style
to the sheet (in the case of one page-per-sheet). This will happen in a
subsequent bug.

Differential Revision: https://phabricator.services.mozilla.com/D173773
parent f894363c
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,10 @@ static bool TagIfSkippedByCustomRange(nsPageFrame* aPageFrame, int32_t aPageNum,
return true;
}
void PrintedSheetFrame::ClaimPageFrameFromPrevInFlow() {
MoveOverflowToChildList();
}
void PrintedSheetFrame::Reflow(nsPresContext* aPresContext,
ReflowOutput& aReflowOutput,
const ReflowInput& aReflowInput,
......
......@@ -26,6 +26,14 @@ class PrintedSheetFrame final : public nsContainerFrame {
void SetSharedPageData(nsSharedPageData* aPD) { mPD = aPD; }
// Invokes MoveOverflowToChildList.
// This is intended for use by callers that need to be able to get our first/
// only nsPageFrame from our child list to examine its computed style just
// **prior** to us being reflowed. (If our first nsPageFrame will come from
// our prev-in-flow, we won't otherwise take ownership of it until we are
// reflowed.)
void ClaimPageFrameFromPrevInFlow();
// nsIFrame overrides
void Reflow(nsPresContext* aPresContext, ReflowOutput& aReflowOutput,
const ReflowInput& aReflowInput,
......
......@@ -347,6 +347,10 @@ void nsPageSequenceFrame::Reflow(nsPresContext* aPresContext,
auto* sheet = static_cast<PrintedSheetFrame*>(kidFrame);
sheet->SetSharedPageData(mPageData.get());
// If we want to reliably access the nsPageFrame before reflowing the sheet
// frame, we need to call this:
sheet->ClaimPageFrameFromPrevInFlow();
// Reflow the sheet
ReflowInput kidReflowInput(
aPresContext, aReflowInput, kidFrame,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment