Bug 484400. When removing a positioned element use the placeholder frame to get the relevant containing block for first-letter processing. r=bzbarsky

This commit is contained in:
Timothy Nikkel
2009-12-22 17:47:25 -06:00
parent 0e46068e56
commit ddb685be31
4 changed files with 39 additions and 9 deletions

View File

@@ -6985,7 +6985,13 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
// Examine the containing-block for the removed content and see if
// :first-letter style applies.
nsIFrame* containingBlock = GetFloatContainingBlock(parentFrame);
nsIFrame* inflowChild = childFrame;
if (childFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
inflowChild = frameManager->GetPlaceholderFrameFor(childFrame);
NS_ASSERTION(inflowChild, "No placeholder for out-of-flow?");
}
nsIFrame* containingBlock =
GetFloatContainingBlock(inflowChild->GetParent());
PRBool haveFLS = containingBlock && HasFirstLetterStyle(containingBlock);
if (haveFLS) {
// Trap out to special routine that handles adjusting a blocks
@@ -7057,11 +7063,6 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
}
if (haveFLS && mRootElementFrame) {
NS_ASSERTION(containingBlock == GetFloatContainingBlock(parentFrame),
"What happened here?");
nsFrameConstructorState state(mPresShell, mFixedContainingBlock,
GetAbsoluteContainingBlock(parentFrame),
containingBlock);
RecoverLetterFrames(containingBlock);
}
@@ -7414,9 +7415,6 @@ nsCSSFrameConstructor::CharacterDataChanged(nsIContent* aContent,
frame->CharacterDataChanged(aInfo);
if (haveFirstLetterStyle) {
nsFrameConstructorState state(mPresShell, mFixedContainingBlock,
GetAbsoluteContainingBlock(frame),
block, nsnull);
RecoverLetterFrames(block);
}
}