Closed Bug 36095 Opened 26 years ago Closed 26 years ago

Inifite loop in GetNearestContainingBlock()

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: jst, Assigned: troy)

References

Details

In nsHTMLReflowState.cpp from line 435 down there a function called GetNearestContainingBlock, the function starts out like this: static nsIFrame* GetNearestContainingBlock(nsIFrame* aFrame, nsMargin& aContentArea) { aFrame->GetParent(&aFrame); while (aFrame) { nsIAtom* frameType; PRBool isBlock; aFrame->GetFrameType(&frameType); isBlock = frameType == nsLayoutAtoms::blockFrame; NS_IF_RELEASE(frameType); if (isBlock) { break; } } now, if the parent of the frame that is passed to this function is not a nsLayoutAtoms::blockFrame the loop is never terminated, this patch fixes the loop and AFAIK it's the right thing to do. Index: html/base/src/nsHTMLReflowState.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/html/base/src/nsHTMLReflowState.cpp,v retrieving revision 1.73 diff -u -r1.73 nsHTMLReflowState.cpp --- html/base/src/nsHTMLReflowState.cpp 2000/04/16 04:07:02 1.73 +++ html/base/src/nsHTMLReflowState.cpp 2000/04/17 21:11:47 @@ -446,6 +446,8 @@ if (isBlock) { break; } + + aFrame->GetParent(&aFrame); } if (aFrame) { (this showed up for brade when she was testing some new editor dialogs that are not in the build yet)
Yes, that's the correct thing to do. I had it that way, but somewhere along the line I must have changed it. Unfortunately my tests didn't catch it Thanks. I will check it in once the tree opens
Status: NEW → ASSIGNED
Fixed
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
*** Bug 36149 has been marked as a duplicate of this bug. ***
*** Bug 36154 has been marked as a duplicate of this bug. ***
*** Bug 36086 has been marked as a duplicate of this bug. ***
*** Bug 36228 has been marked as a duplicate of this bug. ***
Marking verified fixed per last comments.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.