Don't propagate line layout in reflow state when we're not in the line. b=320502 r+sr=roc

This commit is contained in:
dbaron@dbaron.org 2007-05-17 23:04:04 -07:00
parent 4fdff9f2af
commit 93042a4e45
8 changed files with 16 additions and 6 deletions

View File

@ -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

View File

@ -277,7 +277,6 @@ nsBlockReflowContext::ReflowBlock(const nsRect& aSpace,
}
}
aFrameRS.mLineLayout = nsnull;
if (!aIsAdjacentWithTop) {
aFrameRS.mFlags.mIsTopOfPage = PR_FALSE; // make sure this is cleared
}

View File

@ -66,6 +66,8 @@ public:
virtual PRBool IsFrameOfType(PRUint32 aFlags) const
{
if (!GetStyleDisplay()->IsFloating())
aFlags = aFlags & ~(nsIFrame::eLineParticipant);
return nsFirstLetterFrameSuper::IsFrameOfType(aFlags &
~(nsIFrame::eBidiInlineContainer));
}

View File

@ -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);

View File

@ -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

View File

@ -103,7 +103,7 @@ public:
virtual PRBool IsFrameOfType(PRUint32 aFlags) const
{
return nsInlineFrameSuper::IsFrameOfType(aFlags &
~(nsIFrame::eBidiInlineContainer));
~(nsIFrame::eBidiInlineContainer | nsIFrame::eLineParticipant));
}
virtual PRBool IsEmpty();

View File

@ -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

View File

@ -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