diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index a13ceb37cad..967d0fd21d7 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -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; diff --git a/mozilla/layout/generic/nsHTMLParts.h b/mozilla/layout/generic/nsHTMLParts.h index c2334962eaf..8660f113a49 100644 --- a/mozilla/layout/generic/nsHTMLParts.h +++ b/mozilla/layout/generic/nsHTMLParts.h @@ -125,8 +125,8 @@ NS_NewFloatingItemWrapperFrame(nsIPresShell* aPresShell, nsStyleContext* aContex // This type of AreaFrame doesn't use its own space manager and // doesn't shrink wrap. inline nsIFrame* -NS_NewRelativeItemWrapperFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { - return NS_NewAreaFrame(aPresShell, aContext, 0); +NS_NewRelativeItemWrapperFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags) { + return NS_NewAreaFrame(aPresShell, aContext, aFlags); } nsIFrame* diff --git a/mozilla/layout/reftests/bugs/398797-1-ref.html b/mozilla/layout/reftests/bugs/398797-1-ref.html new file mode 100644 index 00000000000..cf32e846bc2 --- /dev/null +++ b/mozilla/layout/reftests/bugs/398797-1-ref.html @@ -0,0 +1,11 @@ + + + + + +
foo
+
+ bar +
+ + diff --git a/mozilla/layout/reftests/bugs/398797-1a.html b/mozilla/layout/reftests/bugs/398797-1a.html new file mode 100644 index 00000000000..ed3613f45f5 --- /dev/null +++ b/mozilla/layout/reftests/bugs/398797-1a.html @@ -0,0 +1,11 @@ + + + + + +
foo
+
+ bar +
+ + diff --git a/mozilla/layout/reftests/bugs/398797-1b.html b/mozilla/layout/reftests/bugs/398797-1b.html new file mode 100644 index 00000000000..8fb4fc660fb --- /dev/null +++ b/mozilla/layout/reftests/bugs/398797-1b.html @@ -0,0 +1,11 @@ + + + + + +
foo
+
+ bar +
+ + diff --git a/mozilla/layout/reftests/bugs/398797-1c.html b/mozilla/layout/reftests/bugs/398797-1c.html new file mode 100644 index 00000000000..ade00e52eee --- /dev/null +++ b/mozilla/layout/reftests/bugs/398797-1c.html @@ -0,0 +1,11 @@ + + + + + +
foo
+
+ bar +
+ + diff --git a/mozilla/layout/reftests/bugs/398797-1d.html b/mozilla/layout/reftests/bugs/398797-1d.html new file mode 100644 index 00000000000..5c726daf551 --- /dev/null +++ b/mozilla/layout/reftests/bugs/398797-1d.html @@ -0,0 +1,11 @@ + + + + + +
foo
+
+ bar +
+ + diff --git a/mozilla/layout/reftests/bugs/398797-style.css b/mozilla/layout/reftests/bugs/398797-style.css new file mode 100644 index 00000000000..d917dc92b49 --- /dev/null +++ b/mozilla/layout/reftests/bugs/398797-style.css @@ -0,0 +1,13 @@ +/* Size the divs */ +div { width: 50px; height: 50px; } + +/* Colors */ +div.green { background: lightgreen; } +div.blue { background: lightblue; } +span.yellow { background: yellow; } + +/* Positioning */ +.abs { position: absolute; } +.rel { position: relative; } +.in { display: inline-block; } +.pos { top: 0px; left: 0px; } diff --git a/mozilla/layout/reftests/bugs/reftest.list b/mozilla/layout/reftests/bugs/reftest.list index 60defc4ff0c..8ce53836dd1 100644 --- a/mozilla/layout/reftests/bugs/reftest.list +++ b/mozilla/layout/reftests/bugs/reftest.list @@ -423,6 +423,10 @@ fails == 393655-2.html 393655-2-ref.html # Remove 'fails' when 393655 lands == 395331-1.xml 395331-1-ref.xml == 396286-1.html about:blank # crash test == 398289-1.html 398289-1-ref.html +== 398797-1a.html 398797-1-ref.html +== 398797-1b.html 398797-1-ref.html +== 398797-1c.html 398797-1-ref.html +== 398797-1d.html 398797-1-ref.html == 399384-1.html 399384-1-ref.html fails == 400171-1a.html 400171-1-ref.html # Remove 'fails' when 400171 lands == 400171-1b.html 400171-1-ref.html