Merge backout of changeset 046f5da25280 due to crash in layout/forms/test/ mochitests.
authorL. David Baron <dbaron@dbaron.org>
Tue, 13 Jan 2009 17:47:38 -0800
changeset 23634 1d21f44cf01ca82c6aaad6eac97449b543704ec9
parent 23632 7165ce2d87c75d6dfab2fa9c60ffcae718dbe4c5 (current diff)
parent 23633 dc598a5eafe10f666a4896b3d452008e6559e263 (diff)
child 23635 602e6c8d494aff5cc17b845c62abcced9aa80623
push id4648
push userdbaron@mozilla.com
push dateWed, 14 Jan 2009 01:47:54 +0000
treeherdermozilla-central@1d21f44cf01c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.2a1pre
Merge backout of changeset 046f5da25280 due to crash in layout/forms/test/ mochitests.
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -266,20 +266,16 @@ public:
   nsIFrame* GetInitialContainingBlock() { return mInitialContainingBlock; }
   // This returns the outermost frame for the root element
   nsIFrame* GetRootElementFrame() { return mInitialContainingBlock; }
   // This returns the frame for the root element that does not
   // have a psuedo-element style
   nsIFrame* GetRootElementStyleFrame() { return mRootElementStyleFrame; }
   nsIFrame* GetPageSequenceFrame() { return mPageSequenceFrame; }
 
-  // Get the frame that is the parent of the root element.
-  nsIFrame* GetDocElementContainingBlock()
-    { return mDocElementContainingBlock; }
-
 private:
 
   nsresult ReconstructDocElementHierarchyInternal();
 
   nsresult ReinsertContent(nsIContent*    aContainer,
                            nsIContent*    aChild);
 
   nsresult ConstructPageFrame(nsIPresShell*  aPresShell, 
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -1307,38 +1307,20 @@ nsFrameManager::ReResolveStyleContext(ns
         }
       }
       else {
         break;
       }
     }
 
     // now look for undisplayed child content and pseudos
-
-    // When the root element is display:none, we still construct *some*
-    // frames that have the root element as their mContent, down to the
-    // DocElementContainingBlock.
-    PRBool checkUndisplayed;
-    nsIContent *undisplayedParent;
-    if (pseudoTag) {
-      checkUndisplayed = aFrame == mPresShell->FrameConstructor()->
-                                     GetDocElementContainingBlock();
-      undisplayedParent = nsnull;
-    } else {
-      checkUndisplayed = !!localContent;
-      undisplayedParent = localContent;
-    }
-    if (checkUndisplayed && mUndisplayedMap) {
+    if (!pseudoTag && localContent && mUndisplayedMap) {
       for (UndisplayedNode* undisplayed =
-                              mUndisplayedMap->GetFirstNode(undisplayedParent);
+                                   mUndisplayedMap->GetFirstNode(localContent);
            undisplayed; undisplayed = undisplayed->mNext) {
-        NS_ASSERTION(undisplayedParent ||
-                     undisplayed->mContent ==
-                       mPresShell->GetDocument()->GetRootContent(),
-                     "undisplayed node child of null must be root");
         nsRefPtr<nsStyleContext> undisplayedContext;
         nsIAtom* const undisplayedPseudoTag = undisplayed->mStyle->GetPseudoType();
         if (!undisplayedPseudoTag) {  // child content
           undisplayedContext = styleSet->ResolveStyleFor(undisplayed->mContent,
                                                          newContext);
         }
         else if (undisplayedPseudoTag == nsCSSAnonBoxes::mozNonElement) {
           undisplayedContext = styleSet->ResolveStyleForNonElement(newContext);