Look on all lists for frames

This commit is contained in:
kipp%netscape.com 1998-11-17 01:03:28 +00:00
parent a37cfd6b02
commit c3aca28e6c
2 changed files with 32 additions and 18 deletions

View File

@ -909,16 +909,23 @@ FindFrameWithContent(nsIFrame* aFrame, nsIContent* aContent)
}
NS_IF_RELEASE(frameContent);
aFrame->FirstChild(nsnull, aFrame);
while (aFrame) {
nsIFrame* result = FindFrameWithContent(aFrame, aContent);
if (result) {
return result;
// Search for the frame in each child list that aFrame supports
nsIAtom* listName = nsnull;
PRInt32 listIndex = 0;
do {
nsIFrame* kid;
aFrame->FirstChild(listName, kid);
while (nsnull != kid) {
nsIFrame* result = FindFrameWithContent(kid, aContent);
if (nsnull != result) {
NS_IF_RELEASE(listName);
return result;
}
kid->GetNextSibling(kid);
}
aFrame->GetNextSibling(aFrame);
}
NS_IF_RELEASE(listName);
aFrame->GetAdditionalChildListName(listIndex++, listName);
} while(nsnull != listName);
return nsnull;
}

View File

@ -909,16 +909,23 @@ FindFrameWithContent(nsIFrame* aFrame, nsIContent* aContent)
}
NS_IF_RELEASE(frameContent);
aFrame->FirstChild(nsnull, aFrame);
while (aFrame) {
nsIFrame* result = FindFrameWithContent(aFrame, aContent);
if (result) {
return result;
// Search for the frame in each child list that aFrame supports
nsIAtom* listName = nsnull;
PRInt32 listIndex = 0;
do {
nsIFrame* kid;
aFrame->FirstChild(listName, kid);
while (nsnull != kid) {
nsIFrame* result = FindFrameWithContent(kid, aContent);
if (nsnull != result) {
NS_IF_RELEASE(listName);
return result;
}
kid->GetNextSibling(kid);
}
aFrame->GetNextSibling(aFrame);
}
NS_IF_RELEASE(listName);
aFrame->GetAdditionalChildListName(listIndex++, listName);
} while(nsnull != listName);
return nsnull;
}