From 9b5edcef2cf94d4375cf2b992e3db71c8b30f37d Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Wed, 7 Nov 2007 19:55:12 -0800 Subject: [PATCH] Bug 398144 - Make blocks that are margin-roots never consider themselves empty. [p=roc r+sr=dbaron a=blocking1.9+] --- layout/generic/nsBlockFrame.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 4592defd7021..20c90e76f09e 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -2574,6 +2574,12 @@ IsMarginZero(nsStyleUnit aUnit, nsStyleCoord &aCoord) /* virtual */ PRBool nsBlockFrame::IsSelfEmpty() { + // Blocks which are margin-roots (including inline-blocks) cannot be treated + // as empty for margin-collapsing and other purposes. They're more like + // replaced elements. + if (GetStateBits() & NS_BLOCK_MARGIN_ROOT) + return PR_FALSE; + const nsStylePosition* position = GetStylePosition(); switch (position->mMinHeight.GetUnit()) {