Don't mess with empty float cache lists. Bug 334105, r+sr+branch181=dbaron

This commit is contained in:
bzbarsky@mit.edu
2006-04-17 01:47:11 +00:00
parent bbe8e84d06
commit 855fdea48a
2 changed files with 10 additions and 4 deletions

View File

@@ -459,11 +459,11 @@ void
nsLineBox::FreeFloats(nsFloatCacheFreeList& aFreeList)
{
NS_ABORT_IF_FALSE(IsInline(), "block line can't have floats");
if (IsInline()) {
if (mInlineData) {
if (IsInline() && mInlineData) {
if (mInlineData->mFloats.NotEmpty()) {
aFreeList.Append(mInlineData->mFloats);
MaybeFreeData();
}
MaybeFreeData();
}
}
@@ -850,6 +850,8 @@ nsFloatCacheList::Tail() const
void
nsFloatCacheList::Append(nsFloatCacheFreeList& aList)
{
NS_PRECONDITION(aList.NotEmpty(), "Appending empty list will fail");
nsFloatCache* tail = Tail();
if (tail) {
NS_ASSERTION(!tail->mNext, "Bogus!");
@@ -908,6 +910,8 @@ nsFloatCacheFreeList::~nsFloatCacheFreeList()
void
nsFloatCacheFreeList::Append(nsFloatCacheList& aList)
{
NS_PRECONDITION(aList.NotEmpty(), "Appending empty list will fail");
if (mTail) {
NS_ASSERTION(!mTail->mNext, "Bogus");
mTail->mNext = aList.mHead;