From 334b39bebc9036e1ecd8819fea8d6c4653a0f69c Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Wed, 31 Jan 2001 23:20:39 +0000 Subject: [PATCH] Bug 67125. If the hint fails, start over to avoid problems when hint is an out-of-flow frame. r=attinasi, sr=buster git-svn-id: svn://10.0.0.236/trunk@85890 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSFrameConstructor.cpp | 13 ++++++++++++- .../layout/html/style/src/nsCSSFrameConstructor.cpp | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 2e634b0492f..7d7fa65d027 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -10912,7 +10912,6 @@ keepLooking: printf("skipping hint because parent frame is special\n"); #endif } - firstTime = PR_FALSE; } if (!kidFrame) { // we didn't have enough info to prune, start searching from the beginning aParentFrame->FirstChild(aPresContext, listName, &kidFrame); @@ -10972,6 +10971,18 @@ keepLooking: #endif } + if (firstTime) { + firstTime = PR_FALSE; + + // If we get here, and we had a hint, then we didn't find a + // frame. The hint may have been a floated or absolutely + // positioned frame, in which case we'd be off in the weeds + // looking through something other than primary frame + // list. Reboot the search from scratch. + if (aHint) + goto keepLooking; + } + NS_IF_RELEASE(listName); aParentFrame->GetAdditionalChildListName(listIndex++, &listName); } while(listName); diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index 2e634b0492f..7d7fa65d027 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -10912,7 +10912,6 @@ keepLooking: printf("skipping hint because parent frame is special\n"); #endif } - firstTime = PR_FALSE; } if (!kidFrame) { // we didn't have enough info to prune, start searching from the beginning aParentFrame->FirstChild(aPresContext, listName, &kidFrame); @@ -10972,6 +10971,18 @@ keepLooking: #endif } + if (firstTime) { + firstTime = PR_FALSE; + + // If we get here, and we had a hint, then we didn't find a + // frame. The hint may have been a floated or absolutely + // positioned frame, in which case we'd be off in the weeds + // looking through something other than primary frame + // list. Reboot the search from scratch. + if (aHint) + goto keepLooking; + } + NS_IF_RELEASE(listName); aParentFrame->GetAdditionalChildListName(listIndex++, &listName); } while(listName);