Bug 286491. Recreate an entire IB-complex if one of the child frames gets frames recreated. It might be changing from block to inline or back again, in which case the IB division may change. r+sr=bzbarsky,a=asa

git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@178861 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
roc+%cs.cmu.edu
2005-08-24 21:20:48 +00:00
parent 7c3c9de5ae
commit c7e0414ca4
2 changed files with 29 additions and 12 deletions

View File

@@ -11616,6 +11616,23 @@ nsCSSFrameConstructor::MaybeRecreateFramesForContent(nsIContent* aContent)
return result;
}
PRBool
nsCSSFrameConstructor::MaybeRecreateContainerForIBSplitterFrame(nsIFrame* aFrame, nsresult* aResult)
{
if (!aFrame || !IsFrameSpecial(aFrame))
return PR_FALSE;
#ifdef DEBUG
if (gNoisyContentUpdates) {
printf("nsCSSFrameConstructor::RecreateFramesForContent: frame=");
nsFrame::ListTag(stdout, aFrame);
printf(" is special\n");
}
#endif
*aResult = ReframeContainingBlock(aFrame);
return PR_TRUE;
}
nsresult
nsCSSFrameConstructor::RecreateFramesForContent(nsIContent* aContent)
{
@@ -11636,6 +11653,8 @@ nsCSSFrameConstructor::RecreateFramesForContent(nsIContent* aContent)
mPresShell->GetPrimaryFrameFor(aContent, &frame);
nsPresContext* presContext = mPresShell->GetPresContext();
nsresult rv = NS_OK;
if (frame) {
// If the background of the frame is painted on one of its ancestors,
// the frame reconstruct might not invalidate correctly.
@@ -11652,20 +11671,16 @@ nsCSSFrameConstructor::RecreateFramesForContent(nsIContent* aContent)
if (ancestor != frame)
ApplyRenderingChangeToTree(presContext, ancestor, nsnull,
nsChangeHint_RepaintFrame);
// If the frame is an anonymous frame created as part of
// inline-in-block splitting --- or if its parent is
// such an anonymous frame (i.e., this frame was the cause
// of such splitting), then recreate the containing block.
if (MaybeRecreateContainerForIBSplitterFrame(frame, &rv) ||
MaybeRecreateContainerForIBSplitterFrame(frame->GetParent(), &rv))
return rv;
}
if (frame && IsFrameSpecial(frame)) {
#ifdef DEBUG
if (gNoisyContentUpdates) {
printf("nsCSSFrameConstructor::RecreateFramesForContent: frame=");
nsFrame::ListTag(stdout, frame);
printf(" is special\n");
}
#endif
return ReframeContainingBlock(frame);
}
nsresult rv = NS_OK;
nsCOMPtr<nsIContent> container = aContent->GetParent();
if (container) {
PRInt32 indexInContainer = container->IndexOf(aContent);