Bug 398797: let rel.-positioned inline-blocks be containing blocks for abs. content. r+sr=bz, a=blocking1.9+

This commit is contained in:
2007-11-07 12:00:51 -08:00
parent 6e4023c7a7
commit c7ac4fe8d5
9 changed files with 83 additions and 10 deletions

View File

@@ -6562,17 +6562,18 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsFrameConstructorState& aSta
}
// See if it's relatively positioned
else if ((NS_STYLE_POSITION_RELATIVE == aDisplay->mPosition) &&
((NS_STYLE_DISPLAY_BLOCK == aDisplay->mDisplay) ||
(NS_STYLE_DISPLAY_INLINE == aDisplay->mDisplay) ||
(NS_STYLE_DISPLAY_LIST_ITEM == aDisplay->mDisplay))) {
(aDisplay->IsBlockInside() ||
(NS_STYLE_DISPLAY_INLINE == aDisplay->mDisplay))) {
if (!aHasPseudoParent && !aState.mPseudoFrames.IsEmpty()) {
ProcessPseudoFrames(aState, aFrameItems);
}
// Is it block-level or inline-level?
if ((NS_STYLE_DISPLAY_BLOCK == aDisplay->mDisplay) ||
(NS_STYLE_DISPLAY_LIST_ITEM == aDisplay->mDisplay)) {
// Create a wrapper frame. No space manager, though
newFrame = NS_NewRelativeItemWrapperFrame(mPresShell, aStyleContext);
if (aDisplay->IsBlockInside()) {
// Create a wrapper frame. Only need space manager if it's inline-block
PRUint32 flags = (aDisplay->mDisplay == NS_STYLE_DISPLAY_INLINE_BLOCK ?
NS_BLOCK_SPACE_MGR | NS_BLOCK_MARGIN_ROOT : 0);
newFrame = NS_NewRelativeItemWrapperFrame(mPresShell, aStyleContext,
flags);
// XXXbz should we be passing in a non-null aContentParentFrame?
ConstructBlock(aState, aDisplay, aContent,
aParentFrame, nsnull, aStyleContext, &newFrame,
@@ -12634,7 +12635,7 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
blockSC = mPresShell->StyleSet()->
ResolvePseudoStyleFor(aContent, blockStyle, aStyleContext);
blockFrame = NS_NewRelativeItemWrapperFrame(mPresShell, blockSC);
blockFrame = NS_NewRelativeItemWrapperFrame(mPresShell, blockSC, 0);
}
else {
blockStyle = nsCSSAnonBoxes::mozAnonymousBlock;