diff --git a/layout/base/crashtests/560447-1.html b/layout/base/crashtests/560447-1.html new file mode 100644 index 00000000000..e6d4f9cb4ed --- /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 e7036eb3bb5..41927df1470 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 e62cd6ea40f..6ca5ff40936 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;