diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index c85e804940e..42d9a4893d9 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -11656,6 +11656,15 @@ ReparentFrame(nsFrameManager* aFrameManager, { aFrame->SetParent(aNewParentFrame); aFrameManager->ReParentStyleContext(aFrame); + if (aFrame->GetStateBits() & + (NS_FRAME_HAS_VIEW | NS_FRAME_HAS_CHILD_WITH_VIEW)) { + // No need to walk up the tree, since the bits are already set + // right on the parent of aNewParentFrame. + NS_ASSERTION(aNewParentFrame->GetParent()->GetStateBits() & + NS_FRAME_HAS_CHILD_WITH_VIEW, + "aNewParentFrame's parent should have this bit set!"); + aNewParentFrame->AddStateBits(NS_FRAME_HAS_CHILD_WITH_VIEW); + } } // Special routine to handle placing a list of frames into a block