mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-01 05:43:46 +00:00
Look on all lists for frames
This commit is contained in:
parent
a37cfd6b02
commit
c3aca28e6c
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user