From a0f2ac4e06c2b228bb875f35ea7ce5d2e8c00137 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Wed, 15 Mar 2000 04:38:08 +0000 Subject: [PATCH] b=21903. Fixes a crash when absolutely positioning a form element. The problem was no space manager was getting created for the form's frame git-svn-id: svn://10.0.0.236/trunk@63004 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSFrameConstructor.cpp | 5 ++++- mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 3e384535706..bf17610bf17 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -3882,7 +3882,10 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresShell* aPresShell, rv = NS_NewObjectFrame(aPresShell, &newFrame); } else if (nsHTMLAtoms::form == aTag) { - rv = NS_NewFormFrame(aPresShell, &newFrame, 0); + PRBool isOutOfFlow = isFloating || isAbsolutelyPositioned || isFixedPositioned; + + rv = NS_NewFormFrame(aPresShell, &newFrame, + isOutOfFlow ? NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT : 0); processChildren = PR_TRUE; } else if (nsHTMLAtoms::frameset == aTag) { diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index 3e384535706..bf17610bf17 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -3882,7 +3882,10 @@ nsCSSFrameConstructor::ConstructFrameByTag(nsIPresShell* aPresShell, rv = NS_NewObjectFrame(aPresShell, &newFrame); } else if (nsHTMLAtoms::form == aTag) { - rv = NS_NewFormFrame(aPresShell, &newFrame, 0); + PRBool isOutOfFlow = isFloating || isAbsolutelyPositioned || isFixedPositioned; + + rv = NS_NewFormFrame(aPresShell, &newFrame, + isOutOfFlow ? NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT : 0); processChildren = PR_TRUE; } else if (nsHTMLAtoms::frameset == aTag) {