Bug 607494. Don't create frame construction items for content that has a primary frame. r=bzbarsky a=blocking-final+
authorTimothy Nikkel <tnikkel@gmail.com>
Wed, 24 Nov 2010 19:35:02 -0600
changeset 58205 c6a2526886f959b6923e93aa5578945140dca1f9
parent 58204 a352c0afa63175292938f9392e2c5fb39ec58251
child 58206 015f5aa6ede2db5e8c376255c8686617f1668aaa
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersbzbarsky, blocking-final
bugs607494
milestone2.0b8pre
Bug 607494. Don't create frame construction items for content that has a primary frame. r=bzbarsky a=blocking-final+
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -5038,20 +5038,23 @@ nsCSSFrameConstructor::AddFrameConstruct
     // display:none parent when our last restyle was posted and
     // processed and now no longer do).
     aContent->UnsetFlags(ELEMENT_ALL_RESTYLE_FLAGS &
                          ~ELEMENT_PENDING_RESTYLE_FLAGS);
   }
 
   // XXX the GetContent() != aContent check is needed due to bug 135040.
   // Remove it once that's fixed.  
-  NS_ASSERTION(!aContent->GetPrimaryFrame() ||
-    aContent->GetPrimaryFrame()->GetContent() != aContent ||
-    aState.mCreatingExtraFrames,
-    "asked to create frame construction item for a node that already has a frame");
+  if (aContent->GetPrimaryFrame() &&
+      aContent->GetPrimaryFrame()->GetContent() == aContent &&
+      !aState.mCreatingExtraFrames) {
+    NS_ERROR("asked to create frame construction item for a node that already "
+             "has a frame");
+    return;
+  }
 
   // don't create a whitespace frame if aParent doesn't want it
   if (!NeedFrameFor(aState, aParentFrame, aContent)) {
     return;
   }
 
   // never create frames for comments or PIs
   if (aContent->IsNodeOfType(nsINode::eCOMMENT) ||