Bug 339548. Part 7: Create nsLayoutUtils::IsAncestorFrameCrossDoc. r=dbaron

This commit is contained in:
Robert O'Callahan 2009-07-22 12:44:56 +12:00
Родитель f18d65c6a2
Коммит 2148628fd6
2 изменённых файлов: 26 добавлений и 0 удалений

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

@ -317,6 +317,16 @@ nsLayoutUtils::IsProperAncestorFrameCrossDoc(nsIFrame* aAncestorFrame, nsIFrame*
return PR_FALSE; return PR_FALSE;
} }
// static
PRBool
nsLayoutUtils::IsAncestorFrameCrossDoc(nsIFrame* aAncestorFrame, nsIFrame* aFrame,
nsIFrame* aCommonAncestor)
{
if (aFrame == aAncestorFrame)
return PR_TRUE;
return IsProperAncestorFrameCrossDoc(aAncestorFrame, aFrame, aCommonAncestor);
}
// static // static
PRBool PRBool
nsLayoutUtils::IsProperAncestorFrame(nsIFrame* aAncestorFrame, nsIFrame* aFrame, nsLayoutUtils::IsProperAncestorFrame(nsIFrame* aAncestorFrame, nsIFrame* aFrame,

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

@ -251,10 +251,26 @@ public:
/** /**
* Like IsProperAncestorFrame, but looks across document boundaries. * Like IsProperAncestorFrame, but looks across document boundaries.
*
* Just like IsAncestorFrameCrossDoc, except that it returns false when
* aFrame == aAncestorFrame.
*/ */
static PRBool IsProperAncestorFrameCrossDoc(nsIFrame* aAncestorFrame, nsIFrame* aFrame, static PRBool IsProperAncestorFrameCrossDoc(nsIFrame* aAncestorFrame, nsIFrame* aFrame,
nsIFrame* aCommonAncestor = nsnull); nsIFrame* aCommonAncestor = nsnull);
/**
* IsAncestorFrameCrossDoc checks whether aAncestorFrame is an ancestor
* of aFrame or equal to aFrame, looking across document boundaries.
* @param aCommonAncestor nsnull, or a common ancestor of aFrame and
* aAncestorFrame. If non-null, this can bound the search and speed up
* the function.
*
* Just like IsProperAncestorFrameCrossDoc, except that it returns true when
* aFrame == aAncestorFrame.
*/
static PRBool IsAncestorFrameCrossDoc(nsIFrame* aAncestorFrame, nsIFrame* aFrame,
nsIFrame* aCommonAncestor = nsnull);
/** /**
* GetFrameFor returns the root frame for a view * GetFrameFor returns the root frame for a view
* @param aView is the view to return the root frame for * @param aView is the view to return the root frame for