diff --git a/layout/generic/nsBRFrame.cpp b/layout/generic/nsBRFrame.cpp index 13d501553d1..5144155de95 100644 --- a/layout/generic/nsBRFrame.cpp +++ b/layout/generic/nsBRFrame.cpp @@ -84,7 +84,8 @@ public: virtual PRBool IsFrameOfType(PRUint32 aFlags) const { - return nsFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced)); + return nsFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced | + nsIFrame::eLineParticipant)); } #ifdef ACCESSIBILITY diff --git a/layout/generic/nsBlockReflowContext.cpp b/layout/generic/nsBlockReflowContext.cpp index d1eefd23bb1..ad46e9ae510 100644 --- a/layout/generic/nsBlockReflowContext.cpp +++ b/layout/generic/nsBlockReflowContext.cpp @@ -277,7 +277,6 @@ nsBlockReflowContext::ReflowBlock(const nsRect& aSpace, } } - aFrameRS.mLineLayout = nsnull; if (!aIsAdjacentWithTop) { aFrameRS.mFlags.mIsTopOfPage = PR_FALSE; // make sure this is cleared } diff --git a/layout/generic/nsFirstLetterFrame.cpp b/layout/generic/nsFirstLetterFrame.cpp index daf60ac7a90..a1729a01833 100644 --- a/layout/generic/nsFirstLetterFrame.cpp +++ b/layout/generic/nsFirstLetterFrame.cpp @@ -66,6 +66,8 @@ public: virtual PRBool IsFrameOfType(PRUint32 aFlags) const { + if (!GetStyleDisplay()->IsFloating()) + aFlags = aFlags & ~(nsIFrame::eLineParticipant); return nsFirstLetterFrameSuper::IsFrameOfType(aFlags & ~(nsIFrame::eBidiInlineContainer)); } diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index 959d7d007de..a46d68371fe 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -158,7 +158,10 @@ nsHTMLReflowState::nsHTMLReflowState(nsPresContext* aPresContext, availableHeight = aAvailableSpace.height; mSpaceManager = aParentReflowState.mSpaceManager; - mLineLayout = aParentReflowState.mLineLayout; + if (frame->IsFrameOfType(nsIFrame::eLineParticipant)) + mLineLayout = aParentReflowState.mLineLayout; + else + mLineLayout = nsnull; mFlags.mIsTopOfPage = aParentReflowState.mFlags.mIsTopOfPage; mFlags.mNextInFlowUntouched = aParentReflowState.mFlags.mNextInFlowUntouched && CheckNextInFlowParenthood(aFrame, aParentReflowState.frame); diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index b680a54d9b0..b6ba987ef1e 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -1435,6 +1435,9 @@ public: // Frame that contains a block but looks like a replaced element // from the outside eReplacedContainsBlock = 1 << 5, + // A frame that participates in inline reflow, i.e., one that + // requires nsHTMLReflowState::mLineLayout. + eLineParticipant = 1 << 6, // These are to allow nsFrame::Init to assert that IsFrameOfType diff --git a/layout/generic/nsInlineFrame.h b/layout/generic/nsInlineFrame.h index f771905ae43..c56e8f1e43d 100644 --- a/layout/generic/nsInlineFrame.h +++ b/layout/generic/nsInlineFrame.h @@ -103,7 +103,7 @@ public: virtual PRBool IsFrameOfType(PRUint32 aFlags) const { return nsInlineFrameSuper::IsFrameOfType(aFlags & - ~(nsIFrame::eBidiInlineContainer)); + ~(nsIFrame::eBidiInlineContainer | nsIFrame::eLineParticipant)); } virtual PRBool IsEmpty(); diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 9260b28da96..3aadca178b2 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -331,7 +331,8 @@ public: { // Set the frame state bit for text frames to mark them as replaced. // XXX kipp: temporary - return nsFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced)); + return nsFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced | + nsIFrame::eLineParticipant)); } #ifdef DEBUG diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp index b30d347e3d8..ddb991cd3d6 100644 --- a/layout/generic/nsTextFrameThebes.cpp +++ b/layout/generic/nsTextFrameThebes.cpp @@ -374,7 +374,8 @@ public: { // Set the frame state bit for text frames to mark them as replaced. // XXX kipp: temporary - return nsFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced)); + return nsFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced | + nsIFrame::eLineParticipant)); } #ifdef DEBUG