From 30563bd0e30dc6a537642c76b727a4742d15026a Mon Sep 17 00:00:00 2001 From: Timothy Nikkel Date: Thu, 15 Oct 2009 21:48:44 -0500 Subject: [PATCH] Bug 457514. If an out of flow first letter frame is the insertion parent, then use the placeholder frame to get the parent, not the out of flow frame. r=bz --HG-- extra : rebase_source : 8913cd4c0484baecba53d239263a761b9c9dcf8b --- layout/base/nsCSSFrameConstructor.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 293242cc0da8..3f7cf0e6ad95 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -6674,7 +6674,16 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer, // If our current parentFrame is a Letter frame, use its parent as our // new parent hint if (parentFrame->GetType() == nsGkAtoms::letterFrame) { - parentFrame = parentFrame->GetParent(); + // If parentFrame is out of flow, then we actually want the parent of + // the placeholder frame. + if (parentFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) { + nsPlaceholderFrame* placeholderFrame = + state.mFrameManager->GetPlaceholderFrameFor(parentFrame); + NS_ASSERTION(placeholderFrame, "No placeholder for out-of-flow?"); + parentFrame = placeholderFrame->GetParent(); + } else { + parentFrame = parentFrame->GetParent(); + } } // Remove the old letter frames before doing the insertion