зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1374761 part 2. Properly restyle the various paginated-presentation anonymous boxes. r=heycam
MozReview-Commit-ID: LJqWbyRKp3b --HG-- extra : rebase_source : fbd246cded64dc1d05c8617ae4f2e5cf022f190f
This commit is contained in:
Родитель
7a8cb34ac0
Коммит
094b059bbf
|
@ -2878,6 +2878,7 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement)
|
|||
rootFrame = NS_NewSimplePageSequenceFrame(mPresShell, viewportPseudoStyle);
|
||||
mPageSequenceFrame = rootFrame;
|
||||
rootPseudo = nsCSSAnonBoxes::pageSequence;
|
||||
rootFrame->AddStateBits(NS_FRAME_OWNS_ANON_BOXES);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2971,6 +2972,7 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement)
|
|||
nsContainerFrame* canvasFrame;
|
||||
nsContainerFrame* pageFrame =
|
||||
ConstructPageFrame(mPresShell, rootFrame, nullptr, canvasFrame);
|
||||
pageFrame->AddStateBits(NS_FRAME_OWNS_ANON_BOXES);
|
||||
SetInitialSingleChild(rootFrame, pageFrame);
|
||||
|
||||
// The eventual parent of the document element frame.
|
||||
|
@ -3045,6 +3047,9 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell,
|
|||
NS_ASSERTION(prevPageContentFrame, "missing page content frame");
|
||||
}
|
||||
pageContentFrame->Init(nullptr, pageFrame, prevPageContentFrame);
|
||||
if (!prevPageContentFrame) {
|
||||
pageContentFrame->AddStateBits(NS_FRAME_OWNS_ANON_BOXES);
|
||||
}
|
||||
SetInitialSingleChild(pageFrame, pageContentFrame);
|
||||
// Make it an absolute container for fixed-pos elements
|
||||
pageContentFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
|
||||
|
|
|
@ -108,6 +108,15 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
|||
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
|
||||
}
|
||||
|
||||
void
|
||||
nsPageContentFrame::AppendDirectlyOwnedAnonBoxes(
|
||||
nsTArray<OwnedAnonBox>& aResult)
|
||||
{
|
||||
MOZ_ASSERT(mFrames.FirstChild(),
|
||||
"pageContentFrame must have a canvasFrame child");
|
||||
aResult.AppendElement(mFrames.FirstChild());
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
nsresult
|
||||
nsPageContentFrame::GetFrameName(nsAString& aResult) const
|
||||
|
|
|
@ -37,6 +37,11 @@ public:
|
|||
|
||||
virtual bool HasTransformGetter() const override { return true; }
|
||||
|
||||
/**
|
||||
* Return our canvas frame.
|
||||
*/
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
// Debugging
|
||||
virtual nsresult GetFrameName(nsAString& aResult) const override;
|
||||
|
|
|
@ -668,6 +668,15 @@ nsPageFrame::SetSharedPageData(nsSharedPageData* aPD)
|
|||
|
||||
}
|
||||
|
||||
void
|
||||
nsPageFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
|
||||
{
|
||||
MOZ_ASSERT(mFrames.FirstChild() &&
|
||||
mFrames.FirstChild()->IsPageContentFrame(),
|
||||
"pageFrame must have a pageContentFrame child");
|
||||
aResult.AppendElement(mFrames.FirstChild());
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
||||
{
|
||||
|
|
|
@ -51,6 +51,11 @@ public:
|
|||
void PaintHeaderFooter(gfxContext& aRenderingContext,
|
||||
nsPoint aPt, bool aSubpixelAA);
|
||||
|
||||
/**
|
||||
* Return our page content frame.
|
||||
*/
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||
|
||||
protected:
|
||||
explicit nsPageFrame(nsStyleContext* aContext);
|
||||
virtual ~nsPageFrame();
|
||||
|
|
|
@ -895,3 +895,12 @@ nsSimplePageSequenceFrame::GetSTFPercent(float& aSTFPercent)
|
|||
aSTFPercent = mPageData->mShrinkToFitRatio;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsSimplePageSequenceFrame::AppendDirectlyOwnedAnonBoxes(
|
||||
nsTArray<OwnedAnonBox>& aResult)
|
||||
{
|
||||
if (mFrames.NotEmpty()) {
|
||||
aResult.AppendElement(mFrames.FirstChild());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,6 +100,11 @@ public:
|
|||
|
||||
bool HasTransformGetter() const override { return true; }
|
||||
|
||||
/**
|
||||
* Return our first page frame.
|
||||
*/
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
nsresult GetFrameName(nsAString& aResult) const override;
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче