mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 731293. Remove nsFrameManager parameter from nsLayoutUtils::GetParentOrPlaceholderFor. r=mats
This commit is contained in:
parent
d5c17c1b06
commit
31953a0563
@ -302,11 +302,10 @@ struct BidiParagraphData {
|
||||
{
|
||||
// Advance aLine to the line containing aFrame
|
||||
nsIFrame* child = aFrame;
|
||||
nsFrameManager* frameManager = aFrame->PresContext()->FrameManager();
|
||||
nsIFrame* parent = nsLayoutUtils::GetParentOrPlaceholderFor(frameManager, child);
|
||||
nsIFrame* parent = nsLayoutUtils::GetParentOrPlaceholderFor(child);
|
||||
while (parent && !nsLayoutUtils::GetAsBlock(parent)) {
|
||||
child = parent;
|
||||
parent = nsLayoutUtils::GetParentOrPlaceholderFor(frameManager, child);
|
||||
parent = nsLayoutUtils::GetParentOrPlaceholderFor(child);
|
||||
}
|
||||
NS_ASSERTION (parent, "aFrame is not a descendent of aBlockFrame");
|
||||
while (!IsFrameInCurrentLine(aLineIter, aPrevFrame, child)) {
|
||||
|
@ -804,8 +804,7 @@ nsCSSRendering::FindNonTransparentBackgroundFrame(nsIFrame* aFrame,
|
||||
|
||||
nsIFrame* frame = nsnull;
|
||||
if (aStartAtParent) {
|
||||
frame = nsLayoutUtils::GetParentOrPlaceholderFor(
|
||||
aFrame->PresContext()->FrameManager(), aFrame);
|
||||
frame = nsLayoutUtils::GetParentOrPlaceholderFor(aFrame);
|
||||
}
|
||||
if (!frame) {
|
||||
frame = aFrame;
|
||||
@ -820,8 +819,7 @@ nsCSSRendering::FindNonTransparentBackgroundFrame(nsIFrame* aFrame,
|
||||
if (frame->IsThemed())
|
||||
break;
|
||||
|
||||
nsIFrame* parent = nsLayoutUtils::GetParentOrPlaceholderFor(
|
||||
frame->PresContext()->FrameManager(), frame);
|
||||
nsIFrame* parent = nsLayoutUtils::GetParentOrPlaceholderFor(frame);
|
||||
if (!parent)
|
||||
break;
|
||||
|
||||
|
@ -92,10 +92,8 @@ nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
|
||||
}
|
||||
|
||||
static void MarkFrameForDisplay(nsIFrame* aFrame, nsIFrame* aStopAtFrame) {
|
||||
nsFrameManager* frameManager = aFrame->PresContext()->PresShell()->FrameManager();
|
||||
|
||||
for (nsIFrame* f = aFrame; f;
|
||||
f = nsLayoutUtils::GetParentOrPlaceholderFor(frameManager, f)) {
|
||||
f = nsLayoutUtils::GetParentOrPlaceholderFor(f)) {
|
||||
if (f->GetStateBits() & NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO)
|
||||
return;
|
||||
f->AddStateBits(NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO);
|
||||
@ -159,10 +157,8 @@ static void UnmarkFrameForDisplay(nsIFrame* aFrame) {
|
||||
presContext->PropertyTable()->
|
||||
Delete(aFrame, nsDisplayListBuilder::OutOfFlowDirtyRectProperty());
|
||||
|
||||
nsFrameManager* frameManager = presContext->PresShell()->FrameManager();
|
||||
|
||||
for (nsIFrame* f = aFrame; f;
|
||||
f = nsLayoutUtils::GetParentOrPlaceholderFor(frameManager, f)) {
|
||||
f = nsLayoutUtils::GetParentOrPlaceholderFor(f)) {
|
||||
if (!(f->GetStateBits() & NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO))
|
||||
return;
|
||||
f->RemoveStateBits(NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO);
|
||||
|
@ -668,12 +668,12 @@ nsLayoutUtils::DoCompareTreePosition(nsIContent* aContent1,
|
||||
}
|
||||
|
||||
static nsIFrame* FillAncestors(nsIFrame* aFrame,
|
||||
nsIFrame* aStopAtAncestor, nsFrameManager* aFrameManager,
|
||||
nsIFrame* aStopAtAncestor,
|
||||
nsTArray<nsIFrame*>* aAncestors)
|
||||
{
|
||||
while (aFrame && aFrame != aStopAtAncestor) {
|
||||
aAncestors->AppendElement(aFrame);
|
||||
aFrame = nsLayoutUtils::GetParentOrPlaceholderFor(aFrameManager, aFrame);
|
||||
aFrame = nsLayoutUtils::GetParentOrPlaceholderFor(aFrame);
|
||||
}
|
||||
return aFrame;
|
||||
}
|
||||
@ -706,17 +706,16 @@ nsLayoutUtils::DoCompareTreePosition(nsIFrame* aFrame1,
|
||||
NS_ERROR("no common ancestor at all, different documents");
|
||||
return 0;
|
||||
}
|
||||
nsFrameManager* frameManager = presContext->PresShell()->FrameManager();
|
||||
|
||||
nsAutoTArray<nsIFrame*,20> frame1Ancestors;
|
||||
if (!FillAncestors(aFrame1, aCommonAncestor, frameManager, &frame1Ancestors)) {
|
||||
if (!FillAncestors(aFrame1, aCommonAncestor, &frame1Ancestors)) {
|
||||
// We reached the root of the frame tree ... if aCommonAncestor was set,
|
||||
// it is wrong
|
||||
aCommonAncestor = nsnull;
|
||||
}
|
||||
|
||||
nsAutoTArray<nsIFrame*,20> frame2Ancestors;
|
||||
if (!FillAncestors(aFrame2, aCommonAncestor, frameManager, &frame2Ancestors) &&
|
||||
if (!FillAncestors(aFrame2, aCommonAncestor, &frame2Ancestors) &&
|
||||
aCommonAncestor) {
|
||||
// We reached the root of the frame tree ... aCommonAncestor was wrong.
|
||||
// Try again with no hint.
|
||||
@ -2098,21 +2097,19 @@ nsLayoutUtils::GetNonGeneratedAncestor(nsIFrame* aFrame)
|
||||
if (!(aFrame->GetStateBits() & NS_FRAME_GENERATED_CONTENT))
|
||||
return aFrame;
|
||||
|
||||
nsFrameManager* frameManager = aFrame->PresContext()->FrameManager();
|
||||
nsIFrame* f = aFrame;
|
||||
do {
|
||||
f = GetParentOrPlaceholderFor(frameManager, f);
|
||||
f = GetParentOrPlaceholderFor(f);
|
||||
} while (f->GetStateBits() & NS_FRAME_GENERATED_CONTENT);
|
||||
return f;
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
nsLayoutUtils::GetParentOrPlaceholderFor(nsFrameManager* aFrameManager,
|
||||
nsIFrame* aFrame)
|
||||
nsLayoutUtils::GetParentOrPlaceholderFor(nsIFrame* aFrame)
|
||||
{
|
||||
if ((aFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW)
|
||||
&& !aFrame->GetPrevInFlow()) {
|
||||
return aFrameManager->GetPlaceholderFrameFor(aFrame);
|
||||
return aFrame->PresContext()->PresShell()->FrameManager()->GetPlaceholderFrameFor(aFrame);
|
||||
}
|
||||
return aFrame->GetParent();
|
||||
}
|
||||
|
@ -809,8 +809,7 @@ public:
|
||||
* If aFrame is an out of flow frame, return its placeholder, otherwise
|
||||
* return its parent.
|
||||
*/
|
||||
static nsIFrame* GetParentOrPlaceholderFor(nsFrameManager* aFrameManager,
|
||||
nsIFrame* aFrame);
|
||||
static nsIFrame* GetParentOrPlaceholderFor(nsIFrame* aFrame);
|
||||
|
||||
/**
|
||||
* Get a frame's next-in-flow, or, if it doesn't have one, its special sibling.
|
||||
|
@ -4486,8 +4486,7 @@ nsTextFrame::GetTextDecorations(nsPresContext* aPresContext,
|
||||
for (nsIFrame* f = this, *fChild = nsnull;
|
||||
f;
|
||||
fChild = f,
|
||||
f = nsLayoutUtils::GetParentOrPlaceholderFor(
|
||||
aPresContext->FrameManager(), f))
|
||||
f = nsLayoutUtils::GetParentOrPlaceholderFor(f))
|
||||
{
|
||||
nsStyleContext *const context = f->GetStyleContext();
|
||||
if (!context->HasTextDecorationLines()) {
|
||||
|
@ -446,8 +446,7 @@ nsTextBoxFrame::DrawText(nsRenderingContext& aRenderingContext,
|
||||
}
|
||||
}
|
||||
} while (0 != decorMask &&
|
||||
(f = nsLayoutUtils::GetParentOrPlaceholderFor(
|
||||
presContext->FrameManager(), f)));
|
||||
(f = nsLayoutUtils::GetParentOrPlaceholderFor(f)));
|
||||
|
||||
nsRefPtr<nsFontMetrics> fontMet;
|
||||
nsLayoutUtils::GetFontMetricsForFrame(this, getter_AddRefs(fontMet));
|
||||
|
Loading…
Reference in New Issue
Block a user