Factored out FrameForPoint code into one that takes a particular list

git-svn-id: svn://10.0.0.236/trunk@14951 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com
1998-11-19 18:09:03 +00:00
parent 84410733de
commit 9ac80e4d0f
4 changed files with 28 additions and 4 deletions

View File

@@ -338,13 +338,21 @@ nsContainerFrame::PaintChild(nsIPresContext& aPresContext,
NS_IMETHODIMP
nsContainerFrame::GetFrameForPoint(const nsPoint& aPoint,
nsIFrame** aFrame)
{
return GetFrameForPointUsing(aPoint, nsnull, aFrame);
}
nsresult
nsContainerFrame::GetFrameForPointUsing(const nsPoint& aPoint,
nsIAtom* aList,
nsIFrame** aFrame)
{
nsIFrame* kid;
nsRect kidRect;
nsPoint tmp;
*aFrame = nsnull;
FirstChild(nsnull, kid);
FirstChild(aList, kid);
while (nsnull != kid) {
kid->GetRect(kidRect);
if (kidRect.Contains(aPoint)) {
@@ -354,7 +362,7 @@ nsContainerFrame::GetFrameForPoint(const nsPoint& aPoint,
kid->GetNextSibling(kid);
}
FirstChild(nsnull, kid);
FirstChild(aList, kid);
while (nsnull != kid) {
nsFrameState state;
kid->GetFrameState(state);

View File

@@ -94,6 +94,10 @@ protected:
void SizeOfWithoutThis(nsISizeOfHandler* aHandler) const;
nsresult GetFrameForPointUsing(const nsPoint& aPoint,
nsIAtom* aList,
nsIFrame** aFrame);
/**
* Prepare a continuation frame of this frame for reflow. Appends
* it to the flow, sets its content offsets, mLastContentIsComplete,

View File

@@ -338,13 +338,21 @@ nsContainerFrame::PaintChild(nsIPresContext& aPresContext,
NS_IMETHODIMP
nsContainerFrame::GetFrameForPoint(const nsPoint& aPoint,
nsIFrame** aFrame)
{
return GetFrameForPointUsing(aPoint, nsnull, aFrame);
}
nsresult
nsContainerFrame::GetFrameForPointUsing(const nsPoint& aPoint,
nsIAtom* aList,
nsIFrame** aFrame)
{
nsIFrame* kid;
nsRect kidRect;
nsPoint tmp;
*aFrame = nsnull;
FirstChild(nsnull, kid);
FirstChild(aList, kid);
while (nsnull != kid) {
kid->GetRect(kidRect);
if (kidRect.Contains(aPoint)) {
@@ -354,7 +362,7 @@ nsContainerFrame::GetFrameForPoint(const nsPoint& aPoint,
kid->GetNextSibling(kid);
}
FirstChild(nsnull, kid);
FirstChild(aList, kid);
while (nsnull != kid) {
nsFrameState state;
kid->GetFrameState(state);

View File

@@ -94,6 +94,10 @@ protected:
void SizeOfWithoutThis(nsISizeOfHandler* aHandler) const;
nsresult GetFrameForPointUsing(const nsPoint& aPoint,
nsIAtom* aList,
nsIFrame** aFrame);
/**
* Prepare a continuation frame of this frame for reflow. Appends
* it to the flow, sets its content offsets, mLastContentIsComplete,