When we push a pseudo cell frame, the block inside it needs to become the float

containing block.  Otherwise, floats inside this cellframe get very confused.
Bug 233094 and various dependencies, r+sr=dbaron
This commit is contained in:
bzbarsky%mit.edu 2004-04-24 16:00:46 +00:00
parent 3357b06204
commit 409de81840
2 changed files with 36 additions and 0 deletions

View File

@ -2977,6 +2977,13 @@ nsCSSFrameConstructor::ConstructTableForeignFrame(nsIPresShell* aPres
if (!parentFrame) return rv; // if pseudo frame wasn't created if (!parentFrame) return rv; // if pseudo frame wasn't created
NS_ASSERTION(parentFrame == aState.mPseudoFrames.mCellInner.mFrame,
"Weird parent in ConstructTableForeignFrame");
// Push the parent as the floater containing block
nsFrameConstructorSaveState saveState;
aState.PushFloatContainingBlock(parentFrame, saveState, PR_FALSE, PR_FALSE);
// save the pseudo frame state XXX - why // save the pseudo frame state XXX - why
nsPseudoFrames prevPseudoFrames; nsPseudoFrames prevPseudoFrames;
aState.mPseudoFrames.Reset(&prevPseudoFrames); aState.mPseudoFrames.Reset(&prevPseudoFrames);
@ -6061,6 +6068,17 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresShell* aPre
} }
} }
nsFrameConstructorSaveState pseudoSaveState;
if (pseudoParent) {
// We pushed an anonymous table cell. The inner block of this
// needs to become the float containing block. Luckily, it's
// hanging about in adjParentFrame!
NS_ASSERTION(adjParentFrame == aState.mPseudoFrames.mCellInner.mFrame,
"Weird parent frame in ConstructFrameByDisplayType");
aState.PushFloatContainingBlock(adjParentFrame, pseudoSaveState,
PR_FALSE, PR_FALSE);
}
// If this is "body", try propagating its scroll style to the viewport // If this is "body", try propagating its scroll style to the viewport
// Note that we need to do this even if the body is NOT scrollable; // Note that we need to do this even if the body is NOT scrollable;
// it might have dynamically changed from scrollable to not scrollable, // it might have dynamically changed from scrollable to not scrollable,

View File

@ -2977,6 +2977,13 @@ nsCSSFrameConstructor::ConstructTableForeignFrame(nsIPresShell* aPres
if (!parentFrame) return rv; // if pseudo frame wasn't created if (!parentFrame) return rv; // if pseudo frame wasn't created
NS_ASSERTION(parentFrame == aState.mPseudoFrames.mCellInner.mFrame,
"Weird parent in ConstructTableForeignFrame");
// Push the parent as the floater containing block
nsFrameConstructorSaveState saveState;
aState.PushFloatContainingBlock(parentFrame, saveState, PR_FALSE, PR_FALSE);
// save the pseudo frame state XXX - why // save the pseudo frame state XXX - why
nsPseudoFrames prevPseudoFrames; nsPseudoFrames prevPseudoFrames;
aState.mPseudoFrames.Reset(&prevPseudoFrames); aState.mPseudoFrames.Reset(&prevPseudoFrames);
@ -6061,6 +6068,17 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresShell* aPre
} }
} }
nsFrameConstructorSaveState pseudoSaveState;
if (pseudoParent) {
// We pushed an anonymous table cell. The inner block of this
// needs to become the float containing block. Luckily, it's
// hanging about in adjParentFrame!
NS_ASSERTION(adjParentFrame == aState.mPseudoFrames.mCellInner.mFrame,
"Weird parent frame in ConstructFrameByDisplayType");
aState.PushFloatContainingBlock(adjParentFrame, pseudoSaveState,
PR_FALSE, PR_FALSE);
}
// If this is "body", try propagating its scroll style to the viewport // If this is "body", try propagating its scroll style to the viewport
// Note that we need to do this even if the body is NOT scrollable; // Note that we need to do this even if the body is NOT scrollable;
// it might have dynamically changed from scrollable to not scrollable, // it might have dynamically changed from scrollable to not scrollable,