Bug 366128. Restrict disabling of floats in XUL to cases where the container is not a float containing block. r+sr=bzbarsky

This commit is contained in:
roc+@cs.cmu.edu 2007-06-13 02:13:25 -07:00
parent 85901f7a47
commit 69030508c5

View File

@ -5792,6 +5792,8 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
aTag == nsGkAtoms::description) {
if ((aTag == nsGkAtoms::label || aTag == nsGkAtoms::description) &&
(! aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::value))) {
// XXX we should probably be calling ConstructBlock here to handle
// things like columns etc
newFrame = NS_NewAreaFrame(mPresShell, aStyleContext,
NS_BLOCK_SPACE_MGR | NS_BLOCK_MARGIN_ROOT);
}
@ -6114,12 +6116,14 @@ nsCSSFrameConstructor::ConstructXULFrame(nsFrameConstructorState& aState,
}
#endif
// Push a null float containing block to disable floating within xul
// If the new frame isn't a float containing block, then push a null
// float containing block to disable floats. This is needed to disable
// floats within XUL frames.
nsFrameConstructorSaveState floatSaveState;
if (newFrame->IsBoxFrame()) {
aState.PushFloatContainingBlock(nsnull, floatSaveState, PR_FALSE,
PR_FALSE);
}
PRBool isFloatContainingBlock =
newFrame->GetContentInsertionFrame()->IsFloatContainingBlock();
aState.PushFloatContainingBlock(isFloatContainingBlock ? newFrame : nsnull,
floatSaveState, PR_FALSE, PR_FALSE);
// Process the child content if requested
nsFrameItems childItems;