Bug 731293. Add nsLayoutUtils::GetParentOrPlaceholderForCrossDoc. r=mats

This commit is contained in:
Robert O'Callahan 2012-06-09 00:22:51 +12:00
parent 453c373374
commit 74d05f0dd8
2 changed files with 17 additions and 1 deletions

View File

@ -2109,11 +2109,21 @@ nsLayoutUtils::GetParentOrPlaceholderFor(nsIFrame* aFrame)
{
if ((aFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW)
&& !aFrame->GetPrevInFlow()) {
return aFrame->PresContext()->PresShell()->FrameManager()->GetPlaceholderFrameFor(aFrame);
return aFrame->PresContext()->PresShell()->FrameManager()->
GetPlaceholderFrameFor(aFrame);
}
return aFrame->GetParent();
}
nsIFrame*
nsLayoutUtils::GetParentOrPlaceholderForCrossDoc(nsIFrame* aFrame)
{
nsIFrame* f = GetParentOrPlaceholderFor(aFrame);
if (f)
return f;
return GetCrossDocParentFrame(aFrame);
}
nsIFrame*
nsLayoutUtils::GetNextContinuationOrSpecialSibling(nsIFrame *aFrame)
{

View File

@ -811,6 +811,12 @@ public:
*/
static nsIFrame* GetParentOrPlaceholderFor(nsIFrame* aFrame);
/**
* If aFrame is an out of flow frame, return its placeholder, otherwise
* return its (possibly cross-doc) parent.
*/
static nsIFrame* GetParentOrPlaceholderForCrossDoc(nsIFrame* aFrame);
/**
* Get a frame's next-in-flow, or, if it doesn't have one, its special sibling.
*/