Bug 522632. Make cellContent blocks returns false from IsContainingBlock. r=dbaron

This commit is contained in:
Boris Zbarsky
2010-03-03 18:53:18 -05:00
parent 6c07345b18
commit fd01d31172
7 changed files with 70 additions and 17 deletions

View File

@@ -307,14 +307,13 @@ void nsHTMLReflowState::InitCBReflowState()
if (parentReflowState->frame->IsContainingBlock() ||
// Absolutely positioned frames should always be kids of the frames that
// determine their containing block
// determine their containing block....
(NS_FRAME_GET_TYPE(mFrameType) == NS_CSS_FRAME_TYPE_ABSOLUTE)) {
// a block inside a table cell needs to use the table cell, and an
// absolutely positioned inner table needs to use the parent of the outer
// table.
// an absolutely positioned inner table needs to use the parent of
// the outer table. So the above comment about absolutely
// positioned frames is sort of a lie.
if (parentReflowState->parentReflowState &&
(IS_TABLE_CELL(parentReflowState->parentReflowState->frame->GetType()) ||
frame->GetType() == nsGkAtoms::tableFrame)) {
frame->GetType() == nsGkAtoms::tableFrame) {
mCBReflowState = parentReflowState->parentReflowState;
} else {
mCBReflowState = parentReflowState;
@@ -376,6 +375,8 @@ nsHTMLReflowState::InitResizeFlags(nsPresContext* aPresContext)
} else if (mCBReflowState && !frame->IsContainingBlock()) {
// XXX Is this problematic for relatively positioned inlines acting
// as containing block for absolutely positioned elements?
// Possibly; in that case we should at least be checking
// NS_SUBTREE_DIRTY, I'd think.
mFlags.mVResize = mCBReflowState->mFlags.mVResize;
} else if (mComputedHeight == NS_AUTOHEIGHT) {
if (eCompatibility_NavQuirks == aPresContext->CompatibilityMode() &&
@@ -717,13 +718,6 @@ nsHTMLReflowState::ComputeRelativeOffsets(const nsHTMLReflowState* cbrs,
}
}
inline PRBool
IsAnonBlockPseudo(nsIAtom *aPseudo)
{
return aPseudo == nsCSSAnonBoxes::mozAnonymousBlock ||
aPseudo == nsCSSAnonBoxes::mozAnonymousPositionedBlock;
}
nsIFrame*
nsHTMLReflowState::GetHypotheticalBoxContainer(nsIFrame* aFrame,
nscoord& aCBLeftEdge,
@@ -732,9 +726,7 @@ nsHTMLReflowState::GetHypotheticalBoxContainer(nsIFrame* aFrame,
do {
aFrame = aFrame->GetParent();
NS_ASSERTION(aFrame, "Must find containing block somewhere");
} while (!(aFrame->IsContainingBlock() ||
(aFrame->IsFrameOfType(nsIFrame::eBlockFrame) &&
IsAnonBlockPseudo(aFrame->GetStyleContext()->GetPseudo()))));
} while (!aFrame->IsContainingBlock());
NS_ASSERTION(aFrame != frame, "How did that happen?");