diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index f34d8e5bd44..f7b280cff68 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -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;