recursion failing finding the same frame we started with sometimes with generated content from style. simple 2 line check to avoind this. dagley said ok to check in red tree since not hurting anyone.

This commit is contained in:
mjudge@netscape.com
1999-09-22 06:12:44 +00:00
parent 76688b46fa
commit 4d9d482ba6
2 changed files with 20 additions and 2 deletions
+10 -1
View File
@@ -2023,7 +2023,16 @@ nsFrame::PeekOffset(nsPeekOffsetStruct *aPos)
edgeCase, //start from thisLine
&(aPos->mResultFrame)
);
doneLooping = PR_TRUE; //do not continue with while loop
if (aPos->mResultFrame == this)//we came back to same spot! keep going
{
aPos->mResultFrame = nsnull;
if (aPos->mDirection == eDirPrevious)
thisLine--;
else
thisLine++;
}
else
doneLooping = PR_TRUE; //do not continue with while loop
if (NS_SUCCEEDED(result) && aPos->mResultFrame){
result = aPos->mResultFrame->QueryInterface(nsILineIterator::GetIID(),getter_AddRefs(it));
if (NS_SUCCEEDED(result) && it)//we have struck another block element!
+10 -1
View File
@@ -2023,7 +2023,16 @@ nsFrame::PeekOffset(nsPeekOffsetStruct *aPos)
edgeCase, //start from thisLine
&(aPos->mResultFrame)
);
doneLooping = PR_TRUE; //do not continue with while loop
if (aPos->mResultFrame == this)//we came back to same spot! keep going
{
aPos->mResultFrame = nsnull;
if (aPos->mDirection == eDirPrevious)
thisLine--;
else
thisLine++;
}
else
doneLooping = PR_TRUE; //do not continue with while loop
if (NS_SUCCEEDED(result) && aPos->mResultFrame){
result = aPos->mResultFrame->QueryInterface(nsILineIterator::GetIID(),getter_AddRefs(it));
if (NS_SUCCEEDED(result) && it)//we have struck another block element!