From ffb0f5620e34646cf0efb4606f4df5472b522dd3 Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Wed, 13 Jun 2007 09:13:25 +0000 Subject: [PATCH] Bug 366128. Restrict disabling of floats in XUL to cases where the container is not a float containing block. r+sr=bzbarsky git-svn-id: svn://10.0.0.236/trunk@227957 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSFrameConstructor.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index f34d8e5bd44..f7b280cff68 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/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;