Bug 495350. Do a better job of keeping track of our line participant count. r+sr=roc

This commit is contained in:
Boris Zbarsky 2009-06-11 13:09:35 -04:00
parent 1220485428
commit f25879a0a0
4 changed files with 24 additions and 4 deletions

View File

@ -0,0 +1,9 @@
<html>
<head>
</head>
<body>
<div style="display: -moz-inline-box;">
<br style="position: fixed;">
</div>
</body>
</html>

View File

@ -237,3 +237,4 @@ load 490747.html
load 492014.xhtml load 492014.xhtml
load 492112-1.xhtml load 492112-1.xhtml
load 492163-1.xhtml load 492163-1.xhtml
load 495350-1.html

View File

@ -5421,7 +5421,7 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
// it's conservative in the sense that anything that will really end up // it's conservative in the sense that anything that will really end up
// as an in-flow non-inline will have false mIsAllInline. It just might // as an in-flow non-inline will have false mIsAllInline. It just might
// be that even an inline that has mIsAllInline false doesn't need an // be that even an inline that has mIsAllInline false doesn't need an
// {ib} split. So this is just an optimization to keep from doint to // {ib} split. So this is just an optimization to keep from doing too
// much work when that happens. // much work when that happens.
(!(bits & FCDATA_DISALLOW_OUT_OF_FLOW) && (!(bits & FCDATA_DISALLOW_OUT_OF_FLOW) &&
aState.GetGeometricParent(display, nsnull)) || aState.GetGeometricParent(display, nsnull)) ||
@ -5433,7 +5433,14 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
aItems.InlineItemAdded(); aItems.InlineItemAdded();
} }
if (bits & FCDATA_IS_LINE_PARTICIPANT) { // Our item should be treated as a line participant if we have the relevant
// bit and are going to be in-flow. Note that this really only matters if
// our ancestor is a box or some such, so the fact that we might have an
// inline ancestor that might become a containing block is not relevant here.
if ((bits & FCDATA_IS_LINE_PARTICIPANT) &&
((bits & FCDATA_DISALLOW_OUT_OF_FLOW) ||
!aState.GetGeometricParent(display, nsnull))) {
item->mIsLineParticipant = PR_TRUE;
aItems.LineParticipantItemAdded(); aItems.LineParticipantItemAdded();
} }
} }
@ -11550,7 +11557,7 @@ AdjustCountsForItem(FrameConstructionItem* aItem, PRInt32 aDelta)
if (aItem->mIsAllInline) { if (aItem->mIsAllInline) {
mInlineCount += aDelta; mInlineCount += aDelta;
} }
if (aItem->mFCData->mBits & FCDATA_IS_LINE_PARTICIPANT) { if (aItem->mIsLineParticipant) {
mLineParticipantCount += aDelta; mLineParticipantCount += aDelta;
} }
mDesiredParentCounts[aItem->DesiredParentType()] += aDelta; mDesiredParentCounts[aItem->DesiredParentType()] += aDelta;

View File

@ -841,7 +841,8 @@ private:
mNameSpaceID(aNameSpaceID), mStyleContext(aStyleContext), mNameSpaceID(aNameSpaceID), mStyleContext(aStyleContext),
mIsText(PR_FALSE), mIsGeneratedContent(PR_FALSE), mIsText(PR_FALSE), mIsGeneratedContent(PR_FALSE),
mIsRootPopupgroup(PR_FALSE), mIsAllInline(PR_FALSE), mIsRootPopupgroup(PR_FALSE), mIsAllInline(PR_FALSE),
mHasInlineEnds(PR_FALSE), mIsPopup(PR_FALSE) mHasInlineEnds(PR_FALSE), mIsPopup(PR_FALSE),
mIsLineParticipant(PR_FALSE)
{} {}
~FrameConstructionItem() { ~FrameConstructionItem() {
if (mIsGeneratedContent) { if (mIsGeneratedContent) {
@ -887,6 +888,8 @@ private:
// Whether construction from this item will create a popup that needs to // Whether construction from this item will create a popup that needs to
// go into the global popup items. // go into the global popup items.
PRPackedBool mIsPopup; PRPackedBool mIsPopup;
// Whether this item should be treated as a line participant
PRPackedBool mIsLineParticipant;
// Child frame construction items. // Child frame construction items.
FrameConstructionItemList mChildItems; FrameConstructionItemList mChildItems;