From 8505796e6e2e80372d56489bd5bc49132a5777fe Mon Sep 17 00:00:00 2001 From: Timothy Nikkel Date: Sat, 1 May 2010 13:42:47 -0500 Subject: [PATCH] Bug 560447. Quiet lazy frame construction assertions for area's because they misbehave. r=bzbarsky --- layout/base/crashtests/560447-1.html | 1 + layout/base/crashtests/crashtests.list | 1 + layout/base/nsCSSFrameConstructor.cpp | 24 ++++++++++++++++++++---- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 layout/base/crashtests/560447-1.html diff --git a/layout/base/crashtests/560447-1.html b/layout/base/crashtests/560447-1.html new file mode 100644 index 000000000000..e6d4f9cb4edf --- /dev/null +++ b/layout/base/crashtests/560447-1.html @@ -0,0 +1 @@ + diff --git a/layout/base/crashtests/crashtests.list b/layout/base/crashtests/crashtests.list index e7036eb3bb57..41927df14709 100644 --- a/layout/base/crashtests/crashtests.list +++ b/layout/base/crashtests/crashtests.list @@ -287,3 +287,4 @@ load 538207-1.xhtml load 538210-1.html load 541869-1.xhtml load 541869-2.html +load 560447-1.html diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index e62cd6ea40f0..6ca5ff40936d 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -6218,7 +6218,11 @@ nsCSSFrameConstructor::MaybeConstructLazily(Operation aOperation, while (content && !content->HasFlag(NODE_DESCENDANTS_NEED_FRAMES)) { NS_ASSERTION(content->GetPrimaryFrame() && - !content->HasFlag(NODE_NEEDS_FRAME), + (!content->HasFlag(NODE_NEEDS_FRAME) || + content->GetPrimaryFrame()->GetContent() != content), + //XXX the content->GetPrimaryFrame()->GetContent() != content + // check is needed due to bug 135040. Remove it once that's + // fixed. "Ancestors of nodes with frames to be constructed lazily " "should have frames and not have NEEDS_FRAME bit set"); content->SetFlags(NODE_DESCENDANTS_NEED_FRAMES); @@ -6227,14 +6231,22 @@ nsCSSFrameConstructor::MaybeConstructLazily(Operation aOperation, // Set NODE_NEEDS_FRAME on the new nodes. if (aOperation == CONTENTINSERT) { - NS_ASSERTION(!aChild->GetPrimaryFrame(), + NS_ASSERTION(!aChild->GetPrimaryFrame() || + aChild->GetPrimaryFrame()->GetContent() != aChild, + //XXX the aChild->GetPrimaryFrame()->GetContent() != aChild + // check is needed due to bug 135040. Remove it once that's + // fixed. "setting NEEDS_FRAME on a node that already has a frame?"); aChild->SetFlags(NODE_NEEDS_FRAME); } else { // CONTENTAPPEND PRUint32 containerCount = aContainer->GetChildCount(); for (PRUint32 i = aIndex; i < containerCount; i++) { nsIContent* child = aContainer->GetChildAt(i); - NS_ASSERTION(!child->GetPrimaryFrame(), + NS_ASSERTION(!child->GetPrimaryFrame() || + child->GetPrimaryFrame()->GetContent() != child, + //XXX the child->GetPrimaryFrame()->GetContent() != child + // check is needed due to bug 135040. Remove it once that's + // fixed. "setting NEEDS_FRAME on a node that already has a frame?"); child->SetFlags(NODE_NEEDS_FRAME); } @@ -6292,7 +6304,11 @@ nsCSSFrameConstructor::CreateNeededFrames(nsIContent* aContent) for (PRUint32 i = 0; i < childCount; i++) { nsIContent* child = aContent->GetChildAt(i); if (child->HasFlag(NODE_NEEDS_FRAME)) { - NS_ASSERTION(!child->GetPrimaryFrame(), + NS_ASSERTION(!child->GetPrimaryFrame() || + child->GetPrimaryFrame()->GetContent() != child, + //XXX the child->GetPrimaryFrame()->GetContent() != child + // check is needed due to bug 135040. Remove it once that's + // fixed. "NEEDS_FRAME set on a node that already has a frame?"); if (!inRun) { inRun = PR_TRUE;